nrf/Makefile: Refine dead-code elimination parameters.

Clang warns about useless -Wl,--gc-sections passed in CFLAGS.
This commit is contained in:
Ayke van Laethem 2018-04-24 16:56:23 +02:00 committed by Damien George
parent ab72b5b69c
commit 4111206bd5

View File

@ -93,9 +93,10 @@ CFLAGS_MCU_m0 = $(CFLAGS_CORTEX_M) -fshort-enums -mtune=cortex-m0 -mcpu=cortex-m
LTO ?= 1 LTO ?= 1
ifeq ($(LTO),1) ifeq ($(LTO),1)
CFLAGS_LTO += -flto CFLAGS += -flto
else else
CFLAGS_LTO += -Wl,--gc-sections -ffunction-sections -fdata-sections CFLAGS += -ffunction-sections -fdata-sections
LDFLAGS += -Wl,--gc-sections
endif endif
@ -104,7 +105,6 @@ CFLAGS += $(INC) -Wall -Werror -g -ansi -std=c11 -nostdlib $(COPT) $(NRF_DEFINES
CFLAGS += -fno-strict-aliasing CFLAGS += -fno-strict-aliasing
CFLAGS += -Iboards/$(BOARD) CFLAGS += -Iboards/$(BOARD)
CFLAGS += -DNRF5_HAL_H='<$(MCU_VARIANT)_hal.h>' CFLAGS += -DNRF5_HAL_H='<$(MCU_VARIANT)_hal.h>'
CFLAGS += $(CFLAGS_LTO)
LDFLAGS = $(CFLAGS) LDFLAGS = $(CFLAGS)
LDFLAGS += -Xlinker -Map=$(@:.elf=.map) LDFLAGS += -Xlinker -Map=$(@:.elf=.map)