]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
machine/arch-arm64: add -mbranch-protection=standard
authorRoss Burton <ross.burton@arm.com>
Thu, 13 Jul 2023 11:01:19 +0000 (12:01 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 14 Jul 2023 16:01:18 +0000 (17:01 +0100)
Enable branch protection (PAC/BTI) for all aarch64 builds.  This was
previously enabled at a global level in the GCC build, but that breaks
the gcc test suite.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/conf/machine/include/arm/arch-arm64.inc

index 0e2efb5a40ff5a208906e85f39f63f4e664e19da..832d0000acbf996d6f786a67638420f30b219d9e 100644 (file)
@@ -37,3 +37,8 @@ TUNE_ARCH = "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', '${TUNE_ARCH_64}',
 TUNE_PKGARCH = "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', '${TUNE_PKGARCH_64}', '${TUNE_PKGARCH_32}', d)}"
 ABIEXTENSION = "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', '${ABIEXTENSION_64}', '${ABIEXTENSION_32}', d)}"
 TARGET_FPU = "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', '${TARGET_FPU_64}', '${TARGET_FPU_32}', d)}"
+
+# Emit branch protection (PAC/BTI) instructions.  On hardware that doesn't
+# support these they're meaningless NOP instructions, so there's very little
+# reason not to.
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', ' -mbranch-protection=standard', '', d)}"