Skip to content
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

Use -fno-ipa-modref when building with gcc-11 (or later) #221

Merged
merged 1 commit into from
Sep 10, 2021

Conversation

daniel-thompson
Copy link
Contributor

As the large comment in the body of the patch, there are mistakes in
the inline assembler fragments contained in the Nordic Softdevice header
files. Fixing the problem is a bit fiddly so for now we'll simply work
around the issue by disabling an optimization pass that was introduced
in gcc-11.

As the large comment in the body of the patch, there are mistakes in
the inline assembler fragments contained in the Nordic Softdevice header
files. Fixing the problem is a bit fiddly so for now we'll simply work
around the issue by disabling an optimization pass that was introduced
in gcc-11.
@daniel-thompson
Copy link
Contributor Author

This is the PR discussed in #211 ...

Note that this PR does not currently revert the structure initializations added in #211 although I think it could because those warnings were arguably correct!

@tannewt tannewt requested a review from hathach September 7, 2021 21:06
@tannewt
Copy link
Member

tannewt commented Sep 8, 2021

Is there an issue on a nordic repo to fix the assembly that is broken by this? I had to add this flag for CircuitPython to work as well.

tannewt added a commit to tannewt/circuitpython that referenced this pull request Sep 8, 2021
This allows tools to look for invisible characters rather than
human readable phrases that may be translated.

This includes a GCC flag fix for nRF with GCC 11.2. See
adafruit/Adafruit_nRF52_Bootloader#221
for background on the flag.

Fixes micropython#5307
@daniel-thompson
Copy link
Contributor Author

Is there an issue on a nordic repo to fix the assembly that is broken by this? I had to add this flag for CircuitPython to work as well.

Yes, the inline assembler can be fixed but fixing it properly is a fairly big change since it would require modifying all the callers of SVCALL() (IIRC S132 alone has 138) so they can provide the number and names of all the arguments that the inline assembler will consume. I thought it unlikely any project would be keen to carry around such a pervasive change.

I did try a couple of different hacks with weak symbols or aliases to try keep SVCALL() unmodified but they all had drawbacks (linker can't garbage collect weak symbols, can't work header only, etc, etc).

tannewt added a commit to tannewt/circuitpython that referenced this pull request Sep 8, 2021
tannewt added a commit to tannewt/circuitpython that referenced this pull request Sep 8, 2021
Copy link
Member

@hathach hathach left a comment

Choose a reason for hiding this comment

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

thank you very much for the PR. I actually haven't tested this since ARM only officially release 10.3 so far. However since it is tested in adafruit/circuitpython#5319. It is good to go.

@hathach hathach merged commit 3d04d61 into adafruit:master Sep 10, 2021
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.

None yet

3 participants