Ticket #353 (open defect)
Failed compiling FFmpeg in OS X 10.6.8
| Reported by: | joao | Owned by: | |
|---|---|---|---|
| Priority: | normal | Component: | build system |
| Version: | git-master | Keywords: | compile |
| Cc: | Blocked By: | ||
| Blocking: | Reproduced by developer: | no | |
| Analyzed by developer: | no |
Description
Hi guys,
Over at the Homebrew project (OS X package manager) we're running into issues compiling and installing FFmpeg on OS X.
You can see our ticket here: https://github.com/mxcl/homebrew/issues/6278
The compilation error is seen here: https://gist.github.com/1059859
Someone managed to make it fail a bit later by doing this: https://gist.github.com/1072836
Can you provide us any help in getting this to compile? Thanks.
Attachments
Change History
comment:2 Changed 22 months ago by reimar
Just removing the "static" should have worked fine (and makes sense anyway).
But this error probably means that you are compiling in a way that will give bad performance.
Or compiling for 64 bit?
comment:3 follow-up: ↓ 5 Changed 22 months ago by joao
@cehoyos
- get the 0.8 tarball
- extract it
- ./configure --prefix=/usr/local/Cellar/ffmpeg/0.8 --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libxvid
- make install
- fails with the error mentioned above
comment:4 Changed 22 months ago by joao
@reimar, removing static works great, but the compiling process fails later on like so:
INSTALL libavcodec/libavcodec.a
Undefined symbols for architecture x86_64:
"_MM_FIX_0_707106781", referenced from:
_filter in libavfilter.a(vf_fspp.o)
"_MM_FIX_0_541196100", referenced from:
_filter in libavfilter.a(vf_fspp.o)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
comment:5 in reply to: ↑ 3 Changed 22 months ago by cehoyos
- ./configure --prefix=/usr/local/Cellar/ffmpeg/0.8 --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libxvid
Is the problem not reproducible if you remove any of the enable-switches?
If it is still reproducible, please remove as many as possible (to get the shortest possible configure line that allows to reproduce the error).
- make install
- fails with the error mentioned above
Which error?
Is "make" sufficient to trigger the error? If yes, please run make multiple times and provide complete, uncut output of an additional "make V=1". (Please do not provide complete, uncut output of running make only once!)
If not, please run "make", then provide complete, uncut output of "make V=1 install". (Please do not provide complete, uncut output of only running "make install"!)
comment:6 Changed 22 months ago by cehoyos
And since this was probably fixed today: Please test latest git head.
comment:7 Changed 22 months ago by joao
Thanks for the help man.
I managed to isolate the --enable-gpl flag as the one that will cause the issue. Here's what I did, after editing the libavcodec/motionpixels_tablegen.h file, removing the static keyword:
$ ./configure --prefix=/usr/local/Cellar/ffmpeg/0.8 --enable-gpl
$ make
...
$ make V=1 # a couple of times
$ make V=1
gcc -Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavutil -Llibpostproc -Llibswscale -Wl,-dynamic,-search_paths_first -o ffmpeg_g ffmpeg.o cmdutils.o -lavdevice -lavfilter -lavformat -lavcodec -lpostproc -lswscale -lavutil -lm -lbz2 -lz
Undefined symbols for architecture x86_64:
"_MM_FIX_0_707106781", referenced from:
_filter in libavfilter.a(vf_fspp.o)
"_MM_FIX_0_541196100", referenced from:
_filter in libavfilter.a(vf_fspp.o)
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [ffmpeg_g] Error 1
$
And I get exactly the same behavior by doing the same steps (except editing motionpixels_tablegen.h beforehand), on the current repo HEAD.
comment:8 Changed 22 months ago by joao
Fixed. It works if the following flag is added to the configure script:
--cc=clang
comment:9 Changed 21 months ago by michael
Maybe loosing the static in
#define DECLARE_ASM_CONST(n,t,v) static const t av_used attribute ((aligned (n))) v
would make it work with gcc
(that of course would need some #if if it works)
comment:10 Changed 21 months ago by cehoyos
- Version changed from 0.8 to git-master
Strings to identify the broken compiler are "build 5658" and "build 2335.15.00", see attached gcc.log
comment:11 Changed 13 months ago by michael
Is this issue still happening / relevant ?
comment:12 follow-up: ↓ 13 Changed 12 months ago by pigoz
I'm having the same issue when compiling mplayer and mplayer2 with llvm-gcc-4.2.1 on Mac OS 10.7.
./version.sh
CC libmpcodecs/vf_fspp.o
CC mplayer
Undefined symbols for architecture x86_64:
"_MM_FIX_0_707106781", referenced from:
_filter in vf_fspp.o
"_MM_FIX_0_541196100", referenced from:
_filter in vf_fspp.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [mplayer] Error 1
I was going going to make a patch to mplayer, but I realized it could be better to fix the problem directly in ffmpeg when I found this bug report.
I ran some tests and it looks like both removing the static completely, or adding __private_extern__ in it's place are working.
At the moment for the #if I'm using #elif defined(__APPLE__) && defined(__llvm__) && defined(__GNUC__) which seems to work ok.
comment:13 in reply to: ↑ 12 Changed 12 months ago by cehoyos
Replying to pigoz:
I ran some tests and it looks like both removing the static completely, or adding __private_extern__ in it's place are working.
At the moment for the #if I'm using #elif defined(__APPLE__) && defined(__llvm__) && defined(__GNUC__) which seems to work ok.
Could you send a patch to ffmpeg-devel after testing with current FFmpeg git head (instead of MPlayer)?
Does the compiler you use still shows the same strings like above or is this still reproducible with newer versions of the compiler?
comment:14 Changed 12 months ago by pigoz
At the moment I use clang 3.1 (which is default with Xcode 4.3). With Xcode 4.1+ the default compiler on OSX is llvm-gcc-4.2.1: that's Apple's modified gcc frontend with an llvm backend, and I believe it's the newest available Apple compiler on OSX based on a gcc frontend.
I'll make a patch and make a test compilation of mplayer2 which already uses external ffmpeg/libav tree.




Please post all information necessary to reproduce your problem here, thank you.