当前位置: 首页 > 工具软件 > libav > 使用案例 >

android rootx8664,为Android x86_64编译libav

冯福
2023-12-01

我试图为所有体系结构(包括64位)编译lib。 我创建的脚本适用于armeabi,armeabi-v7a,arm64-v8a和x86。 它失败了mips,并可能会失败的mips64以及,但我不关心他们;它是次要的,我有主要问题:我关心x86_64,这个不会编译。为Android x86_64编译libav

编辑:x86也失败了。在帖子结尾编译错误日志。

下面是该脚本:

创建一个独立的工具链:就像一个魅力

使用该工具链配置的lib:

./configure --arch=x86_64 --cpu=x86_64 --cross-prefix=/some/path/usingLibAV/toolchains/x86_64/bin/x86_64-linux-android- --target-os=android --sysroot="/some/path/Library/Android/ndk/platforms/android-21/arch-x86_64/" --extra-cflags=" -O3 -fpic -DANDROID -DHAVE_SYS_UIO_H=1 -fasm -Wno-psabi -fno-short-enums -fno-strict-aliasing -finline-limit=300 -march=atom -ffast-math -msse3 -mfpmath=sse " --extra-ldflags="-Wl,-rpath-link=/some/path/Library/Android/ndk/platforms/android-21/arch-x86_64//usr/lib -L/some/path/Library/Android/ndk/platforms/android-21/arch-x86_64//usr/lib -nostdlib -lc -lm" --enable-shared --disable-symver

这似乎配置好,config.log不会引发任何错误,除了下面的警告(无论如何我都会得到这个警告):

WARNING: /some/path/Documents/usingLibAV/toolchains/x86_64/bin/x86_64-linux-android-pkg-config not found, library detection may fail.

compile:make -j 8.我得到.so文件正确生成,但如果我仔细看看日志,我会在最后得到错误(对不起,吨粘贴整个日志,它是长):

CC libswscale/yuv2rgb.o AR libavformat/libavformat.a YASM libswscale/x86/scale.o AR libavcodec/libavcodec.a AR libavresample/libavresample.a AR libavutil/libavutil.a CC avconv.o CC cmdutils.o CC avconv_opt.o CC avconv_filter.o CC avprobe.o HOSTCC doc/print_options.o AR libavdevice/libavdevice.a LD libavutil/libavutil.so.54 AR libavfilter/libavfilter.a /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libc.so while searching for c /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libm.so while searching for m /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libm.so while searching for m /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libz.so while searching for z LD libavresample/libavresample.so.2 /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libc.so while searching for c /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libm.so while searching for m /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libm.so while searching for m /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libz.so while searching for z LD libavcodec/libavcodec.so.56 HOSTLD doc/print_options GENTEXI doc/avoptions_format.texi GENTEXI doc/avoptions_codec.texi POD doc/avprobe.pod POD doc/avconv.pod MAN doc/avprobe.1 MAN doc/avconv.1 /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libc.so while searching for c /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libm.so while searching for m /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libm.so while searching for m /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libz.so while searching for z LD libavformat/libavformat.so.56 /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libc.so while searching for c /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libm.so while searching for m /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libm.so while searching for m /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libz.so while searching for z LD libavdevice/libavdevice.so.55 /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libc.so while searching for c /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libm.so while searching for m /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libm.so while searching for m /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libz.so while searching for z LD libswscale/libswscale.so.3 AR libswscale/libswscale.a /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libc.so while searching for c /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libm.so while searching for m /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libm.so while searching for m /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libz.so while searching for z LD libavfilter/libavfilter.so.5 /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libc.so while searching for c /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libm.so while searching for m /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libm.so while searching for m /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libz.so while searching for z LD avconv LD avprobe /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libc.so while searching for c /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libm.so while searching for m /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libm.so while searching for m /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libz.so while searching for z libavcodec/libavcodec.so: error: undefined reference to '__powidf2' collect2: error: ld returned 1 exit status make: * [avprobe] Error 1 make: * Waiting for unfinished jobs.... /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libc.so while searching for c /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libm.so while searching for m /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libm.so while searching for m /Volumes/diskE/some/path/usingLibAV/toolchains/x86_64/bin/../lib/gcc/x86_64-linux-android/4.9/../../../../x86_64-linux-android/bin/ld: warning: skipping incompatible /some/pathLibrary/Android/ndk/platforms/android-21/arch-x86_64//usr/lib/libz.so while searching for z libavcodec/libavcodec.so: error: undefined reference to '__powidf2' collect2: error: ld returned 1 exit status make: *** [avconv] Error 1

