diff mbox series

[2/2] powerpc/boot: Set target when cross-compiling for clang

Message ID 20181104231133.30848-3-joel@jms.id.au
State New
Headers show
Series poewrpc/Boot: Fix cross compiling with clang | expand

Commit Message

Joel Stanley Nov. 4, 2018, 11:11 p.m. UTC
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>

---
 arch/powerpc/boot/Makefile | 7 +++++++
 1 file changed, 7 insertions(+)

-- 
2.19.1

Comments

Daniel Axtens Nov. 5, 2018, 12:11 a.m. UTC | #1
Joel Stanley <joel@jms.id.au> writes:

Hi Joel,

Thanks!

Tested-by: Daniel Axtens <dja@axtens.net> # powerpc 64-bit BE


This solves one of the 2 issues I have in building for 64-bit BE with
clang. The other is the VDSO32 stuff, and I hope to send a patch for
that soon.

Regards,
Daniel

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

> ---

>  arch/powerpc/boot/Makefile | 7 +++++++

>  1 file changed, 7 insertions(+)

>

> diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile

> index 39354365f54a..8fdb1890f09a 100644

> --- a/arch/powerpc/boot/Makefile

> +++ b/arch/powerpc/boot/Makefile

> @@ -55,6 +55,13 @@ BOOTAFLAGS	:= -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc

>  

>  BOOTARFLAGS	:= -cr$(KBUILD_ARFLAGS)

>  

> +ifdef CONFIG_CC_IS_CLANG

> +BOOTCFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX)

> +BOOTAFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX)

> +BOOTCFLAGS += $(call cc-option, -no-integrated-as)

> +BOOTAFLAGS += $(call cc-option, -no-integrated-as)

> +endif

> +

>  ifdef CONFIG_DEBUG_INFO

>  BOOTCFLAGS	+= -g

>  endif

> -- 

> 2.19.1
diff mbox series

Patch

diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 39354365f54a..8fdb1890f09a 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -55,6 +55,13 @@  BOOTAFLAGS	:= -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc
 
 BOOTARFLAGS	:= -cr$(KBUILD_ARFLAGS)
 
+ifdef CONFIG_CC_IS_CLANG
+BOOTCFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX)
+BOOTAFLAGS += $(CLANG_TARGET) $(CLANG_GCC_TC) $(CLANG_PREFIX)
+BOOTCFLAGS += $(call cc-option, -no-integrated-as)
+BOOTAFLAGS += $(call cc-option, -no-integrated-as)
+endif
+
 ifdef CONFIG_DEBUG_INFO
 BOOTCFLAGS	+= -g
 endif