Skip to content

Commit 9cba2fd

Browse files
committed
kconfig: review proposal on PR#53338
Review proposal for PR#53338. Changes can be moved to correct commits or this commit message can be re-written and changes used as is. Signed-off-by: Torsten Rasmussen <[email protected]>
1 parent eb84c8c commit 9cba2fd

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

lib/libc/Kconfig

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ config PICOLIBC_SUPPORTED
1919
bool
2020
depends on ARC || ARM || ARM64 || MIPS || RISCV
2121
depends on "$(ZEPHYR_TOOLCHAIN_VARIANT)" != "arcmwdt"
22-
depends on !CPLUSPLUS || !PICOLIBC_MODULE
22+
# Picolibc with C++ support in Zephyr SDK is handled by Zephyr SDK's own Kconfig.
23+
depends on !(CPLUSPLUS && "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "zephyr")
2324
default y
2425
help
2526
Selected when the target has support for picolibc.
@@ -43,6 +44,7 @@ config PICOLIBC
4344
select THREAD_LOCAL_STORAGE if ARCH_HAS_THREAD_LOCAL_STORAGE && TOOLCHAIN_SUPPORTS_THREAD_LOCAL_STORAGE
4445
select LIBC_ERRNO if THREAD_LOCAL_STORAGE
4546
depends on !NATIVE_APPLICATION
47+
depends on PICOLIBC_SUPPORTED
4648
help
4749
Build with picolibc library. The picolibc library is built as
4850
a module if PICOLIBC_MODULE is set, otherwise picolibc is
@@ -69,12 +71,6 @@ config EXTERNAL_LIBC
6971

7072
endchoice # LIBC_IMPLEMENTATION
7173

72-
config PICOLIBC_MODULE
73-
bool "Use picolibc module"
74-
default y if !CPLUSPLUS
75-
help
76-
Use picolibc module instead of picolibc included with toolchain
77-
7874
config HAS_NEWLIB_LIBC_NANO
7975
bool
8076

lib/libc/picolibc/Kconfig

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33

44
if PICOLIBC
55

6+
config PICOLIBC_USE_MODULE
7+
bool "Picolibc as module"
8+
default y
9+
depends on ZEPHYR_PICOLIBC_MODULE
10+
depends on !CPLUSPLUS
11+
help
12+
Use picolibc module instead of picolibc included with toolchain
13+
614
config PICOLIBC_HEAP_SIZE
715
int "Picolibc heap size (bytes)"
816
default 16384 if MMU
@@ -33,14 +41,7 @@ config PICOLIBC_IO_FLOAT
3341
help
3442
Include floating point support in printf/scanf functions.
3543

36-
if PICOLIBC_MODULE
37-
38-
config PICOLIBC_USE_MODULE
39-
bool
40-
default y
41-
help
42-
Hidden option that tells the picolibc module
43-
whether to build picolibc or to skip it.
44+
if PICOLIBC_USE_MODULE
4445

4546
choice PICOLIBC_OPTIMIZATIONS
4647
prompt "Optimization level"

0 commit comments

Comments
 (0)