From e8eb8402d0745c6f3f62754182e1d0ce86212384 Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Fri, 27 Jan 2012 22:33:44 +0100 Subject: [PATCH] Sanitize linking for main firmware, too. --- firmware/Makefile | 6 +++--- firmware/Makefile.inc | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/firmware/Makefile b/firmware/Makefile index 44f6a76..5cf7513 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -37,13 +37,13 @@ ifdef APP OUTFILE=$(APP) endif -LDFLAGS+= -Wl,--gc-sections +LDFLAGS+= --gc-sections OBJS += lpc1xxx/$(TARGET)_handlers.o lpc1xxx/LPC1xxx_startup.o ########################################################################## # Startup files ########################################################################## -LDLIBS = -lm +LDLIBS = LDLIBS += -Lapplications -lapp LDLIBS += -Lfunk -lfunk LDLIBS += -Lusbcdc -lusbcdc @@ -111,7 +111,7 @@ $(LD_TEMP): -@echo "INCLUDE $(LD_SCRIPT)" >> $(LD_TEMP) $(OUTFILE).elf: $(OBJS) $(SYS_OBJS) $(SUBDIRS) $(LPCFIX) $(LD_TEMP) - $(CC) $(LDFLAGS) -T $(LD_TEMP) -o $(OUTFILE).elf $(OBJS) $(LDLIBS) + $(LD) $(LDFLAGS) -T $(LD_TEMP) -o $(OUTFILE).elf $(OBJS) $(LDLIBS) -@echo "" $(SIZE) $(OUTFILE).elf -@echo "" diff --git a/firmware/Makefile.inc b/firmware/Makefile.inc index 3cf227d..dda77a0 100644 --- a/firmware/Makefile.inc +++ b/firmware/Makefile.inc @@ -42,7 +42,7 @@ CPU_TYPE = cortex-$(CORTEX_TYPE) # Compiler settings, parameters and flags ########################################################################## -CFLAGS = -std=c99 -c -g -Os $(INCLUDE_PATHS) -Wall -mthumb -ffunction-sections -fdata-sections -fmessage-length=0 -mcpu=$(CPU_TYPE) -DTARGET=$(TARGET) -DRAMCODE=$(RAMCODE) -fno-builtin -Wno-unused-function +CFLAGS = -std=c99 -c -g -Os $(INCLUDE_PATHS) -Wall -mthumb -ffunction-sections -fdata-sections -fmessage-length=0 -mcpu=$(CPU_TYPE) -DTARGET=$(TARGET) -DRAMCODE=$(RAMCODE) -fno-builtin -Wno-unused-function -ffreestanding LDFLAGS = -nostartfiles ifeq "$(USBSERIAL)" "YES"