sys: newlib: check if toolchain is compiled with -fshort-wchar, set CFLAGS accordingly

pr/spi.typo
Kaspar Schleiser 7 years ago
parent 52ff326f69
commit 34bbcad7bb

@ -4,6 +4,9 @@ ifneq (,$(filter newlib_nano,$(USEMODULE)))
# Test if nano.specs is available
ifeq ($(shell $(LINK) -specs=nano.specs -E - 2>/dev/null >/dev/null </dev/null ; echo $$?),0)
USE_NEWLIB_NANO = 1
ifeq ($(shell echo "int main(){} void _exit(int n) {(void)n;while(1);}" | LC_ALL=C $(CC) -xc - -o /dev/null -lc -specs=nano.specs -Wall -Wextra -pedantic 2>&1 | grep -q "use of wchar_t values across objects may fail" ; echo $$?),0)
CFLAGS += -fshort-wchar
endif
endif
endif

Loading…
Cancel
Save