Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 175627 - mplayer failed to compile (can't find a register in class `BREG'...)
Summary: mplayer failed to compile (can't find a register in class `BREG'...)
Status: RESOLVED DUPLICATE of bug 93862
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal with 1 vote (vote)
Assignee: media-video herd
URL:
Whiteboard:
Keywords:
: 176982 179210 181384 183662 186713 190920 207975 210869 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-04-22 21:27 UTC by Alexandre Carsac
Modified: 2011-04-26 18:50 UTC (History)
17 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,70.12 KB, text/plain)
2007-04-27 16:01 UTC, Sascha G.
Details
fix the diff_MMX in vf_decimate.c for hardened (vf_decimate_PIC.patch,996 bytes, patch)
2007-05-05 15:39 UTC, Alexandre Carsac
Details | Diff
patch for similar problem in libavcodec/h264.c (mplayer-h264-c-register-fix.patch,1.27 KB, patch)
2007-06-09 08:27 UTC, Guy Cirino
Details | Diff
ebuild update, patches the above attachement (mplayer-1.0.20070427.ebuild.diff,269 bytes, patch)
2007-06-09 08:29 UTC, Guy Cirino
Details | Diff
added update description to ChangeLog (ChangeLog.diff,671 bytes, patch)
2007-06-09 08:30 UTC, Guy Cirino
Details | Diff
build log +debug mplayer-20070622-r1 (media-video:mplayer-1.0.20070622-r1:20070711-021930.log,837.73 KB, text/plain)
2007-07-11 19:37 UTC, trefoil
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandre Carsac 2007-04-22 21:27:59 UTC
I was attempting to emerge mplayer-1.0_rc2_pre20070321-r4.
The emerge failed always with the following compilation error : 

i686-pc-linux-gnu-gcc -I. -I.. -I../libavutil -I../libavcodec -I../libavformat -Wdeclaration-after-statement -W -Wall -Wno-unused-parameter -O2 -march=i486 -mtune=i686 -g3  -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -I/usr/include/directfb -I/usr/X11R6/include -I/usr/include/SDL  -D_REENTRANT -I/usr/include/freetype2 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include     -c -o aviprint.o aviprint.c
vf_decimate.c: In function `diff_MMX':
vf_decimate.c:26: error: can't find a register in class `BREG' while reloading `asm'
make[1]: *** [vf_decimate.o] Error 1
make[1]: Leaving directory 

Additional informations :

emerge --info
Portage 2.1.2.4 (hardened/x86/2.6, gcc-3.4.6, glibc-2.3.6-r5, 2.6.16-hardened-r10 i686)
=================================================================
System uname: 2.6.16-hardened-r10 i686 Intel(R) Pentium(R) 4 CPU 1.80GHz
Gentoo Base System release 1.12.9
Timestamp of tree: Tue, 17 Apr 2007 20:30:01 +0000
dev-java/java-config: 1.3.7, 2.0.31-r7
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.15-r1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-O2 -march=pentium4"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LINGUAS="fr en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/home/portage/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /usr/portage/local/layman/xeffects /usr/portage/local/layman/xeffects-experimental"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 7zip X aac alsa ao apm asf audiofile bash-completion berkdb bitmap-fonts bzip2 cdr crypt dbus directfb dlloader doc dri dv dvd dvdr encode fbcon fbdev ffmpeg fftw firefox flac gif gnome gpm gtk hal hardened howl inkjar java jpeg jpeg2k kerberos ldap libvisual libwww mad midi mikmod mime mmx mng mp3 mpeg multicall nas ncurses network nls nptl nptlonly nsplugin ogg opengl oss pam pic png quicktime readline real rtc sdl shorten source speex spell sse ssl svg svgz tcpd teamarena truetype udev usb v4l2 vcd vfat vim-with-x vorbis wifi win32codecs wmf x86 xml xorg xv xvid xvmc yaepg zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="fr en" USERLAND="GNU" VIDEO_CARDS="nv vesa"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Steve Dibb (RETIRED) gentoo-dev 2007-04-23 14:15:29 UTC
post emerge -pv mplayer.
Comment 2 Alexandre Carsac 2007-04-23 19:08:39 UTC
emerge -pv mplayer

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U ] media-video/mplayer-1.0_rc2_pre20070321-r4 [1.0_rc1-r3] USE="3dnow 3dnowext X aac alsa bl cpudetection debug directfb doc dv dvd encode fbcon gif gtk jpeg live lzo mad mp3%* musepack nas opengl oss png quicktime%* real rtc sdl speex sse truetype v4l2 vorbis win32codecs x264 xanim xv xvid -a52% -aalib (-altivec) -amr -arts -bidi -bindist -cddb% -cdparanoia -custom-cflags -dga -dts -dvb -dvdnav% -dvdread -enca -esd -ftp% -ggi -iconv -ipv6 -ivtv% -jack -joystick -libcaca -lirc -livecd -md5sum% -mmx* -mmxext* -mp2% -openal -pnm% -radio% -rar% -samba -srt% -sse2 (-svga) -tga -theora -tivo% -unicode -v4l -vidix% -xinerama -xvmc -zoran% (-3dfx%) (-matrox%)" LINGUAS="(-bg%) (-cs%) (-da%) (-de%) (-el%) (-en%*) (-es%) (-fr%*) (-hu%) (-ja%) (-ko%) (-mk%) (-nl%) (-no%) (-pl%) (-pt_BR%) (-ro%) (-ru%) (-sk%) (-tr%) (-uk%) (-zh_CN%) (-zh_TW%)" VIDEO_CARDS="vesa%* -mga% -s3virge% -tdfx%" 0 kB 

Total: 1 package (1 upgrade), Size of downloads: 0 kB

I precise that i try without success to emerge also with flags "mmx" and "mmxext" activated. 
Comment 3 Steve Dibb (RETIRED) gentoo-dev 2007-04-26 16:19:46 UTC
"march=i486 -mtune=i686 -g3"

That's a little odd.  Try the custom-cflags  use flag
Comment 4 Sascha G. 2007-04-27 15:58:34 UTC
I have the same problem over here, the difference being that the compiler flags mplayer uses do not look that strange:

[...]
i686-pc-linux-gnu-gcc -I. -I.. -I../libavutil -I../libavcodec -I../libavformat -Wdeclaration-after-statement -O4 -march=pentium4 -mtune=pentium4 -pipe -ffast-math -fomit-frame-pointer -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -I/usr/include -I/usr/include/freetype2   -c -o vf_decimate.o vf_decimate.c
vf_decimate.c: In function `diff_MMX':
vf_decimate.c:26: error: can't find a register in class `BREG' while reloading `asm'
make[1]: *** [vf_decimate.o] Error 1
make[1]: Leaving directory `/var/tmp/portage/media-video/mplayer-1.0.20070321/work/mplayer/libmpcodecs'
make: *** [libmpcodecs/libmpcodecs.a] Error 2
make: *** Waiting for unfinished jobs....
[...]

Portage 2.1.2.5 (selinux/2005.1/x86/hardened, gcc-3.4.6, glibc-2.3.6-r5, 2.6.20-hardened-r2 i686)
=================================================================
System uname: 2.6.20-hardened-r2 i686 Intel(R) Pentium(R) 4 CPU 1.60GHz
Gentoo Base System release 1.12.10
Timestamp of tree: Fri, 27 Apr 2007 15:20:02 +0000
dev-lang/python:     2.4.4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.6.3, 1.7.9-r1, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.23b
virtual/os-headers:  2.6.20-r2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=pentium4 -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=pentium4 -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig collision-protect distlocks loadpolicy parallel-fetch sandbox selinux sesandbox sfperms strict userfetch userpriv usersandbox"
GENTOO_MIRRORS="ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo ftp://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/"
LANG="de_DE.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--sort-common"
LINGUAS="de ja"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_EXTRA_OPTS="--exclude-from /etc/portage/rsync_excludes"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X a52 aac alsa bzip2 cairo caps cjk crypt cups dri dts dvd dvdread flac gif hardened iconv idn jpeg kdeenablefinal mmap mmx nls nptl offensive ogg pam pic png selinux sse sse2 ssl symlink theora threads truetype unicode vorbis x264 x86 xv xvid zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de ja" USERLAND="GNU" VIDEO_CARDS="nv"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS
Comment 5 Sascha G. 2007-04-27 16:01:32 UTC
Created attachment 117415 [details]
build.log

[ebuild     U ] media-video/mplayer-1.0.20070321 [1.0_rc1-r2] USE="X a52%* aac alsa dts dvd dvdread gif iconv jpeg mmx mmxext png srt%* sse sse2 theora truetype unicode vorbis x264 xv xvid -3dnow -3dnowext -aalib (-altivec) -amr -arts -bidi -bindist -bl -cddb% -cdparanoia -cpudetection -custom-cflags -debug -dga -directfb -doc -dv -dvb -dvdnav% -enca -encode -esd -fbcon -ftp% -ggi -gtk -ipv6 -ivtv% -jack -joystick -libcaca -lirc -live -livecd -lzo -mad -md5sum% -mp2% -mp3% -musepack -nas -openal -opengl -oss -pnm% -quicktime% -radio% -rar% -real -rtc -samba -sdl -speex -svga -tga -tivo% -v4l -v4l2 -vidix% -win32codecs -xanim -xinerama -xvmc -zoran% (-3dfx%) (-matrox%)" LINGUAS="(-bg%) (-cs%) (-da%) (-de%*) (-el%) (-en%) (-es%) (-fr%) (-hu%) (-ja%*) (-ko%) (-mk%) (-nl%) (-no%) (-pl%) (-pt_BR%) (-ro%) (-ru%) (-sk%) (-tr%) (-uk%) (-zh_CN%) (-zh_TW%)" VIDEO_CARDS="-mga% -s3virge% -tdfx% -vesa%" 0 kB
Comment 6 Steve Dibb (RETIRED) gentoo-dev 2007-04-27 16:11:47 UTC
Hmm ... try -unicode -srt -truetype -iconv
Comment 7 Sascha G. 2007-04-27 16:29:59 UTC
The result is the same error at the same place.

[ebuild     U ] media-video/mplayer-1.0.20070321 [1.0_rc1-r2] USE="X a52%* aac alsa dts dvd dvdread gif jpeg mmx mmxext png sse sse2 theora vorbis x264 xv xvid -3dnow -3dnowext -aalib (-altivec) -amr -arts -bidi -bindist -bl -cddb% -cdparanoia -cpudetection -custom-cflags -debug -dga -directfb -doc -dv -dvb -dvdnav% -enca -encode -esd -fbcon -ftp% -ggi -gtk -iconv* -ipv6 -ivtv% -jack -joystick -libcaca -lirc -live -livecd -lzo -mad -md5sum% -mp2% -mp3% -musepack -nas -openal -opengl -oss -pnm% -quicktime% -radio% -rar% -real -rtc -samba -sdl -speex -srt% -svga -tga -tivo% -truetype* -unicode* -v4l -v4l2 -vidix% -win32codecs -xanim -xinerama -xvmc -zoran% (-3dfx%) (-matrox%)" LINGUAS="(-bg%) (-cs%) (-da%) (-de%*) (-el%) (-en%) (-es%) (-fr%) (-hu%) (-ja%*) (-ko%) (-mk%) (-nl%) (-no%) (-pl%) (-pt_BR%) (-ro%) (-ru%) (-sk%) (-tr%) (-uk%) (-zh_CN%) (-zh_TW%)" VIDEO_CARDS="-mga% -s3virge% -tdfx% -vesa%" 0 kB
Comment 8 Steve Dibb (RETIRED) gentoo-dev 2007-04-27 21:44:56 UTC
(In reply to comment #3)
> "march=i486 -mtune=i686 -g3"
> 
> That's a little odd.  Try the custom-cflags  use flag
> 

^^
Comment 9 Sascha G. 2007-04-27 22:57:57 UTC
With USE=custom-cflags, mplayer compiles & runs, thanks!
But now I'm getting this error message:

Compiler did not align stack variables. Libavcodec has been miscompiled
and may be very slow or crash. This is not a bug in libavcodec,
but in the compiler. Do not report crashes to FFmpeg developers.

I have not been noticing anything bad happening yet, it does not seem to be too slow either.
Comment 10 Steve Dibb (RETIRED) gentoo-dev 2007-04-27 23:12:44 UTC
(In reply to comment #9)
> With USE=custom-cflags, mplayer compiles & runs, thanks!
> But now I'm getting this error message:
> 
> Compiler did not align stack variables. Libavcodec has been miscompiled
> and may be very slow or crash. This is not a bug in libavcodec,
> but in the compiler. Do not report crashes to FFmpeg developers.
> 
> I have not been noticing anything bad happening yet, it does not seem to be too
> slow either.
> 

Once it hits the mirrors, can you try mplayer-1.0.20070427 and let me know if that fixes it without the custom-cflags?
Comment 11 Sascha G. 2007-04-28 10:47:33 UTC
No, mplayer-1.0.20070427 doesn't work without custom-cflags. The symptoms are the same as they have been before. The error message that appears when using the internal ffmpeg is also the same.
Comment 12 Steve Dibb (RETIRED) gentoo-dev 2007-04-28 13:03:19 UTC
(In reply to comment #11)
> No, mplayer-1.0.20070427 doesn't work without custom-cflags. The symptoms are
> the same as they have been before. The error message that appears when using
> the internal ffmpeg is also the same.
> 

Alright.  Can you post /proc/cpuinfo for me
Comment 13 Sascha G. 2007-04-28 13:14:18 UTC
$ cat /proc/cpuinfo 
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 15
model		: 2
model name	: Intel(R) Pentium(R) 4 CPU 1.60GHz
stepping	: 4
cpu MHz		: 1607.176
cache size	: 512 KB
fdiv_bug	: no
hlt_bug		: no
f00f_bug	: no
coma_bug	: no
fpu		: yes
fpu_exception	: yes
cpuid level	: 2
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm
bogomips	: 3215.87
clflush size	: 64
Comment 14 Jakub Moc (RETIRED) gentoo-dev 2007-05-04 06:24:47 UTC
*** Bug 176982 has been marked as a duplicate of this bug. ***
Comment 15 Alexandre Carsac 2007-05-05 15:39:14 UTC
Created attachment 118245 [details, diff]
fix the diff_MMX in vf_decimate.c for hardened

Hi, 

I found that this kind of error is very common with hardened because it use the -fPIC option that use %ebx behind the sceen.
Then asm code need to be fix in order keep %ebx unchanged by the asm code. because the code use all the register, we need to use the stack to save %ebx being clobbered by the assembly code, and don't tell gcc about %ebx at all (it doesn't need to know anyway).
Comment 16 Attila Tóth 2007-05-05 17:03:20 UTC
Always good to have a real expert on board!
Should it be reported upstream, or let it remain just a Gentoo patch? When will be this patch included?

Regards,
Dw.

(In reply to comment #15)
> Created an attachment (id=118245) [edit]
> fix the diff_MMX in vf_decimate.c for hardened
> 
> Hi, 
> 
> I found that this kind of error is very common with hardened because it use the
> -fPIC option that use %ebx behind the sceen.
> Then asm code need to be fix in order keep %ebx unchanged by the asm code.
> because the code use all the register, we need to use the stack to save %ebx
> being clobbered by the assembly code, and don't tell gcc about %ebx at all (it
> doesn't need to know anyway).
> 
Comment 17 Alexandre Carsac 2007-05-05 18:19:52 UTC
Hi,

Thanks for your quick response, i am not very aware about the "process".

What i think :
If users who compile with -fPIC on a pentium4 (or another with same number of  registers) are important for "upstream", it is worth to be reported.

The patch named "fix the diff_MMX in vf_decimate.c for hardened" contains only a push/pop overhead, and ecx exchanged with ebx.

Because the change is small, i think there is theorically no regression, but had no way to check after all.

A.
Comment 18 Kevin F. Quinn (RETIRED) gentoo-dev 2007-05-13 20:07:26 UTC
Alexandre is right (well, the hardened compiler sets -fPIE behind the scenes, to be accurate, but that's pretty much the same as -fPIC).  As far as upstream is concerned, they don't build PIE so using the ebx register is not a bug, for them.

I must admit I gave up on making mplayer PIE-friendly; there was just too much asm all over the place that needed changing, and upstream justifiably didn't seem to keen to take such changes on.  We didn't fancy maintaining what would have been significant patches to quite sensitive code.

media-video: the thing that'll make it work on hardened is 'filter-flags -fPIE' - currently this is conditional on USE=custom-flags, but if you make this unconditional (i.e. do it after the 'if use custom-flags' section so that it can take effect after the 'unset CFLAGS') it'll work for everyone.
Comment 19 Reimar Döffinger 2007-05-16 14:09:24 UTC
You can configure with --target=generic-linux, then it will compile with any kind of compiler flags. You'll have to do without asm optimizations though so it's either PIE or fast.
Comment 20 Jakub Moc (RETIRED) gentoo-dev 2007-05-20 13:02:35 UTC
*** Bug 179210 has been marked as a duplicate of this bug. ***
Comment 21 Jakub Moc (RETIRED) gentoo-dev 2007-06-09 08:11:30 UTC
*** Bug 181384 has been marked as a duplicate of this bug. ***
Comment 22 Guy Cirino 2007-06-09 08:27:06 UTC
Created attachment 121549 [details, diff]
patch for similar problem in libavcodec/h264.c

(moved from bug #181384)

mplayer-1.0.20070427 (and possibly older ones) fails to build libavcodec/h264.c
because it runs out of registers.  A Mennucc1 from the debian project spotted
this error, see
http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2007-March/050608.html and
applied a fix, which I adapted and included in the attachements.  The fix
basically flips to a different set of optimizations on x86 architecture which
provides enough registers to compile h264.c.  I commented out A's fix to only
apply when not building in debug mode, it just doesn't work if this isn't
enabled.

Attached are the patch file and a diffed ebuild from
mplayer-1.0.20070427.ebuild - the only change to the ebuild is to apply the
patch.

_guy
Comment 23 Guy Cirino 2007-06-09 08:29:21 UTC
Created attachment 121551 [details, diff]
ebuild update, patches the above attachement

(ebuild fix to apply attachement 121549)
Comment 24 Guy Cirino 2007-06-09 08:30:36 UTC
Created attachment 121552 [details, diff]
added update description to ChangeLog

changelog updates for above
Comment 25 Alexandre Carsac 2007-06-24 21:52:40 UTC
Hi,

>Comment  #18 From Kevin F. Quinn  
>I must admit I gave up on making mplayer PIE-friendly; there was just too much
>asm all over the place that needed changing:

i gave up too, because whenever it now compiles, i have to fix the crash when i launch mplayer. I agree with Kevin when he say that it "would have been significant patches to quite sensitive code, We didn't fancy maintaining". The files needing to be fixed are (for me) :

libavcodec/i386/dsputil_mmx.c
libavcodec/i386/h264dsp_mmx.c
libavcodec/i386/mpegvideo_mmx_template.c
libavcodec/cabac.h
libavcodec/i386/snowdsp_mmx.c
libmpcodecs/vf_decimate.c
libmpcodecs/vf_divtc.c
libmpcodecs/vf_eq2.c
libmpcodecs/vf_eq.c
libmpcodecs/vf_filmdint.c
libmpcodecs/vf_halfpack.c
libmpcodecs/vf_ilpack.c
libmpcodecs/vf_ivtc.c
libmpcodecs/vf_noise.c
libmpcodecs/vf_tfields.c
libpostproc/postprocess_template.c
libswscale/swscale_template.c
libswscale/rgb2rgb_template.c
libswscale/yuv2rgb_template.c
libvo/aclib_template.c
libvo/osd_template.c
mp3lib/decode_MMX.c
mp3lib/dct64_MMX.c
mp3lib/tabinit_MMX.c
mp3lib/dct36_3dnow.c
mp3lib/dct64_3dnow.c
mp3lib/dct64_k7.c
mp3lib/dct64_sse.c
mp3lib/decode_i586.c

So Kevin's solution seem the good one, but unfortunatly i am not an ebuild expert. Further more, What is strange is that i do not have to touch to libavcodec/h264.c as suggested by Guy Cirino (Comment  #22). Perhaps because not having the same use's flags. So the upper list can grow.


A.
Comment 26 Jakub Moc (RETIRED) gentoo-dev 2007-06-29 16:08:58 UTC
*** Bug 183662 has been marked as a duplicate of this bug. ***
Comment 27 Andrew Maule 2007-06-29 17:47:46 UTC
(In reply to comment #26)
> *** Bug 183662 has been marked as a duplicate of this bug. ***
> 

Thanks for finding that my bug post was a duplicate.  I did a search, but apparently it was too specific.

This bug report has been extremely useful.  I was able to successfully compile by changing my profile to i686-pc-linux-gnu-3.4.6-hardenednopiessp using gcc-config.
Comment 28 trefoil 2007-07-11 02:12:36 UTC
Hi, the bug that looked to be a better description of my problem was closed and marked as a duplicate of this one, so here I am. Mplayer works fine for me in general, but does not compile using the debug use flag. I was asked to file my report, so here is my due diligence. Also, I seem to remember it failing with a different error message sometimes. :b

Oh ffs it says my comment is too long.

[ebuild   R   ] media-video/mplayer-1.0.20070622-r1  USE="3dnow 3dnowext X a52 aac alsa cdparanoia debug* dvd encode fbcon ftp gif gtk iconv ipv6 joystick jpeg lzo mad mmx mmxext mp3 musepack opengl png quicktime rar real sdl speex sse tga theora truetype unicode vorbis win32codecs x264 xv xvid -aalib (-altivec) -amrnb -amrwb -arts -bidi -bindist -bl -cddb -cpudetection -custom-cflags -dga -directfb -doc -dts -dv -dvb -dvdnav -enca -esd -ggi -ivtv -jack -libcaca -lirc -live -livecd -md5sum -mp2 -nas -openal -oss -pnm -radio -rtc -samba -srt -sse2 -ssse3 -svga -tivo -v4l -v4l2 -vidix -xanim -xinerama -xvmc -zoran" VIDEO_CARDS="vesa -mga -s3virge -tdfx" 0 kB 
Comment 29 trefoil 2007-07-11 19:37:14 UTC
Created attachment 124587 [details]
build log +debug mplayer-20070622-r1

Interesting side-note?: mplayer will fail to compile in different spots sometimes.
Comment 30 Steve Dibb (RETIRED) gentoo-dev 2007-07-11 20:51:28 UTC
(In reply to comment #28)
> Hi, the bug that looked to be a better description of my problem was closed and
> marked as a duplicate of this one, so here I am. Mplayer works fine for me in
> general, but does not compile using the debug use flag.

That's an upstream issue, debug is broken.  Should probably remove the option from the ebuild.
Comment 31 trefoil 2007-07-11 20:58:38 UTC
Is it possible to get useful backtrace information just by compiling with -gddb? The ebuild forces -fomit-frame-pointer, however, unless debug use flag is set.
Comment 32 Jakub Moc (RETIRED) gentoo-dev 2007-07-26 17:48:50 UTC
*** Bug 186713 has been marked as a duplicate of this bug. ***
Comment 33 Steve Dibb (RETIRED) gentoo-dev 2007-07-26 20:47:48 UTC
(In reply to comment #30)
> (In reply to comment #28)
> > Hi, the bug that looked to be a better description of my problem was closed and
> > marked as a duplicate of this one, so here I am. Mplayer works fine for me in
> > general, but does not compile using the debug use flag.
> 
> That's an upstream issue, debug is broken.  Should probably remove the option
> from the ebuild.
> 

Gone in mplayer-1.0.20070622-r2

Comment 34 Steve Dibb (RETIRED) gentoo-dev 2007-08-15 07:00:56 UTC
Should be fixed.  Usually caused by debug use flag, which shouldn't have been enabled per upstream's advice.
Comment 35 Jan Kundrát (RETIRED) gentoo-dev 2007-08-16 01:14:56 UTC
(In reply to comment #34)
> Should be fixed.  Usually caused by debug use flag, which shouldn't have been
> enabled per upstream's advice.

mplayer-1.0.20070814 still dies:

vf_decimate.c: In function `diff_MMX':
vf_decimate.c:26: error: can't find a register in class `BREG' while reloading `asm'
Comment 36 Jan Kundrát (RETIRED) gentoo-dev 2007-08-16 01:18:46 UTC
it's on hardened profile and hardened isn't cc-ed...
Comment 37 Jakub Moc (RETIRED) gentoo-dev 2007-09-02 17:17:12 UTC
*** Bug 190920 has been marked as a duplicate of this bug. ***
Comment 38 Jakub Moc (RETIRED) gentoo-dev 2007-09-02 17:25:41 UTC
*** Bug 190920 has been marked as a duplicate of this bug. ***
Comment 39 Dylan Hall 2007-09-19 02:47:51 UTC
Using gcc-config has been mentioned previously, but is wasn't obvious (to me) what this meant. After a little tinkering I figured out the following (more verbose explanation may be more useful to others like myself):

# change to non hardened gcc
gcc-config i686-pc-linux-gnu-3.4.6-vanilla
source /etc/profile

# install mplayer
emerge -v mplayer

# switch back to the correct compiler 
gcc-config i686-pc-linux-gnu-3.4.6


The above works for me, so I'm wondering could this somehow be incorporated into the build process?
Comment 40 solar (RETIRED) gentoo-dev 2007-09-19 06:58:10 UTC
(In reply to comment #39)

> The above works for me, so I'm wondering could this somehow be incorporated
> into the build process?

No nothing like that will be done.

Comment 41 karl 2008-01-24 01:42:53 UTC
sys-apps/memtest86-3.4 also gives me this exact same error
Comment 42 Jakub Moc (RETIRED) gentoo-dev 2008-02-15 02:13:28 UTC
*** Bug 207975 has been marked as a duplicate of this bug. ***
Comment 43 Laurento Frittella (mrfree) 2008-02-15 08:08:39 UTC
Same compile problem with media-video/mplayer-1.0_rc2_p25993

cabac.h: In function ‘get_cabac_noinline’:
cabac.h:529: error: can't find a register in class ‘GENERAL_REGS’ while reloading ‘asm’


Note: I'm posting here because #181384 has been marked as duplicate of this bug
Comment 44 Jakub Moc (RETIRED) gentoo-dev 2008-02-20 11:50:12 UTC
*** Bug 210869 has been marked as a duplicate of this bug. ***
Comment 45 Eric Brown 2008-03-27 02:09:16 UTC
None of the solutions mentioned here seem to work.  I haven't had a media player in over 6 months it seems.

Maybe we should do one of these things:

1) find the last working version and mask the new stuff until there's a bug fix
2) put a binary version of mplayer into the portage tree for hardened users
Comment 46 Jan Kundrát (RETIRED) gentoo-dev 2008-03-27 10:50:15 UTC
(In reply to comment #45)
> 2) put a binary version of mplayer into the portage tree for hardened users

Try http://dev.gentoo.org/~jkt/tmp/mplayer-1.0_rc2_p25993.tbz2 , built with regular compiler on a hardened box.
Comment 47 Daniel Burr 2008-04-06 04:07:39 UTC
I saw this when trying to emerge mplayer-1.0_rc2_p25993:

i386/dsputil_mmx.c: In function 'transpose4x4':
i386/dsputil_mmx.c:701: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'

I managed to work around it by creating an overlay that passed in the following extra CFLAGS:
-O2 -fno-PIC -fomit-frame-pointer

Comment 48 Reimar Döffinger 2008-04-13 09:06:40 UTC
If you want MPlayer with PIE, you should try removing the
HAVE_EBX_AVAILABLE
and
HAVE_EBP_AVAILABLE
defines from the config.h generated by configure.
This may leave few enough issues to be fixable, though at least for H.264 the performance hit will be noticeable (around 10% I assume).
Comment 49 Honza 2008-04-13 09:30:38 UTC
What if I want MPlayer WITHOUT PIE ? Even for hardened users no-PIE mplayer should work, so what about adding some use flag to mplayer to automatically build with regular compiler and flag is as such in paxctl if needed ? Or is the problem that hardened users don't usually have regular compiler ?
Comment 50 Reimar Döffinger 2008-04-13 15:37:21 UTC
As others have pointed out, if PIE is not required, you can just use -fno-PIC -fno-PIE as compile options, e.g. by doing
make CC="cc -fno-PIC -fno-PIE" CXX="cc -fno-PIC -fno-PIE"
or probably many more possibilities.
Comment 51 Samuli Suominen gentoo-dev 2009-08-03 21:07:43 UTC

*** This bug has been marked as a duplicate of bug 93862 ***