powerpc/boot: Set target when cross-compiling for clang
authorJoel Stanley <joel@jms.id.au>
Mon, 12 Nov 2018 04:21:16 +0000 (14:51 +1030)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 13 Nov 2018 23:21:23 +0000 (08:21 +0900)
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@jms.id.au>
Tested-by: Daniel Axtens <dja@axtens.net> # powerpc 64-bit BE
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
arch/powerpc/boot/Makefile

index 39354365f54a5ebcbf0b087155e698ebf8337137..111f97b1ccec994a0fbb3da00864dd2bb5fceefa 100644 (file)
@@ -55,6 +55,11 @@ BOOTAFLAGS   := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc
 
 BOOTARFLAGS    := -cr$(KBUILD_ARFLAGS)
 
+ifdef CONFIG_CC_IS_CLANG
+BOOTCFLAGS += $(CLANG_FLAGS)
+BOOTAFLAGS += $(CLANG_FLAGS)
+endif
+
 ifdef CONFIG_DEBUG_INFO
 BOOTCFLAGS     += -g
 endif