Hi,
I'm trying to run the vpxenc on my Android 7.0 device and I downloaded the latest code of libvpx.
What I did are:
$NDK/build/tools/make_standalone_toolchain.py --arch x86_64 --install-dir ~/my_standalone_toolchain
export PATH=$PATH:~/my_standalone_toolchain/bin
CROSS=x86_64-linux-android- CC=clang CXX=clang++ ASFLAGS="-D__ANDROID__" ~/libvpx/configure --target=x86_64-android-gcc --sdk-path=$NDK
The confgiure script runs successfully:
enabling vp8_encoder
enabling vp8_decoder
enabling vp9_encoder
enabling vp9_decoder
Configuring for target 'x86_64-android-gcc'
enabling x86_64
enabling runtime_cpu_detect
enabling mmx
enabling sse
enabling sse2
enabling sse3
enabling ssse3
enabling sse4_1
enabling avx
enabling avx2
using yasm
enabling postproc
enabling webm_io
enabling libyuv
Creating makefiles for x86_64-android-gcc libs
Creating makefiles for x86_64-android-gcc examples
Creating makefiles for x86_64-android-gcc tools
Creating makefiles for x86_64-android-gcc docs
And the compilation is OK. However, when the tool “vpxenc” is pushed to the Android device, there's an error:
"vpxenc": error: only position independent executables (PIE) are supported.
Aborted
So I modified the .mk files manually to add the flags:
CFLAGS += -fPIE
CXXFLAGS += -fPIE
LDFLAGS += -fPIE -pie
However, there're errors during the linking phase for vpxdec:
[LD] vpxdec
/home/anonymous/my_standalone_toolchain/bin/../lib/gcc/x86_64-linux-android/4.9.x/../../../../x86_64-linux-android/bin/ld: error: ./libvpx.a(fwd_txfm_ssse3_x86_64.asm.o): requires dynamic R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
/home/anonymous/my_standalone_toolchain/bin/../lib/gcc/x86_64-linux-android/4.9.x/../../../../x86_64-linux-android/bin/ld: error: ./libvpx.a(quantize_ssse3_x86_64.asm.o): requires dynamic R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
/home/anonymous/my_standalone_toolchain/bin/../lib/gcc/x86_64-linux-android/4.9.x/../../../../x86_64-linux-android/bin/ld: error: ./libvpx.a(subpel_variance_sse2.asm.o): requires dynamic R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
clang38++: error: linker command failed with exit code 1 (use -v to see invocation)
But even I added -fPIC, the same error is seen.
Could anyone help me on this issue?
Thanks a lot!