mirror of
git://code.qt.io/qt/qt5.git
synced 2026-01-05 22:46:55 +08:00
Android: FFmpeg to support 16KB page sizes
This patch adds needed linker flags for FFmpeg Android
compilation to get FFmpeg binary to be compliant for
16KB page size. 16KB page size is compliant with 4KB
page size.
This patch updates Android OpenSSL to be version 3.0.7,
which is build with two NDK's: NDK27c and NDK29-beta2.
Both with 16KB page size support. They are build with
https://github.com/KDAB/android_openssl/pull/69 just
changing OpenSSL version from 3.1.1 to 3.0.7 and NDK
version from 25.2.9519653 to 27.2.12479018 (27c) and
another build with 29.0.13599879 (beta2). The both build
artefacts are added to CI-files to be usable.
As the 16KB page size is applicable only to 64-bit ABI's
this patch adds the variable to 90-install-ffmpeg.sh files
for android-x86_64 and android-arm64.
Change is picked to all branches using Android 15 or newer
as Android 15 introduced the 16KB page size support.
Fixes: QTBUG-139762
Pick-to: 6.9 6.8 6.5
Change-Id: I50bab81b97dad3e9d8c1e834c1928949d1e19687
Reviewed-by: Tero Heikkinen <tero.heikkinen@qt.io>
(cherry picked from commit 875297edfc)
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
This commit is contained in:
@@ -65,3 +65,11 @@ set_ffmpeg_dir_env_var() {
|
||||
source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh"
|
||||
SetEnvVar "$envvar" "$dir"
|
||||
}
|
||||
|
||||
set_ffmpeg_env_var() {
|
||||
local envvar="$1"
|
||||
local value="$2"
|
||||
|
||||
source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh"
|
||||
SetEnvVar "$envvar" "$value"
|
||||
}
|
||||
|
||||
@@ -9,7 +9,8 @@ source "${BASH_SOURCE%/*}/../unix/ffmpeg-installation-utils.sh"
|
||||
|
||||
os="$1"
|
||||
# Optional parameter to set output installation directory. Useful for local builds.
|
||||
target_install_dir_param="$2"
|
||||
page_size="$2"
|
||||
target_install_dir_param="$3"
|
||||
build_type=$(get_ffmpeg_build_type)
|
||||
ffmpeg_source_dir=$(download_ffmpeg)
|
||||
|
||||
@@ -88,7 +89,15 @@ build_ffmpeg_android() {
|
||||
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+=" --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"
|
||||
echo "FFmpeg Android using 16KB page sizes"
|
||||
elif [ $page_size == "use_4kb_page_size" ]; then
|
||||
echo "FFmpeg Android using 4KB page sizes"
|
||||
else
|
||||
echo "Error: FFmpeg Android page_size must be: use_16kb_page_size or: use_4kb_page_size got: $page_size" >&2
|
||||
exit 1
|
||||
fi
|
||||
local build_dir="$ffmpeg_source_dir/build_android/$target_arch"
|
||||
mkdir -p "$build_dir"
|
||||
pushd "$build_dir"
|
||||
|
||||
@@ -13,7 +13,7 @@ source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh"
|
||||
|
||||
sslVersionForLatest="3.0.7"
|
||||
ndkVersionLatest="r27c"
|
||||
prebuiltOpensslShaLatest="733cff853b6ee7738e78b90f46b5f028c8490e1e"
|
||||
prebuiltOpensslShaLatest="2cc15dd990460c2c7157ab257a47071fbd9e0ac8"
|
||||
|
||||
ndkVersionNightly1=$ndkVersionLatest
|
||||
sslVersionForNightly1=$sslVersionForLatest
|
||||
@@ -61,10 +61,10 @@ function InstallPrebuiltOpenssl() {
|
||||
sha=$2
|
||||
sslVersion=$3
|
||||
|
||||
opensslHome="${HOME}/prebuilt-openssl-${sslVersion}-for-android-ndk-${ndkVersion}"
|
||||
opensslHome="${HOME}/prebuilt-openssl-${sslVersion}-for-android-ndk-${ndkVersion}_16kb"
|
||||
if [[ ! -d ${opensslHome} ]]; then
|
||||
prebuiltUrl="http://ci-files01-hki.ci.qt.io/input/openssl/prebuilt-openssl-${sslVersion}-for-android-ndk-${ndkVersion}.zip"
|
||||
targetFile="/tmp/prebuilt-openssl-${sslVersion}-for-android-ndk-${ndkVersion}.zip"
|
||||
prebuiltUrl="http://ci-files01-hki.ci.qt.io/input/openssl/prebuilt-openssl-${sslVersion}-for-android-ndk-${ndkVersion}_16kb.zip"
|
||||
targetFile="/tmp/prebuilt-openssl-${sslVersion}-for-android-ndk-${ndkVersion}_16kb.zip"
|
||||
|
||||
DownloadURL "$prebuiltUrl" "$prebuiltUrl" "$sha" "$targetFile"
|
||||
unzip -o "$targetFile" -d "${HOME}"
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
source "${BASH_SOURCE%/*}/../common/linux/install-ffmpeg-linux.sh"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-x86_64"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-x86"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-x86_64" "use_16kb_page_size"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-x86" "use_4kb_page_size"
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
source "${BASH_SOURCE%/*}/../common/linux/install-ffmpeg-linux.sh"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-x86"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-x86_64"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-x86" "use_4kb_page_size"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-x86_64" "use_16kb_page_size"
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
source "${BASH_SOURCE%/*}/../common/linux/install-ffmpeg-linux.sh"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-x86_64"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-x86_64" "use_16kb_page_size"
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
#SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
|
||||
source "${BASH_SOURCE%/*}/../common/linux/install-ffmpeg-linux.sh"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-x86_64"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-x86"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-x86_64" "use_16kb_page_size"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-x86" "use_4kb_page_size"
|
||||
|
||||
@@ -5,5 +5,5 @@
|
||||
set -ex
|
||||
|
||||
source "${BASH_SOURCE%/*}/../common/macos/install-ffmpeg-macos.sh" "macos-universal"
|
||||
#source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-arm64"
|
||||
#source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-arm64" "use_16kb_page_size"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-ios.sh"
|
||||
|
||||
@@ -5,5 +5,5 @@
|
||||
set -ex
|
||||
|
||||
source "${BASH_SOURCE%/*}/../common/macos/install-ffmpeg-macos.sh" "macos-universal"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-arm64"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-arm64" "use_16kb_page_size"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-ios.sh"
|
||||
|
||||
@@ -5,5 +5,5 @@
|
||||
set -ex
|
||||
|
||||
source "${BASH_SOURCE%/*}/../common/macos/install-ffmpeg-macos.sh" "macos-universal"
|
||||
#source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-arm64"
|
||||
#source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-arm64" "use_16kb_page_size"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-ios.sh"
|
||||
|
||||
@@ -5,5 +5,5 @@
|
||||
set -ex
|
||||
|
||||
source "${BASH_SOURCE%/*}/../common/macos/install-ffmpeg-macos.sh" "macos-universal"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-arm64"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-arm64" "use_16kb_page_size"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-ios.sh"
|
||||
|
||||
@@ -5,5 +5,5 @@
|
||||
set -ex
|
||||
|
||||
source "${BASH_SOURCE%/*}/../common/macos/install-ffmpeg-macos.sh" "macos-universal"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-arm64"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-arm64" "use_16kb_page_size"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-ios.sh"
|
||||
|
||||
@@ -5,5 +5,5 @@
|
||||
set -ex
|
||||
|
||||
source "${BASH_SOURCE%/*}/../common/macos/install-ffmpeg-macos.sh" "macos-universal"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-arm64"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-arm64" "use_16kb_page_size"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-ios.sh"
|
||||
|
||||
@@ -5,5 +5,5 @@
|
||||
set -ex
|
||||
|
||||
source "${BASH_SOURCE%/*}/../common/macos/install-ffmpeg-macos.sh" "macos-universal"
|
||||
#source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-arm64"
|
||||
#source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-arm64" "use_16kb_page_size"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-ios.sh"
|
||||
|
||||
@@ -5,5 +5,5 @@
|
||||
set -ex
|
||||
|
||||
source "${BASH_SOURCE%/*}/../common/macos/install-ffmpeg-macos.sh" "macos-universal"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-arm64"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-android.sh" "android-arm64" "use_16kb_page_size"
|
||||
source "${BASH_SOURCE%/*}/../common/unix/install-ffmpeg-ios.sh"
|
||||
|
||||
Reference in New Issue
Block a user