diff options
author | Lingkai Dong <lingkai.dong@arm.com> | 2021-04-21 16:07:22 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-04-27 18:03:15 (GMT) |
commit | c4941b7e66cd3a0a9de5ed8189ef025fcd6f3122 (patch) | |
tree | c5158533c814362581c1423834fd2238d529e266 /Help/manual/cmake-policies.7.rst | |
parent | 0078db3888e01343d26c1f695b250663bbcb7ac2 (diff) | |
download | CMake-c4941b7e66cd3a0a9de5ed8189ef025fcd6f3122.zip CMake-c4941b7e66cd3a0a9de5ed8189ef025fcd6f3122.tar.gz CMake-c4941b7e66cd3a0a9de5ed8189ef025fcd6f3122.tar.bz2 |
ARMClang: Do not automatically add cpu/arch compile or link options
The compile options `--march=<arch>` and `--mcpu=<cpu>` and the
link option `--cpu=<cpu>` are automatically added by CMake based
on `CMAKE_SYSTEM_PROCESSOR` or `CMAKE_SYSTEM_ARCH`. But this is not
sufficient, because armclang also supports enabling or disabling
features using `+<feature>`:
-mcpu=<name>[+[no]<feature>+...]
For example:
-mcpu=cortex-a57+nocrypto+nofp+nosimd+crc
(Reference: https://developer.arm.com/documentation/dui0774/k/Compiler-Command-line-Options/-mcpu?lang=en)
The problem is, even if a project adds a flag with features it needs,
CMake still adds flags, resulting in code that is compiled with wrong
CPU features and unable to run.
Add policy `CMP0123` to not automatically add compile or link options,
and let projects set them instead.
Co-Author: Brad King <brad.king@kitware.com>
Fixes: #21173
Diffstat (limited to 'Help/manual/cmake-policies.7.rst')
-rw-r--r-- | Help/manual/cmake-policies.7.rst | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index 5dfa894..b41ce59 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -57,6 +57,7 @@ Policies Introduced by CMake 3.21 .. toctree:: :maxdepth: 1 + CMP0123: ARMClang cpu/arch compile and link flags must be set explicitly. </policy/CMP0123> CMP0122: UseSWIG use standard library name conventions for csharp language. </policy/CMP0122> CMP0121: The list command detects invalid indicies. </policy/CMP0121> |