zephyr/lib/libc/minimal/Kconfig

67 lines
2.2 KiB
Plaintext
Raw Normal View History

# Copyright (c) 2016 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
if MINIMAL_LIBC
config MINIMAL_LIBC_NON_REENTRANT_FUNCTIONS
bool "Non-reentrant functions"
default y if !USERSPACE
select NEED_LIBC_MEM_PARTITION
help
Enable non-reentrant functions that make use of the globals; e.g.
rand() and gmtime(). The globals must be put into a dedicated C
library memory partition when CONFIG_USERSPACE=y, and enabling this
option may require an additional memory protection region.
config MINIMAL_LIBC_LL_PRINTF
bool "Build with minimal libc long long printf" if !64BIT
default y if 64BIT
help
Build with long long printf enabled. This will increase the size of
the image.
config MINIMAL_LIBC_OPTIMIZE_STRING_FOR_SIZE
bool "Use size optimized string functions"
default y if SIZE_OPTIMIZATIONS || SIZE_OPTIMIZATIONS_AGGRESSIVE
help
Enable smaller but potentially slower implementations of memcpy and
memset. On the Cortex-M0+ this reduces the total code size by 120 bytes.
config MINIMAL_LIBC_RAND
bool "Rand and srand functions"
help
Enable rand_r() for the minimal libc.
In order to make use of the non-reentrant rand() and srand(), it is
necessary to set CONFIG_MINIMAL_LIBC_NON_REENTRANT_FUNCTIONS=y.
config MINIMAL_LIBC_TIME
bool "Time functions"
posix: timers: deprecate CONFIG_POSIX_CLOCK and TIMER The POSIX_CLOCK option does not correspond to any standard option. It was used to active features of several distinct POSIX Options and Option Groups, which complicated API and application configuration as a result. POSIX_CLOCK 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. Additionally, CONFIG_TIMER is being deprecated because it does not match the corresponding POSIX Option (_POSIX_TIMERS). With this deprecation, we introduce the following Kconfig options that map directly to standard POSIX Option Groups by simply removing "CONFIG_": * CONFIG_POSIX_TIMERS Similarly, we introduce the following Kconfig options that map directly to standard POSIX Options by simply removing "CONFIG": * CONFIG_POSIX_CLOCK_SELECTION * CONFIG_POSIX_CPUTIME * CONFIG_POSIX_DELAYTIMER_MAX * CONFIG_POSIX_MONOTONIC_CLOCK * CONFIG_POSIX_TIMEOUTS * CONFIG_POSIX_TIMER_MAX In order to maintain parity with the current feature set, we introduce the following Kconfig options that map directly to standard POSIX Option Groups by simply removing "CONFIG_": * CONFIG_POSIX_MULTI_PROCESS - sleep() Similarly, in order to maintain parity with the current feature set, we introduce the following additional Kconfig options that map directly to standard POSIX Options by simply removing "CONFIG": * CONFIG_XSI_SINGLE_PROCESS - gettimeofday() Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-05-21 00:23:58 +08:00
select COMMON_LIBC_TIME if POSIX_TIMERS
select COMMON_LIBC_GMTIME_R
select COMMON_LIBC_ASCTIME
select COMMON_LIBC_LOCALTIME_R_UTC
select COMMON_LIBC_CTIME
default y
help
Enable time() and gmtime_r() for the minimal libc.
posix: timers: deprecate CONFIG_POSIX_CLOCK and TIMER The POSIX_CLOCK option does not correspond to any standard option. It was used to active features of several distinct POSIX Options and Option Groups, which complicated API and application configuration as a result. POSIX_CLOCK 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. Additionally, CONFIG_TIMER is being deprecated because it does not match the corresponding POSIX Option (_POSIX_TIMERS). With this deprecation, we introduce the following Kconfig options that map directly to standard POSIX Option Groups by simply removing "CONFIG_": * CONFIG_POSIX_TIMERS Similarly, we introduce the following Kconfig options that map directly to standard POSIX Options by simply removing "CONFIG": * CONFIG_POSIX_CLOCK_SELECTION * CONFIG_POSIX_CPUTIME * CONFIG_POSIX_DELAYTIMER_MAX * CONFIG_POSIX_MONOTONIC_CLOCK * CONFIG_POSIX_TIMEOUTS * CONFIG_POSIX_TIMER_MAX In order to maintain parity with the current feature set, we introduce the following Kconfig options that map directly to standard POSIX Option Groups by simply removing "CONFIG_": * CONFIG_POSIX_MULTI_PROCESS - sleep() Similarly, in order to maintain parity with the current feature set, we introduce the following additional Kconfig options that map directly to standard POSIX Options by simply removing "CONFIG": * CONFIG_XSI_SINGLE_PROCESS - gettimeofday() Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-05-21 00:23:58 +08:00
time() requires CONFIG_POSIX_TIMERS=y because it relies on the POSIX
clock_gettime() function.
In order to make use of the non-reentrant gmtime(), it is necessary
to set CONFIG_MINIMAL_LIBC_NON_REENTRANT_FUNCTIONS=y.
config MINIMAL_LIBC_STRING_ERROR_TABLE
bool "String error table for strerror() and strerror_r()"
help
Select this option to ensure that streror(), strerror_r()
produce strings corresponding to the descriptions in errno.h.
The string error table can add ~2kiB to ROM. As such, it is
disabled by default. In this case, strerror() and strerror_r()
symbols are still present, but the functions produce an empty
string.
endif # MINIMAL_LIBC