summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAyke van Laethem <aykevanlaethem@gmail.com>2018-04-24 16:56:23 +0200
committerDamien George <damien.p.george@gmail.com>2018-07-18 17:12:26 +1000
commit4111206bd51695486d3ac6bb5bc6a2ade61aebd3 (patch)
tree29c469d5953ccacb3894de1c7bf58b8a0c680871
parentab72b5b69c5c1f8d60a78dfa1e01767caf999236 (diff)
nrf/Makefile: Refine dead-code elimination parameters.
Clang warns about useless -Wl,--gc-sections passed in CFLAGS.
-rw-r--r--ports/nrf/Makefile6
1 files changed, 3 insertions, 3 deletions
diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile
index f4220a37b..b353bdcd0 100644
--- a/ports/nrf/Makefile
+++ b/ports/nrf/Makefile
@@ -93,9 +93,10 @@ CFLAGS_MCU_m0 = $(CFLAGS_CORTEX_M) -fshort-enums -mtune=cortex-m0 -mcpu=cortex-m
LTO ?= 1
ifeq ($(LTO),1)
-CFLAGS_LTO += -flto
+CFLAGS += -flto
else
-CFLAGS_LTO += -Wl,--gc-sections -ffunction-sections -fdata-sections
+CFLAGS += -ffunction-sections -fdata-sections
+LDFLAGS += -Wl,--gc-sections
endif
@@ -104,7 +105,6 @@ CFLAGS += $(INC) -Wall -Werror -g -ansi -std=c11 -nostdlib $(COPT) $(NRF_DEFINES
CFLAGS += -fno-strict-aliasing
CFLAGS += -Iboards/$(BOARD)
CFLAGS += -DNRF5_HAL_H='<$(MCU_VARIANT)_hal.h>'
-CFLAGS += $(CFLAGS_LTO)
LDFLAGS = $(CFLAGS)
LDFLAGS += -Xlinker -Map=$(@:.elf=.map)