Gentoo Forums
Gentoo Forums
Quick Search: in
Can't emerge qemu [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
mike934
n00b
n00b


Joined: 25 Aug 2007
Posts: 15
Location: Moscow, Russia

PostPosted: Sat Aug 25, 2007 2:54 pm    Post subject: Can't emerge qemu [SOLVED] Reply with quote

I want to install qemu but emerging it results in errors:
Code:
gcc -O2 -Wall -O2 -g -fno-strict-aliasing -fomit-frame-pointer -I. -I/var/tmp/portage/app-emulation/qemu-user-0.8.0/work/qemu-0.8.0/target-arm -I/var/tmp/portage/app-emulation/qemu-user-0.8.0/work/qemu-0.8.0 -I/var/tmp/portage/app-emulation/qemu-user-0.8.0/work/qemu-0.8.0/linux-user -I/var/tmp/portage/app-emulation/qemu-user-0.8.0/work/qemu-0.8.0/linux-user/arm -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/var/tmp/portage/app-emulation/qemu-user-0.8.0/work/qemu-0.8.0/fpu -I/var/tmp/portage/app-emulation/qemu-user-0.8.0/work/qemu-0.8.0/slirp -c -o mmap.o /var/tmp/portage/app-emulation/qemu-user-0.8.0/work/qemu-0.8.0/linux-user/mmap.c
/var/tmp/portage/app-emulation/qemu-user-0.8.0/work/qemu-0.8.0/linux-user/syscall.c:215: error: syntax error before "gettid"
/var/tmp/portage/app-emulation/qemu-user-0.8.0/work/qemu-0.8.0/linux-user/syscall.c:221: error: syntax error before "sys_uname"
/var/tmp/portage/app-emulation/qemu-user-0.8.0/work/qemu-0.8.0/linux-user/syscall.c:222: error: syntax error before "sys_getcwd1"
/var/tmp/portage/app-emulation/qemu-user-0.8.0/work/qemu-0.8.0/linux-user/syscall.c:223: error: syntax error before "sys_getdents"
[...]
make[1]: *** [syscall.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory `/var/tmp/portage/app-emulation/qemu-user-0.8.0/work/qemu-0.8.0/arm-user'
make: *** [all] Error 1

!!! ERROR: app-emulation/qemu-user-0.8.0 failed.
Call stack:
  ebuild.sh, line 1638:   Called dyn_compile
  ebuild.sh, line 985:   Called qa_call 'src_compile'
  ebuild.sh, line 44:   Called src_compile
  qemu-user-0.8.0.ebuild, line 73:   Called die

That is what gcc-config says:
Code:
mike@miked1 / $ gcc-config -l
 [1] i686-pc-linux-gnu-3.3.6 *
 [2] i686-pc-linux-gnu-3.4.6
 [3] i686-pc-linux-gnu-3.4.6-hardened
 [4] i686-pc-linux-gnu-3.4.6-hardenednopie
 [5] i686-pc-linux-gnu-3.4.6-hardenednopiessp
 [6] i686-pc-linux-gnu-3.4.6-hardenednossp
 [7] i686-pc-linux-gnu-4.1.2
 [8] i686-pc-linux-gnu-4.2.0

package.mask
Code:
>=app-emulation/qemu-0.8.1
>=app-emulation/qemu-user-0.8.1
>=app-emulation/qemu-softmmu-0.8.1

And I have set
Code:
CFLAGS="-O2 -mtune=pentium4 -pipe"

in /etc/make.conf instead of
Code:
CFLAGS="-O2 -march=nocona -pipe"


What should I do to emerge qemu?


Last edited by mike934 on Sat Aug 25, 2007 7:38 pm; edited 1 time in total
Back to top
View user's profile Send private message
didymos
Advocate
Advocate


Joined: 10 Oct 2005
Posts: 4798
Location: California

PostPosted: Sat Aug 25, 2007 3:44 pm    Post subject: Reply with quote

Maybe try using a gcc that's not quite so old?
_________________
Thomas S. Howard
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 8657
Location: beyond the rim

PostPosted: Sat Aug 25, 2007 4:02 pm    Post subject: Reply with quote

didymos wrote:
Maybe try using a gcc that's not quite so old?

and/or testing with qemu-0.9.0
Back to top
View user's profile Send private message
mike934
n00b
n00b


Joined: 25 Aug 2007
Posts: 15
Location: Moscow, Russia

PostPosted: Sat Aug 25, 2007 4:36 pm    Post subject: Reply with quote

Genone wrote:
didymos wrote:
Maybe try using a gcc that's not quite so old?

and/or testing with qemu-0.9.0
With gcc-3.4.6 and qemu-0.8.0 it is the same. With gcc-3.4.6 and qemu-0.9.0 the error is different:
Code:
i686-pc-linux-gnu-gcc -Wall -O2 -g -fno-strict-aliasing -I. -I.. -I/var/tmp/portage/app-emulation/qemu-softmmu-0.9.0/work/qemu-0.9.0/target-i386 -I/var/tmp/portage/app-emulation/qemu-softmmu-0.9.0/work/qemu-0.9.0 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/var/tmp/portage/app-emulation/qemu-softmmu-0.9.0/work/qemu-0.9.0/fpu -DHAS_AUDIO -I/var/tmp/portage/app-emulation/qemu-softmmu-0.9.0/work/qemu-0.9.0/slirp  -c -o i386-dis.o /var/tmp/portage/app-emulation/qemu-softmmu-0.9.0/work/qemu-0.9.0/i386-dis.c
../softmmu_template.h: In function `__stq_mmu':
../softmmu_template.h:260: error: unable to find a register to spill in class `GENERAL_REGS'
../softmmu_template.h:260: error: this is the insn:
(insn:HI 365 364 366 13 ../softmmu_template.h:290 (parallel [
            (set (reg:DI 0 ax [216])
                (lshiftrt:DI (reg/v:DI 59 [ val ])
                    (subreg:QI (reg:SI 0 ax [215]) 0)))
            (clobber (scratch:SI))
            (clobber (reg:CC 17 flags))
        ]) 309 {lshrdi3_1} (insn_list 364 (nil))
    (expr_list:REG_DEAD (reg:SI 0 ax [215])
        (expr_list:REG_UNUSED (reg:CC 17 flags)
            (expr_list:REG_UNUSED (scratch:SI)
                (nil)))))
[...]
!!! ERROR: app-emulation/qemu-softmmu-0.9.0 failed.
Call stack:
  ebuild.sh, line 1638:   Called dyn_compile
  ebuild.sh, line 985:   Called qa_call 'src_compile'
  ebuild.sh, line 44:   Called src_compile
  qemu-softmmu-0.9.0.ebuild, line 96:   Called die

Are there any other options?
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 8657
Location: beyond the rim

PostPosted: Sat Aug 25, 2007 4:56 pm    Post subject: Reply with quote

According to Google that error is usually caused by building qemu with gcc-4, so might be worth checking `gcc --version` to make sure that gcc-3 is really selected. On one wiki there was also the suggestion to not use any CFLAGS to avoid that error.
Back to top
View user's profile Send private message
drwook
Veteran
Veteran


Joined: 30 Mar 2005
Posts: 1313
Location: London

PostPosted: Sat Aug 25, 2007 5:32 pm    Post subject: Reply with quote

did you source /etc/profile after changing compiler?
Back to top
View user's profile Send private message
mike934
n00b
n00b


Joined: 25 Aug 2007
Posts: 15
Location: Moscow, Russia

PostPosted: Sat Aug 25, 2007 5:51 pm    Post subject: Reply with quote

Genone wrote:
According to Google that error is usually caused by building qemu with gcc-4, so might be worth checking `gcc --version` to make sure that gcc-3 is really selected. On one wiki there was also the suggestion to not use any CFLAGS to avoid that error.

Here is my gcc at the moment
Code:
gcc (GCC) 3.4.6 (Gentoo 3.4.6-r2 p1.5, ssp-3.4.6-1.0, pie-8.7.10)
I commented CFLAGS out but unfortunately it did not help.
Back to top
View user's profile Send private message
mike934
n00b
n00b


Joined: 25 Aug 2007
Posts: 15
Location: Moscow, Russia

PostPosted: Sat Aug 25, 2007 5:52 pm    Post subject: Reply with quote

drwook wrote:
did you source /etc/profile after changing compiler?
Yes, sure.
Back to top
View user's profile Send private message
saboya
Tux's lil' helper
Tux's lil' helper


Joined: 28 Nov 2006
Posts: 148
Location: Brazil

PostPosted: Sat Aug 25, 2007 6:45 pm    Post subject: Reply with quote

The error you experienced using gcc-3.4.6 I did too, I switched to 3.3.6 and it worked, which means the problem is probably in your setup.
Back to top
View user's profile Send private message
mike934
n00b
n00b


Joined: 25 Aug 2007
Posts: 15
Location: Moscow, Russia

PostPosted: Sat Aug 25, 2007 7:00 pm    Post subject: Reply with quote

saboya wrote:
The error you experienced using gcc-3.4.6 I did too, I switched to 3.3.6 and it worked, which means the problem is probably in your setup.
As one could see in my first message I had already tried gcc-3.3.6. Yes, I understand that something is wrong in my setup. Could you please give me a hint what it could be?
Back to top
View user's profile Send private message
mike934
n00b
n00b


Joined: 25 Aug 2007
Posts: 15
Location: Moscow, Russia

PostPosted: Sat Aug 25, 2007 7:37 pm    Post subject: Can't emerge qemu [SOLVED] Reply with quote

mike934 wrote:
Genone wrote:
According to Google that error is usually caused by building qemu with gcc-4, so might be worth checking `gcc --version` to make sure that gcc-3 is really selected. On one wiki there was also the suggestion to not use any CFLAGS to avoid that error.

I commented CFLAGS out but unfortunately it did not help.
emerge --info helped me to see that I had to set CFLAGS="" instead of commenting the line out. After that I managed to emerge qemu with gcc-3.3.6 and qemu-0.9.0.

Thanks to all who replied to my post, especially to Genone!
Back to top
View user's profile Send private message
mightymephisto
n00b
n00b


Joined: 19 Dec 2005
Posts: 9

PostPosted: Thu Oct 18, 2007 10:03 pm    Post subject: Reply with quote

I know this is marked as solved, but I have managed to get qemu to compile with gcc4 with the thanks of this patch

http://www.kju-app.org/proj/browser/trunk/patches/qemu-0.9.0-gcc4.patch?format=txt
  • Copied /usr/portage/app-emulation/qemu-softmmu into my portage overlay
  • Downloaded patch into files directory
  • Added epatch "${FILESDIR}"/qemu-0.9.0-gcc4.patch after the cd ${S} in the ebuild src_unpack
  • Comment out all of pkg_setup
Back to top
View user's profile Send private message
drwook
Veteran
Veteran


Joined: 30 Mar 2005
Posts: 1313
Location: London

PostPosted: Sat Oct 20, 2007 2:18 pm    Post subject: Reply with quote

mightymephisto wrote:
I know this is marked as solved, but I have managed to get qemu to compile with gcc4 with the thanks of this patch

http://www.kju-app.org/proj/browser/trunk/patches/qemu-0.9.0-gcc4.patch?format=txt
  • Copied /usr/portage/app-emulation/qemu-softmmu into my portage overlay
  • Downloaded patch into files directory
  • Added epatch "${FILESDIR}"/qemu-0.9.0-gcc4.patch after the cd ${S} in the ebuild src_unpack
  • Comment out all of pkg_setup


Do we know if this patch has been pushed upstream?

Anyone opened a bug to have it included in the portage tree? (esp. if it's being blocked upstream without good reason?)
Back to top
View user's profile Send private message
ecks
n00b
n00b


Joined: 27 Feb 2007
Posts: 64

PostPosted: Sat Oct 20, 2007 11:06 pm    Post subject: Reply with quote

I tried the patch and unfortunately it failed to build for me. What version of gcc did you use? I have gcc-4.1.2, maybe it worked under gcc-4.2.2. I have my build.log at http://www.pastebin.ca/743966.
Back to top
View user's profile Send private message
mightymephisto
n00b
n00b


Joined: 19 Dec 2005
Posts: 9

PostPosted: Mon Oct 22, 2007 2:35 pm    Post subject: Reply with quote

Yes it was under gcc 4.2.2
Back to top
View user's profile Send private message
xPosiMattx
n00b
n00b


Joined: 13 Jul 2004
Posts: 9

PostPosted: Sun Dec 30, 2007 7:49 am    Post subject: Reply with quote

Has anyone had any luck with this recently? It seems that gcc 3.3.6 is masked to use no keywords at this point due to compilation problems / changes in bison, etc. Using i686-pc-linux-gnu-3.4.6, `CFLAGS="" emerge -av qemu` exits with:

Code:

i686-pc-linux-gnu-gcc -Wall -O2 -g -fno-strict-aliasing -I. -I.. -I/var/tmp/portage/app-emulation/qemu-softmmu-0.9.0-r1/work/qemu-0.9.0/target-i386 -I/var/tmp/portage/app-emulation/qemu-softmmu-0.9.0-r1/work/qemu-0.9.0 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/var/tmp/portage/app-emulation/qemu-softmmu-0.9.0-r1/work/qemu-0.9.0/fpu -DHAS_AUDIO -I/var/tmp/portage/app-emulation/qemu-softmmu-0.9.0-r1/work/qemu-0.9.0/slirp  -c -o i8254.o /var/tmp/portage/app-emulation/qemu-softmmu-0.9.0-r1/work/qemu-0.9.0/hw/i8254.c
../softmmu_template.h: In function `__stq_mmu':
../softmmu_template.h:260: error: unable to find a register to spill in class `GENERAL_REGS'
../softmmu_template.h:260: error: this is the insn:
(insn:HI 337 317 338 13 ../softmmu_template.h:287 (parallel [
            (set (reg:DI 0 ax [214])
                (lshiftrt:DI (reg/v:DI 59 [ val ])
                    (subreg:QI (reg:SI 235) 0)))
            (clobber (scratch:SI))
            (clobber (reg:CC 17 flags))
        ]) 309 {lshrdi3_1} (nil)
    (expr_list:REG_UNUSED (reg:CC 17 flags)
        (expr_list:REG_UNUSED (scratch:SI)
            (nil))))
../softmmu_template.h:260: confused by earlier errors, bailing out
make[1]: *** [op_helper.o] Error 1
make[1]: Leaving directory `/var/tmp/portage/app-emulation/qemu-softmmu-0.9.0-r1/work/qemu-0.9.0/sparc-softmmu'
make: *** [subdir-sparc-softmmu] Error 2
make: *** Waiting for unfinished jobs....


<----- SNIP ----->

ar rcs libqemu.a exec.o kqemu.o translate-op.o translate-all.o cpu-exec.o translate.o op.o  fpu/softfloat-native.o helper.o helper2.o disas.o  i386-dis.o
i686-pc-linux-gnu-gcc  -o qemu-system-x86_64 vl.o osdep.o readline.o monitor.o pci.o console.o loader.o isa_mmio.o cutils.o block.o block-raw.o block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o block-dmg.o block-bochs.o block-vpc.o block-vvfat.o block-qcow2.o scsi-disk.o cdrom.o lsi53c895a.o usb.o usb-hub.o usb-linux.o usb-hid.o usb-ohci.o usb-msd.o ne2000.o rtl8139.o pcnet.o ide.o pckbd.o ps2.o vga.o sb16.o es1370.o fmopl.o adlib.o dma.o audio.o noaudio.o wavaudio.o sdlaudio.o ossaudio.o alsaaudio.o wavcapture.o fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o cirrus_vga.o mixeng.o apic.o parallel.o acpi.o piix_pci.o usb-uhci.o smbus_eeprom.o gdbstub.o sdl.o x_keymap.o vnc.o slirp/cksum.o slirp/if.o slirp/ip_icmp.o slirp/ip_input.o slirp/ip_output.o slirp/slirp.o slirp/mbuf.o slirp/misc.o slirp/sbuf.o slirp/socket.o slirp/tcp_input.o slirp/tcp_output.o slirp/tcp_subr.o slirp/tcp_timer.o slirp/udp.o slirp/bootp.o slirp/debug.o slirp/tftp.o libqemu.a  -lm -lz -lasound -lSDL -lpthread  -lutil -lrt
make[1]: Leaving directory `/var/tmp/portage/app-emulation/qemu-softmmu-0.9.0-r1/work/qemu-0.9.0/x86_64-softmmu'
 *
 * ERROR: app-emulation/qemu-softmmu-0.9.0-r1 failed.
 * Call stack:
 *                      ebuild.sh, line 1701:  Called dyn_compile
 *                      ebuild.sh, line 1039:  Called qa_call 'src_compile'
 *                      ebuild.sh, line   44:  Called src_compile
 *   qemu-softmmu-0.9.0-r1.ebuild, line   99:  Called die
 * The specific snippet of code:
 *      emake || die "make failed"
 *  The die message:
 *   make failed
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/app-emulation/qemu-softmmu-0.9.0-r1/temp/build.log'.
 *


I also tried to compile it with a modified ebuild file to only use TARGET_LIST="mips-softmmu", since I'm primarily concerned with emulating a MIPS machine and got the same error.

I'm not really sure where the x86_64 is coming from since I'm on a 32-bit Core2Duo with the following make.conf settings:
Code:
CFLAGS="-O2 -march=prescott -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"


Code:
# gcc-config -l
 [1] i686-pc-linux-gnu-3.4.6 *
 [2] i686-pc-linux-gnu-3.4.6-hardened
 [3] i686-pc-linux-gnu-3.4.6-hardenednopie
 [4] i686-pc-linux-gnu-3.4.6-hardenednopiessp
 [5] i686-pc-linux-gnu-3.4.6-hardenednossp
 [6] i686-pc-linux-gnu-4.1.2

Any help or suggestions would be greatly appreciated!
Back to top
View user's profile Send private message
Maf
Apprentice
Apprentice


Joined: 15 May 2005
Posts: 277
Location: Szczecin, Poland

PostPosted: Thu Jan 03, 2008 1:52 am    Post subject: Reply with quote

Guys, it this really so hard to fix this shitty qemu package to work correctly with gcc4? Did anyone looked at the source?
_________________
got gentoo?
Back to top
View user's profile Send private message
xPosiMattx
n00b
n00b


Joined: 13 Jul 2004
Posts: 9

PostPosted: Thu Jan 03, 2008 5:47 am    Post subject: Reply with quote

I found a patch to compile qemu-0.8.0 with gcc4 at http://gwenole.beauchesne.info/projects/qemu/. I updated this to apply cleanly with the patches already in portage against 0.8.2 and made ebuilds for all of this. With this setup I got qemu-0.8.2 to compile with gcc-4.1.2. You can get all of these files at http://mattfarmer.net/blog/wp-content/uploads/2008/01/qemu-082-gentoo-ebuild-files-and-gcc4-patch.tgz (with a few more details at http://mattfarmer.net/projects/qemu/).
Back to top
View user's profile Send private message
Maf
Apprentice
Apprentice


Joined: 15 May 2005
Posts: 277
Location: Szczecin, Poland

PostPosted: Thu Jan 03, 2008 7:17 pm    Post subject: Reply with quote

xPosiMattx wrote:
You can get all of these files at http://mattfarmer.net/blog/wp-content/uploads/2008/01/qemu-082-gentoo-ebuild-files-and-gcc4-patch.tgz

This link seems to be broken, please fix it ;)
_________________
got gentoo?
Back to top
View user's profile Send private message
xPosiMattx
n00b
n00b


Joined: 13 Jul 2004
Posts: 9

PostPosted: Thu Jan 03, 2008 7:38 pm    Post subject: Reply with quote

Maf wrote:
xPosiMattx wrote:
You can get all of these files at http://mattfarmer.net/blog/wp-content/uploads/2008/01/qemu-082-gentoo-ebuild-files-and-gcc4-patch.tgz

This link seems to be broken, please fix it ;)

Sorry about that, the file got moved out of the way in a wordpress update. Previous link should work now. Critiques welcome on any of those files.
Back to top
View user's profile Send private message
saber850
Tux's lil' helper
Tux's lil' helper


Joined: 21 Mar 2004
Posts: 103

PostPosted: Sat Jan 05, 2008 11:42 am    Post subject: Reply with quote

Yes, I'm also hitting this problem w/ gcc-3.4.
I had to unmask gcc-3.3 just to compile it.

Seems a bit disappointing that qemu builds w/ gcc 3.3 but not 3.4. And I agree w/ Maf regarding 4.0 support.

Otherwise QEMU is awesome!
Back to top
View user's profile Send private message
Maf
Apprentice
Apprentice


Joined: 15 May 2005
Posts: 277
Location: Szczecin, Poland

PostPosted: Sat Jan 05, 2008 12:13 pm    Post subject: Reply with quote

saber850 wrote:
Otherwise QEMU is awesome!

No, but it would be if it worked correctly with latest gcc ;)
_________________
got gentoo?
Back to top
View user's profile Send private message
My_World
Guru
Guru


Joined: 01 Sep 2003
Posts: 339
Location: Kalahari Desert

PostPosted: Sun Jan 13, 2008 8:27 pm    Post subject: Reply with quote

xPosiMattx wrote:
I found a patch to compile qemu-0.8.0 with gcc4 at http://gwenole.beauchesne.info/projects/qemu/. I updated this to apply cleanly with the patches already in portage against 0.8.2 and made ebuilds for all of this. With this setup I got qemu-0.8.2 to compile with gcc-4.1.2. You can get all of these files at http://mattfarmer.net/blog/wp-content/uploads/2008/01/qemu-082-gentoo-ebuild-files-and-gcc4-patch.tgz (with a few more details at http://mattfarmer.net/projects/qemu/).

Love the package you put together, thanks for the effort!
:D
_________________
"Ubuntu" - an African word meaning "Gentoo is too hard for me".
Back to top
View user's profile Send private message
saber850
Tux's lil' helper
Tux's lil' helper


Joined: 21 Mar 2004
Posts: 103

PostPosted: Sun Jan 13, 2008 9:29 pm    Post subject: Reply with quote

FWIW, I came across a couple sites which noted that there were instances of qemu compiling w/ gcc4, but not necessarily running (correctly).
I'd post URLs, but it was too long ago (couple months).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum