-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Workaround for Cortex-M33 Arm toochain linking #14401
Conversation
Binaries generated for Cortex-M33 targets (e.g. Musca S1/B1) using the Arm toolchain + CMake is unable to run, unless we instruct the linker to not use floating points. Note: This is a temporary workaround, because * Ideally, the Arm linker should be able to auto detect the architecture support from the input object files, but it's not always the case. We already have a similar workaround for Cortex-M4. * The full option to use should be `--cpu=Cortex-M33.no_dsp.no_fp` but `no_dsp` currently conflicts with CMake's compilation tests (no option to disable DSP in the test objects before linking).
# the architecture from the objectfiles correctly. | ||
# Also, the complete flag should be "--cpu=Cortex-M33.no_dsp.no_fp" | ||
# but this currently conflicts with CMake's compiler test until fixed | ||
"--cpu=Cortex-M33.no_fp" |
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.
@0xc0170 This works, as long as no_dsp
is not there.
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.
Similar change for Cortex-M4 made by ST:
mbed-os/tools/cmake/cores/Cortex-M4.cmake
Lines 15 to 19 in 0e89f9d
#Necessary as the linker does not always detect | |
#the architecture from the objectfiles correctly. | |
list(APPEND link_options | |
"--cpu=Cortex-M4.no_fp" | |
) |
@LDong-Arm, thank you for your changes. |
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.
Seems reasonnable to apply the same patch as for Cortex-M4
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.
...(no option to disable DSP in the dummy test app, before linking stage).
Can you please raise an issue on https://gitlab.kitware.com/cmake/cmake/-/issues ?
Thanks
Thanks, will do 👌 |
CI started |
Looks like there's a CI issue:
|
@LDong-Arm yup, Saheer managed to temporarily break it. I will restart. |
Jenkins CI Test : ❌ FAILEDBuild Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
Jenkins CI Test : ❌ FAILEDBuild Number: 2 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
@0xc0170 |
CI restarted |
Jenkins CI Test : ✔️ SUCCESSBuild Number: 3 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
There's an existing issue: https://gitlab.kitware.com/cmake/cmake/-/issues/21173 |
Summary of changes
Binaries generated for Cortex-M33 targets (e.g. Musca S1/B1) using the Arm toolchain + CMake are unable to run, unless we pass
--cpu=...
to the linker.Note: This is a workaround, because
--cpu
but it's not always the case. We already have a similar workaround for Cortex-M4 (6220ca5).--cpu=Cortex-M33.no_dsp.no_fp
butno_dsp
currently conflicts with CMake's compilation tests (no option to disable DSP in the dummy test app, before linking stage).Impact of changes
Applications compiled with mbed-tools/CMake + the Arm toolchain are now able to run on Musca S1 and B1.
Migration actions required
None.
Documentation
None.
Pull request type
Test results
Reviewers
@evedon @hugueskamba