Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 524282

Summary: media-video/mplayer2 injects -march=... -mtune=... into CFLAGS
Product: Gentoo Linux Reporter: David Flogeras <dflogeras2>
Component: Current packagesAssignee: Nikoli <nikoli>
Status: RESOLVED WONTFIX    
Severity: normal CC: jer, media-video, proxy-maint
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: media-video:mplayer2-2.0_p20130428-r1:20140823-092249.log.xz
build log from x86 chroot
emerge --info from x86 chroot

Description David Flogeras 2014-10-02 13:10:54 UTC
I build binaries for my aging machines on my most powerful machine.  Since smplayer now uses mplayer2 (was mplayer) as its backend I ran into this issue.  When building mplayer2 inside of my 32bit chroot, the resulting binary crashes with an illegal instruction.  Firstly, no my chroot make.conf does not use -march=native.

At first I suspected that maybe I had botched the sse/mmx USE flags, but putting the binary in gdb shows the instruction was ANDN (which is part of BMI1 instruction set introduced in Haswell, which the build host is).

After looking closer, it seems that the mplayer2 build system is injecting it's own -march=native -mtune=native in the CFLAGS in the generated config.mak.

I can "fix" it by running ebuild /usr/portage/.../mplayer2-2.0_p20130428-r1 configure, hand editing the config.mak to remove the "native" CFLAGS (my original ones are also in there), and then letting the ebuild continue.  I do not know how to properly fix it though.

Reproducible: Always
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2014-10-02 20:43:26 UTC
1) Please post your `emerge --info media-video/mplayer2' output in a comment.
2) Please attach the entire build log to this bug report.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2014-10-02 20:55:25 UTC
Created attachment 385952 [details]
media-video:mplayer2-2.0_p20130428-r1:20140823-092249.log.xz

Confirmed.
Comment 3 David Flogeras 2014-10-02 21:13:37 UTC
Created attachment 385954 [details]
build log from x86 chroot
Comment 4 David Flogeras 2014-10-02 21:13:57 UTC
Created attachment 385956 [details]
emerge --info from x86 chroot
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2014-10-03 07:02:07 UTC
It differes based on whether USE=cpudetection is set. ./configure will gladly use whatever CPU it finds on the system. An entire section of configure should probably be ripped out.
Comment 6 Nikoli 2014-10-04 07:55:09 UTC
media-video/mplayer has USE cpudetection and similar build system, does it have same behaviour for you?
Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2014-10-04 10:11:18 UTC
(In reply to Nikoli from comment #6)
> media-video/mplayer has USE cpudetection and similar build system, does it
> have same behaviour for you?

Are you asking this because you couldn't possibly begin to check how mplayer does that yourself? This bug is about mplayer2.
Comment 8 David Flogeras 2014-10-04 10:20:42 UTC
In the same build environment, mplayer with default USE="-cpudetection" does _not_ exhibit this problem.  If you check the generated config.mak, there is no mention of -march=native (that is, as long as you didn't specify it yourself).
Comment 9 Ben de Groot (RETIRED) gentoo-dev 2015-03-15 09:21:26 UTC
mplayer2 is abandoned and last-rited