[vlc-commits] [Git][videolan/vlc][3.0.x] package/win32: enable Control Flow Guard when building with LLVM16+

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sat Jul 4 14:09:57 UTC 2026



Jean-Baptiste Kempf pushed to branch 3.0.x at VideoLAN / VLC


Commits:
fbe4f357 by Steve Lhomme at 2026-07-04T15:35:57+02:00
package/win32: enable Control Flow Guard when building with LLVM16+

It's already turned on in our Docker images since the switch to LLVM16 [^1].

[^1]: https://code.videolan.org/videolan/docker-images/-/commit/8224e86f5d00c6b19c37f3deaeb8f4db1d3f37ed

(cherry picked from commit a77c00baf586367fda4187df437ec42b045e6cbf)
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>

- - - - -


1 changed file:

- extras/package/win32/build.sh


Changes:

=====================================
extras/package/win32/build.sh
=====================================
@@ -138,6 +138,9 @@ if ! printf "#ifdef __clang__\n#error CLANG\n#endif" | $CC -E - 1>/dev/null 2>/d
     if ! printf "#if __clang_major__ >= 14\n#error CLANG\n#endif" | $CC -E - 1>/dev/null 2>/dev/null; then
         COMPILING_WITH_CLANG14=1
     fi
+    if ! printf "#if __clang_major__ >= 16\n#error CLANG\n#endif" | $CC -E - 1>/dev/null 2>/dev/null; then
+        COMPILING_WITH_CLANG16=1
+    fi
     COMPILING_WITH_CLANG=1
 else
     COMPILING_WITH_CLANG=0
@@ -364,6 +367,11 @@ if [ "$COMPILING_WITH_CLANG" -gt 0 ]; then
         VLC_CXXFLAGS="$VLC_CXXFLAGS --end-no-unused-arguments"
         VLC_LDFLAGS="$VLC_LDFLAGS --end-no-unused-arguments"
     fi
+    if [ "${COMPILING_WITH_CLANG16}" = "1" ]; then
+        VLC_CFLAGS="$VLC_CFLAGS -mguard=cf"
+        VLC_CXXFLAGS="$VLC_CXXFLAGS -mguard=cf"
+        VLC_LDFLAGS="$VLC_LDFLAGS -mguard=cf"
+    fi
 fi
 
 if [ -z "$PKG_CONFIG" ]; then



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

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/fbe4f357b1bc0bdaf78336abe1b262829d214781
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list