[PATCH 4.19 099/148] powerpc/boot: Set target when cross-compiling for clang
From: Greg Kroah-Hartman
Date: Fri Jan 11 2019 - 09:39:10 EST
4.19-stable review patch. If anyone has any objections, please let me know.
------------------
From: Joel Stanley <joel@xxxxxxxxx>
commit 813af51f5d30a2da6a2523c08465f9726e51772e upstream.
Clang needs to be told which target it is building for when cross
compiling.
Link: https://github.com/ClangBuiltLinux/linux/issues/259
Signed-off-by: Joel Stanley <joel@xxxxxxxxx>
Tested-by: Daniel Axtens <dja@xxxxxxxxxx> # powerpc 64-bit BE
Acked-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
Reviewed-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>
Signed-off-by: Masahiro Yamada <yamada.masahiro@xxxxxxxxxxxxx>
Signed-off-by: Nathan Chancellor <natechancellor@xxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
arch/powerpc/boot/Makefile | 5 +++++
1 file changed, 5 insertions(+)
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -55,6 +55,11 @@ BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAG
BOOTARFLAGS := -cr$(KBUILD_ARFLAGS)
+ifdef CONFIG_CC_IS_CLANG
+BOOTCFLAGS += $(CLANG_FLAGS)
+BOOTAFLAGS += $(CLANG_FLAGS)
+endif
+
ifdef CONFIG_DEBUG_INFO
BOOTCFLAGS += -g
endif