zephyr/lib
Yong Cong Sin 89bf4b2ad9 lib/libc: select PICOLIBC_SUPPORTED if toolchain has it or module exists
Currently, `PICOLIBC_SUPPORTED` could be enabled even when
neither the toolchain has picolibc nor the picolibc module is
present, this can be the case when Zephyr is built with
external toolchain (non-Zephyr SDK) + external build system
where PICOLIBC module doesn't exist.

Fix this by having `PICOLIBC_SUPPORTED` depends on either
toolchain OR module, while taking the libc++ into
consideration.

Here's the full logic table of when the PICOLIBC should
be marked as supported.

libc++  TOOLCHAIN       MODULE          PICOLIBC_SUPPORTED
  0         0             0                     0
  0         0             1                     1
  0         1             0                     1
  0         1             1                     1
  1         0             0                     0
  1         0             1                     0
  1         1             0                     1
  1         1             1                     1

Co-authored-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-07-05 12:30:42 +02:00
..
acpi lib: acpi: update shell and test app with the modifed resource struct 2024-02-15 12:28:55 +01:00
cpp lib c/cpp: Move .ctor .init_array handling from C++ to kernel 2024-06-25 19:14:37 -04:00
crc lib: avoided increments/decrements with side effects 2024-06-21 08:48:15 -04:00
hash lib: hash: use new c++ Kconfig symbols 2023-07-26 14:53:51 +02:00
heap lib: added blanks between operators 2024-06-13 20:28:23 -04:00
libc lib/libc: select PICOLIBC_SUPPORTED if toolchain has it or module exists 2024-07-05 12:30:42 +02:00
mem_blocks lib: mem_block: move to own folder 2023-12-13 17:27:54 -05:00
open-amp driver: ram_console: leave one byte from the defined buffer size 2024-06-12 17:09:24 -05:00
os Revert "fdtable: read, write, close: only execute methods if non-NULL" 2024-07-03 15:03:05 -04:00
posix Revert "posix: device_io: require a full libc for c89 functions" 2024-07-03 15:03:05 -04:00
runtime llvm: Add support for selecting runtime library 2023-08-03 19:35:11 +02:00
smf lib: smf: use while (true) in get_child_of for better clarity 2024-07-01 16:08:05 -04:00
utils zephyr: Add zero-len check for utf8_trunc 2024-06-27 08:48:31 -04:00
CMakeLists.txt lib posix: Allow building the POSIX_API library without the host libC 2023-12-28 09:58:23 -05:00
Kconfig lib: move utilities into own folder 2023-12-22 09:54:12 +01:00