-
Notifications
You must be signed in to change notification settings - Fork 404
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
Conversation
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.
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. |
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
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). |
See adafruit/Adafruit_nRF52_Bootloader#221 for background on the flag.
See adafruit/Adafruit_nRF52_Bootloader#221 for background on the flag.
There was a problem hiding this 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.
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.