-
Notifications
You must be signed in to change notification settings - Fork 3k
Set executable suffix in CMake #14204
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
Conversation
@multiplemonomials, 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.
I assume this will work to have .elf always. In case some tool required own (uvision works with .axf, gcc usually has no extension), we rename to pass to the tooling ?
I can see trustfirmware uses axf
https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git/tree/cmake/Common/BuildSys.cmake?h=e2c5a7ae51b6226ee3cf57ab70ff61f065d2da9b#n89
Yeah, if it becomes a problem you could copy the executable with a different name as a post-build step, or you could even have the CMAKE_EXECUTABLE_SUFFIX be configurable. |
It looks like the current tools always have as well .elf then postprocess it to create hex/bin or other format. |
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.
One simple line addition and LGTM
This pull request has automatically been marked as stale because it has had no recent activity. @ARMmbed/mbed-os-maintainers, please start CI to get the PR merged. |
I started the first CI run @hugueskamba @rajkan01 Please review |
Jenkins CI Test : ❌ FAILEDBuild Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
CMakeLists.txt
Outdated
@@ -203,7 +203,7 @@ function(mbed_generate_map_file target) | |||
TARGET | |||
${target} | |||
POST_BUILD | |||
COMMAND ${Python3_EXECUTABLE} ${MBED_PATH}/tools/memap.py -t ${MBED_TOOLCHAIN} ${CMAKE_BINARY_DIR}/${target}${CMAKE_EXECUTABLE_SUFFIX}.map | |||
COMMAND ${Python3_EXECUTABLE} ${MBED_PATH}/tools/memap.py -t ${MBED_TOOLCHAIN} ${CMAKE_BINARY_DIR}/${target}.map |
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.
Did this break ARMClang? See the logs
Finished: 0 information, 1 warning and 0 error messages.
-- built: /builds/workspace/mbed-os-ci_cmake-example-ARM@3/examples/mbed-os-example-kvstore/cmake_build/mbed-os-example-kvstore.bin
-- built: /builds/workspace/mbed-os-ci_cmake-example-ARM@3/examples/mbed-os-example-kvstore/cmake_build/mbed-os-example-kvstore.hex
usage: memap.py [-h] -t TOOLCHAIN [-d DEPTH] [-o OUTPUT] [-e EXPORT] [-v] file
memap.py: error: argument file: /builds/workspace/mbed-os-ci_cmake-example-ARM@3/examples/mbed-os-example-kvstore/cmake_build/mbed-os-example-kvstore.map does not exist in the filesystem.
ninja: build stopped: subcommand failed.
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.
Yes, this is the offending cmd:
--map --via=CMakeFiles/mbed-os-example-kvstore.rsp -o mbed-os-example-kvstore.elf --list=mbed-os-example-kvstore.elf.map
Ah, I think I figured out what's up, I think that CMAKE_EXECUTABLE_SUFFIX was already being set to elf for ARMClang. Should be fixed now. |
CI started |
Jenkins CI Test : ✔️ SUCCESSBuild Number: 2 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
Summary of changes
Set
CMAKE_EXECUTABLE_SUFFIX
in the CMake build system. This will cause all final linked files to have the .elf extension instead of no extension. This is a bit more correct to build system standards, and it's also important to allow one to upload files using STM32CubeProg which only accepts elf files with a .elf extension.Broken out from #14010 .
Impact of changes
Migration actions required
None.
Documentation
None needed..
Pull request type
Test results
Reviewers
@0xc0170