[vlc-commits] package/apple: fix compilation on ARM-64

Felix Paul Kühne git at videolan.org
Tue Feb 16 14:30:59 UTC 2021


vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Mon Feb 15 13:48:17 2021 +0100| [a089d8b795d5b77650f697eec9c8192ed6ada906] | committer: Felix Paul Kühne

package/apple: fix compilation on ARM-64

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a089d8b795d5b77650f697eec9c8192ed6ada906
---

 extras/package/apple/build.sh | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/extras/package/apple/build.sh b/extras/package/apple/build.sh
index 1868c8f1f4..4190938f86 100755
--- a/extras/package/apple/build.sh
+++ b/extras/package/apple/build.sh
@@ -57,6 +57,7 @@ VLC_HOST_ARCH="x86_64"
 # Host platform information
 VLC_HOST_PLATFORM=
 VLC_HOST_TRIPLET=
+VLC_BUILD_TRIPLET=
 # Set to "1" when building for simulator
 VLC_HOST_PLATFORM_SIMULATOR=
 # The host OS name (without the simulator suffix)
@@ -232,6 +233,18 @@ set_host_triplet()
     VLC_HOST_TRIPLET="${triplet_arch}-apple-darwin"
 }
 
+# Set the VLC_BUILD_TRIPLET based on the architecture
+# that we run on.
+# Globals:
+#   VLC_BUILD_TRIPLET
+# Arguments:
+#   None
+set_build_triplet()
+{
+    local build_arch="$(uname -m | cut -d. -f1)"
+    VLC_BUILD_TRIPLET="$(cc -arch "${build_arch}" -dumpmachine)"
+}
+
 # Take SDK name, verify it exists and populate
 # VLC_HOST_*, VLC_APPLE_SDK_PATH variables based
 # on the SDK and calls the set_deployment_target
@@ -490,6 +503,7 @@ validate_architecture "$VLC_HOST_ARCH"
 
 # Set triplet (needs to be called after validating the arch)
 set_host_triplet "$VLC_HOST_ARCH"
+set_build_triplet
 
 # Set pseudo-triplet
 # FIXME: This should match the actual clang triplet and should be used for compiler invocation too!
@@ -603,6 +617,7 @@ write_config_mak "-Werror=partial-availability"
 # Bootstrap contribs
 ../bootstrap \
     --host="$VLC_HOST_TRIPLET" \
+    --build="$VLC_BUILD_TRIPLET" \
     --prefix="$VLC_CONTRIB_INSTALL_DIR" \
     "${VLC_CONTRIB_OPTIONS[@]}" \
 || abort_err "Bootstrapping contribs failed"
@@ -680,6 +695,7 @@ mkdir -p "$VLC_INSTALL_DIR"
 hostenv ../../configure \
     --with-contrib="$VLC_CONTRIB_INSTALL_DIR" \
     --host="$VLC_HOST_TRIPLET" \
+    --build="$VLC_BUILD_TRIPLET" \
     --prefix="$VLC_INSTALL_DIR" \
     "${VLC_CONFIG_OPTIONS[@]}" \
  || abort_err "Configuring VLC failed"



More information about the vlc-commits mailing list