-
Notifications
You must be signed in to change notification settings - Fork 3k
CMake: Fix cmake response files #13427
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: Fix cmake response files #13427
Conversation
@0xc0170, thank you for your changes. |
I could reproduce ARMClang issue (different error) - I'll check why response files are causing build failures.. |
Found it: https://developer.arm.com/documentation/101754/0614/armclang-Reference/armclang-Command-line-Options/-file?search=5eec717fe24a5e02d07b26d8 . ARMClang on windows using rsp files needs paths to be escaped 🤕 If they are not (what works on cmd), this happens @hugueskamba I am getting different error (windows related), please look at the --cpu error on MacOS, I could not reporduce locally so far. |
I created an issue for CMake https://gitlab.kitware.com/cmake/cmake/-/issues/21093 |
25b0725
to
849b3f0
Compare
This PR cannot be merged due to conflicts. Please rebase to resolve them. |
ed355b0
to
e20513e
Compare
@hugueskamba looks like our branch is broken for nrf52 after the latest rebase. I'll look at it now |
e20513e
to
629d981
Compare
Rebased to get in nrf52 fix. |
The response files introduced couple of bugs to the system. My findings so far on windows, using cmake 3.18.1, ninja 1.10.0, make 4.3, blinky example: GCC ARM:
ARMClang:
|
a57d101
to
129e697
Compare
This PR cannot be merged due to conflicts. Please rebase to resolve them. |
629d981
to
a431cd9
Compare
@hugueskamba Please review. |
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.
ARM toolchain does not build successfully with Make or Ninja.
This commit should not be merged until that is fixed because I work mostly with the ARM toolchain. Since we do not have CI check with the ARM toolchain , I ensure that it does not get broken. I also prefer it because it builds significantly much faster than GCC_ARM.
Ninja failure:
1 warning generated.
[405/846] Building ASM object mbed-os/CMakeFiles/mbed-os.dir/rtos/source/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_RTOS_M4_M7/irq_cm4f.o
FAILED: mbed-os/CMakeFiles/mbed-os.dir/rtos/source/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_RTOS_M4_M7/irq_cm4f.o
"/Library/Application Support/Mbed Studio/mbed-studio-tools/ac6/bin/armasm" @mbed-os/CMakeFiles/mbed-os.dir/rtos/source/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_RTOS_M4_M7/irq_cm4f.o.rsp -o mbed-os/CMakeFiles/mbed-os.dir/rtos/source/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_RTOS_M4_M7/irq_cm4f.o ../mbed-os/rtos/source/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_RTOS_M4_M7/irq_cm4f.S
Fatal error: A9912E: No --cpu selected
1 Error, 0 Warnings
[410/846] Building CXX object mbed-os/CMakeFiles/mbed-os.dir/rtos/source/TARGET_CORTEX/mbed_rtx_idle.o
ninja: build stopped: subcommand failed.
Make failure:
[ 80%] Building ASM object mbed-os/CMakeFiles/mbed-os.dir/platform/source/TARGET_CORTEX_M/TOOLCHAIN_ARM/except.o
Error: A1067E: Output file specified as '/Users/hugkam01/projects/mbed/examples/mbed-os-example-blinky/mbed-os/platform/source/TARGET_CORTEX_M/TOOLCHAIN_ARM/except.S', but it has already been specified as 'CMakeFiles/mbed-os.dir/platform/source/TARGET_CORTEX_M/TOOLCHAIN_ARM/except.o'
armclang: error: no input files
Fatal error: A1905U: Pre-processor step failed for '@CMakeFiles/mbed-os.dir/includes_ASM.rsp'
2 Errors, 0 Warnings
make[2]: *** [mbed-os/CMakeFiles/mbed-os.dir/platform/source/TARGET_CORTEX_M/TOOLCHAIN_ARM/except.o] Error 8
make[1]: *** [mbed-os/CMakeFiles/mbed-os.dir/all] Error 2
make: *** [all] Error 2
1272a43
to
7f85097
Compare
0aa9846
to
fff832e
Compare
I rebased this one, to clean it up. Only one commit adding response files for now. |
This PR cannot be merged due to conflicts. Please rebase to resolve them. |
As Mbed OS is built as whole, we have long paths again. This is known issue with windows. To fix the paths, we need to use response files. Ninja is special, needs to be forced to use long paths.
fff832e
to
b16a2c2
Compare
Both merged, I rebased it. @hugueskamba can you test if this works with armclang6 (ninja, makefiles) ? |
Mac OS, ARMClang 6.13, cmake version 3.18.0
Linux, ARMClang 6.13, cmake version 3.18.2 |
I have updated CMake on Mac OS from Mac OS, ARMClang 6.13, cmake version 3.18.2 |
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.
There are fixes in the latest version we need for ARMClang.
Pull request has been modified.
💯 for 3.18.2 results - this is ready to get in ! I updated the requirements. Note: we use 3.18.2 from now on (the reason is above or in the commit msg). The only limitation we know at the moment: Ninja with ARMClang on windows not working: https://gitlab.kitware.com/cmake/cmake/-/issues/21093 |
The bug you mentioned was reported with CMake version |
yes, 3.18.2 still contains the bug |
Summary of changes
Testing this changes with Travis jobs, as there are implications.
Impact of changes
Migration actions required
Documentation
Pull request type
Test results
Reviewers