When I compile with the -fPIC flag it errors on compiling the cpu_accel.c file. The output is below. When I compile with-out the -fPIC flag it compiled fine. Reproducible: Always Steps to Reproduce: 1. Put -fPIC in cflags and compile 2. Compile fails 3. Change ebuild to filter -fPIC recompile 4. Compile works Actual Results: source='yuv4mpeg.c' object='yuv4mpeg.o' libtool=no \ depfile='.deps/yuv4mpeg.Po' tmpdepfile='.deps/yuv4mpeg.TPo' \ depmode=gcc3 /bin/sh ../depcomp \ gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -mcpu=i586 -march=i586 -mcpu=k6-2 -O2 -pipe -fomit-frame-pointer -fPIC -m3dnow -mmmx -mno-sse2 -Wall -Wunused -c `test -f 'yuv4mpeg.c' || echo './'`yuv4mpeg.c cpu_accel.c: In function `x86_accel': cpu_accel.c:87: can't find a register in class `BREG' while reloading `asm' cpu_accel.c:104: can't find a register in class `BREG' while reloading `asm' cpu_accel.c:110: can't find a register in class `BREG' while reloading `asm' cpu_accel.c:132: can't find a register in class `BREG' while reloading `asm' cpu_accel.c:136: can't find a register in class `BREG' while reloading `asm' make[3]: *** [cpu_accel.o] Error 1 Expected Results: Expected no errors in the build. Portage 2.0.49-r15 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r3, 2.4.20-gentoo-r9) ================================================================= System uname: 2.4.20-gentoo-r9 i686 VIA Samuel 2 Gentoo Base System version 1.4.3.10 distcc 2.11.1 i586-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled] ccache version 2.3 [enabled] ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-march=i586 -O2 -pipe -fomit-frame-pointer -m3dnow -mmmx -fPIC" CHOST="i586-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config /usr/share/config" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" CXXFLAGS="-march=i586 -O2 -pipe -fomit-frame-pointer -m3dnow -mmmx -fPIC" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs -sandbox ccache distcc prelink" GENTOO_MIRRORS="ftp://mirror.iawnet.sandia.gov/pub/gentoo/ http://gentoo.mirrors.pair.com/ http://gentoo.oregonstate.edu http://www.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage" USE="apm encode foomaticdb gtk2 imlib libg++ libwww mad mikmod motif ncurses nls pdflib spell truetype xml2 xmms gdbm berkdb slang readline gpm tcpd ssl perl python opengl X -gtk -gnome -cups qt alsa oss mysql jpeg mpeg png gif xv kde zlib x86 pam oggvorbis dvd css quicktime aalib directfb svga sdl fbcon crypt arts 3dnow avi prelink PIC mythtv mmx dv tiff"
technically you're not supposed to have -fPIC in your CFLAGS ebuilds take care of that for you
That makes sense now that I dig more. I have removed fPIC from my cflags and added the "pic" use flag to my USE variable. But should the -fPIC flag be filtered so that this doesn't happen to other unsuppecting gentooers?
i'll leave it to the video peeps to decide ... honestly if it happens to other people they shouldnt have -fPIC in theif CFLAGS either :)
Happened to me too on 1.6.1.91 but I don't have -fPIC. NOT applying the -fPIC patch fixed the problem. Excerpt of emerge info: Gentoo Base System version 1.4.3.12 Portage 2.0.49-r20 (default-x86-1.4, gcc-3.3.2, glibc-2.3.3_pre20031222-r0, 2.4.22-gentoo-r2) ================================================================= System uname: 2.4.22-gentoo-r2 i686 mobile AMD Athlon(tm) XP 1800+ ACCEPT_KEYWORDS="x86 ~x86" CFLAGS="-O2 -march=athlon-xp -pipe" CHOST="i686-pc-liux-gnu" MAKEOPTS="-j2" USE="x86 3dnow X alsa arts berkdb canna cdr cjk dvd encode freewnn gif gtk imlib java jpeg kde mmx motif mpeg ncurses nls oggvorbis opengl pam png qt readline sasl spell sse ssl tcpd truetype unicode usb xinerama xv"
*** Bug 37080 has been marked as a duplicate of this bug. ***
Another positive result for commenting this: epatch ${FILESDIR}/${P}-fPIC.patch out of mjpegtools-1.6.1.91.ebuild. emerge failed on my dual Athlon system until I commented the above line out of the ebuild.
I get the error. I have no -fPIC in my CFLAGS but the build addes it in... then fails. if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../utils -mcpu=i686 -march=i686 -O3 -fomit-frame-pointer -pipe -march=athlon -ffast-math -fno-strength-reduce -mno-sse2 -Wall -Wunused -fPIC -MT cpu_accel.o -MD -MP -MF ".deps/cpu_accel.Tpo" \ -c -o cpu_accel.o `test -f 'cpu_accel.c' || echo './'`cpu_accel.c; \ then mv -f ".deps/cpu_accel.Tpo" ".deps/cpu_accel.Po"; \ else rm -f ".deps/cpu_accel.Tpo"; exit 1; \ fi cpu_accel.c: In function `x86_accel': cpu_accel.c:87: error: can't find a register in class `BREG' while reloading `asm' cpu_accel.c:104: error: can't find a register in class `BREG' while reloading `asm' cpu_accel.c:110: error: can't find a register in class `BREG' while reloading `asm' cpu_accel.c:132: error: can't find a register in class `BREG' while reloading `asm' cpu_accel.c:136: error: can't find a register in class `BREG' while reloading `asm' CFLAGS="-O3 -fomit-frame-pointer -pipe -march=athlon -ffast-math -fno-strength-reduce" oddly, this package also forces -mcpu=i686 -march=i686 then addes my -march=athlon Should this be fixes as well?
I agree that that patch should be removed from portage. The reason is that cpu_accel.c uses the ebx register which PIC uses. Thus, the -fPIC CFLAG causes the above compile errors.
mjpegtools-1.6.1.90-r1 failed on my athlox xp system, too. Removing the fPIC.patch solved the problem.
Whoops, I wanted to say mjpegtools-1.6.1.91, not 90. The new ebuild reintroduced the PIC patch which was removed from mjpegtools-1.6.1.90 :(
Yet another test result: mjpegtools-1.6.1.91 fails to build as-is, with the PIC patch. commenting out the PIC patch line, it works.
Same here. AFAICT the patch should only be applied on non-x86 archs.
I am running a Dual Athlon-XP system and commenting out the fPIC patch in the ebuild fixed my compile process as well.
Ditto. Running AthlonXP, no -fPIC flag in USE. Doesn't compile unless the epatch ${FILESDIR}/${P}-fPIC.patch line is commented out in the ebuild.
Made it optional on ARCH in the 1.92 version. Works for me, please test and reopen if problems.