2019-09-25 22:13:08 +02:00
|
|
|
ifneq (,$(filter picolibc,$(USEMODULE)))
|
|
|
|
# Test if picolibc.specs is available
|
|
|
|
ifeq ($(shell $(LINK) -specs=picolibc.specs -E - 2>/dev/null >/dev/null </dev/null ; echo $$?),0)
|
|
|
|
USE_PICOLIBC = 1
|
|
|
|
ifeq ($(shell echo "int main(){} void _exit(int n) {(void)n;while(1);}" | LC_ALL=C $(CC) -xc - -o /dev/null -lc -specs=picolibc.specs -Wall -Wextra -pedantic 2>&1 | grep -q "use of wchar_t values across objects may fail" ; echo $$?),0)
|
|
|
|
CFLAGS += -fshort-wchar
|
|
|
|
LINKFLAGS += -Wl,--no-wchar-size-warning
|
|
|
|
endif
|
2021-02-15 10:51:51 +01:00
|
|
|
else
|
2021-02-15 14:06:14 +01:00
|
|
|
$(warning picolibc was selected to be build but no picolibc.spec could be found)
|
|
|
|
$(warning you might want to install "picolibc" for "$(TARGET_ARCH)")
|
|
|
|
$(warning or add "FEATURES_BLACKLIST += picolibc" to Makefile)
|
2021-02-15 10:51:51 +01:00
|
|
|
$(error check your installation or build configuration.)
|
2019-09-25 22:13:08 +02:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq (1,$(USE_PICOLIBC))
|
|
|
|
LINKFLAGS += -specs=picolibc.specs
|
|
|
|
CFLAGS += -specs=picolibc.specs
|
2020-07-31 01:26:34 +02:00
|
|
|
ifeq (,$(filter printf_float scanf_float,$(USEMODULE)))
|
2020-08-24 20:35:01 +02:00
|
|
|
CFLAGS += -DPICOLIBC_INTEGER_PRINTF_SCANF
|
|
|
|
LINKFLAGS += -DPICOLIBC_INTEGER_PRINTF_SCANF
|
2020-07-31 01:26:34 +02:00
|
|
|
endif
|
2019-09-25 22:13:08 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
LINKFLAGS += -lc
|