File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
app/src/processing/app/debug Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -183,12 +183,18 @@ public boolean compile(Sketch sketch,
183183 }
184184
185185 // 4. link it all together into the .elf file
186-
186+ // For atmega2560, need --relax linker option to link larger
187+ // programs correctly.
188+ String optRelax = "" ;
189+ String atmega2560 = new String ("atmega2560" );
190+ if ( atmega2560 .equals (boardPreferences .get ("build.mcu" )) ) {
191+ optRelax = new String (",--relax" );
192+ }
187193 sketch .setCompilingProgress (60 );
188194 List baseCommandLinker = new ArrayList (Arrays .asList (new String [] {
189195 avrBasePath + "avr-gcc" ,
190196 "-Os" ,
191- "-Wl,--gc-sections" ,
197+ "-Wl,--gc-sections" + optRelax ,
192198 "-mmcu=" + boardPreferences .get ("build.mcu" ),
193199 "-o" ,
194200 buildPath + File .separator + primaryClassName + ".elf"
You can’t perform that action at this time.
0 commit comments