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

Workaround for Cortex-M33 Arm toochain linking #14401

Merged
merged 1 commit into from
Mar 11, 2021

Conversation

LDong-Arm
Copy link
Contributor

@LDong-Arm LDong-Arm commented Mar 9, 2021

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

  • Ideally, the Arm linker should be able to auto detect the architecture support from the input object files, without having to explicitly pass --cpu but it's not always the case. We already have a similar workaround for Cortex-M4 (6220ca5).
  • 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 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

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers

@evedon @hugueskamba


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"
Copy link
Contributor Author

@LDong-Arm LDong-Arm Mar 9, 2021

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.

Copy link
Contributor Author

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:

#Necessary as the linker does not always detect
#the architecture from the objectfiles correctly.
list(APPEND link_options
"--cpu=Cortex-M4.no_fp"
)

@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label Mar 9, 2021
@ciarmcom
Copy link
Member

ciarmcom commented Mar 9, 2021

@LDong-Arm, thank you for your changes.
@hugueskamba @evedon @ARMmbed/mbed-os-maintainers please review.

Copy link
Contributor

@evedon evedon left a 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

@mergify mergify bot added needs: CI and removed needs: review labels Mar 10, 2021
Copy link
Collaborator

@hugueskamba hugueskamba left a 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

@LDong-Arm
Copy link
Contributor Author

Can you please raise an issue on https://gitlab.kitware.com/cmake/cmake/-/issues ?
Thanks

Thanks, will do 👌

@adbridge
Copy link
Contributor

CI started

@mergify mergify bot added needs: work and removed needs: CI labels Mar 10, 2021
@LDong-Arm
Copy link
Contributor Author

Looks like there's a CI issue:

Exited https://jenkins-mbedos.oss.arm.com/job/mbed-os-ci_unittests with result org.jenkinsci.plugins.workflow.steps.FlowInterruptedException

@adbridge
Copy link
Contributor

@LDong-Arm yup, Saheer managed to temporarily break it. I will restart.

@mbed-ci
Copy link

mbed-ci commented Mar 10, 2021

Jenkins CI Test : ❌ FAILED

Build Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests
jenkins-ci/mbed-os-ci_cmake-example-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM
jenkins-ci/mbed-os-ci_build-greentea-ARM
jenkins-ci/mbed-os-ci_build-cloud-example-ARM
jenkins-ci/mbed-os-ci_build-example-GCC_ARM
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM
jenkins-ci/mbed-os-ci_build-example-ARM

@mbed-ci
Copy link

mbed-ci commented Mar 10, 2021

Jenkins CI Test : ❌ FAILED

Build Number: 2 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_cmake-example-ARM
jenkins-ci/mbed-os-ci_build-greentea-ARM
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM
jenkins-ci/mbed-os-ci_build-cloud-example-ARM
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM
jenkins-ci/mbed-os-ci_build-example-GCC_ARM
jenkins-ci/mbed-os-ci_build-example-ARM
jenkins-ci/mbed-os-ci_unittests

@LDong-Arm
Copy link
Contributor Author

LDong-Arm commented Mar 11, 2021

@0xc0170
Can we restart CI on this? The CI issue was fixed towards the end of yesterday.
We'd like to have this PR in the release, thanks.

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 11, 2021

CI restarted

@mbed-ci
Copy link

mbed-ci commented Mar 11, 2021

Jenkins CI Test : ✔️ SUCCESS

Build Number: 3 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_cmake-example-ARM ✔️
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-ARM ✔️
jenkins-ci/mbed-os-ci_build-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️
jenkins-ci/mbed-os-ci_cmake-example-test ✔️

@0xc0170 0xc0170 merged commit 0ef2024 into ARMmbed:master Mar 11, 2021
@LDong-Arm
Copy link
Contributor Author

...(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

There's an existing issue: https://gitlab.kitware.com/cmake/cmake/-/issues/21173

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

Successfully merging this pull request may close these issues.

8 participants