mirror of
git://code.qt.io/qt/qt5.git
synced 2026-05-04 18:27:05 +08:00
FFmpeg, Android: Use llvm-readelf
In the current Android FFmpeg provisioning, we rely on the tool
'readelf' to be installed on the host. On macOS we currently pull this
tool through the Homebrew 'binutils' package. This has proven
unreliable on older macOS hosts.
The Android NDK provides the same tool under the name 'llvm-readelf'.
This patch makes us rely on this tool during provisioning, which is
guaranteed to be provided.
Change-Id: I47a186d2dd4b442929b82f35b4d257d011cb9d10
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Tero Heikkinen <tero.heikkinen@qt.io>
(cherry picked from commit 07ec75fa35)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
committed by
Qt Cherry-pick Bot
parent
367441b41c
commit
8b9149ca0c
@@ -8,25 +8,27 @@ lib_dir="$1/lib"
|
||||
additional_suffix="${2:-}"
|
||||
set_rpath="${3:-yes}"
|
||||
page_size="${4:-}"
|
||||
custom_readelf="${5:-""}"
|
||||
|
||||
# readelf and patchelf are prerequisite tools for this script. Check
|
||||
# that they are available.
|
||||
if [ "$(uname -s)" = "Darwin" ]; then
|
||||
# Under Homebrew, binutils package is not symlinked into PATH.
|
||||
# This lets us use readelf provided by Homebrew.
|
||||
readelf_homebrew_path="$(brew --prefix binutils)/bin/readelf"
|
||||
if [[ ! -x "$readelf_homebrew_path" ]]; then
|
||||
echo "Found no valid readelf executable. It is possible it was not correctly installed through Homebrew."
|
||||
# If custom_readelf is not provided, we fallback to host readelf.
|
||||
if [ -n "$custom_readelf" ]; then
|
||||
if ! command -v "$custom_readelf"; then
|
||||
echo "Error. Provided readelf executable '${custom_readelf}' is not a valid executable"
|
||||
exit 1
|
||||
fi
|
||||
readelf() { "$readelf_homebrew_path" "$@"; }
|
||||
fi
|
||||
|
||||
if ! command -v readelf; then
|
||||
elif ! command -v readelf; then
|
||||
echo "Found no valid readelf command. It is possible it was not correctly installed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
readelf_wrapper() {
|
||||
if [ -n "$custom_readelf" ]; then
|
||||
"$custom_readelf" "$@"
|
||||
else
|
||||
readelf "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
if ! command -v patchelf; then
|
||||
echo "Found no valid patchelf command. It is possible it was not correctly installed."
|
||||
exit 1
|
||||
@@ -57,7 +59,7 @@ for lib_name in "${ffmpeg_libs[@]}"; do
|
||||
fi
|
||||
|
||||
read_needed_deps() {
|
||||
readelf -d "$lib_path" | grep '(NEEDED)'
|
||||
readelf_wrapper -d "$lib_path" | grep '(NEEDED)'
|
||||
}
|
||||
|
||||
while read -r line; do
|
||||
|
||||
Reference in New Issue
Block a user