Skip to contentSkip to conversation

build error

Qemu-devel Edgar E. Iglesias 3 participants 5 messages Jan 7, 2008 – Jan 8, 2008

lore
Share & tools
lore
#0 lore raw

Hello,

I needed this or similar to build recent qemu's with gcc-4.

Best regards

Signature · 2 lines
Edgar E. Iglesias
Axis Communications AB
linux-user/main.c +2 -1
index e3a2374..164fdb9 100644
@@ -53,7 +53,8 @@ asm(".globl __preinit_array_start\n"
     "__init_array_end:\n"
     "__fini_array_start:\n"
     "__fini_array_end:\n"
-    ".long 0\n");
+    ".long 0\n"
+    ".previous\n");
 #endif
 
 /* XXX: on x86 MAP_GROWSDOWN only works if ESP <= address + 32, so
#1 lore raw
Quoted 5 lines · On Monday 07 January 2008 05:27:19 Edgar E. Iglesias wrote:

Hello,

I needed this or similar to build recent qemu's with gcc-4.

Best regards

Is that all you needed, and did the result work?

The 0.9.1 build I did yesterday grabbed gcc 3.4 during the ./configure stage, which is only installed for qemu...

Rob

Signature · 2 lines
"One of my most productive days was throwing away 1000 lines of code."
  - Ken Thompson.
#2 lore raw
Quoted 11 lines · Rob Landley
Quoted 5 lines · On Monday 07 January 2008 05:27:19 Edgar E. Iglesias wrote:

Hello,

I needed this or similar to build recent qemu's with gcc-4.

Best regards

Is that all you needed, and did the result work?

The 0.9.1 build I did yesterday grabbed gcc 3.4 during the ./configure stage, which is only installed for qemu...

I haven't done very extensive testing but the CRIS linux-user simulator builds and runs it's testsuite as expected. Maybe I'll run into trouble later...

# Configured with: ../qemu/configure --disable-gcc-check --target-list=cris-linux-user

% gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.1.2 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.2/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/g++-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --disable-nls --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-libunwind-exceptions --disable-multilib --enable-libmudflap --disable-libssp --disable-libgcj --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu Thread model: posix
gcc version 4.1.2 (Gentoo 4.1.2)

% objdump -s -j .comment cris-linux-user/qemu-cris

cris-linux-user/qemu-cris: file format elf32-i386

Contents of section .comment:

 0000 00474343 3a202847 4e552920 342e312e  .GCC: (GNU) 4.1.
 0010 32202847 656e746f 6f20342e 312e3229  2 (Gentoo 4.1.2)
 0020 00004743 433a2028 474e5529 20342e31  ..GCC: (GNU) 4.1

....

Best regards

Signature · 2 lines
Edgar E. Iglesias
Axis Communications AB
#3 lore raw
In reply to Rob Landley

Hello,

Am 08.01.2008 um 00:59 schrieb Rob Landley:

Quoted 4 lines · On Monday 07 January 2008 05:27:19 Edgar E. Iglesias wrote:
Quoted 2 lines

I needed this or similar to build recent qemu's with gcc-4.

Is that all you needed, and did the result work?

For system emulation on OSX/ppc I only needed a fix for always_inline (as suggested by Alexander Graf as part of his OSX x86_64 patch), then sparc-softmmu compiles and runs fine for several hours on OSX Leopard.

It seems Leopard's system headers are incompatible with gcc-3.3, and using a different -sdkroot does not work. So GCC4 is becoming a necessity there, too (in addition to any OSX/i386).

Is there anything specific to watch out for with GCC4 at this time? What does this ".previous" addition fix?

Andreas

#4 lore raw
Quoted 13 lines · Andreas Färber

Hello,

Am 08.01.2008 um 00:59 schrieb Rob Landley:

Quoted 4 lines · On Monday 07 January 2008 05:27:19 Edgar E. Iglesias wrote:
Quoted 2 lines

I needed this or similar to build recent qemu's with gcc-4.

Is that all you needed, and did the result work?

For system emulation on OSX/ppc I only needed a fix for always_inline (as suggested by Alexander Graf as part of his OSX x86_64 patch), then sparc-softmmu compiles and runs fine for several hours on OSX Leopard.

Quoted 6 lines

It seems Leopard's system headers are incompatible with gcc-3.3, and using a different -sdkroot does not work. So GCC4 is becoming a necessity there, too (in addition to any OSX/i386).

Is there anything specific to watch out for with GCC4 at this time? What does this ".previous" addition fix?

The workaround in linux-user/main.c for recent libc's switches the current section to .rodata but does not switch it back. The .previous makes sure it is restored to it's previous section.

It's not really gcc4 related but on my system gcc 4 failed while gcc-3.4.6 didn't.

Best regards

Signature · 2 lines
Edgar E. Iglesias
Axis Communications AB