Fix corrupted disassembly listing (LSS) files due to linker relaxations; pass -mrelax to the compiler to make it aware of, and able to compensate for, linker relaxations.

pull/1469/head
Dean Camera 12 years ago
parent b2e49663f6
commit 6e8642185a

@ -192,6 +192,9 @@ BASE_CC_FLAGS += -DARCH=ARCH_$(ARCH) -DBOARD=BOARD_$(BOARD) -DF_USB=$(F_USB)UL
ifneq ($(F_CPU),)
BASE_CC_FLAGS += -DF_CPU=$(F_CPU)UL
endif
ifeq ($(LINKER_RELAXATIONS), Y)
BASE_CC_FLAGS += -mrelax
endif
# Additional language specific compiler flags
BASE_C_FLAGS := -x c -O$(OPTIMIZATION) -std=$(C_STANDARD) -Wstrict-prototypes

@ -20,7 +20,7 @@
<toolchain-config name="avrgcc.compiler.optimization.OtherFlags" value="-fdata-sections" toolchain="avrgcc"/>
<toolchain-config name="avrgcc.compiler.optimization.PrepareFunctionsForGarbageCollection" value="True" toolchain="avrgcc"/>
<toolchain-config name="avrgcc.compiler.warnings.AllWarnings" value="True" toolchain="avrgcc"/>
<toolchain-config name="avrgcc.compiler.miscellaneous.OtherFlags" value="-std=gnu99 -fno-strict-aliasing" toolchain="avrgcc"/>
<toolchain-config name="avrgcc.compiler.miscellaneous.OtherFlags" value="-mrelax -std=gnu99 -fno-strict-aliasing" toolchain="avrgcc"/>
<toolchain-config name="avrgcc.linker.optimization.GarbageCollectUnusedSections" value="True" toolchain="avrgcc"/>
<toolchain-config name="avrgcc.linker.optimization.RelaxBranches" value="True" toolchain="avrgcc"/>
</module>
@ -35,7 +35,7 @@
<toolchain-config name="avr32gcc.compiler.optimization.OtherFlags" value="-fdata-sections" toolchain="avr32gcc"/>
<toolchain-config name="avr32gcc.compiler.optimization.PrepareFunctionsForGarbageCollection" value="True" toolchain="avr32gcc"/>
<toolchain-config name="avr32gcc.compiler.warnings.AllWarnings" value="True" toolchain="avr32gcc"/>
<toolchain-config name="avr32gcc.compiler.miscellaneous.OtherFlags" value="-std=gnu99 -fno-strict-aliasing -mno-cond-exec-before-reload" toolchain="avr32gcc"/>
<toolchain-config name="avr32gcc.compiler.miscellaneous.OtherFlags" value="-mrelax -std=gnu99 -fno-strict-aliasing -mno-cond-exec-before-reload" toolchain="avr32gcc"/>
<toolchain-config name="avr32gcc.linker.optimization.GarbageCollectUnusedSections" value="True" toolchain="avr32gcc"/>
<toolchain-config name="avr32gcc.linker.optimization.RelaxBranches" value="True" toolchain="avr32gcc"/>
</module>

Loading…
Cancel
Save