From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FFUBC-0007M9-Nd for qemu-devel@nongnu.org; Sat, 04 Mar 2006 05:40:06 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FFUB8-0007KA-PS for qemu-devel@nongnu.org; Sat, 04 Mar 2006 05:40:05 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FFUB8-0007Jo-9s for qemu-devel@nongnu.org; Sat, 04 Mar 2006 05:40:02 -0500 Received: from [193.70.192.54] (helo=smtp4.libero.it) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FFUCy-0003W4-Uo for qemu-devel@nongnu.org; Sat, 04 Mar 2006 05:41:57 -0500 Received: from localhost (172.16.1.47) by smtp4.libero.it (7.0.027-DD01) id 43F225B201AF673B for qemu-devel@nongnu.org; Sat, 4 Mar 2006 11:39:56 +0100 Received: from smtp1.libero.it ([172.16.1.224]) by localhost (asav7.libero.it [193.70.193.93]) (amavisd-new, port 10024) with ESMTP id 21933-03 for ; Sat, 4 Mar 2006 11:39:56 +0100 (CET) Received: from [192.168.2.2] (adsl-ull-112-27.46-151.net24.it [151.46.27.112]) by smtp1.libero.it (Postfix) with ESMTP id C3B18A8C58 for ; Sat, 4 Mar 2006 11:39:55 +0100 (MET) From: Fausto Saporito In-Reply-To: References: Content-Type: multipart/alternative; boundary="=-d2yc9aY31sZDyrMKuQz3" Date: Sat, 04 Mar 2006 11:39:51 +0100 Message-Id: <1141468791.31085.27.camel@localhost.localdomain> Mime-Version: 1.0 Subject: [Qemu-devel] PPC linking error Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --=-d2yc9aY31sZDyrMKuQz3 Content-Type: text/plain Content-Transfer-Encoding: 7bit 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 After that I had no further errors... all went fine :-) thanks in advance, Fausto --=-d2yc9aY31sZDyrMKuQz3 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit 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
--=-d2yc9aY31sZDyrMKuQz3--