mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #15859 from fjmolinas/pr_newlib_feature
treewide: model newlib as a FEATURE
This commit is contained in:
commit
ce97e9d8ce
@ -20,3 +20,7 @@ include $(RIOTCPU)/$(CPU)/Makefile.features
|
|||||||
|
|
||||||
# Provide CPU as a feature to allow listing all boards with a CPU
|
# Provide CPU as a feature to allow listing all boards with a CPU
|
||||||
FEATURES_PROVIDED += cpu_$(CPU)
|
FEATURES_PROVIDED += cpu_$(CPU)
|
||||||
|
|
||||||
|
# Features that are conflicting for all architectures
|
||||||
|
FEATURES_CONFLICT += picolibc:newlib
|
||||||
|
FEATURES_CONFLICT_MSG += "Only one standard C library can be used"
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
# Use Picolibc to reduce ROM usage
|
# Use Picolibc to reduce ROM usage
|
||||||
USEMODULE += picolibc
|
|
||||||
FEATURES_REQUIRED += picolibc
|
FEATURES_REQUIRED += picolibc
|
||||||
|
|
||||||
include $(RIOTBOARD)/common/nucleo/Makefile.dep
|
include $(RIOTBOARD)/common/nucleo/Makefile.dep
|
||||||
|
@ -4,4 +4,3 @@ endif
|
|||||||
|
|
||||||
# Use Picolibc to reduce ROM usage
|
# Use Picolibc to reduce ROM usage
|
||||||
FEATURES_REQUIRED += picolibc
|
FEATURES_REQUIRED += picolibc
|
||||||
USEMODULE += picolibc
|
|
||||||
|
@ -1,3 +1,2 @@
|
|||||||
# Use Picolibc to reduce ROM usage
|
# Use Picolibc to reduce ROM usage
|
||||||
FEATURES_REQUIRED += picolibc
|
FEATURES_REQUIRED += picolibc
|
||||||
USEMODULE += picolibc
|
|
||||||
|
@ -24,6 +24,7 @@ config CPU_CORE_ARM7TDMI_S
|
|||||||
## Declaration of specific features
|
## Declaration of specific features
|
||||||
config HAS_ARCH_ARM7
|
config HAS_ARCH_ARM7
|
||||||
bool
|
bool
|
||||||
|
select HAS_NEWLIB
|
||||||
select HAS_PICOLIBC
|
select HAS_PICOLIBC
|
||||||
help
|
help
|
||||||
Indicates that the core is part of the ARM7 group of cores.
|
Indicates that the core is part of the ARM7 group of cores.
|
||||||
|
@ -1,12 +1,8 @@
|
|||||||
# use common ARM7 periph code
|
# use common ARM7 periph code
|
||||||
USEMODULE += arm7_common_periph
|
USEMODULE += arm7_common_periph
|
||||||
|
|
||||||
ifneq (,$(filter picolibc,$(FEATURES_USED)))
|
FEATURES_REQUIRED_ANY += newlib|picolibc
|
||||||
# Use Picolibc when explicitly selected
|
ifneq (,$(filter newlib,$(USEMODULE)))
|
||||||
USEMODULE += picolibc
|
|
||||||
else
|
|
||||||
# all cortex MCU's use newlib as libc
|
|
||||||
USEMODULE += newlib
|
|
||||||
# use the nano-specs of Newlib when available
|
# use the nano-specs of Newlib when available
|
||||||
USEMODULE += newlib_nano
|
USEMODULE += newlib_nano
|
||||||
endif
|
endif
|
||||||
|
@ -6,6 +6,7 @@ FEATURES_PROVIDED += arch_arm
|
|||||||
FEATURES_PROVIDED += arch_arm7
|
FEATURES_PROVIDED += arch_arm7
|
||||||
FEATURES_PROVIDED += cpp
|
FEATURES_PROVIDED += cpp
|
||||||
FEATURES_PROVIDED += libstdcpp
|
FEATURES_PROVIDED += libstdcpp
|
||||||
|
FEATURES_PROVIDED += newlib
|
||||||
FEATURES_PROVIDED += periph_pm
|
FEATURES_PROVIDED += periph_pm
|
||||||
FEATURES_PROVIDED += picolibc
|
FEATURES_PROVIDED += picolibc
|
||||||
FEATURES_PROVIDED += puf_sram
|
FEATURES_PROVIDED += puf_sram
|
||||||
|
@ -47,6 +47,7 @@ config CPU_CORE_CORTEX_M
|
|||||||
select HAS_CPU_CHECK_ADDRESS
|
select HAS_CPU_CHECK_ADDRESS
|
||||||
select HAS_SSP
|
select HAS_SSP
|
||||||
select HAS_CORTEXM_SVC
|
select HAS_CORTEXM_SVC
|
||||||
|
select HAS_NEWLIB
|
||||||
|
|
||||||
## Common CPU symbols
|
## Common CPU symbols
|
||||||
config CPU_CORE
|
config CPU_CORE
|
||||||
|
@ -4,17 +4,8 @@ USEMODULE += cortexm_common
|
|||||||
# include common periph code
|
# include common periph code
|
||||||
USEMODULE += cortexm_common_periph
|
USEMODULE += cortexm_common_periph
|
||||||
|
|
||||||
# Ensure newlib is not added if picolibc is already in FEATURES_USED or USEMODULE.
|
FEATURES_REQUIRED_ANY += newlib|picolibc
|
||||||
# nucleo-l011k4 doesn't use features to forces picolibc but directly set it in
|
ifneq (,$(filter newlib,$(USEMODULE)))
|
||||||
# USEMODULE. This is because during the first pass of the dependency resolution,
|
|
||||||
# with the feature mechanism, the picolib feature is not present in FEATURES_USED
|
|
||||||
# at this staged and as a result newlib modules are wrongly added.
|
|
||||||
ifneq (,$(filter picolibc,$(FEATURES_USED) $(USEMODULE)))
|
|
||||||
# Use Picolibc when explicitly selected
|
|
||||||
USEMODULE += picolibc
|
|
||||||
else
|
|
||||||
# all cortex MCU's use newlib as libc
|
|
||||||
USEMODULE += newlib
|
|
||||||
# use the nano-specs of Newlib when available
|
# use the nano-specs of Newlib when available
|
||||||
USEMODULE += newlib_nano
|
USEMODULE += newlib_nano
|
||||||
endif
|
endif
|
||||||
|
@ -5,6 +5,7 @@ FEATURES_PROVIDED += cpp
|
|||||||
FEATURES_PROVIDED += cpu_check_address
|
FEATURES_PROVIDED += cpu_check_address
|
||||||
FEATURES_PROVIDED += cpu_core_cortexm
|
FEATURES_PROVIDED += cpu_core_cortexm
|
||||||
FEATURES_PROVIDED += libstdcpp
|
FEATURES_PROVIDED += libstdcpp
|
||||||
|
FEATURES_PROVIDED += newlib
|
||||||
FEATURES_PROVIDED += periph_pm
|
FEATURES_PROVIDED += periph_pm
|
||||||
FEATURES_PROVIDED += puf_sram
|
FEATURES_PROVIDED += puf_sram
|
||||||
FEATURES_PROVIDED += picolibc
|
FEATURES_PROVIDED += picolibc
|
||||||
|
@ -5,9 +5,12 @@ include $(RIOTCPU)/esp_common/Makefile.dep
|
|||||||
USEMODULE += esp_idf_driver
|
USEMODULE += esp_idf_driver
|
||||||
USEMODULE += esp_idf_esp32
|
USEMODULE += esp_idf_esp32
|
||||||
USEMODULE += esp_idf_soc
|
USEMODULE += esp_idf_soc
|
||||||
USEMODULE += newlib_nano
|
|
||||||
USEMODULE += pm_layered
|
USEMODULE += pm_layered
|
||||||
|
|
||||||
|
ifneq (,$(filter newlib,$(USEMODULE)))
|
||||||
|
USEMODULE += newlib_nano
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq (,$(filter esp_eth,$(USEMODULE)))
|
ifneq (,$(filter esp_eth,$(USEMODULE)))
|
||||||
USEMODULE += esp_freertos
|
USEMODULE += esp_freertos
|
||||||
USEMODULE += esp_idf_eth
|
USEMODULE += esp_idf_eth
|
||||||
|
@ -9,7 +9,6 @@ USEMODULE += esp_idf_util
|
|||||||
USEMODULE += esp_idf_wpa_supplicant_crypto
|
USEMODULE += esp_idf_wpa_supplicant_crypto
|
||||||
USEMODULE += esp_sdk
|
USEMODULE += esp_sdk
|
||||||
USEMODULE += mtd
|
USEMODULE += mtd
|
||||||
USEMODULE += newlib
|
|
||||||
USEMODULE += periph_common
|
USEMODULE += periph_common
|
||||||
USEMODULE += ps
|
USEMODULE += ps
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ config CPU_COMMON_ESP
|
|||||||
select HAS_ESP_SPIFFS
|
select HAS_ESP_SPIFFS
|
||||||
select HAS_ESP_WIFI
|
select HAS_ESP_WIFI
|
||||||
select HAS_ESP_WIFI_AP
|
select HAS_ESP_WIFI_AP
|
||||||
|
select HAS_NEWLIB
|
||||||
select HAS_LIBSTDCPP
|
select HAS_LIBSTDCPP
|
||||||
select HAS_PERIPH_CPUID
|
select HAS_PERIPH_CPUID
|
||||||
select HAS_PERIPH_HWRNG
|
select HAS_PERIPH_HWRNG
|
||||||
|
@ -7,7 +7,6 @@ USEMODULE += esp_common_periph
|
|||||||
USEMODULE += esp_freertos
|
USEMODULE += esp_freertos
|
||||||
USEMODULE += esp_idf
|
USEMODULE += esp_idf
|
||||||
USEMODULE += log
|
USEMODULE += log
|
||||||
USEMODULE += newlib
|
|
||||||
USEMODULE += periph
|
USEMODULE += periph
|
||||||
USEMODULE += periph_hwrng
|
USEMODULE += periph_hwrng
|
||||||
USEMODULE += periph_flash
|
USEMODULE += periph_flash
|
||||||
@ -22,6 +21,7 @@ USEMODULE += xtensa
|
|||||||
|
|
||||||
# Features used by ESP*
|
# Features used by ESP*
|
||||||
|
|
||||||
|
FEATURES_REQUIRED += newlib
|
||||||
FEATURES_REQUIRED += cpp # Vendor code uses C++
|
FEATURES_REQUIRED += cpp # Vendor code uses C++
|
||||||
|
|
||||||
ifneq (,$(filter esp_wifi_ap,$(USEMODULE)))
|
ifneq (,$(filter esp_wifi_ap,$(USEMODULE)))
|
||||||
|
@ -10,6 +10,7 @@ FEATURES_PROVIDED += esp_spiffs
|
|||||||
FEATURES_PROVIDED += esp_wifi_ap
|
FEATURES_PROVIDED += esp_wifi_ap
|
||||||
FEATURES_PROVIDED += esp_wifi
|
FEATURES_PROVIDED += esp_wifi
|
||||||
FEATURES_PROVIDED += libstdcpp
|
FEATURES_PROVIDED += libstdcpp
|
||||||
|
FEATURES_PROVIDED += newlib
|
||||||
FEATURES_PROVIDED += periph_cpuid
|
FEATURES_PROVIDED += periph_cpuid
|
||||||
FEATURES_PROVIDED += periph_hwrng
|
FEATURES_PROVIDED += periph_hwrng
|
||||||
FEATURES_PROVIDED += periph_pm
|
FEATURES_PROVIDED += periph_pm
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
config CPU_ARCH_RISCV
|
config CPU_ARCH_RISCV
|
||||||
bool
|
bool
|
||||||
select HAS_ARCH_RISCV
|
select HAS_ARCH_RISCV
|
||||||
|
select HAS_NEWLIB
|
||||||
select HAS_PICOLIBC if '$(RIOT_CI_BUILD)' != '1'
|
select HAS_PICOLIBC if '$(RIOT_CI_BUILD)' != '1'
|
||||||
select MODULE_MALLOC_THREAD_SAFE if TEST_KCONFIG
|
select MODULE_MALLOC_THREAD_SAFE if TEST_KCONFIG
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
ifneq (,$(filter picolibc,$(FEATURES_USED)))
|
|
||||||
USEMODULE += picolibc
|
FEATURES_REQUIRED_ANY += picolibc|newlib
|
||||||
else
|
ifneq (,$(filter newlib,$(USEMODULE)))
|
||||||
USEMODULE += newlib_nano
|
USEMODULE += newlib_nano
|
||||||
USEMODULE += newlib_syscalls_default
|
USEMODULE += newlib_syscalls_default
|
||||||
endif
|
endif
|
||||||
|
@ -2,6 +2,7 @@ FEATURES_PROVIDED += arch_32bit
|
|||||||
FEATURES_PROVIDED += arch_riscv
|
FEATURES_PROVIDED += arch_riscv
|
||||||
FEATURES_PROVIDED += cpp
|
FEATURES_PROVIDED += cpp
|
||||||
FEATURES_PROVIDED += libstdcpp
|
FEATURES_PROVIDED += libstdcpp
|
||||||
|
FEATURES_PROVIDED += newlib
|
||||||
FEATURES_PROVIDED += periph_cpuid
|
FEATURES_PROVIDED += periph_cpuid
|
||||||
FEATURES_PROVIDED += periph_gpio periph_gpio_irq
|
FEATURES_PROVIDED += periph_gpio periph_gpio_irq
|
||||||
FEATURES_PROVIDED += periph_plic
|
FEATURES_PROVIDED += periph_plic
|
||||||
|
@ -9,6 +9,7 @@ config CPU_ARCH_MIPS32R2
|
|||||||
bool
|
bool
|
||||||
select HAS_ARCH_32BIT
|
select HAS_ARCH_32BIT
|
||||||
select HAS_ARCH_MIPS32R2
|
select HAS_ARCH_MIPS32R2
|
||||||
|
select HAS_NEWLIB
|
||||||
select HAS_CPP
|
select HAS_CPP
|
||||||
select HAS_LIBSTDCPP
|
select HAS_LIBSTDCPP
|
||||||
select HAS_PERIPH_PM
|
select HAS_PERIPH_PM
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
USEMODULE += mips32r2_common
|
USEMODULE += mips32r2_common
|
||||||
USEMODULE += mips32r2_common_periph
|
USEMODULE += mips32r2_common_periph
|
||||||
USEMODULE += newlib
|
|
||||||
|
|
||||||
|
FEATURES_REQUIRED += newlib
|
||||||
# mips32 needs periph_timer for its gettimeofday() implementation
|
# mips32 needs periph_timer for its gettimeofday() implementation
|
||||||
FEATURES_REQUIRED += periph_timer
|
FEATURES_REQUIRED += periph_timer
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ CPU_ARCH = mips32r2
|
|||||||
|
|
||||||
FEATURES_PROVIDED += arch_32bit
|
FEATURES_PROVIDED += arch_32bit
|
||||||
FEATURES_PROVIDED += arch_mips32r2
|
FEATURES_PROVIDED += arch_mips32r2
|
||||||
|
FEATURES_PROVIDED += newlib
|
||||||
FEATURES_PROVIDED += cpp
|
FEATURES_PROVIDED += cpp
|
||||||
FEATURES_PROVIDED += libstdcpp
|
FEATURES_PROVIDED += libstdcpp
|
||||||
FEATURES_PROVIDED += periph_pm
|
FEATURES_PROVIDED += periph_pm
|
||||||
|
@ -12,6 +12,7 @@ config CPU_ARCH_MSP430
|
|||||||
select HAS_ARCH_MSP430
|
select HAS_ARCH_MSP430
|
||||||
select HAS_PERIPH_FLASHPAGE
|
select HAS_PERIPH_FLASHPAGE
|
||||||
select HAS_PERIPH_FLASHPAGE_PAGEWISE
|
select HAS_PERIPH_FLASHPAGE_PAGEWISE
|
||||||
|
select HAS_NEWLIB
|
||||||
select HAS_PERIPH_PM
|
select HAS_PERIPH_PM
|
||||||
select MODULE_MALLOC_THREAD_SAFE if TEST_KCONFIG
|
select MODULE_MALLOC_THREAD_SAFE if TEST_KCONFIG
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ CPU_CORE = msp430
|
|||||||
|
|
||||||
FEATURES_PROVIDED += arch_16bit
|
FEATURES_PROVIDED += arch_16bit
|
||||||
FEATURES_PROVIDED += arch_msp430
|
FEATURES_PROVIDED += arch_msp430
|
||||||
|
FEATURES_PROVIDED += newlib
|
||||||
FEATURES_PROVIDED += periph_flashpage
|
FEATURES_PROVIDED += periph_flashpage
|
||||||
FEATURES_PROVIDED += periph_flashpage_pagewise
|
FEATURES_PROVIDED += periph_flashpage_pagewise
|
||||||
FEATURES_PROVIDED += periph_pm
|
FEATURES_PROVIDED += periph_pm
|
||||||
|
@ -327,6 +327,11 @@ config HAS_PICOLIBC
|
|||||||
help
|
help
|
||||||
Indicates that the picolibc C library is available for the platform.
|
Indicates that the picolibc C library is available for the platform.
|
||||||
|
|
||||||
|
config HAS_NEWLIB
|
||||||
|
bool
|
||||||
|
help
|
||||||
|
Indicates that the newlib C library is available for the platform.
|
||||||
|
|
||||||
config HAS_PUF_SRAM
|
config HAS_PUF_SRAM
|
||||||
bool
|
bool
|
||||||
help
|
help
|
||||||
|
@ -45,5 +45,15 @@ ifneq (,$(filter cortexm_mpu,$(FEATURES_USED)))
|
|||||||
USEMODULE += mpu_stack_guard
|
USEMODULE += mpu_stack_guard
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# use picolibc if the feature is used
|
||||||
|
ifneq (,$(filter picolibc,$(FEATURES_USED)))
|
||||||
|
USEMODULE += picolibc
|
||||||
|
endif
|
||||||
|
|
||||||
|
# use newlib if the feature is used
|
||||||
|
ifneq (,$(filter newlib,$(FEATURES_USED)))
|
||||||
|
USEMODULE += newlib
|
||||||
|
endif
|
||||||
|
|
||||||
# use efm32_coretemp if the feature is used
|
# use efm32_coretemp if the feature is used
|
||||||
USEMODULE += $(filter efm32_coretemp, $(FEATURES_USED))
|
USEMODULE += $(filter efm32_coretemp, $(FEATURES_USED))
|
||||||
|
@ -530,11 +530,11 @@ ifneq (,$(filter od_string,$(USEMODULE)))
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq (,$(filter newlib_gnu_source,$(USEMODULE)))
|
ifneq (,$(filter newlib_gnu_source,$(USEMODULE)))
|
||||||
USEMODULE += newlib
|
FEATURES_REQUIRED += newlib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq (,$(filter newlib_nano,$(USEMODULE)))
|
ifneq (,$(filter newlib_nano,$(USEMODULE)))
|
||||||
USEMODULE += newlib
|
FEATURES_REQUIRED += newlib
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq (,$(filter newlib,$(USEMODULE)))
|
ifneq (,$(filter newlib,$(USEMODULE)))
|
||||||
|
Loading…
Reference in New Issue
Block a user