From 160d9a53b97c0c4f1ee15e8dfa4ca2d87f2ad169 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Wed, 14 Oct 2020 18:23:26 +0200 Subject: [PATCH] cpu/cortexm_common: also check for picolibc in USEMODULE --- cpu/cortexm_common/Makefile.dep | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cpu/cortexm_common/Makefile.dep b/cpu/cortexm_common/Makefile.dep index d2b74c516f..1718d328f8 100644 --- a/cpu/cortexm_common/Makefile.dep +++ b/cpu/cortexm_common/Makefile.dep @@ -4,7 +4,12 @@ USEMODULE += cortexm_common # include common periph code USEMODULE += cortexm_common_periph -ifneq (,$(filter picolibc,$(FEATURES_USED))) +# Ensure newlib is not added if picolibc is already in FEATURES_USED or USEMODULE. +# nucleo-l011k4 doesn't use features to forces picolibc but directly set it in +# 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