summaryrefslogtreecommitdiffstats
path: root/Help/release
diff options
context:
space:
mode:
authorLingkai Dong <lingkai.dong@arm.com>2021-04-21 16:07:22 (GMT)
committerBrad King <brad.king@kitware.com>2021-04-27 18:03:15 (GMT)
commitc4941b7e66cd3a0a9de5ed8189ef025fcd6f3122 (patch)
treec5158533c814362581c1423834fd2238d529e266 /Help/release
parent0078db3888e01343d26c1f695b250663bbcb7ac2 (diff)
downloadCMake-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/release')
-rw-r--r--Help/release/dev/ARMClang-cpu-arch-flags.rst7
1 files changed, 7 insertions, 0 deletions
diff --git a/Help/release/dev/ARMClang-cpu-arch-flags.rst b/Help/release/dev/ARMClang-cpu-arch-flags.rst
new file mode 100644
index 0000000..5e885fe
--- /dev/null
+++ b/Help/release/dev/ARMClang-cpu-arch-flags.rst
@@ -0,0 +1,7 @@
+ARMClang-cpu-arch-flags
+-----------------------
+
+* ``ARMClang`` cpu/arch compile and link flags are no longer added
+ automatically based on the :variable:`CMAKE_SYSTEM_PROCESSOR`
+ variable or the undocumented ``CMAKE_SYSTEM_ARCH`` variable.
+ They must be specified explicitly. See policy :policy:`CMP0123`.