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

CMAKE : correct "Cortex-M7F" link parameter #14159

Merged
merged 1 commit into from
Jan 20, 2021

Conversation

jeromecoutant
Copy link
Collaborator

Summary of changes

Needed for STM32F7

Impact of changes

Migration actions required

Documentation


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


@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label Jan 15, 2021
@ciarmcom ciarmcom requested review from a team January 15, 2021 15:30
@ciarmcom
Copy link
Member

@jeromecoutant, thank you for your changes.
@ARMmbed/mbed-os-tools @ARMmbed/mbed-os-maintainers please review.

Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

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

What error does this fix ? Did we port the cpu flag incorrectly or there is an issue somewhere else?

@jeromecoutant
Copy link
Collaborator Author

Here is error during link before patch:

Error: L6366E: CMakeFiles\mbed-os-example-blinky.dir\mbed-os\cmsis\CMSIS_5\CMSIS\RTOS2\RTX\Source\TOOLCHAIN_ARM\TARGET_RTOS_M4_M7\irq_cm4f.o attributes are not compatible with the provided attributes .
Object CMakeFiles\mbed-os-example-blinky.dir\mbed-os\cmsis\CMSIS_5\CMSIS\RTOS2\RTX\Source\TOOLCHAIN_ARM\TARGET_RTOS_M4_M7\irq_cm4f.o contains Build Attributes that are incompatible with the provided attributes.
    Tag_ABI_HardFP_use = Permitted VFP use is implied by Tag_FP_arch (=0)
Error: L6366E: CMakeFiles\mbed-os-example-blinky.dir\mbed-os\platform\source\TARGET_CORTEX_M\TOOLCHAIN_ARM\except.o attributes are not compatible with the provided attributes .
Object CMakeFiles\mbed-os-example-blinky.dir\mbed-os\platform\source\TARGET_CORTEX_M\TOOLCHAIN_ARM\except.o contains Build Attributes that are incompatible with the provided attributes.
    Tag_ABI_HardFP_use = Permitted VFP use is implied by Tag_FP_arch (=0)
Error: L6366E: CMakeFiles\mbed-os-example-blinky.dir\mbed-os\targets\TARGET_STM\TARGET_STM32F7\TARGET_STM32F746xG\TOOLCHAIN_ARM\startup_stm32f746xx.o attributes are not compatible with the provided attributes .
Object CMakeFiles\mbed-os-example-blinky.dir\mbed-os\targets\TARGET_STM\TARGET_STM32F7\TARGET_STM32F746xG\TOOLCHAIN_ARM\startup_stm32f746xx.o contains Build Attributes that are incompatible with the provided attributes.
    Tag_ABI_HardFP_use = Permitted VFP use is implied by Tag_FP_arch (=0)

@0xc0170 0xc0170 requested review from rajkan01 and hugueskamba and removed request for a team January 18, 2021 09:14
@@ -16,10 +16,10 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
"-mfloat-abi=hard"
)
list(APPEND asm_compile_options
"-mcpu=Cortex-M7.fp.sp"
"-mcpu=Cortex-M7"
Copy link
Contributor

@kjbracey kjbracey Jan 18, 2021

Choose a reason for hiding this comment

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

I think the problem here is that you're using armclang to invoke the assembler (why?), but passing it armasm-type CPU options.

I believe your asm_compile_options should be the same as the c_cxx_compile_options, including the -mfpu and -mfloat-abi, and armclang should translate.

(Not actually sure how this change effects that translation though - don't know how armclang interprets "Cortex-M7.fp.sp". Do you get a warning about it?)

Not sure about the link, but potentially the same thing applies if you're invoking it via armclang. In which case you're in the same situation as GCC, and they should all be common_options. (Edit: ah, I see that's using --cpu not -mcpu which suggests you're not?)

Copy link
Contributor

@0xc0170 0xc0170 Jan 21, 2021

Choose a reason for hiding this comment

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

I think the problem here is that you're using armclang to invoke the assembler (why?), but passing it armasm-type CPU options.

I've missed this earlier. We were suggested due to another bug to use armclang and --auto mode for Mbed OS asm files.
The flags should be fixed m thanks for noticing.

@@ -16,10 +16,10 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
"-mfloat-abi=hard"
)
list(APPEND asm_compile_options
"-mcpu=Cortex-M7.fp.sp"
"-mcpu=Cortex-M7"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I can confirm that asm_compile_option should share the same options as c_cxx_compile_options because they are processed by armclang.
A similar issue was encountered for Cortex-M33.

Copy link
Contributor

Choose a reason for hiding this comment

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

@jeromecoutant Can you do the same in this PR as we did for m33 ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@mergify mergify bot added needs: CI and removed needs: work labels Jan 20, 2021
@0xc0170
Copy link
Contributor

0xc0170 commented Jan 20, 2021

CI started

@kjbracey
Copy link
Contributor

To clarify on the linker thing - it was using --cpu, but is now using -mcpu. So does that mean that it was ignoring the --cpu? Or what?

Presumably this change needs to be made to all chips?

@mergify mergify bot added needs: work and removed needs: CI labels Jan 20, 2021
@mbed-ci
Copy link

mbed-ci commented Jan 20, 2021

Jenkins CI Test : ❌ FAILED

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

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-ARM ✔️
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-greentea-ARM
jenkins-ci/mbed-os-ci_build-greentea-GCC_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_build-cloud-example-ARM

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 20, 2021

Ci restarted

@mbed-ci
Copy link

mbed-ci commented Jan 20, 2021

Jenkins CI Test : ✔️ SUCCESS

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

CLICK for Detailed Summary

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

@mergify mergify bot removed the needs: CI label Jan 20, 2021
@0xc0170 0xc0170 merged commit d2b6797 into ARMmbed:master Jan 20, 2021
@mergify mergify bot removed the ready for merge label Jan 20, 2021
@jeromecoutant jeromecoutant deleted the PR_CMAKE_F7 branch January 20, 2021 14:15
@mbedmain mbedmain added release-version: 6.7.0 Release-pending and removed release-type: patch Indentifies a PR as containing just a patch Release-pending labels Jan 25, 2021
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.

None yet

7 participants