linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: allow cross-compilation of ppc64 kernel
@ 2015-11-05 11:47 Laurent Vivier
  2015-11-06 21:09 ` Scott Wood
  0 siblings, 1 reply; 12+ messages in thread
From: Laurent Vivier @ 2015-11-05 11:47 UTC (permalink / raw)
  To: benh, paulus; +Cc: linuxppc-dev, linux-kernel, Laurent Vivier

When I try to cross compile a ppc64 kernel, it generally
fails on the VDSO stage. This is true for powerpc64 cross-
compiler, but also when I try to build a ppc64le kernel
on a ppc64 host.

VDSO64L fails:

  VDSO64L arch/powerpc/kernel/vdso64/vdso64.so.dbg
/usr/bin/powerpc64-linux-gnu-ld: arch/powerpc/kernel/vdso64/sigtramp.o:
file class ELFCLASS64 incompatible with ELFCLASS32
/usr/bin/powerpc64-linux-gnu-ld: final link failed: File in wrong format

This fails because gcc calls "collect2" with
"--oformat elf32-powerpcle" with ppc64 objects, without the
"--oformat" ld works well because it use the format of the
first object as output format.

As this case is correctly managed to build the other kernel
objects, this patch replaces $(GCC) by $(LD) to generate the
VDSO objects.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 arch/powerpc/kernel/vdso64/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/vdso64/Makefile b/arch/powerpc/kernel/vdso64/Makefile
index effca94..618c420 100644
--- a/arch/powerpc/kernel/vdso64/Makefile
+++ b/arch/powerpc/kernel/vdso64/Makefile
@@ -36,7 +36,7 @@ $(obj-vdso64): %.o: %.S
 
 # actual build commands
 quiet_cmd_vdso64ld = VDSO64L $@
-      cmd_vdso64ld = $(CC) $(c_flags) -Wl,-T $^ -o $@
+      cmd_vdso64ld = $(LD) $(LDFLAGS) $(ldflags-y) -T $^ -o $@
 quiet_cmd_vdso64as = VDSO64A $@
       cmd_vdso64as = $(CC) $(a_flags) -c -o $@ $<
 
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-11-10  7:54 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-05 11:47 [PATCH] powerpc: allow cross-compilation of ppc64 kernel Laurent Vivier
2015-11-06 21:09 ` Scott Wood
2015-11-06 22:22   ` Laurent Vivier
2015-11-06 23:24     ` Scott Wood
2015-11-07 11:35       ` Laurent Vivier
2015-11-10  0:29         ` Michael Ellerman
2015-11-10  7:54           ` Laurent Vivier
2015-11-06 22:55   ` Segher Boessenkool
2015-11-06 23:32     ` Segher Boessenkool
2015-11-07 11:32       ` Laurent Vivier
2015-11-06 23:12   ` Benjamin Herrenschmidt
2015-11-07 11:34     ` Laurent Vivier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).