CMake: fix Gcc Arm compiler check #13993
Closed
+2
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of changes
Fixes the issue with "Detecting C compiler ABI info". CMake invokes simple check during project().
As we add flags after project is invoked, this check can fail. We should provide init values via toolchain
file to make checks passing and CMake configuration properly done.
We found an issue with Gcc Arm checks only so far. Linker needs nosys to be able to link simple program as we are cross compiling and not providing sys functionality required (like _exit).
I only add to FLAGS_INIT required flags to pass linking when CMake is doing try_compile(). We could move there all linker flags and do the same for ARMClang - unification of linker FLAGS_INIT for both toolchains. Let me know what you think, I can fix that if it receives +1. Or maybe it is fine as it is as CMake does very minimal example testing - it won't test for us what we use - retargeting, wrapping some libs symbols. Therefore the minimum approach to satisfy simple app should be sufficient.
Impact of changes
Migration actions required
Documentation
Pull request type
Test results
Reviewers