From 28f0ce6185b04ef5e8d2c4e089326c8a99fb36df Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 18 Dec 2012 13:54:30 +1100 Subject: [PATCH] Build: use -O0 for SITL --- libraries/AP_Common/Arduino.mk | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libraries/AP_Common/Arduino.mk b/libraries/AP_Common/Arduino.mk index 1b4100af0f..926ee8b48b 100644 --- a/libraries/AP_Common/Arduino.mk +++ b/libraries/AP_Common/Arduino.mk @@ -241,7 +241,7 @@ endif # EXTRAFLAGS ?= DEFINES = -DF_CPU=$(F_CPU) -DARDUINO=$(ARDUINO_VERS) $(EXTRAFLAGS) -DSKETCH=\"$(SKETCH)\" -OPTFLAGS = -Os -Wformat -Wall -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wformat=2 -Wno-reorder +WARNFLAGS = -Wformat -Wall -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wformat=2 -Wno-reorder DEPFLAGS = -MD -MT $@ # XXX warning options TBD @@ -252,20 +252,22 @@ ASOPTS = -x assembler-with-cpp LISTOPTS = -adhlns=$(@:.o=.lst) ifeq ($(HAL_BOARD),HAL_BOARD_AVR_SITL) -CPUFLAGS = -D_GNU_SOURCE -g +CPUFLAGS = -D_GNU_SOURCE CPULDFLAGS = -g +OPTFLAGS = -O0 -g else CPUFLAGS = -mmcu=$(MCU) -mcall-prologues CPULDFLAGS = -Wl,-m,avr6 +OPTFLAGS = -Os endif -CXXFLAGS = -g $(CPUFLAGS) $(DEFINES) -Wa,$(LISTOPTS) $(OPTFLAGS) $(DEPFLAGS) $(CXXOPTS) -CFLAGS = -g $(CPUFLAGS) $(DEFINES) -Wa,$(LISTOPTS) $(OPTFLAGS) $(DEPFLAGS) $(COPTS) +CXXFLAGS = -g $(CPUFLAGS) $(DEFINES) -Wa,$(LISTOPTS) $(OPTFLAGS) $(WARNFLAGS) $(DEPFLAGS) $(CXXOPTS) +CFLAGS = -g $(CPUFLAGS) $(DEFINES) -Wa,$(LISTOPTS) $(OPTFLAGS) $(WARNFLAGS) $(DEPFLAGS) $(COPTS) ASFLAGS = -g $(CPUFLAGS) $(DEFINES) -Wa,$(LISTOPTS) $(DEPFLAGS) $(ASOPTS) -LDFLAGS = -g $(CPUFLAGS) $(OPTFLAGS) -Wl,--gc-sections -Wl,-Map -Wl,$(SKETCHMAP) $(CPULDFLAGS) +LDFLAGS = -g $(CPUFLAGS) $(OPTFLAGS) $(WARNFLAGS) -Wl,--gc-sections -Wl,-Map -Wl,$(SKETCHMAP) $(CPULDFLAGS) ifeq ($(BOARD),mega) - LDFLAGS = -g $(CPUFLAGS) $(OPTFLAGS) -Wl,--gc-sections -Wl,-Map -Wl,$(SKETCHMAP) + LDFLAGS = -g $(CPUFLAGS) $(OPTFLAGS) $(WARNFLAGS) -Wl,--gc-sections -Wl,-Map -Wl,$(SKETCHMAP) endif # under certain situations with certain avr-gcc versions the --relax flag causes