Skip to content
Browse files

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

  • Loading branch information...
1 parent 10aba52 commit fa4ab4f6ab07117dd95ad284b2b9afff5c81c376 @damellis damellis committed Dec 5, 2011
Showing with 8 additions and 2 deletions.
  1. +8 −2 app/src/processing/app/debug/Compiler.java
View
10 app/src/processing/app/debug/Compiler.java
@@ -183,12 +183,18 @@ public boolean compile(Sketch sketch,
}
// 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"

0 comments on commit fa4ab4f

Please sign in to comment.
Something went wrong with that request. Please try again.