错误编译86,与配置后:的./configure --arch = 86 --cpu = 86 --cross前缀= /一些/ path/Documents/usingLibAV/toolchains/x86/bin/i686-linux-android- --target-os = android --sysroot =“/ some/path/Library/Android/ndk/platforms/android-9/arch- x86 /“--extra-cflags =”-O3 -fpic -DANDROID -DHAVE_SYS_UIO_H = 1 -fasm -Wno-psabi -fno-short-enums -fno-strict-aliasing - finline-limit = 300 -march = atom -fast-math -msse3 -mfpmath = sse“--extra-ldflags =” - Wl,-rpath-link =/some/path/Library/Android/ndk/platforms/android- 9/arch-x86 // usr/lib -L ​​/ some/path/Library/Android/ndk/platforms/android-9/arch-x86 // usr/lib -nostdlib -lc -lm“--enable-shared

^

CC libswscale/x86/yuv2rgb.o

CC libswscale/yuv2rgb.o

AR libavformat/libavformat.a

YASM libswscale/x86/scale.o

AR libavcodec/libavcodec.a

AR libavresample/libavresample.a

AR libavutil/libavutil.a

CC avconv.o

CC cmdutils.o

CC avconv_opt.o

CC avconv_filter.o

CC avprobe.o

HOSTCC doc/print_options.o

AR libavdevice/libavdevice.a

LD libavutil/libavutil.so.54

AR libavfilter/libavfilter.a

HOSTLD doc/print_options

LD libavresample/libavresample.so.2

GENTEXI doc/avoptions_format.texi

GENTEXI doc/avoptions_codec.texi

POD doc/avprobe.pod

POD doc/avconv.pod

LD libavcodec/libavcodec.so.56

MAN doc/avprobe.1

MAN doc/avconv.1

LD libavformat/libavformat.so.56

LD libavdevice/libavdevice.so.55

LD libswscale/libswscale.so.3

AR libswscale/libswscale.a

LD libavfilter/libavfilter.so.5

LD avconv

LD avprobe

libavdevice/libavdevice.so: error: undefined reference to '__divdi3'

libavdevice/libavdevice.so:libavdevice/libavdevice.so: errorerror: undefined reference to ': __moddi3'

libavformatundefined reference to '__moddi3'

libavformat/libavformat.so/libavformat.so: error: undefined reference: error to : undefined'__udivdi3' reference to '__udivdi3'

libavformat/

libavformat/libavformat.so: errorlibavformat.so: error: : undefined reference undefined referenceto ' to '__umoddi3'

libavcodec/__umoddi3'

libavcodec.so: errorlibavcodec/: libavcodec.so: error: undefined reference to '__powidf2'

avconv.c:1434: error: undefined referenceundefined reference to '__powidf2 to '

'__divdi3'

avconv.c:1441: error: undefined reference to '__divdi3'

avconv.c:1434: error: undefined reference to '__divdi3'

avconv.c:1441: error: undefined reference to '__divdi3'

collect2: error: ld returned 1 exit status

collect2: error: ld returned 1 exit status

make: *** [avprobe] Error 1

make: *** Waiting for unfinished jobs....

make: *** [avconv] Error 1

 类似资料: