Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 166392 - app-emulation/qemu-{softmmu,user}-0.9.0 do not compile with hardened gcc
Summary: app-emulation/qemu-{softmmu,user}-0.9.0 do not compile with hardened gcc
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Luca Barbato
URL:
Whiteboard:
Keywords:
: 177837 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-02-11 18:58 UTC by Robert A.
Modified: 2009-03-07 15:45 UTC (History)
5 users (show)

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


Attachments
qemu-0.9.0-nopiessp.patch (qemu-solar.patch,389 bytes, patch)
2007-02-11 20:44 UTC, solar (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robert A. 2007-02-11 18:58:34 UTC
qemu-softmmu-0.9.0 and qemu-user-0.9.0 do not compile with a hardened gcc.
iirc it didnt work with previous versions either, but i used cvs versions the last months.

switching to a non hardend gcc works (in my case: from i686-pc-linux-gnu-3.4.6 to i686-pc-linux-gnu-3.4.6-vanilla). This behaviours is listed in qemu´s faq[0] but maybe someone can fix the ebuild.

[0] http://www.kidsquid.com/cgi-bin/moin.cgi/FrequentlyAskedQuestions

Reproducible: Always

Steps to Reproduce:
1. use a hardened gcc
2. emerge app-emulation/qemu-softmmu app-emulation/qemu-user

Actual Results:  
qemu-softmmmu:
i686-pc-linux-gnu-gcc -nopie -fno-stack-protector -Wall -O2 -g -fno-strict-aliasing -I. -I.. -I/tmp/portage/qemu-softmmu-0.9.0/work/qemu-0.9.0/target-mips -I/tmp/portage/qemu-softmmu-0.9.0/work/qemu-0.9.0 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/tmp/portage/qemu-softmmu-0.9.0/work/qemu-0.9.0/fpu -I/tmp/portage/qemu-softmmu-0.9.0/work/qemu-0.9.0/slirp  -c -o slirp/sbuf.o /tmp/portage/qemu-softmmu-0.9.0/work/qemu-0.9.0/slirp/sbuf.c
../dyngen -o op.h op.o
dyngen: unsupported i386 relocation (10)
make[1]: *** [op.h] Error 1
make[1]: Leaving directory `/tmp/portage/qemu-softmmu-0.9.0/work/qemu-0.9.0/sparc-softmmu'
make: *** [subdir-sparc-softmmu] Error 2

qemu-user:
gcc -nopie -fno-stack-protector -Wall -O2 -g -fno-strict-aliasing -I. -I.. -I/tmp/portage/app-emulation/qemu-user-0.9.0/work/qemu-0.9.0/target-sparc -I/tmp/portage/app-emulation/qemu-user-0.9.0/work/qemu-0.9.0 -I/tmp/portage/app-emulation/qemu-user-0.9.0/work/qemu-0.9.0/linux-user -I/tmp/portage/app-emulation/qemu-user-0.9.0/work/qemu-0.9.0/linux-user/sparc -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/tmp/portage/app-emulation/qemu-user-0.9.0/work/qemu-0.9.0/fpu -I/tmp/portage/app-emulation/qemu-user-0.9.0/work/qemu-0.9.0/slirp  -c -o gdbstub.o /tmp/portage/app-emulation/qemu-user-0.9.0/work/qemu-0.9.0/gdbstub.c
../dyngen -o op.h op.o
dyngen: unsupported i386 relocation (10)
make[1]: *** [op.h] Error 1

Expected Results:  
compile should finish cleanly or an error message should be printed before starting the compilation

emerge --info:
Portage 2.1.2-r9 (hardened/x86/2.6, gcc-3.4.6, glibc-2.3.6-r5, 2.6.16-ra i686)
=================================================================
System uname: 2.6.16-ra i686 Intel(R) Pentium(R) III CPU family      1266MHz
Gentoo Base System release 1.12.6
Timestamp of tree: Sun, 11 Feb 2007 01:47:01 +0000
dev-java/java-config: 1.3.7, 2.0.31
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
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, 1.10
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=pentium3 -O2 -pipe -fomit-frame-pointer"
CHOST="i686-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/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-march=pentium3 -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig buildpkg collision-protect distlocks metadata-transfer parallel-fetch prelink sandbox sfperms strict userpriv usersandbox"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LDFLAGS="-Wl,-O1,--as-needed"
MAKEOPTS="-j6"
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="X aac alsa arts bash-completion bzip2 crypt cups dlloader encode flac gpm hal hardened idn kde kdeenablefinal mad midi mmx mp3 nptl ogg opengl pam pic readline sdl sse ssl threads truetype unicode vorbis x86 xorg zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="mouse keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="nv vesa fbdev"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 solar (RETIRED) gentoo-dev 2007-02-11 20:44:22 UTC
Created attachment 109894 [details, diff]
qemu-0.9.0-nopiessp.patch

This could be done via a sed statement also. It just forces ssp and pie to 
be disabled everywhere. The op.c was not inheriting the cflags fully 
when it was built.
Comment 2 Kevin F. Quinn (RETIRED) gentoo-dev 2007-02-15 10:44:15 UTC
I'm tempted to alter flag-o-matic to set GCC_SPECS when filtering hardened stuff.  Then filter-flags on the hardened flags would work regardless whether the build passes through CFLAGS everywhere or not.  See

http://overlays.gentoo.org/dev/kevquinn/browser/hardened/toolchain/branches/pieworld/eclass/flag-o-matic.eclass

for what I'm currently using.  This means we would only require ebuilds to do 'filter-flags', and they wouldn't have to muck around in their makefiles just for us.
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2007-05-09 17:40:51 UTC
*** Bug 177837 has been marked as a duplicate of this bug. ***
Comment 4 RonnyPeine 2007-05-18 08:53:54 UTC
solar's small bugfix is working very well here. Can someone please consider this fix for integration in the official ebuild as a good solution for now? This would be better than waiting until the specmangling is done.

Comment 5 solar (RETIRED) gentoo-dev 2007-05-18 14:18:26 UTC
(In reply to comment #2)
> I'm tempted to alter flag-o-matic to set GCC_SPECS when filtering hardened
> stuff.  

I think that would break cross compiles.
Comment 6 Kevin F. Quinn (RETIRED) gentoo-dev 2007-05-18 16:35:54 UTC
(In reply to comment #5)
> (In reply to comment #2)
> > I'm tempted to alter flag-o-matic to set GCC_SPECS when filtering hardened
> > stuff.  
> 
> I think that would break cross compiles.

What I currently have in my overlay for flag-o-matic checks for the existence of the spec file before adding it to GCC_SPECS - currently it 'die's when the spec doesn't exist, perhaps that would be better as a warning.
Comment 7 Luca Barbato gentoo-dev 2009-03-07 15:45:15 UTC
I used the same code used for kvm so now qemu-0.10 should work fine.