Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 132667 - app-emulation/qemu-{user,softmmu} won't build on gcc-4
Summary: app-emulation/qemu-{user,softmmu} won't build on gcc-4
Status: VERIFIED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Luca Barbato
URL:
Whiteboard:
Keywords:
: 133516 137112 140236 146113 146115 146506 157278 158970 165970 (view as bug list)
Depends on:
Blocks: 117482
  Show dependency tree
 
Reported: 2006-05-08 05:35 UTC by Daniel Drake (RETIRED)
Modified: 2009-08-05 08:52 UTC (History)
34 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ebuild patches disabling sparc support (qemu-0.8.1-gcc4-op.patch,1.52 KB, text/plain)
2006-05-28 20:06 UTC, Jory A. Pratt
Details
fixes compilation for sparc target (qemu-softmmu-0.8.1-gcc41.patch,1.28 KB, patch)
2006-05-29 03:03 UTC, Carlo Marcelo Arenas Belon
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Drake (RETIRED) gentoo-dev 2006-05-08 05:35:10 UTC
gcc -O2 -Wall -O2 -g -fno-strict-aliasing -I. -I.. -I/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/target-sparc -I/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/fpu -I/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/slirp -c -o sparc-dis.o /var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/sparc-dis.c
../dyngen -o op.h op.o
../dyngen -c -o opc.h op.o
../dyngen -g -o gen-op.h op.o
gcc -O2 -Wall -O2 -g -fno-strict-aliasing -I. -I.. -I/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/target-sparc -I/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/fpu -I/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/slirp -c -o translate-op.o /var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/translate-op.c
In file included from /var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/translate-op.c:36:
./op.h: In function 'dyngen_code':
./op.h:3525: error: expected identifier or '(' before '.' token
./op.h:3527: error: expected expression before '.' token
make[1]: *** [translate-op.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/sparc-softmmu'
make: *** [all] Error 1

!!! ERROR: app-emulation/qemu-softmmu-0.8.1 failed.
Call stack:
  ebuild.sh, line 1525:   Called dyn_compile
  ebuild.sh, line 928:   Called src_compile
  qemu-softmmu-0.8.1.ebuild, line 84:   Called die



Portage 2.1_pre10-r4 (default-linux/amd64/2005.1, gcc-4.1.0, glibc-2.4-r2, 2.6.17-rc3 x86_64)
=================================================================
System uname: 2.6.17-rc3 x86_64 AMD Athlon(tm) 64 Processor 3200+
Gentoo Base System version 1.12.0_pre19
dev-lang/python:     2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.18
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r2
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r3
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -fomit-frame-pointer -march=k8"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib64/mozilla/defaults/pref /usr/share/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/eselect/compiler /etc/gconf /etc/make.conf /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d /etc/env.d"
CXXFLAGS="-O2 -pipe -fomit-frame-pointer -march=k8"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig cvs distlocks metadata-transfer sandbox sfperms sign strict"
GENTOO_MIRRORS="http://gentoo.blueyonder.co.uk"
LANG="en_GB.UTF-8"
LC_ALL="en_GB.UTF-8"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.uk.gentoo.org/gentoo-portage"
USE="amd64 X alsa avahi bash-completion beagle cairo cdr custom-cflags daap dbus dvd dvdr dvdread glitz gnome gtk gtk2 hal jpeg mono moznocompose moznoirc moznomail mp3 nptl nptlonly opengl png rtc samba ssl svg tiff truetype truetype-fonts userlocales xv xvid elibc_glibc input_devices_evdev input_devices_keyboard input_devices_mouse kernel_linux userland_GNU video_cards_nvidia video_cards_fbdev video_cards_nv video_cards_vesa video_cards_vga"
Unset:  ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Patrizio Bassi 2006-05-08 11:43:54 UTC
a different error for me, due to 2.6.16 headers

gcc -O2 -Wall -O2 -g -fno-strict-aliasing -fomit-frame-pointer -I. -I.. -I/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/target-i386 -I/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/fpu -DHAS_AUDIO -I/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/slirp -c -o osdep.o /var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/osdep.c
In file included from /var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c:88:
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/exec-all.h:474: error: conflicting types for ‘spinlock_t’
/usr/include/linux/spinlock_types.h:27: error: previous declaration of ‘spinlock_t’ was here
In file included from /var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c:88:
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/exec-all.h:476:1: warning: "SPIN_LOCK_UNLOCKED" redefined
In file included from /usr/include/linux/spinlock.h:79,
                 from /usr/include/linux/wait.h:23,
                 from /usr/include/asm/semaphore.h:4,
                 from /usr/include/linux/sched.h:20,
                 from /usr/include/linux/smp_lock.h:6,
                 from /usr/include/linux/hardirq.h:6,
                 from /usr/include/linux/interrupt.h:11,
                 from /usr/include/linux/rtc.h:14,
                 from /var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c:55:
/usr/include/linux/spinlock_types.h:58:1: warning: this is the location of the previous definition
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/exec-all.h:495: error: conflicting types for ‘_spin_lock’
/usr/include/linux/spinlock_api_smp.h:22: error: previous declaration of ‘_spin_lock’ was here
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/exec-all.h:499: error: conflicting types for ‘_spin_unlock’
/usr/include/linux/spinlock_api_smp.h:41: error: previous declaration of ‘_spin_unlock’ was here
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/exec-all.h:503: error: conflicting types for ‘_spin_trylock’
/usr/include/linux/spinlock_api_smp.h:37: error: previous declaration of ‘_spin_trylock’ was here
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c: In function ‘timer_save’:
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c:856: warning: pointer targets in passing argument 2 of ‘qemu_put_be64s’ differ in signedness
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c:857: warning: pointer targets in passing argument 2 of ‘qemu_put_be64s’ differ in signedness
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c: In function ‘timer_load’:
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c:867: warning: pointer targets in passing argument 2 of ‘qemu_get_be64s’ differ in signedness
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c:868: warning: pointer targets in passing argument 2 of ‘qemu_get_be64s’ differ in signedness
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c: At top level:
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c:968: error: static declaration of ‘init_timers’ follows non-static declaration
/usr/include/linux/timer.h:96: error: previous declaration of ‘init_timers’ was here
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c: In function ‘qemu_chr_printf’:
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c:1089: warning: pointer targets in passing argument 2 of ‘qemu_chr_write’ differ in signedness
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c: In function ‘net_socket_fd_init’:
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c:2914: warning: pointer targets in passing argument 5 of ‘getsockopt’ differ in signedness
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c: In function ‘qemu_savevm’:
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c:3700: warning: pointer targets in passing argument 2 of ‘qemu_put_buffer’ differ in signedness
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c: In function ‘qemu_loadvm’:
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c:3771: warning: pointer targets in passing argument 2 of ‘qemu_get_buffer’ differ in signedness
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c:4280:61: error: macro "LIST_HEAD" passed 2 arguments, but takes just 1
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c: At top level:
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c:4280: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘vm_change_state_head’
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c: In function ‘qemu_add_vm_change_state_handler’:
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c:4293: error: ‘vm_change_state_head’ undeclared (first use in this function)
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c:4293: error: (Each undeclared identifier is reported only once
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c:4293: error: for each function it appears in.)
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c: In function ‘vm_state_notify’:
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c:4307: error: ‘vm_change_state_head’ undeclared (first use in this function)
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c: In function ‘main’:
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/vl.c:5067: error: ‘vm_change_state_head’ undeclared (first use in this function)
make[1]: *** [vl.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/i386-softmmu'
make: *** [all] Error 1

!!! ERROR: app-emulation/qemu-softmmu-0.8.1 failed.
Call stack:
  ebuild.sh, line 1525:   Called dyn_compile
  ebuild.sh, line 928:   Called src_compile
  qemu-softmmu-0.8.1.ebuild, line 84:   Called die

!!! make failed
!!! If you need support, post the topmost build error, and the call stack if relevant.

Comment 2 Daniel Drake (RETIRED) gentoo-dev 2006-05-08 13:49:01 UTC
Patrizio, your bug is clearly different, please report it separately.
Comment 3 Daniel Drake (RETIRED) gentoo-dev 2006-05-08 13:58:30 UTC
Compiles fine on gcc 3.4
Comment 4 Daniel Drake (RETIRED) gentoo-dev 2006-05-09 05:08:48 UTC
Same problem with qemu-user-0.8.1 on gcc 4.1
Comment 5 mtthsme 2006-05-11 10:02:05 UTC
For the issue with linux-headers-2.6.16, edit rtc.h (/usr/include/linux) and remove the 

#include ???/interrupt.h

It worked for me. I am not totally sure about the exact location, since i don't have my computer with me as i write this.

BTW, i even compiled qemu-softmmu with my cflags(the normal ebuild filters them all), and it doesn't like -march=athlon-xp, while -mtune=athlon-xp is fine.

ABTW, wouldn't it be nice to activate only certain targets, per use flag probably? I for one will never use ppc or sparc.
Comment 6 SpanKY gentoo-dev 2006-05-14 06:58:58 UTC
i dont think this is gcc-4.1's fault so much as qemu's fault

the bad code generated is:
case INDEX_op_fnegs: {
    extern void op_fnegs();
extern char .LC0;
    memcpy(gen_code_ptr, (void *)((char *)&op_fnegs+0), 23);
    *(uint32_t *)(gen_code_ptr + 11) = (long)(&.LC0) - (long)(gen_code_ptr + 11) + -4;
    gen_code_ptr += 23;
}
Comment 7 Jakub Moc (RETIRED) gentoo-dev 2006-05-16 11:31:36 UTC
*** Bug 133516 has been marked as a duplicate of this bug. ***
Comment 8 Nathan Sullivan 2006-05-28 19:35:34 UTC
the rtc.h issue has been fixed in linux-headers-2.6.16 in the tree now.
Comment 9 Jory A. Pratt 2006-05-28 20:06:53 UTC
Created attachment 87775 [details]
ebuild patches disabling sparc support

This is a temp fix, could be used with an ewarn letting amd64 users know that sparc support in qemu is temp. disabled until gcc-4 fixes are released.
Comment 10 Carlo Marcelo Arenas Belon 2006-05-29 03:01:59 UTC
woud like to add that the lines before the pasted problem are :

gcc -O2 -Wall -O2 -g -fno-strict-aliasing -falign-functions=0 -fno-reorder-blocks -fno-optimize-sibling-calls -I. -I.. -I/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/target-sparc -I/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/fpu -I/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/slirp -c -o op.o /var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/target-sparc/op.c
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/target-sparc/op.c: In function 'op_goto_tb0':
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/target-sparc/op.c:1310: warning: cast to pointer from integer of different size
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/target-sparc/op.c: In function 'op_goto_tb1':
/var/tmp/portage/qemu-softmmu-0.8.1/work/qemu-0.8.1/target-sparc/op.c:1315: warning: cast to pointer from integer of different size
../dyngen -o op.h op.o
../dyngen -c -o opc.h op.o

which are generating an op.o file that dyngen uses to generate code that won't compile as explained before (because of an invalid identifier named .LC0)

attached patch that would fix the compilation problem with a helper function that won't confuse qemu's dissassemler for the dynamic code generation (dyngen)
Comment 11 Carlo Marcelo Arenas Belon 2006-05-29 03:03:40 UTC
Created attachment 87789 [details, diff]
fixes compilation for sparc target
Comment 12 Luca Barbato gentoo-dev 2006-05-29 03:09:50 UTC
could you please push it upstream?
Comment 13 Carlo Marcelo Arenas Belon 2006-05-29 23:42:04 UTC
using gcc 4 won't be supported upstream (http://lists.gnu.org/archive/html/qemu-devel/2005-11/msg00250.html), because it requires several intrusive hacks to try to force gcc to behave as it did for version 3 and makes the use of gcc for core dynamic generation not ideal and fragile, while the use of a hand written code generation is seen as a better long time solution :

  https://nowt.dyndns.org/

if we want to be compatible with upstream, then gcc3 should be required for building qemu.

Comment 14 Luca Barbato gentoo-dev 2006-05-30 00:07:19 UTC
I'll try this patch and probably apply it if works as should
Comment 15 Jakub Moc (RETIRED) gentoo-dev 2006-06-18 01:08:03 UTC
*** Bug 137112 has been marked as a duplicate of this bug. ***
Comment 16 Mehmet Kemal EROL 2006-07-12 16:30:25 UTC
Problem persist with `qemu-softmmu-0.8.1-r1' on my amd64 box running gcc-4.1.1:

* Qemu could not build with GCC 4

* Applying qemu-0.8.0-gcc4-hacks.patch ...
* Applying qemu-0.8.0-gcc4-opts.patch ...

Install prefix    /usr
BIOS directory    /usr/share/qemu
binary directory  /usr/bin
Manual directory  /usr/share/man
ELF interp prefix /usr/gnemul/qemu-%M
Source path       /var/tmp/portage/qemu-softmmu-0.8.1-r1/work/qemu-0.8.1
C compiler        gcc
Host C compiler   gcc
make              make
install           install
host CPU          x86_64
host big endian   no
target list       i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu arm-softmmu mips-softmmu
gprof enabled     no
profiler          no
static build      no
SDL support       yes
SDL static link   yes
mingw32 support   no
Adlib support     no
CoreAudio support no
ALSA support      yes
DSound support    no
FMOD support      no 
kqemu support     yes
Documentation     yes

[skip compilation output with huge warnings]

-I/var/tmp/portage/qemu-softmmu-0.8.1-r1/work/qemu-0.8.1/target-sparc -I/var/tmp/portage/qemu-softmmu-0.8.1-r1/work/qemu-0.8.1 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/var/tmp/portage/qemu-softmmu-0.8.1-r1/work/qemu-0.8.1/fpu -I/var/tmp/portage/qemu-softmmu-0.8.1-r1/work/qemu-0.8.1/slirp -c -o translate-op.o /var/tmp/portage/qemu-softmmu-0.8.1-r1/work/qemu-0.8.1/translate-op.c
gcc -O2 -Wall -O2 -g -fno-strict-aliasing -I. -I.. -I/var/tmp/portage/qemu-softmmu-0.8.1-r1/work/qemu-0.8.1/target-sparc -I/var/tmp/portage/qemu-softmmu-0.8.1-r1/work/qemu-0.8.1 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/var/tmp/portage/qemu-softmmu-0.8.1-r1/work/qemu-0.8.1/fpu -I/var/tmp/portage/qemu-softmmu-0.8.1-r1/work/qemu-0.8.1/slirp -c -o translate-all.o /var/tmp/portage/qemu-softmmu-0.8.1-r1/work/qemu-0.8.1/translate-all.c
In file included from /var/tmp/portage/qemu-softmmu-0.8.1-r1/work/qemu-0.8.1/translate-op.c:37:
./op.h: In function 'dyngen_code':
./op.h:3595: error: expected identifier or '(' before '.' token
./op.h:3597: error: expected expression before '.' token
make[1]: *** [translate-op.o] Error 1
make[1]: *** Waiting for unfinished jobs....
/var/tmp/portage/qemu-softmmu-0.8.1-r1/work/qemu-0.8.1/translate-all.c: In function 'cpu_restore_state':
/var/tmp/portage/qemu-softmmu-0.8.1-r1/work/qemu-0.8.1/translate-all.c:257: warning: cast from pointer to integer of different size
make[1]: Leaving directory `/var/tmp/portage/qemu-softmmu-0.8.1-r1/work/qemu-0.8.1/sparc-softmmu'
make: *** [all] Error 1

!!! ERROR: app-emulation/qemu-softmmu-0.8.1-r1 failed.
Call stack:
  ebuild.sh, line 1545:   Called dyn_compile
  ebuild.sh, line 940:   Called src_compile
  qemu-softmmu-0.8.1-r1.ebuild, line 89:   Called die

!!! make failed
!!! If you need support, post the topmost build error, and the call stack if relevant.
Comment 17 Jakub Moc (RETIRED) gentoo-dev 2006-07-13 09:02:40 UTC
*** Bug 140236 has been marked as a duplicate of this bug. ***
Comment 18 Pawel Kraszewski 2006-07-15 11:05:02 UTC
(In reply to comment #9)

> This is a temp fix, could be used with an ewarn letting amd64 users know that
> sparc support in qemu is temp. disabled until gcc-4 fixes are released.

This helped me a lot...

As a side-note -- perhaps it is time to USE-control built emulators? In fact I need just x86 and definitely not PPC, SPARC, MIPS or ARM...
Comment 19 Carlo Marcelo Arenas Belon 2006-07-29 03:34:12 UTC
FYI, qemu-0.8.2 is out and compiles with gcc4 (no need to patch it to fix the compile failure in op.h) even if the sparc target is enable but (as with the workaround) segfaults when running
Comment 20 Luca Barbato gentoo-dev 2006-07-31 13:19:13 UTC
I'm back from a short vacation, you'll find the updated ebuilds soonish
Comment 21 Christian Faulhammer (RETIRED) gentoo-dev 2006-08-09 02:45:24 UTC
I have no problems running 0.8.1(-r1) with GCC 4.1.1...do you need more information or is this intended behaviour now?
Comment 22 Steve Arnold archtester gentoo-dev 2006-08-13 19:53:47 UTC
What's the status on this?  I'm getting the same failure with the latest ~amd64, though I'm not sure why it doesn't pull in 0.8.2:

In file included from /var/tmp/portage/qemu-softmmu-0.8.1-r1/work/qemu-0.8.1/translate-op.c:37:
./op.h: In function 'dyngen_code':
./op.h:3595: error: expected identifier or '(' before '.' token
./op.h:3597: error: expected expression before '.' token
make[1]: *** [translate-op.o] Error 1
make[1]: Leaving directory `/var/tmp/portage/qemu-softmmu-0.8.1-r1/work/qemu-0.8.1/sparc-softmmu'
make: *** [all] Error 1

!!! ERROR: app-emulation/qemu-softmmu-0.8.1-r1 failed.
Comment 23 Luca Barbato gentoo-dev 2006-08-14 06:14:19 UTC
qemu-0.8.2 built with gcc-3 worked on the amd64 I have access.
Comment 24 Neil Skrypuch 2006-08-31 23:38:52 UTC
Does QEmu compile with GCC 4.1.1 then? The ebuilds still have this in them:

pkg_setup() {
    if [ "$(gcc-major-version)" == "4" ]; then
    eerror "qemu requires gcc-3 in order to build and work correctly"
    eerror "please compile it with gcc-3"
    die "gcc 4 cannot build qemu"
    fi
}
Comment 25 Matthew Hamilton 2006-09-01 19:20:44 UTC
After removing the gcc4 block in the ebuild, qemu and related deps compiled correctly with GCC 4.1.1.  It didn't run though, segfaults every time.

It looks like an upstream deal, as the gcc4 issue is mentioned on the front page.
Comment 26 Pat Double 2006-09-02 05:26:15 UTC
It runs fine here compiled with GCC 4.1.1 and -march=prescott even. Have you tried reducing your CFLAGS ? I have:

CFLAGS="-Os -pipe -march=prescott -mfpmath=sse -fomit-frame-pointer"
Comment 27 Jakub Moc (RETIRED) gentoo-dev 2006-09-03 04:24:46 UTC
*** Bug 146113 has been marked as a duplicate of this bug. ***
Comment 28 Jakub Moc (RETIRED) gentoo-dev 2006-09-03 04:25:34 UTC
*** Bug 146115 has been marked as a duplicate of this bug. ***
Comment 29 Jakub Moc (RETIRED) gentoo-dev 2006-09-05 23:17:14 UTC
*** Bug 146506 has been marked as a duplicate of this bug. ***
Comment 30 Fabio Erculiani 2006-10-06 02:11:38 UTC
qemu-user 0.8.2 compiles fine here with GCC 4.1.1.
Please remove pkg_setup()
Comment 31 Fabio Erculiani 2006-10-06 02:24:39 UTC
moreover, kqemu compiles fine with gentoo-sources-2.6.18 (JFYI), qemu-softmmu
does not compile:

/var/tmp/portage/qemu-softmmu-0.8.2-r1/work/qemu-0.8.2/slirp/tftp.c:288:
warning
: pointer targets in passing argument 1 of ‘__builtin_strcmp’
differ in signedne
ss
/var/tmp/portage/qemu-softmmu-0.8.2-r1/work/qemu-0.8.2/slirp/tftp.c:288:
warning
: pointer targets in passing argument 1 of ‘__builtin_strcmp’
differ in signedne
ss
/var/tmp/portage/qemu-softmmu-0.8.2-r1/work/qemu-0.8.2/slirp/tftp.c:288:
warning
: pointer targets in passing argument 1 of ‘__builtin_strcmp’
differ in signedne
ss
/var/tmp/portage/qemu-softmmu-0.8.2-r1/work/qemu-0.8.2/slirp/tftp.c:288:
warning
: pointer targets in passing argument 1 of ‘strncmp’ differ in
signedness
/var/tmp/portage/qemu-softmmu-0.8.2-r1/work/qemu-0.8.2/target-i386/ops_template_
mem.h: In function ‘op_shlb_user_T0_T1_cc’:
../softmmu_header.h:207: error: can't find a register in class
‘GENERAL_REGS’ wh
ile reloading ‘asm’
make[1]: *** [op.o] Error 1
make: *** [subdir-i386-softmmu] Error 2
make: *** Waiting for unfinished jobs....
/var/tmp/portage/qemu-softmmu-0.8.2-r1/work/qemu-0.8.2/target-ppc/translate.c:35
2: warning: pointer targets in initialization differ in signedness
/var/tmp/portage/qemu-softmmu-0.8.2-r1/work/qemu-0.8.2/target-ppc/translate.c:35
5: warning: pointer targets in initialization differ in signedness
/var/tmp/portage/qemu-softmmu-0.8.2-r1/work/qemu-0.8.2/target-ppc/translate.c:42
3: warning: pointer targets in initialization differ in signedness



everything tested on ~x86.
Comment 32 Luca Barbato gentoo-dev 2006-10-06 02:26:22 UTC
using gcc-4?
Comment 33 Mike McQuaid 2006-10-06 02:28:40 UTC
(In reply to comment #30)
> qemu-user 0.8.2 compiles fine here with GCC 4.1.1.
> Please remove pkg_setup()
It compiles fine, or runs fine?

The issue is now not about not compiling, but generating bad code, which results in a segfault every time. Have you tried running it?
Comment 34 Pat Double 2006-10-06 05:13:57 UTC
It compiles and runs fine for me on x86 with the qemu-0.8.0-gcc4-hacks.patch and qemu-0.8.0-gcc4-opts.patch patches applied.
Comment 36 Pat Double 2006-10-06 05:59:45 UTC
Thanks for the link. The biggest issue for me is that it reduces performance, which is a significant issue with emulators. I recompiled with gcc 3 and it "feels" faster, although that could be because of an expectation :) Anyone care to benchmark?
Comment 37 Federico Guglielmo Edoardo Granata 2006-11-10 04:24:23 UTC
qemu-user-0.8.0 don't compile on amd64
still get

In file included from /var/tmp/portage/qemu-user-0.8.0/work/qemu-0.8.0/translate-op.c:36:
./op.h: In function 'dyngen_code':
./op.h:3595: error: expected identifier or '(' before '.' token
./op.h:3597: error: expected expression before '.' token
make[1]: *** [translate-op.o] Error 1
make[1]: Leaving directory `/var/tmp/portage/qemu-user-0.8.0/work/qemu-0.8.0/sparc-user'
make: *** [all] Error 1


# emerge --info
Portage 2.1.1-r1 (default-linux/amd64/2006.1/desktop, gcc-4.1.1, glibc-2.4-r4, 2.6.17-gentoo-r8 x86_64)
=================================================================
System uname: 2.6.17-gentoo-r8 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 4600+
Gentoo Base System version 1.12.6
Last Sync: Fri, 10 Nov 2006 07:00:01 +0000
ccache version 2.3 [enabled]
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: [Not Present]
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.3
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r4
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -fomit-frame-pointer -pipe -march=k8"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -fomit-frame-pointer -pipe -march=k8"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig buildpkg ccache distlocks metadata-transfer parallel-fetch sandbox sfperms strict"
GENTOO_MIRRORS="http://www.die.unipd.it/pub/Linux/distributions/gentoo-sources/ ftp://ftp.unina.it/pub/linux/distributions/gentoo "
LANG="it_IT@euro"
LC_ALL="it_IT@euro"
LINGUAS="it"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 X a52 aac aalib acpi alsa apm bash-completion berkdb bitmap-fonts bzip2 cairo cdr cli cracklib crypt dbus directfb dlloader dri dvb dvb_cards_tda1004x dvd dvdr elibc_glibc encode extrafilters fam fbcon firefox flac gdbm gif gpm gstreamer hal iconv imagemagick input_devices_keyboard input_devices_mouse ipv6 isdnlog jpeg kde kdeenablefinal kdehiddenvisibility kernel_linux libg++ linguas_it lirc lirc_devices_devinput lm_sensors logrotate mad mikmod mp3 mpeg ncurses nforce2 nls nptl nptlonly nvidia offensive ogg opengl pam pcre perl pmu png ppds pppd python qt3 qt4 quicktime readline reflection ruby sdl session spell spl sqlite3 ssl svg tcpd threads tiff truetype truetype-fonts type1-fonts udev unicode userland_GNU v4l v4l2 video_cards_nvidia video_cards_vesa vorbis xml xorg xscreensaver xv xvid zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 38 Peter Read 2006-11-11 13:29:05 UTC
(In reply to comment #37)
> qemu-user-0.8.0 don't compile on amd64

umm, yeah that's right.  upstream issue, see comment 13...
Comment 39 Jakub Moc (RETIRED) gentoo-dev 2006-12-05 22:43:56 UTC
*** Bug 157278 has been marked as a duplicate of this bug. ***
Comment 40 Jakub Moc (RETIRED) gentoo-dev 2006-12-23 13:12:43 UTC
*** Bug 158970 has been marked as a duplicate of this bug. ***
Comment 41 Chris Slycord 2007-01-02 15:15:30 UTC
So if this doesn't work with gcc-4, shouldn't the ebuild depend on gcc-3?

Because as it is, I installed gcc-3 so that I could install this and now gcc-3 isn't depended on by anything so when I run a script that tells me stuff to punt, it mentions gcc-3.
Comment 42 Jory A. Pratt 2007-01-02 15:42:13 UTC
(In reply to comment #41)
> So if this doesn't work with gcc-4, shouldn't the ebuild depend on gcc-3?
> 
> Because as it is, I installed gcc-3 so that I could install this and now gcc-3
> isn't depended on by anything so when I run a script that tells me stuff to
> punt, it mentions gcc-3.
> 

It is only a build time dep hense it can be removed after installing qemu.
Comment 43 Denilson Sá Maia 2007-01-02 16:29:59 UTC
(In reply to comment #42)
> It is only a build time dep hense it can be removed after installing qemu.

Each ebuild does have "DEPEND" and "RDEPEND" variables, meaning compile-time and run-time dependencies. So, it "makes sense" to add gcc-3 to "DEPEND" variable.

Unfortunately, last time I checked, portage treated both variables the same way.
Comment 44 Ryan Hill (RETIRED) gentoo-dev 2007-01-02 17:28:36 UTC
(In reply to comment #41)
> So if this doesn't work with gcc-4, shouldn't the ebuild depend on gcc-3?

No.  As a policy we don't depend on specific versions of gcc.  Right now all we can do is check the gcc version you're building with and die if it's >=4.0, which we already do.  Sorry.

We're trying as best we can to get everything working with GCC 4, but in this case it's out of our hands. =/
Comment 45 Jakub Moc (RETIRED) gentoo-dev 2007-02-08 19:05:17 UTC
*** Bug 165970 has been marked as a duplicate of this bug. ***