First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 36502
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: media-video herd <media-video@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Jonathan Karras <gentoo@karras.net>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 36502 depends on: Show dependency tree
Bug 36502 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2003-12-25 20:17 0000
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"

------- Comment #1 From SpanKY 2003-12-25 20:24:57 0000 -------
technically you're not supposed to have -fPIC in your CFLAGS

ebuilds take care of that for you

------- Comment #2 From Jonathan Karras 2003-12-25 21:12:07 0000 -------
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?

------- Comment #3 From SpanKY 2003-12-25 21:15:14 0000 -------
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 :)

------- Comment #4 From Jason Stubbs (RETIRED) 2004-01-03 00:20:34 0000 -------
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"

------- Comment #5 From SpanKY 2004-01-03 08:55:59 0000 -------
*** Bug 37080 has been marked as a duplicate of this bug. ***

------- Comment #6 From Brian Bilbrey 2004-01-03 11:28:48 0000 -------
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.


------- Comment #7 From Bryan Whitehead 2004-01-04 11:37:50 0000 -------
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?

------- Comment #8 From nma@cox.net 2004-01-04 23:20:06 0000 -------
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.  

------- Comment #9 From Stephan Kapfinger 2004-01-09 06:33:43 0000 -------
mjpegtools-1.6.1.90-r1 failed on my athlox xp system, too. Removing the
fPIC.patch solved the problem.

------- Comment #10 From Stephan Kapfinger 2004-01-09 06:43:31 0000 -------
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 :(

------- Comment #11 From Owen Gunden 2004-01-10 10:05:25 0000 -------
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.

------- Comment #12 From Tal Peer (RETIRED) 2004-01-11 07:06:49 0000 -------
Same here.
AFAICT the patch should only be applied on non-x86 archs.

------- Comment #13 From Sumit Khanna 2004-01-15 07:23:44 0000 -------
I am running a Dual Athlon-XP system and commenting out the fPIC patch in the
ebuild fixed my compile process as well.

------- Comment #14 From Tro 2004-01-15 14:51:22 0000 -------
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.

------- Comment #15 From Wout Mertens (RETIRED) 2004-01-16 09:21:30 0000 -------
Made it optional on ARCH in the 1.92 version. Works for me, please test and
reopen if problems.

First Last Prev Next    No search results available      Search page      Enter new bug