Opened 11 years ago

Closed 8 years ago

#353 closed defect (fixed)

Failed compiling FFmpeg in OS X 10.6.8

Reported by: João Owned by:
Priority: normal Component: build system
Version: git-master Keywords: osx
Cc: Blocked By:
Blocking: Reproduced by developer: yes
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 (1)

gcc.log (720 bytes ) - added by Carl Eugen Hoyos 11 years ago.

Download all attachments as: .zip

Change History (18)

comment:1 by Carl Eugen Hoyos, 11 years ago

Status: newopen

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

comment:2 by reimar, 11 years ago

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 by João, 11 years ago

@cehoyos

  1. get the 0.8 tarball
  2. extract it
  3. ./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
  4. make install
  5. fails with the error mentioned above

comment:4 by João, 11 years ago

@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

in reply to:  3 comment:5 by Carl Eugen Hoyos, 11 years ago

  1. ./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).

  1. make install
  2. 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 by Carl Eugen Hoyos, 11 years ago

And since this was probably fixed today: Please test latest git head.

comment:7 by João, 11 years ago

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 by João, 11 years ago

Fixed. It works if the following flag is added to the configure script:

--cc=clang
Last edited 11 years ago by João (previous) (diff)

comment:9 by Michael Niedermayer, 11 years ago

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)

by Carl Eugen Hoyos, 11 years ago

Attachment: gcc.log added

comment:10 by Carl Eugen Hoyos, 11 years ago

Version: 0.8git-master

Strings to identify the broken compiler are "build 5658" and "build 2335.15.00", see attached gcc.log

comment:11 by Michael Niedermayer, 10 years ago

Is this issue still happening / relevant ?

comment:12 by pigoz, 10 years ago

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.

in reply to:  12 comment:13 by Carl Eugen Hoyos, 10 years ago

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 by pigoz, 10 years ago

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.

comment:15 by Michael Niedermayer, 9 years ago

Its 15 months, any news on this, is it still relevant, ffmpeg surely can be build on osx with various compilers (according to our fate server). Also if its still failing, what happened with the patch that someone wanted to make?

comment:16 by Carl Eugen Hoyos, 8 years ago

Keywords: osx added; compile removed

comment:17 by Carl Eugen Hoyos, 8 years ago

Reproduced by developer: set
Resolution: fixed
Status: openclosed

I was able to reproduce the original problem - compilation fails with ./configure --enable-gpl --disable-everything --enable-filter=mp for llvm-gcc-4.2.1 - testing gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Fixed in fa35ade8 / 0.11

Note: See TracTickets for help on using tickets.