summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2022-10-19 15:53:22 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-10-24 11:03:51 +0200
commit9f3477b0e9b3c0fec8afe196a1c0dcab7ad18b7c (patch)
treeff31ed5fd0a2d95d2789d982abb8808ed66b191d /Makefile
parent184f1b3ccdacc119104d1b401c6e33f78c44ed3d (diff)
downloadbarebox-9f3477b0e9b3c0fec8afe196a1c0dcab7ad18b7c.tar.gz
Kbuild: disable ARM64 pointer authentication
The aarch64 cross-compiler built with Yocto's kirkstone release configures -mbranch-protection=standard as default. The resulting PACIASP/AUTIASP instructions are interpreted as NOPs by existing CPUs, but they increase image size and misalign the barebox header in ENTRY_FUNCTION(). Also on ARMv8.3+, where they serve a purpose, we wouldn't benefit from them as we don't setup any pointer authentication keys. Thus disable it. The misaligned barebox header caused is_barebox_arm_head to fail, breaking all code that verified barebox' header, like i.MX8MM imx-usb-loader barebox-side support and barebox_update for some ARM64 SoCs without a SoC-specific header. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221019135322.2283270-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 5 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index d7f1e3779a..ddbdc5e1d4 100644
--- a/Makefile
+++ b/Makefile
@@ -659,6 +659,11 @@ KBUILD_CFLAGS += $(call cc-option,-fno-stack-check)
# Platforms that have their setjmp appropriately implemented may override this
KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none)
+# We don't have the necessary infrastructure to benefit from ARMv8.3+ pointer
+# authentication. On older CPUs, they are interpreted as NOPs and blot the
+# code and break less portable code that expects a very specific code layout
+KBUILD_CFLAGS += $(call cc-option,-mbranch-protection=none)
+
KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
# Align the bit size of userspace programs with the kernel