libavcodec static configuration failure
Describe your issue
Using recent android prebuild binaries (gstreamer-1.0-android-universal-1.22.9), attempting to statically link the libav plugin lib 'libavcodec' results in several symbol relocation build failures:
ld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol 'ff_cos_32'; recompile with -fPIC
>>> defined in /Users/ramdau/Documents/libs/gstreamer-1.0-android-universal-1.22.9/arm64/lib/libavcodec.a(fft_float.o)
>>> referenced by asm.S:526 (./libavutil/aarch64/asm.S:526)
>>> fft_neon.o:(fft32_neon) in archive /Users/ramdau/Documents/libs/gstreamer-1.0-android-universal-1.22.9/arm64/lib/libavcodec.a
...
ld: error: relocation R_AARCH64_ADD_ABS_LO12_NC cannot be used against symbol 'ff_cos_16384'; recompile with -fPIC
>>> defined in /Users/ramdau/Documents/libs/gstreamer-1.0-android-universal-1.22.9/arm64/lib/libavcodec.a(fft_float.o)
>>> referenced by asm.S:535 (./libavutil/aarch64/asm.S:535)
>>> fft_neon.o:(fft16384_neon) in archive /Users/ramdau/Documents/libs/gstreamer-1.0-android-universal-1.22.9/arm64/lib/libavcodec.a
Setup
- Operating System: Android, compileSdkVersion 34
- Device: Android Studio on Macbook Pro, M1 Pro
- GStreamer Version: gstreamer-1.0-android-universal-1.22.9
Steps to reproduce the bug
Same as in the issue #1612
- Install gstreamer 1.22.9 binaries for android: gstreamer-1.0-android-universal-1.22.9
- Set environment variable GSTREAMER_ROOT_ANDROID
- Rename folders in GSTREAMER_ROOT_ANDROID to match android studio ABI names i.e. 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
- Pull repository
- Link 'libav' plugin and its libs 'avutil, swresample, avfilter, avcodec, avformat'
- Try building project
Solutions you have tried
Adding '-fPIC' flag to my cmake c/cpp configuration does nothing.