zephyr/lib/libc
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
..
arcmwdt ARCMWDT: Fix issues with posix types 2024-07-01 18:14:34 +02:00
armstdc lib: libc: armstdc: add missing retarget of fputc to _stdout_hook 2023-10-04 11:02:37 +02:00
common libc: common: Fix init hang issue 2024-06-26 13:07:02 -04:00
minimal libc: minimal: Removed unnecessary casts 2024-06-26 09:00:13 -04:00
newlib libc: common: Fix init hang issue 2024-06-26 13:07:02 -04:00
picolibc lib/libc: picolibc: cleanup PICOLIBC_USE_TOOLCHAIN dependencies 2024-07-05 12:30:42 +02:00
CMakeLists.txt
Kconfig lib/libc: select PICOLIBC_SUPPORTED if toolchain has it or module exists 2024-07-05 12:30:42 +02:00