Opened 5 years ago

Closed 2 years ago

#353 closed defect (fixed)

Failed compiling FFmpeg in OS X 10.6.8

Reported by: joao 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 cehoyos 5 years ago.

Download all attachments as: .zip

Change History (18)

comment:1 Changed 5 years ago by cehoyos

  • Status changed from new to open

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

comment:2 Changed 5 years 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: Changed 5 years ago by joao

@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 Changed 5 years 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 5 years ago by cehoyos

  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 Changed 5 years ago by cehoyos

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

comment:7 Changed 5 years 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 5 years ago by joao

Fixed. It works if the following flag is added to the configure script: --cc=clang

Version 0, edited 5 years ago by joao (next)

comment:9 Changed 5 years 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)

Changed 5 years ago by cehoyos

comment:10 Changed 5 years 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 4 years ago by michael

Is this issue still happening / relevant ?

comment:12 follow-up: Changed 4 years 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 4 years 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 4 years 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.

comment:15 Changed 3 years ago by michael

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 Changed 3 years ago by cehoyos

  • Keywords osx added; compile removed

comment:17 Changed 2 years ago by cehoyos

  • Reproduced by developer set
  • Resolution set to fixed
  • Status changed from open to closed

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.