Re: i386 -> x86_64 cross compile failure (binutils bug?)

From: Lee Revell
Date: Sat Dec 10 2005 - 14:32:07 EST


On Sat, 2005-12-10 at 08:19 +0100, Andi Kleen wrote:
> On Sat, Dec 10, 2005 at 12:12:03AM -0500, Lee Revell wrote:
> > On Sat, 2005-12-10 at 01:56 -0700, Andi Kleen wrote:
> > > Lee Revell <rlrevell@xxxxxxxxxxx> writes:
> > > > - disable CONFIG_IA32_EMULATION
> > >
> > > I just tried it here. Adding -m64 to CFLAGS/AFLAGS on a native
> > > 64bit biarch toolchain and it compiled without problems. It ends
> > > up with -m64 -m32 for the 32bit vsyscall files, but that seems
> > > to DTRT at least in gcc 4.
> >
> > Nope, passing -m64 -m32 does not seem to DTRT on native 32bit biarch
> > toolchain:
>
> How about this patch?

FWIW it still fails at the final link step:

ld -m elf_x86_64 -o .tmp_vmlinux1 -T arch/x86_64/kernel/vmlinux.lds
arch/x86_64/kernel/head.o arch/x86_64/kernel/head64.o
arch/x86_64/kernel/init_task.o init/built-in.o --start-group
usr/built-in.o arch/x86_64/kernel/built-in.o arch/x86_64/mm/built-in.o
arch/x86_64/crypto/built-in.o arch/x86_64/ia32/built-in.o
kernel/built-in.o mm/built-in.o fs/built-in.o ipc/built-in.o
security/built-in.o crypto/built-in.o lib/lib.a arch/x86_64/lib/lib.a
lib/built-in.o arch/x86_64/lib/built-in.o drivers/built-in.o
sound/built-in.o arch/x86_64/pci/built-in.o net/built-in.o
--end-group
ld:arch/x86_64/kernel/vmlinux.lds:383: parse error
make: *** [.tmp_vmlinux1] Error 1

Here are the relevant lines of arch/x86_64/kernel/vmlinux.lds:

382 OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
383 OUTPUT_ARCH(1:x86-64)
384 ENTRY(phys_startup_64)

Any ideas? Another toolchain quirk?

Lee

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/