qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] PPC linking error


From: Fausto Saporito
Subject: [Qemu-devel] PPC linking error
Date: Sat, 04 Mar 2006 11:39:51 +0100

Hello all,

I have this problem during linking qemu under Ubuntu 5.10 (linux-ppc).
The system is up to date, and I'm using the gcc-3.4 as you can see.

gcc-3.4 -g -Wl,-T,/home/fausap/qemu/ppc.ld -o qemu-i386 elfload.o main.o syscall.o mmap.o signal.o path.o osdep.o thunk.o vm86.o libqemu.a gdbstub.o   -lm
/usr/bin/ld: qemu-i386: Not enough room for program headers (allocated 8, need 9)
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
make[1]: *** [qemu-i386] Error 1
make[1]: Leaving directory `/home/fausap/qemu/i386-user'
make: *** [all] Error 1

The problem is in ppd.ld with SIZEOF_HEADERS variable. I fixed it copying the standard linker script elfppc32.x from /usr/lib/ldscripts in the qemu directory renaming it as ppc.ld
Now the link is ok.

After, I have a problem with an ASM instruction:

make[1]: Entering directory `/home/fausap/qemu/arm-user'
gcc-3.4 -Wall -O2 -g -fno-strict-aliasing -D__powerpc__ -I. -I/home/fausap/qemu/target-arm -I/home/fausap/qemu -I/home/fausap/qemu/linux-user -I/home/fausap/qemu/linux-user/arm -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/home/fausap/qemu/fpu -I/home/fausap/qemu/slirp -c -o elfload.o /home/fausap/qemu/linux-user/elfload.c
/home/fausap/qemu/linux-user/elfload.c: In function `load_elf_binary':
/home/fausap/qemu/cpu-all.h:253: error: inconsistent operand constraints in an `asm'
/home/fausap/qemu/cpu-all.h:253: error: inconsistent operand constraints in an `asm'
make[1]: *** [elfload.o] Error 1

Now, finding in other sources the occurence of stwbrx asm operand, I saw there's no need of "=m" operand in the __asm__ call.
Also, in the qemu code, the function is declared return void in the cpu-all.h file.
So i changed the line in :

    __asm__ __volatile__ ("stwbrx %0,0,%1" : : "r" (v), "r" (ptr));

The same I did for the 16bit version:

   __asm__ __volatile__ ("sthbrx %0,0,%1" : : "r" (v), "r" (ptr));

and all has gone fine.

Then there's a missing include in exec.h in target-mips directory, otherwise there's no way to recognize int32_t type.

In file included from /home/fausap/qemu/target-mips/op_helper.c:21:
/home/fausap/qemu/target-mips/exec.h:15: error: parse error before "host_int_t"

I added in target-mips/exec.h the line:

   #include <stdint.h>

After that I had no further errors... all went fine :-)

thanks in advance,
Fausto

reply via email to

[Prev in Thread] Current Thread [Next in Thread]