Reverted the patch by KevinOConnor, as it crashes some versions of avr-gcc and caused linking issues.

This commit is contained in:
Daid 2012-12-13 12:19:12 +01:00
parent 673577a31b
commit b264317fa0

View file

@ -149,8 +149,7 @@ else ifeq ($(HARDWARE_MOTHERBOARD),90)
HARDWARE_VARIANT ?= SanguinoA HARDWARE_VARIANT ?= SanguinoA
MCU ?= atmega644 MCU ?= atmega644
# #Final OMCA board
Final OMCA board
else ifeq ($(HARDWARE_MOTHERBOARD),91) else ifeq ($(HARDWARE_MOTHERBOARD),91)
HARDWARE_VARIANT ?= Sanguino HARDWARE_VARIANT ?= Sanguino
MCU ?= atmega644p MCU ?= atmega644p
@ -241,10 +240,6 @@ AVRDUDE = avrdude
REMOVE = rm -f REMOVE = rm -f
MV = mv -f MV = mv -f
# Tool for testing compiler flags
cc-option=$(shell if test -z "`$(1) $(2) -S -o /dev/null -xc /dev/null 2>&1`" \
; then echo "$(2)"; else echo "$(3)"; fi ;)
# Place -D or -U options here # Place -D or -U options here
CDEFS = -DF_CPU=$(F_CPU) ${addprefix -D , $(DEFINES)} CDEFS = -DF_CPU=$(F_CPU) ${addprefix -D , $(DEFINES)}
CXXDEFS = $(CDEFS) CXXDEFS = $(CDEFS)
@ -275,12 +270,10 @@ CTUNING += -DMOTHERBOARD=${HARDWARE_MOTHERBOARD}
endif endif
#CEXTRA = -Wa,-adhlns=$(<:.c=.lst) #CEXTRA = -Wa,-adhlns=$(<:.c=.lst)
CFLAGS := $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CEXTRA) $(CTUNING) \ CFLAGS := $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CEXTRA) $(CTUNING)
$(call cc-option,$(CC),-flto -fwhole-program,) CXXFLAGS := $(CDEFS) $(CINCS) -O$(OPT) -Wall $(CEXTRA) $(CTUNING)
CXXFLAGS := $(CDEFS) $(CINCS) -O$(OPT) -Wall $(CEXTRA) $(CTUNING) \ #ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
$(call cc-option,$(CC),-flto -fwhole-program,) LDFLAGS = -lm
#ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs
LDFLAGS = -lm -Wl,--relax
# Programming support using avrdude. Settings and variables. # Programming support using avrdude. Settings and variables.
@ -386,13 +379,9 @@ extcoff: $(TARGET).elf
$(NM) -n $< > $@ $(NM) -n $< > $@
# Link: create ELF output file from library. # Link: create ELF output file from library.
$(BUILD_DIR)/$(TARGET).elf: $(BUILD_DIR)/$(TARGET).o $(BUILD_DIR)/$(TARGET).elf: $(OBJ) Configuration.h
$(Pecho) " CXX $@" $(Pecho) " CXX $@"
$P $(CC) $(ALL_CXXFLAGS) -Wl,--gc-sections -o $@ -L. $^ $(LDFLAGS) $P $(CC) $(ALL_CXXFLAGS) -Wl,--gc-sections -o $@ -L. $(OBJ) $(LDFLAGS)
$(BUILD_DIR)/$(TARGET).o: $(OBJ) Configuration.h
$(Pecho) " CXX $@"
$P $(CC) $(ALL_CXXFLAGS) -nostdlib -Wl,-r -o $@ $(OBJ)
$(BUILD_DIR)/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE) $(BUILD_DIR)/%.o: %.c Configuration.h Configuration_adv.h $(MAKEFILE)
$(Pecho) " CC $<" $(Pecho) " CC $<"