FFmpeg, Android: Use 'llvm-strip' from Android NDK explicitly

When running 'install-ffmpeg-android.sh' on Ubuntu hosts, it may fail
due to the FFmpeg build process using the host's 'strip' executable.
This causes the build to fail due to the 'strip' throwing an error
due to it not being able to recognize the format of the .so files for
the FFmpeg Android build.

This patch solves this by explicitly using the executable 'llvm-strip'
command from the Android NDK.

Pick-to: 6.11 6.10 6.8
Change-Id: Ia32c31e3e9d1f550a026f2684362e19d663a8863
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This commit is contained in:
Nils Petter Skålerud
2025-12-10 13:24:39 +01:00
parent 2bac4d3be9
commit c5a42f267f

View File

@@ -82,12 +82,13 @@ build_ffmpeg_android() {
local cc=${toolchain_bin}/${target_toolchain_arch}${api_version}-clang
local ar=${toolchain_bin}/llvm-ar
local ranlib=${toolchain_bin}/llvm-ranlib
local strip=${toolchain_bin}/llvm-strip
local ffmpeg_config_options
ffmpeg_config_options=$(get_ffmpeg_config_options $build_type)
ffmpeg_config_options+=" --enable-cross-compile --target-os=android --enable-jni --enable-mediacodec --enable-openssl --enable-pthreads --enable-neon --disable-asm --disable-indev=android_camera"
ffmpeg_config_options+=" --arch=$target_arch --cpu=${target_cpu} --sysroot=${sysroot} --sysinclude=${sysroot}/usr/include/"
ffmpeg_config_options+=" --cc=${cc} --cxx=${cxx} --ar=${ar} --ranlib=${ranlib}"
ffmpeg_config_options+=" --cc=${cc} --cxx=${cxx} --ar=${ar} --ranlib=${ranlib} --strip=${strip}"
ffmpeg_config_options+=" --extra-cflags=-I${openssl_include} --extra-ldflags=-L${openssl_libs}"
if [ $page_size == "use_16kb_page_size" ]; then
ffmpeg_config_options+=" --extra-ldflags=-Wl,-z,max-page-size=16384"