Skip to content
Commit 89bf4b2a authored by Yong Cong Sin's avatar Yong Cong Sin Committed by Alberto Escolar
Browse files

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: default avatarKeith Packard <keithp@keithp.com>
Signed-off-by: default avatarYong Cong Sin <ycsin@meta.com>
parent 7950638e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment