--- /usr/portage/app-emulation/qemu-softmmu/qemu-softmmu-0.9.1-r1.ebuild 2008-03-09 18:35:31.000000000 +0300 +++ qemu-softmmu-0.9.1-r1.ebuild 2008-03-19 13:04:02.000000000 +0300 @@ -29,7 +29,7 @@ gnutls? ( net-libs/gnutls ) alsa? ( media-libs/alsa-lib )" -S="${WORKDIR}/${P/-softmmu/}" +S=${WORKDIR}/${P/-softmmu/} pkg_setup() { if [ "$(gcc-major-version)" == "4" ]; then @@ -61,8 +61,26 @@ } src_compile() { - #Let the application set its cflags - unset CFLAGS + if use x86 ; then + # Force -march=pentium-mmx or lower. Fixes bug #212351. + local march + march=$(echo "${CFLAGS}" | sed 's:^.*-march=\([[:alnum:]-]\+\)\([[:blank:]].*\)\?$:\1:p;d') + case ${march} in + i386|i486|i586|pentium) ;; + *) # Either march is not enough low or not exists at all + case ${CHOST} in + i486-*-*) march=i486 ;; + i586-*-*) march=i586 ;; + *) march=pentium-mmx ;; + esac ;; + esac + #Let the application set its cflags + unset CFLAGS + append-flags -march=${march} + else + #Let the application set its cflags + unset CFLAGS + fi # Switch off hardened tech filter-flags -fpie -fstack-protector @@ -80,6 +98,7 @@ if ! use sdl ; then myconf="$myconf --disable-sdl --disable-gfx-check" fi + # econf does not work ./configure \ --prefix=/usr \ --enable-adlib \ @@ -90,11 +109,11 @@ ${myconf} \ || die "could not configure" - emake || die "make failed" + emake OS_CFLAGS="${CFLAGS}" || die "make failed" } src_install() { - make install \ + emake install \ prefix="${D}/usr" \ bindir="${D}/usr/bin" \ datadir="${D}/usr/share/qemu" \