2019-11-01 13:45:29 +01:00
|
|
|
# C library
|
2016-12-15 11:16:55 -05:00
|
|
|
|
|
|
|
# Copyright (c) 2016 Intel Corporation
|
2017-01-18 17:01:01 -08:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
2016-12-15 11:16:55 -05:00
|
|
|
|
2019-08-15 20:39:20 +02:00
|
|
|
config REQUIRES_FULL_LIBC
|
2023-02-10 11:03:11 -08:00
|
|
|
prompt "Require complete C library"
|
2019-08-15 20:39:20 +02:00
|
|
|
bool
|
|
|
|
help
|
2023-02-10 11:03:11 -08:00
|
|
|
Select a C library implementation that provides a complete C library
|
|
|
|
implementation, rather than the subset provided by MINIMAL_LIBC.
|
2019-08-15 20:39:20 +02:00
|
|
|
|
2023-09-28 15:14:09 -07:00
|
|
|
config REQUIRES_FLOAT_PRINTF
|
|
|
|
bool "Requires floating point support in printf"
|
|
|
|
select CBPRINTF_FP_SUPPORT if MINIMAL_LIBC
|
|
|
|
select NEWLIB_LIBC_FLOAT_PRINTF if NEWLIB_LIBC
|
|
|
|
help
|
|
|
|
Select a printf implementation that provides a complete
|
|
|
|
implementation including floating point support.
|
|
|
|
|
2023-02-08 13:44:39 -08:00
|
|
|
config FULL_LIBC_SUPPORTED
|
|
|
|
bool
|
|
|
|
help
|
|
|
|
Selected when the target has at least one C library that offers a
|
|
|
|
complete implementation and which would be selected when
|
|
|
|
REQUIRES_FULL_LIBC is set.
|
|
|
|
|
2023-02-10 11:11:29 -08:00
|
|
|
config MINIMAL_LIBC_SUPPORTED
|
2021-08-15 23:14:21 +02:00
|
|
|
bool
|
2024-09-14 08:57:56 +02:00
|
|
|
depends on !NATIVE_APPLICATION
|
2021-08-15 23:14:21 +02:00
|
|
|
default y
|
2023-02-10 11:11:29 -08:00
|
|
|
help
|
|
|
|
Selected when the target has support for the minimal C library
|
2021-08-15 23:14:21 +02:00
|
|
|
|
2023-02-10 14:59:26 -08:00
|
|
|
config NEWLIB_LIBC_SUPPORTED
|
|
|
|
bool
|
|
|
|
default y
|
|
|
|
depends on "$(TOOLCHAIN_HAS_NEWLIB)" = "y"
|
2024-09-14 08:57:56 +02:00
|
|
|
depends on !NATIVE_APPLICATION
|
2023-02-08 13:44:39 -08:00
|
|
|
select FULL_LIBC_SUPPORTED
|
2023-02-10 14:59:26 -08:00
|
|
|
help
|
|
|
|
Selected when the target has support for the newlib C library
|
|
|
|
|
2022-11-02 13:11:41 -07:00
|
|
|
# Picolibc with C++ support in Zephyr SDK is handled by Zephyr SDK's own Kconfig.
|
lib/libc: Add picolibc support (aarch32, aarch64 and RISC-V) [v21]
Picolibc is a fork of newlib designed and tested on embedded systems. It
offers a smaller memory footprint (both ROM and RAM), and native TLS
support, which uses the Zephyr TLS support.
By default, the full printf version is included in the executable, which
includes exact floating point and long long input and output. A
configuration option has been added to switch to the integer-only
version (which also omits long long support).
Here are some size comparisons using qemu-cortex-m3 and this application
(parameters passed to printf to avoid GCC optimizing it into puts):
void main(void)
{
printf("Hello World! %s %d\n", CONFIG_BOARD, 12);
}
FLASH SRAM
minimal 8696 3952
picolibc int 7600 3960
picolibc float 12304 3960
newlib-nano int 11696 4128
newlib-nano float 30516 4496
newlib 34800 6112
---
v2:
Include picolibc-tls.ld
v3:
Document usage in guides/c_library.rst and
getting_started/toolchain_other_x_compilers.rst
v4:
Lost the lib/libc/picolibc directory somehow!
v5:
Add PICOLIBC_ALIGNED_HEAP_SIZE configuration option.
Delete PICOLIBC_SEMIHOST option support code
v6:
Don't allocate static RAM for TLS values; TLS
values only need to be allocated for each thread.
v7:
Use arm coprocessor for TLS pointer storage where supported for
compatibility with the -mtp=cp15 compiler option (or when the
target cpu type selects this option)
Add a bunch of tests
Round TLS segment up to stack alignment so that overall stack
remains correctly aligned
Add aarch64 support
Rebase to upstream head
v8:
Share NEWLIB, NEWLIB_NANO and PICOLIBC library configuration
variables in a single LIBC_PARTITIONS variable instead of
having separate PICOLIBC_PART and NEWLIB_PART variables.
v9:
Update docs to reference pending sdk-ng support for picolibc
v10:
Support memory protection by creating a partition for
picolibc shared data and any pre-defined picolibc heap.
v11:
Fix formatting in arch/arm/core/aarch64/switch.S
v12:
Remove TLS support from this patch now that TLS is upstream
Require THREAD_LOCAL_STORAGE when using PICOLIBC for architectures
that support it.
v13:
Merge errno changes as they're only needed for picolibc.
Adapt cmake changes suggested by Torsten Tejlmand Rasmussen
v14:
Update to picolibc 1.7 and newer (new stdin/stdout/stderr ABI)
v15:
Respond to comments from dcpleung:
* switch kernel/errno to use CONFIG_LIBC_ERRNO instead of
CONFIG_PICOLIBC
* Add comment to test/lib/sprintf as to why the %n test
was disabled for picolibc.
v16:
Switch picolibc to a module built with Zephyr. This eliminates
toolchain dependencies and allows compiler settings for Zephyr
to also be applied to picolibc.
v17:
Provide Zephyr-specific 'abort' implementation.
Support systems with MMU
v18:
Allow use of toolchain picolibc version.
v19:
Use zephyr/ for zephyr headers
v20:
Add locking
Use explicit commit for picolibc module
v21:
Create PICOLIBC_SUPPORTED config param. Set on arc, arm, arm64,
mips and riscv architectures.
Signed-off-by: Keith Packard <keithp@keithp.com>
2020-10-26 19:07:50 -07:00
|
|
|
config PICOLIBC_SUPPORTED
|
|
|
|
bool
|
2022-10-12 11:48:26 -07:00
|
|
|
depends on !NATIVE_APPLICATION
|
2024-07-02 11:18:18 +08:00
|
|
|
depends on ("$(TOOLCHAIN_HAS_PICOLIBC)" = "y") || (ZEPHYR_PICOLIBC_MODULE && !REQUIRES_FULL_LIBCPP)
|
lib/libc: Add picolibc support (aarch32, aarch64 and RISC-V) [v21]
Picolibc is a fork of newlib designed and tested on embedded systems. It
offers a smaller memory footprint (both ROM and RAM), and native TLS
support, which uses the Zephyr TLS support.
By default, the full printf version is included in the executable, which
includes exact floating point and long long input and output. A
configuration option has been added to switch to the integer-only
version (which also omits long long support).
Here are some size comparisons using qemu-cortex-m3 and this application
(parameters passed to printf to avoid GCC optimizing it into puts):
void main(void)
{
printf("Hello World! %s %d\n", CONFIG_BOARD, 12);
}
FLASH SRAM
minimal 8696 3952
picolibc int 7600 3960
picolibc float 12304 3960
newlib-nano int 11696 4128
newlib-nano float 30516 4496
newlib 34800 6112
---
v2:
Include picolibc-tls.ld
v3:
Document usage in guides/c_library.rst and
getting_started/toolchain_other_x_compilers.rst
v4:
Lost the lib/libc/picolibc directory somehow!
v5:
Add PICOLIBC_ALIGNED_HEAP_SIZE configuration option.
Delete PICOLIBC_SEMIHOST option support code
v6:
Don't allocate static RAM for TLS values; TLS
values only need to be allocated for each thread.
v7:
Use arm coprocessor for TLS pointer storage where supported for
compatibility with the -mtp=cp15 compiler option (or when the
target cpu type selects this option)
Add a bunch of tests
Round TLS segment up to stack alignment so that overall stack
remains correctly aligned
Add aarch64 support
Rebase to upstream head
v8:
Share NEWLIB, NEWLIB_NANO and PICOLIBC library configuration
variables in a single LIBC_PARTITIONS variable instead of
having separate PICOLIBC_PART and NEWLIB_PART variables.
v9:
Update docs to reference pending sdk-ng support for picolibc
v10:
Support memory protection by creating a partition for
picolibc shared data and any pre-defined picolibc heap.
v11:
Fix formatting in arch/arm/core/aarch64/switch.S
v12:
Remove TLS support from this patch now that TLS is upstream
Require THREAD_LOCAL_STORAGE when using PICOLIBC for architectures
that support it.
v13:
Merge errno changes as they're only needed for picolibc.
Adapt cmake changes suggested by Torsten Tejlmand Rasmussen
v14:
Update to picolibc 1.7 and newer (new stdin/stdout/stderr ABI)
v15:
Respond to comments from dcpleung:
* switch kernel/errno to use CONFIG_LIBC_ERRNO instead of
CONFIG_PICOLIBC
* Add comment to test/lib/sprintf as to why the %n test
was disabled for picolibc.
v16:
Switch picolibc to a module built with Zephyr. This eliminates
toolchain dependencies and allows compiler settings for Zephyr
to also be applied to picolibc.
v17:
Provide Zephyr-specific 'abort' implementation.
Support systems with MMU
v18:
Allow use of toolchain picolibc version.
v19:
Use zephyr/ for zephyr headers
v20:
Add locking
Use explicit commit for picolibc module
v21:
Create PICOLIBC_SUPPORTED config param. Set on arc, arm, arm64,
mips and riscv architectures.
Signed-off-by: Keith Packard <keithp@keithp.com>
2020-10-26 19:07:50 -07:00
|
|
|
default y
|
2023-04-17 09:54:36 -07:00
|
|
|
select FULL_LIBC_SUPPORTED
|
lib/libc: Add picolibc support (aarch32, aarch64 and RISC-V) [v21]
Picolibc is a fork of newlib designed and tested on embedded systems. It
offers a smaller memory footprint (both ROM and RAM), and native TLS
support, which uses the Zephyr TLS support.
By default, the full printf version is included in the executable, which
includes exact floating point and long long input and output. A
configuration option has been added to switch to the integer-only
version (which also omits long long support).
Here are some size comparisons using qemu-cortex-m3 and this application
(parameters passed to printf to avoid GCC optimizing it into puts):
void main(void)
{
printf("Hello World! %s %d\n", CONFIG_BOARD, 12);
}
FLASH SRAM
minimal 8696 3952
picolibc int 7600 3960
picolibc float 12304 3960
newlib-nano int 11696 4128
newlib-nano float 30516 4496
newlib 34800 6112
---
v2:
Include picolibc-tls.ld
v3:
Document usage in guides/c_library.rst and
getting_started/toolchain_other_x_compilers.rst
v4:
Lost the lib/libc/picolibc directory somehow!
v5:
Add PICOLIBC_ALIGNED_HEAP_SIZE configuration option.
Delete PICOLIBC_SEMIHOST option support code
v6:
Don't allocate static RAM for TLS values; TLS
values only need to be allocated for each thread.
v7:
Use arm coprocessor for TLS pointer storage where supported for
compatibility with the -mtp=cp15 compiler option (or when the
target cpu type selects this option)
Add a bunch of tests
Round TLS segment up to stack alignment so that overall stack
remains correctly aligned
Add aarch64 support
Rebase to upstream head
v8:
Share NEWLIB, NEWLIB_NANO and PICOLIBC library configuration
variables in a single LIBC_PARTITIONS variable instead of
having separate PICOLIBC_PART and NEWLIB_PART variables.
v9:
Update docs to reference pending sdk-ng support for picolibc
v10:
Support memory protection by creating a partition for
picolibc shared data and any pre-defined picolibc heap.
v11:
Fix formatting in arch/arm/core/aarch64/switch.S
v12:
Remove TLS support from this patch now that TLS is upstream
Require THREAD_LOCAL_STORAGE when using PICOLIBC for architectures
that support it.
v13:
Merge errno changes as they're only needed for picolibc.
Adapt cmake changes suggested by Torsten Tejlmand Rasmussen
v14:
Update to picolibc 1.7 and newer (new stdin/stdout/stderr ABI)
v15:
Respond to comments from dcpleung:
* switch kernel/errno to use CONFIG_LIBC_ERRNO instead of
CONFIG_PICOLIBC
* Add comment to test/lib/sprintf as to why the %n test
was disabled for picolibc.
v16:
Switch picolibc to a module built with Zephyr. This eliminates
toolchain dependencies and allows compiler settings for Zephyr
to also be applied to picolibc.
v17:
Provide Zephyr-specific 'abort' implementation.
Support systems with MMU
v18:
Allow use of toolchain picolibc version.
v19:
Use zephyr/ for zephyr headers
v20:
Add locking
Use explicit commit for picolibc module
v21:
Create PICOLIBC_SUPPORTED config param. Set on arc, arm, arm64,
mips and riscv architectures.
Signed-off-by: Keith Packard <keithp@keithp.com>
2020-10-26 19:07:50 -07:00
|
|
|
help
|
|
|
|
Selected when the target has support for picolibc.
|
|
|
|
|
2025-02-05 21:24:48 +00:00
|
|
|
config IAR_LIBC_SUPPORTED
|
|
|
|
bool
|
|
|
|
default n
|
|
|
|
select FULL_LIBC_SUPPORTED
|
|
|
|
help
|
|
|
|
Selected if the target is an IAR Systems compiler
|
|
|
|
|
2024-03-27 14:13:47 +01:00
|
|
|
config NATIVE_LIBC_INCOMPATIBLE
|
|
|
|
bool
|
|
|
|
help
|
|
|
|
Other Kconfig options can select this, if they are not compatible with the
|
|
|
|
native/host libC, and should only be compiled with an embedded libC
|
|
|
|
|
2023-02-10 11:00:41 -08:00
|
|
|
menu "C Library"
|
|
|
|
|
2019-08-15 20:39:20 +02:00
|
|
|
choice LIBC_IMPLEMENTATION
|
|
|
|
prompt "C Library Implementation"
|
2024-03-27 14:13:47 +01:00
|
|
|
default EXTERNAL_LIBC if NATIVE_BUILD && !(NATIVE_LIBRARY && NATIVE_LIBC_INCOMPATIBLE)
|
2023-01-10 21:17:32 -08:00
|
|
|
default PICOLIBC
|
2019-08-15 20:39:20 +02:00
|
|
|
default NEWLIB_LIBC if REQUIRES_FULL_LIBC
|
|
|
|
default MINIMAL_LIBC
|
2025-02-05 21:24:48 +00:00
|
|
|
default IAR_LIBC
|
2019-08-15 20:39:20 +02:00
|
|
|
|
|
|
|
config MINIMAL_LIBC
|
|
|
|
bool "Minimal C library"
|
2019-11-01 17:10:50 +01:00
|
|
|
depends on !REQUIRES_FULL_LIBC
|
2023-02-10 11:11:29 -08:00
|
|
|
depends on MINIMAL_LIBC_SUPPORTED
|
2023-02-08 14:56:50 -08:00
|
|
|
imply COMPILER_FREESTANDING
|
2023-05-05 10:26:45 -05:00
|
|
|
select COMMON_LIBC_ABORT
|
2023-05-05 09:56:35 -05:00
|
|
|
select COMMON_LIBC_STRNLEN
|
2024-06-17 22:26:47 +08:00
|
|
|
imply COMMON_LIBC_MALLOC
|
|
|
|
imply COMMON_LIBC_CALLOC
|
|
|
|
imply COMMON_LIBC_REALLOCARRAY
|
2019-08-15 20:39:20 +02:00
|
|
|
help
|
|
|
|
Build with minimal C library.
|
2016-12-15 11:16:55 -05:00
|
|
|
|
lib/libc: Add picolibc support (aarch32, aarch64 and RISC-V) [v21]
Picolibc is a fork of newlib designed and tested on embedded systems. It
offers a smaller memory footprint (both ROM and RAM), and native TLS
support, which uses the Zephyr TLS support.
By default, the full printf version is included in the executable, which
includes exact floating point and long long input and output. A
configuration option has been added to switch to the integer-only
version (which also omits long long support).
Here are some size comparisons using qemu-cortex-m3 and this application
(parameters passed to printf to avoid GCC optimizing it into puts):
void main(void)
{
printf("Hello World! %s %d\n", CONFIG_BOARD, 12);
}
FLASH SRAM
minimal 8696 3952
picolibc int 7600 3960
picolibc float 12304 3960
newlib-nano int 11696 4128
newlib-nano float 30516 4496
newlib 34800 6112
---
v2:
Include picolibc-tls.ld
v3:
Document usage in guides/c_library.rst and
getting_started/toolchain_other_x_compilers.rst
v4:
Lost the lib/libc/picolibc directory somehow!
v5:
Add PICOLIBC_ALIGNED_HEAP_SIZE configuration option.
Delete PICOLIBC_SEMIHOST option support code
v6:
Don't allocate static RAM for TLS values; TLS
values only need to be allocated for each thread.
v7:
Use arm coprocessor for TLS pointer storage where supported for
compatibility with the -mtp=cp15 compiler option (or when the
target cpu type selects this option)
Add a bunch of tests
Round TLS segment up to stack alignment so that overall stack
remains correctly aligned
Add aarch64 support
Rebase to upstream head
v8:
Share NEWLIB, NEWLIB_NANO and PICOLIBC library configuration
variables in a single LIBC_PARTITIONS variable instead of
having separate PICOLIBC_PART and NEWLIB_PART variables.
v9:
Update docs to reference pending sdk-ng support for picolibc
v10:
Support memory protection by creating a partition for
picolibc shared data and any pre-defined picolibc heap.
v11:
Fix formatting in arch/arm/core/aarch64/switch.S
v12:
Remove TLS support from this patch now that TLS is upstream
Require THREAD_LOCAL_STORAGE when using PICOLIBC for architectures
that support it.
v13:
Merge errno changes as they're only needed for picolibc.
Adapt cmake changes suggested by Torsten Tejlmand Rasmussen
v14:
Update to picolibc 1.7 and newer (new stdin/stdout/stderr ABI)
v15:
Respond to comments from dcpleung:
* switch kernel/errno to use CONFIG_LIBC_ERRNO instead of
CONFIG_PICOLIBC
* Add comment to test/lib/sprintf as to why the %n test
was disabled for picolibc.
v16:
Switch picolibc to a module built with Zephyr. This eliminates
toolchain dependencies and allows compiler settings for Zephyr
to also be applied to picolibc.
v17:
Provide Zephyr-specific 'abort' implementation.
Support systems with MMU
v18:
Allow use of toolchain picolibc version.
v19:
Use zephyr/ for zephyr headers
v20:
Add locking
Use explicit commit for picolibc module
v21:
Create PICOLIBC_SUPPORTED config param. Set on arc, arm, arm64,
mips and riscv architectures.
Signed-off-by: Keith Packard <keithp@keithp.com>
2020-10-26 19:07:50 -07:00
|
|
|
config PICOLIBC
|
|
|
|
bool "Picolibc library"
|
2023-05-05 10:26:45 -05:00
|
|
|
select COMMON_LIBC_ABORT
|
2023-09-05 14:19:07 -07:00
|
|
|
imply THREAD_LOCAL_STORAGE if ARCH_HAS_THREAD_LOCAL_STORAGE && TOOLCHAIN_SUPPORTS_THREAD_LOCAL_STORAGE
|
2022-06-22 12:30:37 -07:00
|
|
|
select LIBC_ERRNO if THREAD_LOCAL_STORAGE
|
2023-10-04 09:17:27 -07:00
|
|
|
select NEED_LIBC_MEM_PARTITION
|
2024-09-13 16:34:24 -07:00
|
|
|
select TC_PROVIDES_POSIX_C_LANG_SUPPORT_R
|
2023-03-29 11:33:08 -07:00
|
|
|
imply COMMON_LIBC_MALLOC
|
2025-01-28 08:13:53 -08:00
|
|
|
imply COMMON_LIBC_ABORT
|
2022-11-02 13:11:41 -07:00
|
|
|
depends on PICOLIBC_SUPPORTED
|
lib/libc: Add picolibc support (aarch32, aarch64 and RISC-V) [v21]
Picolibc is a fork of newlib designed and tested on embedded systems. It
offers a smaller memory footprint (both ROM and RAM), and native TLS
support, which uses the Zephyr TLS support.
By default, the full printf version is included in the executable, which
includes exact floating point and long long input and output. A
configuration option has been added to switch to the integer-only
version (which also omits long long support).
Here are some size comparisons using qemu-cortex-m3 and this application
(parameters passed to printf to avoid GCC optimizing it into puts):
void main(void)
{
printf("Hello World! %s %d\n", CONFIG_BOARD, 12);
}
FLASH SRAM
minimal 8696 3952
picolibc int 7600 3960
picolibc float 12304 3960
newlib-nano int 11696 4128
newlib-nano float 30516 4496
newlib 34800 6112
---
v2:
Include picolibc-tls.ld
v3:
Document usage in guides/c_library.rst and
getting_started/toolchain_other_x_compilers.rst
v4:
Lost the lib/libc/picolibc directory somehow!
v5:
Add PICOLIBC_ALIGNED_HEAP_SIZE configuration option.
Delete PICOLIBC_SEMIHOST option support code
v6:
Don't allocate static RAM for TLS values; TLS
values only need to be allocated for each thread.
v7:
Use arm coprocessor for TLS pointer storage where supported for
compatibility with the -mtp=cp15 compiler option (or when the
target cpu type selects this option)
Add a bunch of tests
Round TLS segment up to stack alignment so that overall stack
remains correctly aligned
Add aarch64 support
Rebase to upstream head
v8:
Share NEWLIB, NEWLIB_NANO and PICOLIBC library configuration
variables in a single LIBC_PARTITIONS variable instead of
having separate PICOLIBC_PART and NEWLIB_PART variables.
v9:
Update docs to reference pending sdk-ng support for picolibc
v10:
Support memory protection by creating a partition for
picolibc shared data and any pre-defined picolibc heap.
v11:
Fix formatting in arch/arm/core/aarch64/switch.S
v12:
Remove TLS support from this patch now that TLS is upstream
Require THREAD_LOCAL_STORAGE when using PICOLIBC for architectures
that support it.
v13:
Merge errno changes as they're only needed for picolibc.
Adapt cmake changes suggested by Torsten Tejlmand Rasmussen
v14:
Update to picolibc 1.7 and newer (new stdin/stdout/stderr ABI)
v15:
Respond to comments from dcpleung:
* switch kernel/errno to use CONFIG_LIBC_ERRNO instead of
CONFIG_PICOLIBC
* Add comment to test/lib/sprintf as to why the %n test
was disabled for picolibc.
v16:
Switch picolibc to a module built with Zephyr. This eliminates
toolchain dependencies and allows compiler settings for Zephyr
to also be applied to picolibc.
v17:
Provide Zephyr-specific 'abort' implementation.
Support systems with MMU
v18:
Allow use of toolchain picolibc version.
v19:
Use zephyr/ for zephyr headers
v20:
Add locking
Use explicit commit for picolibc module
v21:
Create PICOLIBC_SUPPORTED config param. Set on arc, arm, arm64,
mips and riscv architectures.
Signed-off-by: Keith Packard <keithp@keithp.com>
2020-10-26 19:07:50 -07:00
|
|
|
help
|
|
|
|
Build with picolibc library. The picolibc library is built as
|
|
|
|
a module if PICOLIBC_MODULE is set, otherwise picolibc is
|
|
|
|
expected to be provided by the toolchain.
|
|
|
|
|
2016-12-15 11:16:55 -05:00
|
|
|
config NEWLIB_LIBC
|
2019-08-15 20:39:20 +02:00
|
|
|
bool "Newlib C library"
|
2023-05-05 10:26:45 -05:00
|
|
|
select COMMON_LIBC_ABORT
|
2023-02-08 13:52:40 -08:00
|
|
|
depends on NEWLIB_LIBC_SUPPORTED
|
2023-10-04 09:17:27 -07:00
|
|
|
select NEED_LIBC_MEM_PARTITION
|
2024-12-09 15:36:20 +01:00
|
|
|
select TC_PROVIDES_POSIX_C_LANG_SUPPORT_R
|
posix: deprecate POSIX_MAX_FDS and add POSIX_DEVICE_IO
The POSIX_MAX_FDS option does not correspond to any standard
POSIX option. It was used to define the size of the file
descriptor table, which is by no means exclusively used by
POSIX (also net, fs, ...).
POSIX_MAX_FDS is being deprecated in order to ensure that
Zephyr's POSIX Kconfig variables correspond to those defined in
the specification, as of IEEE 1003.1-2017. Namely,
POSIX_OPEN_MAX. CONFIG_POSIX_MAX_OPEN_FILES is being deprecated
for the same reason.
To mitigate any possible layering violations, that option is
not user selectable. It tracks the newly added
CONFIG_ZVFS_OPEN_MAX option, which is native to Zephyr.
With this deprecation, we introduce the following Kconfig
options that map directly to standard POSIX Option Groups by
simply removing "CONFIG_":
* CONFIG_POSIX_DEVICE_IO
Similarly, with this deprecation, we introduce the following
Kconfig options that map directly to standard POSIX Options by
simply removing "CONFIG":
* CONFIG_POSIX_OPEN_MAX
In order to maintain parity with the current feature set, we
introduce the following Kconfig options.
* CONFIG_POSIX_DEVICE_IO_ALIAS_CLOSE
* CONFIG_POSIX_DEVICE_IO_ALIAS_OPEN
* CONFIG_POSIX_DEVICE_IO_ALIAS_READ
* CONFIG_POSIX_DEVICE_IO_ALIAS_WRITE
Gate open(), close(), read(), and write() via the
CONFIG_POSIX_DEVICE_IO Kconfig option and move
implementations into device_io.c, to be conformant with the
spec.
Lastly, stage function names for upcoming ZVFS work, to be
completed as part of the LTSv3 Roadmap (e.g. zvfs_open(), ..).
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-05-21 22:45:15 -04:00
|
|
|
imply POSIX_DEVICE_IO_ALIAS_CLOSE
|
|
|
|
imply POSIX_DEVICE_IO_ALIAS_OPEN
|
|
|
|
imply POSIX_DEVICE_IO_ALIAS_READ
|
|
|
|
imply POSIX_DEVICE_IO_ALIAS_WRITE
|
2024-05-22 16:35:57 -04:00
|
|
|
imply POSIX_FD_MGMT_ALIAS_LSEEK
|
2024-05-22 19:56:11 -04:00
|
|
|
imply POSIX_FILE_SYSTEM_ALIAS_FSTAT
|
2024-05-23 13:51:14 -04:00
|
|
|
imply POSIX_MULTI_PROCESS_ALIAS_GETPID
|
2024-06-17 13:01:06 -04:00
|
|
|
imply POSIX_SIGNALS_ALIAS_KILL
|
2016-12-15 11:16:55 -05:00
|
|
|
help
|
2017-12-13 10:08:21 -05:00
|
|
|
Build with newlib library. The newlib library is expected to be
|
|
|
|
part of the SDK in this case.
|
2016-12-15 11:16:55 -05:00
|
|
|
|
2021-06-03 19:55:08 +03:00
|
|
|
config ARCMWDT_LIBC
|
|
|
|
bool "ARC MWDT C library"
|
|
|
|
depends on !NATIVE_APPLICATION
|
|
|
|
depends on "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "arcmwdt"
|
|
|
|
help
|
|
|
|
C library provided by ARC MWDT toolchain.
|
|
|
|
|
2019-08-15 20:39:20 +02:00
|
|
|
config EXTERNAL_LIBC
|
|
|
|
bool "External C library"
|
|
|
|
help
|
|
|
|
Build with external/user provided C library.
|
|
|
|
|
2025-02-05 21:24:48 +00:00
|
|
|
config IAR_LIBC
|
|
|
|
bool "IAR C Runtime Library"
|
|
|
|
depends on IAR_LIBC_SUPPORTED
|
|
|
|
depends on "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "iar"
|
|
|
|
select COMMON_LIBC_STRNLEN
|
|
|
|
select COMMON_LIBC_TIME if POSIX_TIMERS
|
|
|
|
help
|
|
|
|
Use the full IAR Compiler runtime libraries.
|
|
|
|
A reduced Zephyr minimal libc will be used for library functionality
|
|
|
|
not provided by the IAR C Runtime Library.
|
|
|
|
|
2019-11-01 16:22:49 +01:00
|
|
|
endchoice # LIBC_IMPLEMENTATION
|
2019-08-15 20:39:20 +02:00
|
|
|
|
2020-01-28 09:58:56 -06:00
|
|
|
config HAS_NEWLIB_LIBC_NANO
|
|
|
|
bool
|
|
|
|
|
2023-03-24 19:10:50 +00:00
|
|
|
rsource "common/Kconfig"
|
2022-12-07 18:18:37 +09:00
|
|
|
rsource "minimal/Kconfig"
|
2022-12-07 18:22:19 +09:00
|
|
|
rsource "newlib/Kconfig"
|
2022-12-07 18:34:15 +09:00
|
|
|
rsource "picolibc/Kconfig"
|
2019-08-15 20:39:20 +02:00
|
|
|
|
|
|
|
config STDOUT_CONSOLE
|
|
|
|
bool "Send stdout to console"
|
|
|
|
depends on CONSOLE_HAS_DRIVER
|
2023-06-09 14:28:01 +02:00
|
|
|
depends on !(NATIVE_APPLICATION || (NATIVE_LIBRARY && EXTERNAL_LIBC))
|
2019-08-15 20:39:20 +02:00
|
|
|
default y
|
|
|
|
help
|
|
|
|
This option directs standard output (e.g. printf) to the console
|
|
|
|
device, rather than suppressing it entirely. See also EARLY_CONSOLE
|
|
|
|
option.
|
|
|
|
|
2020-10-01 14:49:30 -07:00
|
|
|
config NEED_LIBC_MEM_PARTITION
|
|
|
|
bool
|
|
|
|
help
|
|
|
|
Hidden option to signal that a memory partition is needed for
|
2022-02-24 12:00:55 +00:00
|
|
|
the C library even though it would not have been enabled
|
2020-10-01 14:49:30 -07:00
|
|
|
otherwise.
|
|
|
|
|
2016-12-15 11:16:55 -05:00
|
|
|
endmenu
|