blob: 659cbf41db68ff03382e08a6df8604edd6e9718c [file] [log] [blame]
# Copyright © 2021 Amazon.com, Inc. or its affiliates.
# SPDX-License-Identifier: Apache-2.0
if PICOLIBC
config PICOLIBC_USE_MODULE
bool "Picolibc as module"
default y if "$(ZEPHYR_TOOLCHAIN_VARIANT)" != "zephyr"
depends on ZEPHYR_PICOLIBC_MODULE
depends on !GLIBCXX_LIBCPP
help
Use picolibc module instead of picolibc included with toolchain.
This is enabled by default for toolchains other than the Zephyr
SDK.
config PICOLIBC_HEAP_SIZE
int "[DEPRECATED] Picolibc heap size (bytes)"
default -2
help
[DEPRECATED] Use COMMON_LIBC_MALLOC_ARENA_SIZE
Indicate the size in bytes of the memory arena used for common C
library malloc() implementation when using Picolibc.
If set to -2, then the value of COMMON_LIBC_MALLOC_ARENA_SIZE
will be used.
config PICOLIBC_IO_LONG_LONG
bool "support for long long in integer-only printf/scanf"
help
Includes support for long long in integer-only printf/scanf. long long
types are always supported in the floating-point versions.
config PICOLIBC_IO_FLOAT
bool "support for floating point values in printf/scanf"
help
Include floating point support in printf/scanf functions.
if PICOLIBC_USE_MODULE
choice PICOLIBC_OPTIMIZATIONS
prompt "Optimization level"
default PICOLIBC_SIZE_OPTIMIZATIONS if SIZE_OPTIMIZATIONS
default PICOLIBC_SPEED_OPTIMIZATIONS if SPEED_OPTIMIZATIONS
default PICOLIBC_DEBUG_OPTIMIZATIONS if DEBUG_OPTIMIZATIONS
default PICOLIBC_NO_OPTIMIZATIONS if NO_OPTIMIZATIONS
help
Note that these flags shall only control the compiler
optimization level for picolibc, not the level for the
rest of Zephyr
config PICOLIBC_SIZE_OPTIMIZATIONS
bool "Optimize for size"
help
Compiler optimizations will be set to -Os independently of other
options.
config PICOLIBC_SPEED_OPTIMIZATIONS
bool "Optimize for speed"
help
Compiler optimizations will be set to -O2 independently of other
options.
config PICOLIBC_DEBUG_OPTIMIZATIONS
bool "Optimize debugging experience"
help
Compiler optimizations will be set to -Og independently of other
options.
config PICOLIBC_NO_OPTIMIZATIONS
bool "Optimize nothing"
help
Compiler optimizations will be set to -O0 independently of other
options.
endchoice
config PICOLIBC_FAST_STRCMP
bool "always use fast strcmp paths"
default y
help
This provides a faster strcmp version even when libc is
built in space-optimized mode
config PICOLIBC_IO_C99_FORMATS
bool "support C99 format additions in printf/scanf"
default y
help
Includes support for hex floats (in floating-point version) and j, z,
t size modifiers.
config PICOLIBC_IO_POS_ARGS
bool "Support POSIX positional args (e.g. %$1d) in printf/scanf"
default y
depends on !PICOLIBC_IO_FLOAT
help
Includes support for positional args (e.g. $1) in integer-only printf
and scanf. Positional args are always supported in the floating-point
versions.
config PICOLIBC_IO_FLOAT_EXACT
bool "support for exact float/string conversion"
default y
help
Uses Ryu algorithm for exact binary/decimal float conversions.
This ensures that printf values with enough digits can be
fed to scanf and generate exactly the same binary value.
config PICOLIBC_LOCALE_INFO
bool "support locales in libc functions"
help
Includes code for basic locale support
config PICOLIBC_LOCALE_EXTENDED_INFO
bool "support extended locales in libc functions"
help
Includes code for extended locale support
config PICOLIBC_MULTIBYTE
bool "support multibyte functions in libc"
help
Includes code for multi-byte characters
config PICOLIBC_PICOEXIT
bool "use smaller atexit/onexit implementation"
default y
help
Provides a simpler atexit/onexit implementation that doesn't use
malloc, but only supports a small number (32) of exit handlers.
config PICOLIBC_MULTITHREAD
bool "support multiple threads using retargetable locking API"
default y
help
Protects shared data structures in libc with mutexes that use
an API which can be retargeted to OS provided routines.
config PICOLIBC_GLOBAL_ERRNO
bool "use a single global variable for errno"
help
Picolibc usually uses a TLS variable for errno, ensuring that
multiple threads have a reliable mechanism for detecting libc
exceptions. This option switches to a single global errno variable,
which can be used to avoid TLS variable usage by the library if
necessary.
endif # PICOLIBC_USE_MODULE
endif # PICOLIBC