-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix ST targets naming and linker script issues #14275
Conversation
@rwalton-arm, thank you for your changes. |
4a10144
to
f9b19f3
Compare
Is this still WIP? This is a must in the upcoming release :-) I'll start CI meanwhile |
Jenkins CI Test : ✔️ SUCCESSBuild Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
This PR cannot be merged due to conflicts. Please rebase to resolve them. |
f9b19f3
to
9638dde
Compare
Should be ready to merge now. Thanks. |
This PR cannot be merged due to conflicts. Please rebase to resolve them. |
One last rebase and we are good to go ! |
tools/cmake/toolchain.cmake
Outdated
@@ -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") |
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.
Also this should be "current" - the recent fix to allow multiple targets to be built
9638dde
to
039a98a
Compare
039a98a
to
380d88d
Compare
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.
380d88d
to
fd63d33
Compare
Pull request has been modified.
Aborting CI and restarting |
Jenkins CI Test : ❌ FAILEDBuild Number: 3 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
I restarted CI (CI error) |
Jenkins CI Test : ✔️ SUCCESSBuild Number: 4 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
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
tombed_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 thembed-os
directory in the application due to our non-obvious backward coupling betweenmbed-os
and the application. Thembed_generate_options_for_linker
function is not available to the app before addingmbed-os
, and thembed-target
expects the global response file property to be set at the timembed-os
is added. This causes build failures for some targets and incorrect linker script config for others. So, I've moved thembed_generate_options_for_linker
function back tombed-os/CMakeLists.txt
and made it take the compile options frommbed-core
rather than the app. This should work as the linker scripts only seem to rely on config definitions coming from thembed_config.cmake
filembed-tools
produces, which are added to thembed-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
Test results
Reviewers