Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 263847 - ffmpeg fails to compile on the prefixed portage on x86-macosx and most likely other x86 platforms as well
Summary: ffmpeg fails to compile on the prefixed portage on x86-macosx and most likely...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: x86 OS X
: High major (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-26 09:54 UTC by Dirk Tilger
Modified: 2009-03-26 10:02 UTC (History)
0 users

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


Attachments
Modification to the ffmpeg ebuild that should fix the problem (ffmpeg-0.4.9_p20081219.patch,596 bytes, patch)
2009-03-26 09:56 UTC, Dirk Tilger
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Tilger 2009-03-26 09:54:23 UTC
A few files generate the following error message:
error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'

There are a few loosely related bugs here:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13850
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32267

The problem is that ffmpeg uses heavily optimized assembly routines. On X86 registers are not plenty, so a single missing one causes problems. The ffmpeg ebuild has therefore put -fomit-frame-pointer into the compiler flags to make BP available. Since for prefixed portage tc-arch changed from x86 to x86-linux, the macro the ebuild needs to be modified.

Activation of -fomit-frame-pointer should happen automatically with -O* according to "man gcc", but did not with -O2 on my machine. My CFLAGS and CXXFLAGS are:

"-march=prescott -O2 -pipe -mfpmath=sse -msse3 "

The 

Reproducible: Always

Steps to Reproduce:
1. Go on x86 arch
2. Compile ffmpeg without -fomit-frame-pointer
Comment 1 Dirk Tilger 2009-03-26 09:56:14 UTC
Created attachment 186310 [details, diff]
Modification to the ffmpeg ebuild that should fix the problem

This modification will make the -fomit-frame-pointer compiler flag added, whenever we are on x86 (standard portage) or x86-* (tested on x86-macos with prefixed portage).
Comment 2 Fabian Groffen gentoo-dev 2009-03-26 10:02:20 UTC
Thanks for your in-depth explanation!  I didn't hit the problem on x86-solaris, probably because I use -O3, and FSF gcc, but I see no harm in your patch.

I committed it to 0.5, do you need it in the 0.4_p* versions too?  Please reopen if so.