Skip to content

Arduino Mega elf build is not compliant with Arduino IDE command line #1147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jantje opened this issue Mar 5, 2020 · 4 comments
Closed
Labels
OS: all status: Arduino IDE incompatibility Somethig that is not exactly the same as the arduino ide status: fixed in 4.3.3

Comments

@jantje
Copy link
Member

jantje commented Mar 5, 2020

Arduino mega "c to elf" command should have the -relax option for big programs
However arduino IDE does not have this
To work around that (needed for marvin) Sloeber overwrites the platform.txt setting

mega.compiler.c.elf.flags={compiler.warning_flags} -Os -Wl,--gc-sections,--relax
megaADK.compiler.c.elf.flags={compiler.warning_flags} -Os -Wl,--gc-sections,--relax

However it would be better to have a compiler option "c to elf" and have the user add the -relax option if needed

@uzi18
Copy link
Contributor

uzi18 commented Mar 5, 2020

related to #270

@jantje
Copy link
Member Author

jantje commented Mar 5, 2020

It would be great if you can point me to how arduino IDE is adding the --relax

@jantje jantje added Help wanted If you want to become a active contributor, start looking at this issue. status: Arduino IDE incompatibility Somethig that is not exactly the same as the arduino ide labels Mar 5, 2020
@jantje
Copy link
Member Author

jantje commented Mar 5, 2020

Found it here
https://github.com/arduino/arduino-cli/blob/master/legacy/builder/phases/linker.go#L82
Hardcoded based on BUILD_PROPERTIES_BUILD_MCU == "atmega2560" behind BUILD_PROPERTIES_COMPILER_C_ELF_FLAGS

@uzi18
Copy link
Contributor

uzi18 commented Mar 5, 2020

what a workaround ;)

jantje pushed a commit that referenced this issue Mar 8, 2020
@jantje jantje added OS: all status: fixed in 4.3.3 and removed Help wanted If you want to become a active contributor, start looking at this issue. labels Mar 8, 2020
@jantje jantje closed this as completed Mar 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS: all status: Arduino IDE incompatibility Somethig that is not exactly the same as the arduino ide status: fixed in 4.3.3
Projects
None yet
Development

No branches or pull requests

2 participants