Skip to content

Fix ST targets naming and linker script issues #14275

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

Merged

Conversation

rwalton-arm
Copy link
Contributor

@rwalton-arm rwalton-arm commented Feb 12, 2021

Summary of changes

The recent PR to change the CMake target names to lowercase seems to have missed a few targets, and introduced other typos.

The PR that moved mbed_generate_options_for_linker to mbed_configure_app has caused another issue: the response file property is not set at the time the targets request it. This is because we must call the function to set the response file after adding the mbed-os directory in the application due to our non-obvious backward coupling between mbed-os and the application. The mbed_generate_options_for_linker function is not available to the app before adding mbed-os, and the mbed-target expects the global response file property to be set at the time mbed-os is added. This causes build failures for some targets and incorrect linker script config for others. So, I've moved the mbed_generate_options_for_linker function back to mbed-os/CMakeLists.txt and made it take the compile options from mbed-core rather than the app. This should work as the linker scripts only seem to rely on config definitions coming from the mbed_config.cmake file mbed-tools produces, which are added to the mbed-core target. However, we need to run a full regression test of all targets to ensure this approach does work for everything.

Impact of changes

Migration actions required

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


@mergify mergify bot added the do not merge label Feb 12, 2021
@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label Feb 12, 2021
@ciarmcom ciarmcom requested review from a team February 12, 2021 11:00
@ciarmcom
Copy link
Member

@rwalton-arm, thank you for your changes.
@ARMmbed/mbed-os-tools @ARMmbed/team-st-mcd @ARMmbed/mbed-os-maintainers please review.

@rwalton-arm rwalton-arm force-pushed the dev/rwalton-arm/fix-more-st-targets branch from 4a10144 to f9b19f3 Compare February 12, 2021 14:15
@0xc0170
Copy link
Contributor

0xc0170 commented Feb 12, 2021

Is this still WIP? This is a must in the upcoming release :-) I'll start CI meanwhile

@mbed-ci
Copy link

mbed-ci commented Feb 12, 2021

Jenkins CI Test : ✔️ SUCCESS

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-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-test ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️

@mergify mergify bot added the needs: work label Feb 14, 2021
@mergify
Copy link

mergify bot commented Feb 14, 2021

This PR cannot be merged due to conflicts. Please rebase to resolve them.

@mergify mergify bot removed the needs: review label Feb 14, 2021
@rwalton-arm rwalton-arm changed the title WIP: Fix ST targets naming and linker script issues Fix ST targets naming and linker script issues Feb 15, 2021
@rwalton-arm rwalton-arm force-pushed the dev/rwalton-arm/fix-more-st-targets branch from f9b19f3 to 9638dde Compare February 15, 2021 09:48
@rwalton-arm
Copy link
Contributor Author

Is this still WIP? This is a must in the upcoming release :-) I'll start CI meanwhile

Should be ready to merge now. Thanks.

@mergify
Copy link

mergify bot commented Feb 15, 2021

This PR cannot be merged due to conflicts. Please rebase to resolve them.

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 15, 2021

One last rebase and we are good to go !

@@ -19,8 +19,8 @@ function(mbed_generate_options_for_linker target definitions_file)
set(_compile_definitions
"$<$<BOOL:${_compile_definitions}>:-D$<JOIN:${_compile_definitions}, -D>>"
)
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/compile_time_defs.txt" CONTENT "${_compile_definitions}\n")
set(${definitions_file} @${CMAKE_CURRENT_BINARY_DIR}/compile_time_defs.txt PARENT_SCOPE)
file(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/compile_time_defs.txt" CONTENT "${_compile_definitions}\n")
Copy link
Contributor

Choose a reason for hiding this comment

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

Also this should be "current" - the recent fix to allow multiple targets to be built

@rwalton-arm rwalton-arm force-pushed the dev/rwalton-arm/fix-more-st-targets branch from 9638dde to 039a98a Compare February 15, 2021 11:09
@rwalton-arm rwalton-arm force-pushed the dev/rwalton-arm/fix-more-st-targets branch from 039a98a to 380d88d Compare February 15, 2021 11:11
We need to generate a "response file" to pass to the C preprocessor
when we preprocess the linker script, because of path length limitations
on Windows. We set the response file and bind the path to a global
property. The MBED_TARGET being built queries this global property when
it sets the linker script.

We must set this global property before the targets subdirectory is
added to the project. This is required because the MBED_TARGET depends
on the response file. If the path to the response file is not defined
when the target requests it the config definitions will not be passed
to CPP.
0xc0170
0xc0170 previously approved these changes Feb 15, 2021
@rwalton-arm rwalton-arm force-pushed the dev/rwalton-arm/fix-more-st-targets branch from 380d88d to fd63d33 Compare February 15, 2021 11:17
@mergify mergify bot dismissed 0xc0170’s stale review February 15, 2021 11:17

Pull request has been modified.

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 15, 2021

Aborting CI and restarting

@mbed-ci
Copy link

mbed-ci commented Feb 15, 2021

Jenkins CI Test : ❌ FAILED

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

CLICK for Detailed Summary

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

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 15, 2021

I restarted CI (CI error)

@mbed-ci
Copy link

mbed-ci commented Feb 15, 2021

Jenkins CI Test : ✔️ SUCCESS

Build Number: 4 | 🔒 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-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-test ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️

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.

7 participants