1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/makefiles/libc/picolibc.mk
Benjamin Valentin 28d40eae6f picolibc: enable multiple heaps
We can simply re-use the same code from newlib.
2020-08-24 20:45:05 +02:00

22 lines
829 B
Makefile

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
endif
endif
ifeq (1,$(USE_PICOLIBC))
LINKFLAGS += -specs=picolibc.specs
CFLAGS += -specs=picolibc.specs
ifeq (,$(filter printf_float scanf_float,$(USEMODULE)))
CFLAGS += -DPICOLIBC_INTEGER_PRINTF_SCANF
LINKFLAGS += -DPICOLIBC_INTEGER_PRINTF_SCANF
endif
endif
LINKFLAGS += -lc