Reputation: 12167
I want to cross compile ffmpeg 2.8.x on Mac OS X 10.10, but I got the following error.
HOSTCC libavcodec/cabac_tablegen.o
In file included from libavcodec/cabac_tablegen.c:25:
In file included from libavcodec/cabac_functions.h:43:
libavcodec/arm/cabac.h:96:25: error: value '24' out of range for constraint 'M'
[byte]"M"(offsetof(CABACContext, bytestream)),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/7.0.2/include/stddef.h:120:24: note:
expanded from macro 'offsetof'
#define offsetof(t, d) __builtin_offsetof(t, d)
^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [libavcodec/cabac_tablegen.o] Error 1
The error show some error in host cc, the host cc is clang-700.1.81
$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin14.5.0
Thread model: posix
Before I upgrade Xcode to 7.2, it worked fine.
For ffmpeg 3.x, there is no such problem. But the ffmpeg version I need is 2.8.x. How can I fix without downgrade Xcode to previous version?
Upvotes: 0
Views: 259
Reputation: 12167
It was the problems of host cc.
I kept the current version Xcode and install another version command line tools Command_Line_Tools_OS_X_10.10_for_Xcode_6.4
.
The clang version for this command line tools is
$ /Library/Developer/CommandLineTools/usr/bin/cc --version
Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.5.0
Thread model: posix
And change the host cc to this compiler when configure ffmpeg.
./configure --host-cc=/Library/Developer/CommandLineTools/usr/bin/cc
Now it can get compiled without error.
Upvotes: 1