From: Greg Hackmann Date: Mon, 10 Apr 2017 18:23:25 +0000 (-0700) Subject: ANDROID: HACK: arm64: use -mno-implicit-float instead of -mgeneral-regs-only X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1416d1c4396e660bb23ab6d1b71fa72d36b45254;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git ANDROID: HACK: arm64: use -mno-implicit-float instead of -mgeneral-regs-only LLVM bug 30792 causes clang's AArch64 backend to crash compiling arch/arm64/crypto/aes-ce-cipher.c. Replacing -mgeneral-regs-only with -mno-implicit-float is the suggested workaround. Drop this patch once the clang bug has been fixed. Change-Id: I89fda12d826783ffe18142ba048ff10bd769e240 Signed-off-by: Greg Hackmann Signed-off-by: Matthias Kaehlcke [AmitP: Refactored the changes to align with changes from upstream commit bbb56c27228d ("arm64: Add detection code for broken .inst support in binutils")] Signed-off-by: Amit Pundir --- diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 62274e34d78e..7f61b2f44cd7 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -45,7 +45,14 @@ $(warning Detected assembler with broken .inst; disassembly will be unreliable) endif endif -KBUILD_CFLAGS += -mgeneral-regs-only $(lseinstr) $(brokengasinst) +ifeq ($(cc-name),clang) +# This is a workaround for https://bugs.llvm.org/show_bug.cgi?id=30792. +# TODO: revert when this is fixed in LLVM. +KBUILD_CFLAGS += -mno-implicit-float +else +KBUILD_CFLAGS += -mgeneral-regs-only +endif +KBUILD_CFLAGS += $(lseinstr) $(brokengasinst) KBUILD_CFLAGS += -fno-asynchronous-unwind-tables KBUILD_CFLAGS += $(call cc-option, -mpc-relative-literal-loads) KBUILD_CFLAGS += -fno-pic