From 7e457684ea05795be91265cc5bc0320995288871 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 7 Jan 2021 17:21:39 -0800 Subject: picolibc: Convert to companion library This allows configurations to include picolibc without excluding another C library. Signed-off-by: Keith Packard --- config/comp_libs/picolibc.in | 121 +++++++++++++++++++++++++++++++++++++++++ config/libc/picolibc.in | 124 ------------------------------------------- 2 files changed, 121 insertions(+), 124 deletions(-) create mode 100644 config/comp_libs/picolibc.in delete mode 100644 config/libc/picolibc.in (limited to 'config') diff --git a/config/comp_libs/picolibc.in b/config/comp_libs/picolibc.in new file mode 100644 index 00000000..a3f07d63 --- /dev/null +++ b/config/comp_libs/picolibc.in @@ -0,0 +1,121 @@ +# picolibc options + +## depends on BARE_METAL && CONFIGURE_has_meson && CONFIGURE_has_ninja + +## help This option adds Picolibc to an existing configuration which may have +## help a C library, allowing you to install both and select between them +## help when compiling applications using the toolchain +## help +## help Picolibc is a C library intended for use on embedded systems. It is a +## help conglomeration of several library parts, all under BSD-compatible software +## help licenses that make them easily usable on embedded products. + +config PICOLIBC_CXA_ATEXIT + def_bool y + select LIBC_PROVIDES_CXA_ATEXIT + +config LIBC_PICOLIBC_TARGET_CFLAGS + string + prompt "Target CFLAGS for picolibc" + default "" + help + Used to add specific options when compiling the target libraries + (eg. -ffunction-sections -fdata-sections), which can't be defined + in global TARGET_CFLAGS, because they shall be not used for the + gcc target libraries. + Note: Both TARGET_CFLAGS and LIBC_PICOLIBC_TARGET_CFLAGS are used + to compile the libraries. + + Leave blank if you don't know better. + +config LIBC_PICOLIBC_IO_C99FMT + bool + prompt "Enable IOs on C99 formats" + default y + help + Enable support for IOs on C99 formats. + +config LIBC_PICOLIBC_REGISTER_FINI + bool + prompt "Enable finalization function registration using atexit" + help + Enable finalization function registration using atexit. + +config LIBC_PICOLIBC_ATEXIT_DYNAMIC_ALLOC + bool + prompt "Enable dynamic allocation of atexit entries" + help + Enable dynamic allocation of atexit entries. + +config LIBC_PICOLIBC_GLOBAL_ATEXIT + bool + prompt "Enable atexit data structure as global variable" + help + Enable atexit data structure as global variable, instead + of being thread-local. + +config LIBC_PICOLIBC_LITE_EXIT + bool + prompt "Enable lite exit" + default y + help + Enable lite exit, a size-reduced implementation of exit that doesn't + invoke clean-up functions such as _fini or global destructors. + +config LIBC_PICOLIBC_MULTITHREAD + bool + prompt "Enable support for multiple threads" + default y + help + Enable support for multiple threads. + +config LIBC_PICOLIBC_RETARGETABLE_LOCKING + bool + prompt "Enable retargetable locking" + help + Enable retargetable locking to allow the operating system to override + the dummy lock functions defined within picolibc. + +config LIBC_PICOLIBC_EXTRA_SECTIONS + bool + prompt "Place each function & data element in their own section" + help + Place each function & data symbol in their own section. This allows + the linker to garbage collect unused symbols at link time. + +config LIBC_PICOLIBC_ENABLE_TARGET_OPTSPACE + bool + prompt "Optimize picolibc for size" + default y + help + Pass --enable-target-optspace to picolibc configure. + + This will compile picolibc with -Os. + +config LIBC_PICOLIBC_LTO + bool + prompt "Enable Link Time Optimization" + depends on CC_GCC_USE_LTO + help + Builds the libraries with -flto to enable more aggressive link time + optimization. You will need to add -flto-partition=one to your + application's link line to keep the RETURN assembler macro together + with it's consumers. + +config LIBC_PICOLIBC_NANO_MALLOC + bool + prompt "Enable Nano Malloc" + default y + help + PICOLIBC has two implementations of malloc family's functions, one in + `mallocr.c' and the other one in `nano-mallocr.c'. This options + enables the nano-malloc implementation, which is for small systems + with very limited memory. Note that this implementation does not + support `--enable-malloc-debugging' any more. + +config LIBC_PICOLIBC_EXTRA_CONFIG_ARRAY + string + prompt "Extra config for picolibc" + default "" + help + Extra flags to pass to meson when configuring picolibc. diff --git a/config/libc/picolibc.in b/config/libc/picolibc.in deleted file mode 100644 index cc1d4d1f..00000000 --- a/config/libc/picolibc.in +++ /dev/null @@ -1,124 +0,0 @@ -# picolibc options - -## depends on BARE_METAL && CONFIGURE_has_meson && CONFIGURE_has_ninja -## select LIBC_SUPPORT_THREADS_NATIVE - -## select CC_CORE_PASSES_NEEDED if CANADIAN -## select CC_CORE_PASS_2_NEEDED if ! CANADIAN - -## help Picolibc is a C library intended for use on embedded systems. It is a -## help conglomeration of several library parts, all under BSD-compatible software -## help licenses that make them easily usable on embedded products. Picolibc -## help is only available in source form. It can be compiled for a wide -## help array of processors, and will usually work on any architecture with -## help the addition of a few low-level routines. - -config PICOLIBC_CXA_ATEXIT - def_bool y - select LIBC_PROVIDES_CXA_ATEXIT - -config LIBC_PICOLIBC_TARGET_CFLAGS - string - prompt "Target CFLAGS for picolibc" - default "" - help - Used to add specific options when compiling the target libraries - (eg. -ffunction-sections -fdata-sections), which can't be defined - in global TARGET_CFLAGS, because they shall be not used for the - gcc target libraries. - Note: Both TARGET_CFLAGS and LIBC_PICOLIBC_TARGET_CFLAGS are used - to compile the libraries. - - Leave blank if you don't know better. - -config LIBC_PICOLIBC_IO_C99FMT - bool - prompt "Enable IOs on C99 formats" - default y - help - Enable support for IOs on C99 formats. - -config LIBC_PICOLIBC_REGISTER_FINI - bool - prompt "Enable finalization function registration using atexit" - help - Enable finalization function registration using atexit. - -config LIBC_PICOLIBC_ATEXIT_DYNAMIC_ALLOC - bool - prompt "Enable dynamic allocation of atexit entries" - help - Enable dynamic allocation of atexit entries. - -config LIBC_PICOLIBC_GLOBAL_ATEXIT - bool - prompt "Enable atexit data structure as global variable" - help - Enable atexit data structure as global variable, instead - of being thread-local. - -config LIBC_PICOLIBC_LITE_EXIT - bool - prompt "Enable lite exit" - default y - help - Enable lite exit, a size-reduced implementation of exit that doesn't - invoke clean-up functions such as _fini or global destructors. - -config LIBC_PICOLIBC_MULTITHREAD - bool - prompt "Enable support for multiple threads" - default y - help - Enable support for multiple threads. - -config LIBC_PICOLIBC_RETARGETABLE_LOCKING - bool - prompt "Enable retargetable locking" - help - Enable retargetable locking to allow the operating system to override - the dummy lock functions defined within picolibc. - -config LIBC_PICOLIBC_EXTRA_SECTIONS - bool - prompt "Place each function & data element in their own section" - help - Place each function & data symbol in their own section. This allows - the linker to garbage collect unused symbols at link time. - -config LIBC_PICOLIBC_ENABLE_TARGET_OPTSPACE - bool - prompt "Optimize picolibc for size" - default y - help - Pass --enable-target-optspace to picolibc configure. - - This will compile picolibc with -Os. - -config LIBC_PICOLIBC_LTO - bool - prompt "Enable Link Time Optimization" - depends on CC_GCC_USE_LTO - help - Builds the libraries with -flto to enable more aggressive link time - optimization. You will need to add -flto-partition=one to your - application's link line to keep the RETURN assembler macro together - with it's consumers. - -config LIBC_PICOLIBC_NANO_MALLOC - bool - prompt "Enable Nano Malloc" - default y - help - PICOLIBC has two implementations of malloc family's functions, one in - `mallocr.c' and the other one in `nano-mallocr.c'. This options - enables the nano-malloc implementation, which is for small systems - with very limited memory. Note that this implementation does not - support `--enable-malloc-debugging' any more. - -config LIBC_PICOLIBC_EXTRA_CONFIG_ARRAY - string - prompt "Extra config for picolibc" - default "" - help - Extra flags to pass to meson when configuring picolibc. -- cgit v1.2.3