From 3578eb5fcdfcbbde1750272e3a1b16c87dadf8dc Mon Sep 17 00:00:00 2001 From: Nick Desaulniers Date: Mon, 22 Jul 2019 15:38:13 -0700 Subject: [PATCH] ANDROID: x86: boot: Makefile: pass CLANG_FLAGS to Kbuild The build machines seem to have older versions of ld.bfd that don't support R_X86_64_32S absolute relocations, visible as the following failure in presubmit testing: Invalid absolute R_X86_64_32S relocation: __end_of_kernel_reserve It seems that parts of KBUILD that overwrite KBUILD_CFLAGS drop import clang flags like `--gcc-toolchain` (where to look for the GNU binutils), so clang just finds the host utilities and just uses those. This is bad for hermeticity of builds, and needs to be fixed upstream. Link: https://github.com/ClangBuiltLinux/linux/issues/618 Signed-off-by: Nick Desaulniers Signed-off-by: Greg Kroah-Hartman Change-Id: I30de5841a50e3fd97ba95c25cc12339d47ad083e --- arch/x86/boot/Makefile | 2 +- arch/x86/boot/compressed/Makefile | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile index e2839b5c246c..f3e1d9791db7 100644 --- a/arch/x86/boot/Makefile +++ b/arch/x86/boot/Makefile @@ -65,7 +65,7 @@ clean-files += cpustr.h # --------------------------------------------------------------------------- -KBUILD_CFLAGS := $(REALMODE_CFLAGS) -D_SETUP +KBUILD_CFLAGS := $(REALMODE_CFLAGS) -D_SETUP $(CLANG_FLAGS) KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ GCOV_PROFILE := n UBSAN_SANITIZE := n diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile index 6b84afdd7538..15ea18f57e09 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile @@ -38,6 +38,7 @@ KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector) KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) KBUILD_CFLAGS += $(call cc-disable-warning, gnu) KBUILD_CFLAGS += -Wno-pointer-sign +KBUILD_CFLAGS += $(CLANG_FLAGS) KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ GCOV_PROFILE := n