ANDROID: arm64: vdso32: fix CC=clang build
authorMark Salyzyn <salyzyn@google.com>
Wed, 10 Jan 2018 00:55:17 +0000 (16:55 -0800)
committerMichael Benedict <michaelbt@live.com>
Sun, 22 Sep 2019 16:16:21 +0000 (02:16 +1000)
clang build had wrong --gcc-toolchain for cross compiler.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 63737556
Change-Id: Ib0c3bbb250943a0309da021ba5335a8320b584f4

arch/arm64/kernel/vdso32/Makefile

index 6d44d972e89ddd4c0eab452994509b8df26d8d08..e9ca1f97a543b96a9537d2f3d488f9b1023d8c14 100644 (file)
@@ -6,6 +6,10 @@
 
 ifeq ($(cc-name),clang)
   CC_ARM32 := $(cc-name) $(CLANG_TARGET_ARM32) -no-integrated-as
+  GCC_ARM32_TC := $(realpath $(dir $(shell which $(CROSS_COMPILE_ARM32)ld))/..)
+ifneq ($(GCC_ARM32_TC),)
+  CC_ARM32 += --gcc-toolchain=$(GCC_ARM32_TC)
+endif
 else
   CC_ARM32 := $(CROSS_COMPILE_ARM32)$(cc-name)
 endif
@@ -29,7 +33,9 @@ cc32-ldoption = $(call try-run,\
 # NOSTDINC_FLAGS
 VDSO_CPPFLAGS := -nostdinc -isystem $(shell $(CC_ARM32) -print-file-name=include)
 VDSO_CPPFLAGS += $(LINUXINCLUDE)
-VDSO_CPPFLAGS += $(KBUILD_CPPFLAGS)
+VDSO_CPPFLAGS += -D__KERNEL__
+VDSO_CPPFLAGS += $(call cc-option,-Qunused-arguments,)
+VDSO_CPPFLAGS += $(ARCH_CPPFLAGS) $(KCPPFLAGS)
 
 # Common C and assembly flags
 # From top-level Makefile