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
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.
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.
*** Bug 177837 has been marked as a duplicate of this bug. ***
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.
(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.
(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.
I used the same code used for kvm so now qemu-0.10 should work fine.