[vlc-commits] [Git][videolan/vlc][master] apple: build.sh: always set target through compiler argument

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Nov 20 13:33:33 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
c18c26a9 by Marvin Scholz at 2025-11-20T13:09:17+00:00
apple: build.sh: always set target through compiler argument

Even when linking we should use the -m<os>-version-min argument and
let the compiler set the proper low-level linker arguments instead of
second-guessing it, and getting it wrong in cases like when building for
aarch64 targeting 10.11, which never existed. Letting the compiler
handle this will result in the proper outcome:
  ld [...] -arch arm64 -platform_version macos 11.0.0 26.1

- - - - -


1 changed file:

- extras/package/apple/build.sh


Changes:

=====================================
extras/package/apple/build.sh
=====================================
@@ -178,26 +178,19 @@ check_tool()
 set_deployment_target()
 {
     VLC_DEPLOYMENT_TARGET="$1"
-    VLC_DEPLOYMENT_TARGET_LDFLAG="${VLC_HOST_OS}"
     VLC_DEPLOYMENT_TARGET_CFLAG="-m$VLC_HOST_OS"
 
-    if [ "$VLC_HOST_OS" = "macosx" ]; then
-        VLC_DEPLOYMENT_TARGET_LDFLAG="macos"
-    else
-        VLC_DEPLOYMENT_TARGET_LDFLAG="${VLC_HOST_OS}"
-    fi
-
     if [ -n "$VLC_HOST_PLATFORM_SIMULATOR" ]; then
-        VLC_DEPLOYMENT_TARGET_LDFLAG="${VLC_HOST_OS}-simulator"
         VLC_DEPLOYMENT_TARGET_CFLAG="${VLC_DEPLOYMENT_TARGET_CFLAG}-simulator"
     fi
-    VLC_DEPLOYMENT_TARGET_LDFLAG="-Wl,-platform_version,${VLC_DEPLOYMENT_TARGET_LDFLAG},${VLC_DEPLOYMENT_TARGET},${VLC_APPLE_SDK_VERSION}"
 
-    # xrOS does not support the minimal version flag in clang 15.x (yet ?)
+    # TODO: To support setting the min version for xrOS we need to use a target triplet
     if [ "$VLC_HOST_OS" != "xros" ]; then
         VLC_DEPLOYMENT_TARGET_CFLAG="${VLC_DEPLOYMENT_TARGET_CFLAG}-version-min=${VLC_DEPLOYMENT_TARGET}"
+        VLC_DEPLOYMENT_TARGET_LDFLAG="${VLC_DEPLOYMENT_TARGET_CFLAG}"
     else
-	    VLC_DEPLOYMENT_TARGET_CFLAG=""
+        VLC_DEPLOYMENT_TARGET_CFLAG=""
+        VLC_DEPLOYMENT_TARGET_LDFLAG=""
     fi
 }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/c18c26a9672020c99c8c7ebe46af80d185152bb1

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/c18c26a9672020c99c8c7ebe46af80d185152bb1
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list