diff --git a/lib/Kconfig b/lib/Kconfig index ff983dbda3a..56e16aad07c 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -20,3 +20,5 @@ source "lib/crypto/tinycrypt/Kconfig" endmenu source "lib/iot/Kconfig" + +source "lib/libc/Kconfig" diff --git a/lib/Makefile b/lib/Makefile index 287ff74ba45..07dd923c409 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -1,7 +1,3 @@ -ifdef CONFIG_MINIMAL_LIBC -ZEPHYRINCLUDE += -I$(srctree)/lib/libc/minimal/include -endif - ifdef CONFIG_NEWLIB_LIBC ZEPHYRINCLUDE += $(TOOLCHAIN_CFLAGS) ALL_LIBS += m c @@ -14,6 +10,8 @@ ifdef CONFIG_NEWLIB_LIBC_FLOAT_SCANF LDFLAGS += -u _scanf_float endif +else +ZEPHYRINCLUDE += -I$(srctree)/lib/libc/minimal/include endif include $(srctree)/lib/iot/Makefile diff --git a/lib/iot/http/Kconfig b/lib/iot/http/Kconfig index 5dc9427cac7..98fe3324589 100644 --- a/lib/iot/http/Kconfig +++ b/lib/iot/http/Kconfig @@ -20,8 +20,7 @@ config HTTP_PARSER help This option enables the http_parser library from nodejs. This parser requires some string-related routines commonly - provided by a libc implementation. So, MINIMAL_LIBC_EXTENDED - can be used here to resolve all the required dependencies. + provided by a libc implementation. config HTTP_PARSER_STRICT bool diff --git a/lib/libc/Kconfig b/lib/libc/Kconfig new file mode 100644 index 00000000000..1cbf7826069 --- /dev/null +++ b/lib/libc/Kconfig @@ -0,0 +1,44 @@ +# Kconfig - C library + +# +# Copyright (c) 2016 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +menu "C Library" + +config NEWLIB_LIBC + bool + prompt "Build with newlib c library" + help + Build with newlib library. The newlib library is expected to be + part of the SDK in this case. + +config NEWLIB_LIBC_FLOAT_PRINTF + bool "Build with newlib float printf" + default n + depends on NEWLIB_LIBC + help + Build with floating point printf enabled. This will increase the size of + the image. + +config NEWLIB_LIBC_FLOAT_SCANF + bool "Build with newlib float scanf" + default n + depends on NEWLIB_LIBC + help + Build with floating point scanf enabled. This will increase the size of + the image. + +endmenu diff --git a/lib/libc/Makefile b/lib/libc/Makefile index 82a1ef5c4ad..ee9067dce90 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -1,2 +1,5 @@ -obj-$(CONFIG_MINIMAL_LIBC) += minimal/ -obj-$(CONFIG_NEWLIB_LIBC) += newlib/ +ifeq ($(CONFIG_NEWLIB_LIBC),y) +obj-y += newlib/ +else +obj-y += minimal/ +endif diff --git a/lib/libc/minimal/source/stdlib/Makefile b/lib/libc/minimal/source/stdlib/Makefile index 8d93cd5a14c..e01313e5d72 100644 --- a/lib/libc/minimal/source/stdlib/Makefile +++ b/lib/libc/minimal/source/stdlib/Makefile @@ -1 +1 @@ -obj-$(CONFIG_MINIMAL_LIBC_EXTENDED) += strtol.o strtoul.o atoi.o +obj-y += strtol.o strtoul.o atoi.o diff --git a/lib/libc/minimal/source/string/Makefile b/lib/libc/minimal/source/string/Makefile index e9d0476350c..f04653e8dc7 100644 --- a/lib/libc/minimal/source/string/Makefile +++ b/lib/libc/minimal/source/string/Makefile @@ -1,2 +1,2 @@ -obj-y := string.o -obj-$(CONFIG_MINIMAL_LIBC_EXTENDED) += strncasecmp.o strstr.o +obj-y += string.o +obj-y += strncasecmp.o strstr.o diff --git a/misc/Kconfig b/misc/Kconfig index d81cfcd7ea1..ab3af625ce3 100644 --- a/misc/Kconfig +++ b/misc/Kconfig @@ -122,58 +122,6 @@ config CPLUSPLUS help This option enables the use of applications built with C++. -choice -prompt "C Library" -default MINIMAL_LIBC - -config MINIMAL_LIBC - bool - prompt "Build minimal c library" - help - Build integrated minimal c library. This integrated library is available - to support kernel functionality and test cases. It is not designed to be - used with applications. For applications, please use an external C - library such as newlib. - -config NEWLIB_LIBC - bool - prompt "Build with newlib c library" - help - Build with newlib library. The newlib library is expected to be - part of the SDK in this case. - -endchoice - -config NEWLIB_LIBC_FLOAT_PRINTF - bool "Build with newlib float printf" - default n - depends on NEWLIB_LIBC - help - Build with floating point printf enabled. This will increase the size of - the image. - -config NEWLIB_LIBC_FLOAT_SCANF - bool "Build with newlib float scanf" - default n - depends on NEWLIB_LIBC - help - Build with floating point scanf enabled. This will increase the size of - the image. - -config MINIMAL_LIBC_EXTENDED - bool "Build additional libc functions [EXPERIMENTAL]" - default n - depends on MINIMAL_LIBC - help - This option enables building some optional libc functions that - are not used directly by the kernel but can be used in applications. - The option adds the following functions: strtoul, strtol, atoi, - strncasecmp. - Warning: Use the above functions only for testing, if you need to - use any of the functions in an application you probably should be - linking against a full lib c implementation instead. - - endmenu menu "Debugging Options" diff --git a/samples/bluetooth/handsfree/prj.conf b/samples/bluetooth/handsfree/prj.conf index 4debd315b78..284ece708bb 100644 --- a/samples/bluetooth/handsfree/prj.conf +++ b/samples/bluetooth/handsfree/prj.conf @@ -1,4 +1,3 @@ -CONFIG_MINIMAL_LIBC_EXTENDED=y CONFIG_BLUETOOTH=y CONFIG_BLUETOOTH_BREDR=y CONFIG_BLUETOOTH_RFCOMM=y diff --git a/samples/bluetooth/peripheral_csc/prj_nble.conf b/samples/bluetooth/peripheral_csc/prj_nble.conf index bae8eac90db..33a4bce42ed 100644 --- a/samples/bluetooth/peripheral_csc/prj_nble.conf +++ b/samples/bluetooth/peripheral_csc/prj_nble.conf @@ -1,4 +1,3 @@ -CONFIG_MINIMAL_LIBC_EXTENDED=y CONFIG_RANDOM_GENERATOR=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_BLUETOOTH=y diff --git a/samples/grove/light/prj.conf b/samples/grove/light/prj.conf index bf2cf32b3f1..19482d564d4 100644 --- a/samples/grove/light/prj.conf +++ b/samples/grove/light/prj.conf @@ -3,5 +3,4 @@ CONFIG_GROVE_LIGHT_SENSOR=y CONFIG_GROVE=y CONFIG_SENSOR=y CONFIG_NEWLIB_LIBC=y -CONFIG_MINIMAL_LIBC=n CONFIG_STDOUT_CONSOLE=y diff --git a/samples/grove/temperature/prj.conf b/samples/grove/temperature/prj.conf index c956751849a..38e8836a011 100644 --- a/samples/grove/temperature/prj.conf +++ b/samples/grove/temperature/prj.conf @@ -4,7 +4,6 @@ CONFIG_I2C=y CONFIG_GROVE=y CONFIG_ADC=y CONFIG_NEWLIB_LIBC=y -CONFIG_MINIMAL_LIBC=n CONFIG_GROVE_TEMPERATURE_SENSOR_ADC_CHANNEL=10 CONFIG_GROVE_TEMPERATURE_SENSOR=y CONFIG_GROVE_TEMPERATURE_SENSOR_V1_1=y diff --git a/samples/legacy/task_profiler/README.txt b/samples/legacy/task_profiler/README.txt index e9c9755a822..cfde2059704 100644 --- a/samples/legacy/task_profiler/README.txt +++ b/samples/legacy/task_profiler/README.txt @@ -231,10 +231,8 @@ For that purpose, following flags must be enabled in project configuration file CONFIG_KERNEL_EVENT_LOGGER_DYNAMIC=y CONFIG_CONSOLE_HANDLER=y CONFIG_CONSOLE_HANDLER_SHELL=y -CONFIG_MINIMAL_LIBC_EXTENDED=y --> -CONFIG_MINIMAL_LIBC_EXTENDED is required for atoi() function used in profiler shell command implementation. If done, the profiler will automatically enable a shell over UART allowing to diff --git a/samples/legacy/task_profiler/microkernel/prj.conf b/samples/legacy/task_profiler/microkernel/prj.conf index 2650751f7b7..1bc74d92af4 100644 --- a/samples/legacy/task_profiler/microkernel/prj.conf +++ b/samples/legacy/task_profiler/microkernel/prj.conf @@ -2,7 +2,6 @@ CONFIG_STDOUT_CONSOLE=y CONFIG_CONSOLE_HANDLER=y CONFIG_CONSOLE_HANDLER_SHELL=y CONFIG_ENABLE_SHELL=y -CONFIG_MINIMAL_LIBC_EXTENDED=y CONFIG_TASK_MONITOR=y CONFIG_TASK_MONITOR_MASK=6 CONFIG_RING_BUFFER=y diff --git a/samples/legacy/task_profiler/microkernel/prj_quark_se_c1000_devboard.conf b/samples/legacy/task_profiler/microkernel/prj_quark_se_c1000_devboard.conf index d47ee89d2aa..e97a9051e46 100644 --- a/samples/legacy/task_profiler/microkernel/prj_quark_se_c1000_devboard.conf +++ b/samples/legacy/task_profiler/microkernel/prj_quark_se_c1000_devboard.conf @@ -2,7 +2,6 @@ CONFIG_STDOUT_CONSOLE=y CONFIG_CONSOLE_HANDLER=y CONFIG_CONSOLE_HANDLER_SHELL=y CONFIG_ENABLE_SHELL=y -CONFIG_MINIMAL_LIBC_EXTENDED=y CONFIG_TASK_MONITOR=y CONFIG_TASK_MONITOR_MASK=6 CONFIG_RING_BUFFER=y diff --git a/samples/legacy/task_profiler/nanokernel/prj.conf b/samples/legacy/task_profiler/nanokernel/prj.conf index 6105f6fe09f..c7ca8457f09 100644 --- a/samples/legacy/task_profiler/nanokernel/prj.conf +++ b/samples/legacy/task_profiler/nanokernel/prj.conf @@ -2,7 +2,6 @@ CONFIG_STDOUT_CONSOLE=y CONFIG_CONSOLE_HANDLER=y CONFIG_CONSOLE_HANDLER_SHELL=y CONFIG_ENABLE_SHELL=y -CONFIG_MINIMAL_LIBC_EXTENDED=y CONFIG_RING_BUFFER=y CONFIG_KERNEL_EVENT_LOGGER=y CONFIG_KERNEL_EVENT_LOGGER_DYNAMIC=y diff --git a/samples/legacy/task_profiler/nanokernel/prj_quark_se_c1000_devboard.conf b/samples/legacy/task_profiler/nanokernel/prj_quark_se_c1000_devboard.conf index 72951399730..b255a05ed59 100644 --- a/samples/legacy/task_profiler/nanokernel/prj_quark_se_c1000_devboard.conf +++ b/samples/legacy/task_profiler/nanokernel/prj_quark_se_c1000_devboard.conf @@ -2,7 +2,6 @@ CONFIG_STDOUT_CONSOLE=y CONFIG_CONSOLE_HANDLER=y CONFIG_CONSOLE_HANDLER_SHELL=y CONFIG_ENABLE_SHELL=y -CONFIG_MINIMAL_LIBC_EXTENDED=y CONFIG_RING_BUFFER=y CONFIG_KERNEL_EVENT_LOGGER=y CONFIG_KERNEL_EVENT_LOGGER_DYNAMIC=y diff --git a/samples/net/mbedtls_dtlsclient/prj_arduino_101.conf b/samples/net/mbedtls_dtlsclient/prj_arduino_101.conf index 5cdcb11e09a..ddfbbeaa835 100644 --- a/samples/net/mbedtls_dtlsclient/prj_arduino_101.conf +++ b/samples/net/mbedtls_dtlsclient/prj_arduino_101.conf @@ -1,5 +1,4 @@ CONFIG_STDOUT_CONSOLE=y -CONFIG_MINIMAL_LIBC_EXTENDED=y CONFIG_SYS_LOG=y CONFIG_NET_LOG=y diff --git a/samples/net/mbedtls_dtlsclient/prj_qemu_x86.conf b/samples/net/mbedtls_dtlsclient/prj_qemu_x86.conf index 7de4fb3e06c..c930eab345b 100644 --- a/samples/net/mbedtls_dtlsclient/prj_qemu_x86.conf +++ b/samples/net/mbedtls_dtlsclient/prj_qemu_x86.conf @@ -1,5 +1,4 @@ CONFIG_STDOUT_CONSOLE=y -CONFIG_MINIMAL_LIBC_EXTENDED=y CONFIG_NETWORKING=y CONFIG_NET_IPV6=n diff --git a/samples/net/mbedtls_sslclient/prj_galileo.conf b/samples/net/mbedtls_sslclient/prj_galileo.conf index 217703b721b..f06dfecdb6d 100644 --- a/samples/net/mbedtls_sslclient/prj_galileo.conf +++ b/samples/net/mbedtls_sslclient/prj_galileo.conf @@ -1,5 +1,4 @@ CONFIG_STDOUT_CONSOLE=y -CONFIG_MINIMAL_LIBC_EXTENDED=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_NETWORKING=y diff --git a/samples/net/zperf/prj_frdm_k64f.conf b/samples/net/zperf/prj_frdm_k64f.conf index efa452872d7..b534397ad8f 100644 --- a/samples/net/zperf/prj_frdm_k64f.conf +++ b/samples/net/zperf/prj_frdm_k64f.conf @@ -39,7 +39,6 @@ CONFIG_CONSOLE_HANDLER=y CONFIG_CONSOLE_HANDLER_SHELL=y CONFIG_ENABLE_SHELL=y CONFIG_PRINTK=y -CONFIG_MINIMAL_LIBC_EXTENDED=y CONFIG_NET_SAMPLES_IP_ADDRESSES=y CONFIG_NET_SAMPLES_MY_IPV6_ADDR="2001:db8::1" diff --git a/samples/net/zperf/prj_frdm_k64f_prof.conf b/samples/net/zperf/prj_frdm_k64f_prof.conf index 1b9dbdbe1f1..5552f0167e7 100644 --- a/samples/net/zperf/prj_frdm_k64f_prof.conf +++ b/samples/net/zperf/prj_frdm_k64f_prof.conf @@ -46,4 +46,3 @@ CONFIG_KERNEL_EVENT_LOGGER_BUFFER_SIZE=10000 CONFIG_KERNEL_EVENT_LOGGER_CONTEXT_SWITCH=y CONFIG_KERNEL_EVENT_LOGGER_INTERRUPT=y CONFIG_KERNEL_EVENT_LOGGER_DYNAMIC=y -CONFIG_MINIMAL_LIBC_EXTENDED=y diff --git a/samples/net/zperf/prj_galileo_ethernet.conf b/samples/net/zperf/prj_galileo_ethernet.conf index 0718e025aa8..0dfb3be0659 100644 --- a/samples/net/zperf/prj_galileo_ethernet.conf +++ b/samples/net/zperf/prj_galileo_ethernet.conf @@ -6,7 +6,6 @@ CONFIG_CONSOLE_HANDLER=y CONFIG_CONSOLE_HANDLER_SHELL=y CONFIG_ENABLE_SHELL=y CONFIG_PRINTK=y -CONFIG_MINIMAL_LIBC_EXTENDED=y # # networking # diff --git a/samples/net/zperf/prj_galileo_ethernet_prof.conf b/samples/net/zperf/prj_galileo_ethernet_prof.conf index e976bc31482..d1c85bd8e20 100644 --- a/samples/net/zperf/prj_galileo_ethernet_prof.conf +++ b/samples/net/zperf/prj_galileo_ethernet_prof.conf @@ -6,7 +6,6 @@ CONFIG_CONSOLE_HANDLER=y CONFIG_CONSOLE_HANDLER_SHELL=y CONFIG_ENABLE_SHELL=y CONFIG_PRINTK=y -CONFIG_MINIMAL_LIBC_EXTENDED=y # # networking # @@ -43,4 +42,3 @@ CONFIG_KERNEL_EVENT_LOGGER_INTERRUPT=y CONFIG_UART_NS16550_PORT_1_BAUD_RATE=921600 CONFIG_UART_NS16550_PORT_0=n CONFIG_KERNEL_EVENT_LOGGER_DYNAMIC=y -CONFIG_MINIMAL_LIBC_EXTENDED=y diff --git a/samples/net/zperf/prj_qemu_x86.conf b/samples/net/zperf/prj_qemu_x86.conf index f4908b4747b..09ab5cfcb5e 100644 --- a/samples/net/zperf/prj_qemu_x86.conf +++ b/samples/net/zperf/prj_qemu_x86.conf @@ -32,7 +32,6 @@ CONFIG_CONSOLE_HANDLER=y CONFIG_CONSOLE_HANDLER_SHELL=y CONFIG_ENABLE_SHELL=y CONFIG_PRINTK=y -CONFIG_MINIMAL_LIBC_EXTENDED=y CONFIG_NET_SAMPLES_IP_ADDRESSES=y CONFIG_NET_SAMPLES_MY_IPV6_ADDR="2001:db8::1" diff --git a/samples/net/zperf/prj_quark_se_c1000_devboard.conf b/samples/net/zperf/prj_quark_se_c1000_devboard.conf index c64632d01f3..adf6b633fa3 100644 --- a/samples/net/zperf/prj_quark_se_c1000_devboard.conf +++ b/samples/net/zperf/prj_quark_se_c1000_devboard.conf @@ -37,7 +37,6 @@ CONFIG_CONSOLE_HANDLER=y CONFIG_CONSOLE_HANDLER_SHELL=y CONFIG_ENABLE_SHELL=y CONFIG_PRINTK=y -CONFIG_MINIMAL_LIBC_EXTENDED=y CONFIG_NET_SAMPLES_IP_ADDRESSES=y CONFIG_NET_SAMPLES_MY_IPV6_ADDR="2001:db8::1" diff --git a/subsys/net/ip/Kconfig.debug b/subsys/net/ip/Kconfig.debug index c68a873d911..f79ac361c16 100644 --- a/subsys/net/ip/Kconfig.debug +++ b/subsys/net/ip/Kconfig.debug @@ -34,7 +34,6 @@ config NET_SHELL select ENABLE_SHELL select CONSOLE_HANDLER select CONSOLE_HANDLER_SHELL - select MINIMAL_LIBC_EXTENDED help Activate shell module that provides network commands like ping to the console. diff --git a/subsys/net/ip/Kconfig.samples b/subsys/net/ip/Kconfig.samples index f52c847a5bc..6ab42f42e8c 100644 --- a/subsys/net/ip/Kconfig.samples +++ b/subsys/net/ip/Kconfig.samples @@ -19,7 +19,6 @@ menuconfig NET_SAMPLES_IP_ADDRESSES bool "Set IP addresses for sample applications" default n - select MINIMAL_LIBC_EXTENDED help Allow IP addresses to be set in config file for networking client/server sample applications. diff --git a/tests/bluetooth/shell/arduino_101.conf b/tests/bluetooth/shell/arduino_101.conf index d4133e37094..e0c4dc54f64 100644 --- a/tests/bluetooth/shell/arduino_101.conf +++ b/tests/bluetooth/shell/arduino_101.conf @@ -1,4 +1,3 @@ -CONFIG_MINIMAL_LIBC_EXTENDED=y CONFIG_BLUETOOTH=y CONFIG_CONSOLE_HANDLER=y CONFIG_BLUETOOTH_DEBUG_LOG=y diff --git a/tests/bluetooth/shell/prj.conf b/tests/bluetooth/shell/prj.conf index 02bff1a02b6..59c70c4c5a8 100644 --- a/tests/bluetooth/shell/prj.conf +++ b/tests/bluetooth/shell/prj.conf @@ -1,4 +1,3 @@ -CONFIG_MINIMAL_LIBC_EXTENDED=y CONFIG_BLUETOOTH=y CONFIG_CONSOLE_HANDLER=y CONFIG_BLUETOOTH_DEBUG_LOG=y diff --git a/tests/bluetooth/shell/prj_br.conf b/tests/bluetooth/shell/prj_br.conf index f4d8b9e8f3b..bfba5e403b2 100644 --- a/tests/bluetooth/shell/prj_br.conf +++ b/tests/bluetooth/shell/prj_br.conf @@ -1,4 +1,3 @@ -CONFIG_MINIMAL_LIBC_EXTENDED=y CONFIG_BLUETOOTH=y CONFIG_BLUETOOTH_BREDR=y CONFIG_BLUETOOTH_RFCOMM=y diff --git a/tests/bluetooth/shell/prj_nble.conf b/tests/bluetooth/shell/prj_nble.conf index 48b29679bb3..17c8d5e0964 100644 --- a/tests/bluetooth/shell/prj_nble.conf +++ b/tests/bluetooth/shell/prj_nble.conf @@ -1,4 +1,3 @@ -CONFIG_MINIMAL_LIBC_EXTENDED=y CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_BLUETOOTH=y CONFIG_BLUETOOTH_CUSTOM=y diff --git a/tests/bluetooth/shell/prj_nimble.conf b/tests/bluetooth/shell/prj_nimble.conf index 2bea75a61d1..86e10093dda 100644 --- a/tests/bluetooth/shell/prj_nimble.conf +++ b/tests/bluetooth/shell/prj_nimble.conf @@ -1,4 +1,3 @@ -CONFIG_MINIMAL_LIBC_EXTENDED=y CONFIG_BLUETOOTH=y CONFIG_CONSOLE_HANDLER=y CONFIG_BLUETOOTH_DEBUG_LOG=y diff --git a/tests/crypto/test_mbedtls/prj.conf b/tests/crypto/test_mbedtls/prj.conf index 5ac30f4ce44..282f51104b0 100644 --- a/tests/crypto/test_mbedtls/prj.conf +++ b/tests/crypto/test_mbedtls/prj.conf @@ -2,7 +2,6 @@ CONFIG_MAIN_STACK_SIZE=4096 CONFIG_ARC_INIT=n CONFIG_STDOUT_CONSOLE=y -CONFIG_MINIMAL_LIBC_EXTENDED=y CONFIG_MBEDTLS=y CONFIG_MBEDTLS_BUILTIN=y CONFIG_MBEDTLS_TEST=y diff --git a/tests/iot/test_http_header/prj.conf b/tests/iot/test_http_header/prj.conf index b9f08eee506..2579ed9ad6f 100644 --- a/tests/iot/test_http_header/prj.conf +++ b/tests/iot/test_http_header/prj.conf @@ -1,5 +1,4 @@ # Comment the following line if you want to try another libc -CONFIG_MINIMAL_LIBC_EXTENDED=y CONFIG_HTTP_PARSER=y # Enable strict parser by uncommenting the following line # CONFIG_HTTP_PARSER_STRICT=y diff --git a/tests/kernel/test_build/newlib.conf b/tests/kernel/test_build/newlib.conf index 329b4c8f07d..fd690407c24 100644 --- a/tests/kernel/test_build/newlib.conf +++ b/tests/kernel/test_build/newlib.conf @@ -1,5 +1,4 @@ CONFIG_DEBUG=y CONFIG_STDOUT_CONSOLE=y CONFIG_NEWLIB_LIBC=y -CONFIG_MINIMAL_LIBC=n