zimbatm/ffmpeg-static

FFmpeg does not build

albertz opened this issue · 7 comments

*** Building FFmpeg ***
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
gcc is unable to create an executable file.
If gcc is a cross-compiler, use the --enable-cross-compile option.
Only do this if you know what cross compiling means.
C compiler test failed.

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solving the problem.

config.log:

...
check_cc
BEGIN /var/folders/fk/mt9zfm3n2853v1pcy0q3y25h0000gp/T//ffconf.iqXjAyiA.c
    1   int main(void){ return 0; }
END /var/folders/fk/mt9zfm3n2853v1pcy0q3y25h0000gp/T//ffconf.iqXjAyiA.c
gcc -I/Users/az/Programmierung/ffmpeg-static/target/include -I/Users/az/Programmierung/ffmpeg-static/target/include -static --static -c -o /var/folders/fk/mt9zfm3n2853v1pcy0q3y25h0000gp/T//ffconf.pZYEfFwm.o /var/folders/fk/mt9zfm3n2853v1pcy0q3y25h0000gp/T//ffconf.iqXjAyiA.c
gcc -L/Users/az/Programmierung/ffmpeg-static/target/lib -lm -L/Users/az/Programmierung/ffmpeg-static/target/lib -lm -static -o /var/folders/fk/mt9zfm3n2853v1pcy0q3y25h0000gp/T//ffconf.9l7nvoI1 /var/folders/fk/mt9zfm3n2853v1pcy0q3y25h0000gp/T//ffconf.pZYEfFwm.o
ld: library not found for -lcrt0.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
C compiler test failed.

"-Bstatic" option instead of "-static" solved the issue

thanks to amnonbb, i succeed.

/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../x86_64-pc-linux-gnu/bin/ld: ./libvpx.a(vp9_subpel_variance.asm.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
./libvpx.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
src/ffmpeg-static/build/libvpx-v1.3.0/libs.mk:480: recipe for target 'test_libvpx' failed
make[1]: *** [test_libvpx] Error 1
Makefile:17: recipe for target '.DEFAULT' failed
make: *** [.DEFAULT] Error 2

@fbm-static Maybe try with -fPIC?

I've got similar errors like fbm-static and from what I've read, static "linking" isn't possible on Linux unless the base libraries are also compiled with -fPIC, building ffmpeg with it doesn't resolve the issue.

Maybe we need a simple feature-detection script to guide these flags. The start of autohell :)

Totally, but as long as it "just works" would be great. Sorta related, I hope to get some traction over on ask ubuntu http://askubuntu.com/questions/784018/building-static-ffmpeg-libraries-on-amd64-where-libc-isnt-compiled-with-fpic