[PATCH] arm64: Paper over ARM_SMCCC_ARCH_WORKAROUND_3 Clang issue

Marc Zyngier maz at kernel.org
Wed Mar 9 07:57:16 PST 2022


Compiling the arm64 kernel with the BHB workarounds and Clang+LTO
results in a bunch of:

<instantiation>:4:2: error: invalid fixup for movz/movk instruction
 mov w0, #ARM_SMCCC_ARCH_WORKAROUND_3

when compiling arch/arm64/kernel/entry.S, and makes no sense at all.

As it turns out, moving a single include line around makes the
problem disappear. Why, you'd ask? Well, I don't have the faintest
idea, and I'm running out of patience. So make of that what you want.

Cc: James Morse <james.morse at arm.com>
Cc: Nick Desaulniers <ndesaulniers at google.com>
Cc: Will Deacon <will at kernel.org>
Cc: Catalin Marinas <catalin.marinas at arm.com>
Signed-off-by: Marc Zyngier <maz at kernel.org>
---
 include/linux/arm-smccc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h
index 220c8c60e021..0a341dd9ff61 100644
--- a/include/linux/arm-smccc.h
+++ b/include/linux/arm-smccc.h
@@ -5,7 +5,6 @@
 #ifndef __LINUX_ARM_SMCCC_H
 #define __LINUX_ARM_SMCCC_H
 
-#include <linux/init.h>
 #include <uapi/linux/const.h>
 
 /*
@@ -193,6 +192,7 @@
 
 #ifndef __ASSEMBLY__
 
+#include <linux/init.h>
 #include <linux/linkage.h>
 #include <linux/types.h>
 
-- 
2.34.1




More information about the linux-arm-kernel mailing list