Skip to content

Commit

Permalink
Merge pull request #5627 from kaspar030/newlib_fix_short_whar
Browse files Browse the repository at this point in the history
sys: newlib: check if toolchain is compiled with -fshort-wchar, set CFLAGS accordingly
  • Loading branch information
kaspar030 authored Jul 13, 2016
2 parents d0ab56a + 34bbcad commit 58baba5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sys/newlib/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 58baba5

Please sign in to comment.