Skip to content

Removed automatic '--relax' hack for compiles on Atmega2560 MCU #749

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

Merged
merged 1 commit into from
Jun 12, 2020

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Jun 11, 2020

As discussed in: #639

This change has no effects on all board with MCU != Atmega2560.
AFAIU the --relax option should be no more needed with the latest available avr compilers.

Copy link
Collaborator

@matthijskooijman matthijskooijman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good.

I would suggest adding the following to the commit message:

This removes the --relax option, potentially producing slightly bigger code for the atmega2560. On the longer term, the AVR core should just add this option for all boards, but this is not currently the case yet because removing --relax also works around a gcc miscompilation (see arduino/ArduinoCore-avr#339).

@matthijskooijman
Copy link
Collaborator

AFAIU the --relax option should be no more needed with the latest available avr compilers.

Do you mean the gcc7 we use? Or later versions? Since with gcc7, removing --relax seems to prevent a miscompile, so it does actually change code (though maybe LTO somehow applies a double correction here were LTO relaxes and then the linker erronously relaxes again, then --relax would indeed not be needed).

@cmaglie cmaglie merged commit f7a6d63 into arduino:master Jun 12, 2020
@cmaglie cmaglie deleted the remove_mmrelax_trick branch June 12, 2020 15:26
@matthijskooijman
Copy link
Collaborator

Hm, did you intentionally not include my suggested addition to the commit message? Should I have just pushed it to the branch directly (I think I could have)?

@cmaglie
Copy link
Member Author

cmaglie commented Jun 12, 2020

I added it in the squash

@matthijskooijman
Copy link
Collaborator

Ah, should have checked the master history. I had somehow assumed that this would have looked differently for a squash commit, but apparently not. Sorry for that, and thanks! :-)

cmaglie added a commit to arduino/arduino-builder that referenced this pull request Jun 12, 2020
- Removed automatic '--relax' hack for compiles on Atmega2560 MCU
  arduino/arduino-cli#749

- Fixed skethbook+bootloader hex merger.
  arduino/arduino-cli#744

- Fixed race condition in legacy i18n.LoggerToCustomStreams
  arduino/arduino-cli#704

- Fixed path-relativization error when traversing different partitions
  arduino/arduino-cli#658

- Add macro during lib discovery phase
  arduino/arduino-cli#633

- legacy: Improved progress report from Compile
  arduino/arduino-cli#625
umbynos pushed a commit that referenced this pull request Jun 17, 2020
This removes the --relax option, potentially producing slightly bigger code for the atmega2560. On the longer term, the AVR core should just add this option for all boards, but this is not currently the case yet because removing --relax also works around a gcc miscompilation (see arduino/ArduinoCore-avr#339).

Close: #639
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants