Bug 16238 - CFLAGS optimizations b0rk mjpegtools ebuild
|
Bug#:
16238
|
Product: Gentoo Linux
|
Version: 1.4_rc2
|
Platform: x86
|
|
OS/Version: Linux
|
Status: RESOLVED
|
Severity: critical
|
Priority: P1
|
|
Resolution: FIXED
|
Assigned To: mholzer@gentoo.org
|
Reported By: sekurb@yahoo.com
|
|
Component: Ebuilds
|
|
|
URL:
|
|
Summary: CFLAGS optimizations b0rk mjpegtools ebuild
|
|
Keywords:
|
|
Status Whiteboard:
|
|
Opened: 2003-02-23 13:30 0000
|
When a user has CFLAGS optimizations for a specific architecture (e.g.
-fprefetch-loop-arrays) the mjpegtools ebuild still uses them in spite of the
fact that the build itself forces -march=i686. As a result, cc1 dies with error:
"-fprefetch-loop-arrays is invalid for specified architecture".
The ebuild needs to filter these out or something.
can you paste/attach the entire log and also emerge info?
it's very easy to recreate: if you have a p4 box handy, add -march=pentium4
-fpretech-loop-arrays to your CFLAGS (or any other p4 specific optimization
flag) and try emerging mjpegtools; Since mjpegtools replaces -march=pentium4
with -march=i686 the compiler dies coz -fprefetch-loop-arrays is invalid with
-march=i686; my workaround was to temporarily remove flags that cause trouble
from CFLAGs just to emerge mjpegtools successfuly, then revert back to normal;
I'll try to recreate this for you and paste some additional info.
That would come in handy - i dont have a p4 box lying around.
Sounds 'filter-flags -fprefetch-loop-arrays' reasonable to you?
-phoen][x-
but i have
let's see if it fails for me too
just recently I did emerge gnome and mjpegtools failed as well, with
-fprefetch-loop-arrays included in my CFLAGS; filtering these out will do the
trick (or not forcing i686) ...
prints out a lot of warning messages
cc1: warning: -fprefetch-loop-arrays not supported for this target (try -march switches)
fails here too
Portage 2.0.47-r10 (default-x86-1.4, gcc-3.2.2, glibc-2.3.1-r4)
=================================================================
System uname: 2.4.20-gentoo-r2 i686
GENTOO_MIRRORS="http://localhost/gentoo"
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"
PORTDIR="/usr/portage"
DISTDIR="/usr/portage/distfiles"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR_OVERLAY=""
USE="x86 oss 3dnow apm arts avi crypt cups encode gif java jpeg kde gnome libg++ libwww mikmod mmx motif mpeg ncurses nls pdflib png quicktime spell truetype xml2 xmms xv zlib gdbm berkdb slang readline svga X sdl gpm tcpd pam ssl perl python esd imlib oggvorbis gtk qt opengl"
COMPILER="gcc3"
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -O3 -pipe -ffast-math -fomit-frame-pointer -fprefetch-loop-arrays -fforce-addr"
CXXFLAGS="-march=pentium4 -O3 -pipe -ffast-math -fomit-frame-pointer -fprefetch-loop-arrays -fforce-addr"
ACCEPT_KEYWORDS="x86"
MAKEOPTS="-j2"
AUTOCLEAN="yes"
SYNC="rsync://localhost/gentoo-portage"
FEATURES="sandbox buildpkg ccache"
-fPIC in CFLAGS also borks the compile
comment #8 is invalid
this could only be a USE flag, not a CFLAGS
I can confirm that -fPIC breaks the compile for mjpegtools-1.6.0-r7
With the following settings it errors out:
CFLAGS="-mcpu=athlon-xp -O3 -pipe -fomit-frame-pointer -fPIC"
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -mcpu=i686 -march=i686 -mcpu=athlon-xp -O3 -pipe -fomit-frame-pointer -fPIC -Wall -Wunused -c `test -f cpu_accel.c || echo './'`cpu_accel.c
cpu_accel.c: In function `x86_accel':
cpu_accel.c:83: can't find a register in class `BREG' while reloading `asm'
cpu_accel.c:100: can't find a register in class `BREG' while reloading `asm'
cpu_accel.c:106: can't find a register in class `BREG' while reloading `asm'
cpu_accel.c:128: 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'
make[2]: *** [cpu_accel.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/var/tmp/portage/mjpegtools-1.6.0-r7/work/mjpegtools-1.6.0/utils'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/mjpegtools-1.6.0-r7/work/mjpegtools-1.6.0'
make: *** [all] Error 2
!!! ERROR: media-video/mjpegtools-1.6.0-r7 failed.
!!! Function src_compile, Line 105, Exitcode 2
When I change it to:
CFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer"
this ebuild builds successfully
added filter-flags "-fprefetch-loop-arrays"