From 2cb4e275996f0bd24a4ea0bf666ba20e1575961b Mon Sep 17 00:00:00 2001 From: Niclas Finne Date: Tue, 15 May 2018 00:50:24 +0200 Subject: [PATCH] Added a configurable linker flag to enable linker warnings as errors since OSX requires a diffent linker flag. --- Makefile.include | 7 ++++++- arch/cpu/native/Makefile.native | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile.include b/Makefile.include index c11aea699..de0606ad4 100644 --- a/Makefile.include +++ b/Makefile.include @@ -50,7 +50,12 @@ CFLAGS += -DCONTIKI_BOARD_STRING=\"$(BOARD)\" endif CFLAGS += -Wno-unused-const-variable -LDFLAGS = -Wl,--fatal-warnings + +LDFLAGS_WERROR ?= -Wl,--fatal-warnings + +ifeq ($(WERROR),1) + LDFLAGS += $(LDFLAGS_WERROR) +endif MODULES += os os/sys os/dev os/lib os/services diff --git a/arch/cpu/native/Makefile.native b/arch/cpu/native/Makefile.native index af7328b31..d7832d358 100644 --- a/arch/cpu/native/Makefile.native +++ b/arch/cpu/native/Makefile.native @@ -22,6 +22,7 @@ CFLAGS += $(CFLAGSNO) ifeq ($(HOST_OS),Darwin) AROPTS = -rc +LDFLAGS_WERROR := -Wl,-fatal_warnings LDFLAGS += -Wl,-flat_namespace,-map,$(CONTIKI_NG_PROJECT_MAP) CFLAGS += -DHAVE_SNPRINTF=1 -U__ASSERT_USE_STDERR else