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 <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I30de5841a50e3fd97ba95c25cc12339d47ad083e
This commit is contained in:
Nick Desaulniers
2019-07-22 15:38:13 -07:00
committed by Alistair Delva
parent cf045d8837
commit 3578eb5fcd
2 changed files with 2 additions and 1 deletions

View File

@@ -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

View File

@@ -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