Adding --relax flag for linking of ATmega2560 code. (arducopter)

http://code.google.com/p/arduino/issues/detail?id=729
This commit is contained in:
David A. Mellis 2011-12-05 17:21:05 -05:00
parent 10aba52ab8
commit fa4ab4f6ab
1 changed files with 8 additions and 2 deletions

View File

@ -183,12 +183,18 @@ public class Compiler implements MessageConsumer {
}
// 4. link it all together into the .elf file
// For atmega2560, need --relax linker option to link larger
// programs correctly.
String optRelax = "";
String atmega2560 = new String ("atmega2560");
if ( atmega2560.equals(boardPreferences.get("build.mcu")) ) {
optRelax = new String(",--relax");
}
sketch.setCompilingProgress(60);
List baseCommandLinker = new ArrayList(Arrays.asList(new String[] {
avrBasePath + "avr-gcc",
"-Os",
"-Wl,--gc-sections",
"-Wl,--gc-sections"+optRelax,
"-mmcu=" + boardPreferences.get("build.mcu"),
"-o",
buildPath + File.separator + primaryClassName + ".elf"