media-gfx/xzgv-0.8-r1 does not emerge. complains about PIC register in mmx.h Reproducible: Always Steps to Reproduce: 1.emerge xzgv 2. 3. Actual Results: gcc -march=k6 -O2 -pipe -fomit-frame-pointer -DINTERP_MMX -DBACKEND_IMLIB1 `gtk- config --cflags` -c -o rename.o rename.c gcc -march=k6 -O2 -pipe -fomit-frame-pointer -DINTERP_MMX -DBACKEND_IMLIB1 `gtk- config --cflags` -c -o readmrf.o readmrf.c gcc -march=k6 -O2 -pipe -fomit-frame-pointer -DINTERP_MMX -DBACKEND_IMLIB1 `gtk- config --cflags` -c -o readgif.o readgif.c libmmx-990416/mmx.h: In function `main': libmmx-990416/mmx.h:72: error: PIC register `ebx' clobbered in `asm' make[1]: *** [main.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make[1]: Leaving directory `/var/tmp/portage/xzgv-0.8-r1/work/xzgv-0.8/src' make: *** [xzgv] Error 2 !!! ERROR: media-gfx/xzgv-0.8-r1 failed. !!! Function src_compile, Line 44, Exitcode 2 !!! (no error message) !!! If you need support, post the topmost build error, NOT this status message. Expected Results: install it self? Portage 2.0.51.22-r2 (default-linux/x86/2005.0, gcc-3.4.4, glibc-2.3.5-r1, 2.6. 12-gentoo-r8 i586) ================================================================= System uname: 2.6.12-gentoo-r8 i586 AMD-K6tm w/ multimedia extensions Gentoo Base System version 1.12.0_pre5 ccache version 2.4 [enabled] dev-lang/python: 2.3.5, 2.4.1-r1 sys-apps/sandbox: 1.2.12 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 sys-devel/binutils: 2.15.92.0.2-r10, 2.16.1 sys-devel/libtool: 1.5.18-r1 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i586-pc-linux-gnu" CFLAGS="-march=k6 -mtune=k6 -Os -pipe -fomit-frame-pointer" CHOST="i586-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/ X11/xkb /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/env.d" CXXFLAGS="-march=k6 -mtune=k6 -Os -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig ccache distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://mirror.datapipe.net/gentoo http://mirror.datapipe.net/ gentoo http://gentoo.mirrors.tds.net/gentoo http://gentoo.seren.com/gentoo" LDFLAGS="-Wl,-O1 -Wl,--enable-new-dtags -Wl,--sort-common -s" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.ca.gentoo.org/gentoo-portage" USE="x86 X X509 acl acpi alsa apache2 apm arts authdaemond avi bash-completion berkdb bitmap-fonts bzip2 bzlib ccache chroot cjk cluster crypt ctype curlwrappers dba dio eds emboss encode erandom exif extensions fbcon font-server foomaticdb fortran ftp gdbm gif gmp gpm gstreamer gtk gtk2 hardened imagemagick imap imlib innodb ipv6 javamail jpeg kerberos libg++ libwww mad maildir memlimit mhash mikmod mmx motif mp3 mpeg mpi multislot nagios-dns nagios-ntp nagios-ping nagios-ssh ncurses neural nis nls nptl nptlonly objc ogg oggvorbis opengl oss pam pcntl pcre pdflib perl pg-hier pg-intdatetime pg-vacuumdelay php pic png posix procmail python qt quicktime readline samba sasl sdl sendfile session sftplogging shaper shared sharedext sharedmem simplexml sockets softquota spell ssl svga sysvipc szip tcpd tiff truetype truetype-fonts type1-fonts unicode vda vhosts virtual-users virus-scan vorbis wddx xml xml2 xmlrpc xmms xsl xv zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LINGUAS, PORTDIR_OVERLAY
This looks rather similar to http://bugs.gentoo.org/show_bug.cgi?id=101627
the first thing i tried was USE="-pic" and then no ldflags and less cflags.
(In reply to comment #2) > the first thing i tried was USE="-pic" and then no ldflags and less cflags. as Spanky said, don't mess with the use flags/cflags/ldflags, that had been an error on my part.
(In reply to comment #2) > the first thing i tried was USE="-pic" and then no ldflags and less cflags. what are you talking about? xzgv doesn't have a pic USE flag...
due to no response, marking this WORKSFORME
Mhmm, I stumbled over the same issue on my system (xzgv-0.8-r1 and xzgv-0.8-r2): gcc -mtune=athlon-xp -march=athlon-xp -O2 -pipe -Wall -DINTERP_MMX -DBACKEND_IMLIB1 `gtk-config --cflags` -c -o main.o main.c main.c: In function `do_logo_invert': main.c:4590: warning: operation on `ptr' may be undefined libmmx-990416/mmx.h: In function `main': libmmx-990416/mmx.h:72: error: PIC register `ebx' clobbered in `asm' make[1]: *** [main.o] Error 1 make[1]: Leaving directory `/var/tmp/portage/xzgv-0.8-r2/work/xzgv-0.8/src' make: *** [xzgv] Error 2 I just use the hardened profile (see below), without any special CFLAGS/LDFLAGS. Compilation succeeds upon switching to i686-pc-linux-gnu-3.4.5-vanilla or i686-pc-linux-gnu-3.4.5-hardenednopie as you would expect. Maybe would be a good idea to cc: hardened? Actually I would be happy to the bug reopened (and solved if possible). ;-) As it was just bumped for security reasons, a GLSA is soon to come and probably some hardened users might have the same issue there may be some dupes if the bug remains 'resolved'. # emerge --info Portage 2.1_pre7-r5 (hardened/x86/2.6, gcc-3.4.5-hardenednopie, glibc-2.3.5-r3, 2.6.14-hardened-r3 i686) ================================================================= System uname: 2.6.14-hardened-r3 i686 AMD Athlon(tm) XP Gentoo Base System version 1.6.14 distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] dev-lang/python: 2.4.2 sys-apps/sandbox: 1.2.12 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-r1 sys-devel/binutils: 2.16.1 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-mtune=athlon-xp -march=athlon-xp -O2 -pipe -Wall" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/eselect/compiler /etc/gconf /etc/postfix/sample /etc/revdep-rebuild /etc/terminfo /etc/env.d" CXXFLAGS="-mtune=athlon-xp -march=athlon-xp -O2 -pipe -Wall" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig collision-protect distlocks metadata-transfer parallel-fetch sandbox sfperms strict test" GENTOO_MIRRORS="http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror" LINGUAS="de" PKGDIR="/usr/portage//packages/x86/" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage/" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://linux.rz.ruhr-uni-bochum.de/gentoo-portage" USE="3dnow 3dnowext a52 acpi alsa ash-completion berkdb bitmap-fonts cdparanoia crypt dga dlloader dri dv dvd dvdr dvdread encode font-server glx gtk2 hardened imap isdnlog jabber live lzo matrox mbox mime mjpeg mmx mmxext mozcalendar mozsvg mp3 mpeg mplayer network nls nodrm nptl nsplugin offensive opengl pam pam_timestamp pic quicktime readline real sftplogging sse ssl tcpd theora truetype-fonts type1 type1-fonts userlocales v4l v4l2 win32codecs x86 xv xvmc zlib elibc_glibc kernel_linux linguas_de userland_GNU video_cards_mga" Unset: ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, MAKEOPTS
repoening now. seems to be a problem only for hardened toolchain.
I can confirm this bug using hardened.
Commenting out the CFLAGS+=-DINTERP_MMX of course lets this pkg compile. The logic used in the ebuild is incorrect also. It assumes that any x86 cpu is mmx aware. --- xzgv-0.8-r2.ebuild 2006-04-10 14:36:21.000000000 +0000 +++ xzgv-0.8-r3.ebuild 2006-04-21 08:29:19.000000000 +0000 @@ -11,7 +11,7 @@ LICENSE="GPL-2" SLOT="0" KEYWORDS="alpha amd64 ~hppa ia64 ppc ~ppc64 sparc x86" -IUSE="" +IUSE="mmx" DEPEND="media-libs/libpng media-libs/jpeg @@ -26,7 +26,7 @@ cd ${S} cp config.mk config.mk.orig sed -i -e "s:-O2 -Wall:${CFLAGS}:" config.mk - + use mmx || sed -i -e "s:-DINTERP_MMX::" config.mk case "${ARCH}" in "x86") ;;
Taking into account, that the last release from upstream was done in september 2003 it seems unlikely, that the author will actually fix his code in a way compatible to mmx and PIE (if it is even possible). Or does anybody know if it still maintained by the author? I also assume neither maintainer nor hardened team have time and motivation for that. Therefore following solar's suggestion seems the best solution to me. Maybe the ebuild may additionally warn not to use "mmx" on a hardened system/PIE-enabled gcc?
upstream is indeed dead afaict
Created attachment 85423 [details, diff] Makes xzgv compatible with the gentoo hardened profile (ie: PIC)
Comment on attachment 85423 [details, diff] Makes xzgv compatible with the gentoo hardened profile (ie: PIC) This is actually a problem in libmmx, which hasn't been updated since 1999 it would appear. The site that it was originally hosted on is no longer up. Fortunatelly the code is distributed with xzgv, so it's an easy patch. I added this patch to a local ebuild and re-emerged and it compiles fine with the hardened profile. Hope that helps.
Sounds great. I also put it into my local ebuild. ;-) Nonetheless Solars patch should be added too, for being able to disable mmx by USE flag if one doesn't want to use it or the CPU does not support it.
no more xzgv, but I'm open for gtk+-2.0 alternatives we don't have yet.