[vlc-commits] [Git][videolan/vlc][master] 3 commits: contrib: glew: do not force compiler flags and don't build .dll

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sun Jun 28 09:20:03 UTC 2026



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
afe91e3d by Steve Lhomme at 2026-06-28T10:39:47+02:00
contrib: glew: do not force compiler flags and don't build .dll

- - - - -
a77c00ba by Steve Lhomme at 2026-06-28T10:39:47+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

- - - - -
1ddc41eb by Steve Lhomme at 2026-06-28T10:39:47+02:00
contrib: theora: use a fork that is not failing all the time

Until there is a proper release of libtheora.

- - - - -


5 changed files:

- + contrib/src/glew/0005-Do-not-force-compiler-flag.patch
- + contrib/src/glew/0006-Do-not-compile-the-shared-library-with-DBUILD_SHARED.patch
- contrib/src/glew/rules.mak
- contrib/src/theora/rules.mak
- extras/package/win32/build.sh


Changes:

=====================================
contrib/src/glew/0005-Do-not-force-compiler-flag.patch
=====================================
@@ -0,0 +1,38 @@
+From 168f2f76d55b828918355aa35fda853766347735 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <slhomme at matroska.org>
+Date: Fri, 26 Jun 2026 06:46:01 +0200
+Subject: [PATCH 5/6] Do not force compiler flag
+
+- We do want stack protection if it's forced.
+- We don't need to disable standard libraries.
+- Use built-in if you want.
+---
+ build/cmake/CMakeLists.txt | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/build/cmake/CMakeLists.txt b/build/cmake/CMakeLists.txt
+index bd9fc9e..087aaf6 100644
+--- a/build/cmake/CMakeLists.txt
++++ b/build/cmake/CMakeLists.txt
+@@ -133,12 +133,12 @@ if (MSVC)
+   target_link_libraries (glew LINK_PRIVATE libvcruntime.lib)
+   target_link_libraries (glew LINK_PRIVATE msvcrt.lib )
+   string(REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
+-elseif (WIN32 AND ((CMAKE_C_COMPILER_ID MATCHES "GNU") OR (CMAKE_C_COMPILER_ID MATCHES "Clang")))
+-  # remove stdlib dependency on windows with GCC and Clang (for similar reasons
+-  # as to MSVC - to allow it to be used with any Windows compiler)
+-  target_compile_options (glew PRIVATE -fno-builtin -fno-stack-protector)
+-  target_compile_options (glew_s PRIVATE -fno-builtin -fno-stack-protector)
+-  target_link_libraries (glew LINK_PRIVATE -nostdlib)
++# elseif (WIN32 AND ((CMAKE_C_COMPILER_ID MATCHES "GNU") OR (CMAKE_C_COMPILER_ID MATCHES "Clang")))
++#   # remove stdlib dependency on windows with GCC and Clang (for similar reasons
++#   # as to MSVC - to allow it to be used with any Windows compiler)
++#   target_compile_options (glew PRIVATE -fno-builtin -fno-stack-protector)
++#   target_compile_options (glew_s PRIVATE -fno-builtin -fno-stack-protector)
++#   target_link_libraries (glew LINK_PRIVATE -nostdlib)
+ endif ()
+ 
+ if (BUILD_FRAMEWORK)
+-- 
+2.39.5 (Apple Git-154)
+


=====================================
contrib/src/glew/0006-Do-not-compile-the-shared-library-with-DBUILD_SHARED.patch
=====================================
@@ -0,0 +1,68 @@
+From 94f25bbf055dff046cb865ed73f156ac68ff7c0d Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <slhomme at matroska.org>
+Date: Fri, 26 Jun 2026 06:47:57 +0200
+Subject: [PATCH 6/6] Do not compile the shared library with
+ -DBUILD_SHARED_LIBS=OFF
+
+---
+ build/cmake/CMakeLists.txt | 16 ++++++++++------
+ 1 file changed, 10 insertions(+), 6 deletions(-)
+
+diff --git a/build/cmake/CMakeLists.txt b/build/cmake/CMakeLists.txt
+index 087aaf6..024e4b6 100644
+--- a/build/cmake/CMakeLists.txt
++++ b/build/cmake/CMakeLists.txt
+@@ -111,10 +111,12 @@ if (WIN32)
+   list (APPEND GLEW_SRC_FILES ${GLEW_DIR}/build/glew.rc)
+ endif ()
+ 
++if(BUILD_SHARED_LIBS)
+ add_library (glew SHARED ${GLEW_PUBLIC_HEADERS_FILES} ${GLEW_SRC_FILES})
+ set_target_properties (glew PROPERTIES COMPILE_DEFINITIONS "GLEW_BUILD" OUTPUT_NAME "${GLEW_LIB_NAME}" PREFIX "${DLL_PREFIX}"
+                                        VERSION ${GLEW_VERSION}
+                                        SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR})
++endif()
+ add_library (glew_s STATIC ${GLEW_PUBLIC_HEADERS_FILES} ${GLEW_SRC_FILES})
+ set_target_properties (glew_s PROPERTIES COMPILE_DEFINITIONS "GLEW_STATIC" OUTPUT_NAME "${GLEW_LIB_NAME}" PREFIX lib)
+ 
+@@ -141,7 +143,7 @@ if (MSVC)
+ #   target_link_libraries (glew LINK_PRIVATE -nostdlib)
+ endif ()
+ 
+-if (BUILD_FRAMEWORK)
++if (BUILD_FRAMEWORK AND BUILD_SHARED_LIBS)
+   set_target_properties(glew PROPERTIES
+     FRAMEWORK TRUE
+     FRAMEWORK_VERSION ${GLEW_VERSION}
+@@ -154,14 +156,11 @@ if (BUILD_FRAMEWORK)
+   )
+ endif()
+ 
++if(BUILD_SHARED_LIBS)
+ target_link_libraries (glew LINK_PUBLIC ${GLEW_LIBRARIES})
++endif()
+ target_link_libraries (glew_s ${GLEW_LIBRARIES})
+ 
+-target_compile_definitions(glew_s INTERFACE "GLEW_STATIC")
+-foreach(t glew glew_s)
+-  target_include_directories(${t} PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
+-endforeach()
+-
+ set(targets_to_install "")
+ if(BUILD_SHARED_LIBS)
+   list(APPEND targets_to_install glew)
+@@ -169,6 +168,11 @@ else ()
+   list(APPEND targets_to_install glew_s)
+ endif()
+ 
++target_compile_definitions(glew_s INTERFACE "GLEW_STATIC")
++foreach(t ${targets_to_install})
++  target_include_directories(${t} PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
++endforeach()
++
+ install ( TARGETS ${targets_to_install}
+           EXPORT glew-targets
+           RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Runtime
+-- 
+2.52.0.windows.1
+


=====================================
contrib/src/glew/rules.mak
=====================================
@@ -17,6 +17,8 @@ glew: glew-$(GLEW_VERSION).tgz .sum-glew
 	$(APPLY) $(SRC)/glew/0002-Link-with-opengl32-on-Windows.patch
 	$(APPLY) $(SRC)/glew/0003-Link-directly-with-glu32-on-Windows.patch
 	$(APPLY) $(SRC)/glew/0004-Allow-disabling-the-CMAKE_DEBUG_POSTFIX.patch
+	$(APPLY) $(SRC)/glew/0005-Do-not-force-compiler-flag.patch
+	$(APPLY) $(SRC)/glew/0006-Do-not-compile-the-shared-library-with-DBUILD_SHARED.patch
 	$(MOVE)
 
 GLEW_CONF := -DBUILD_UTILS=OFF


=====================================
contrib/src/theora/rules.mak
=====================================
@@ -2,7 +2,8 @@
 
 THEORA_VERSION := 1.2.0
 THEORA_URL := $(XIPH)/theora/libtheora-$(THEORA_VERSION).tar.xz
-THEORA_GITURL := https://gitlab.xiph.org/xiph/theora.git
+# THEORA_GITURL := https://gitlab.xiph.org/xiph/theora.git
+THEORA_GITURL := https://github.com/xiph/theora.git
 THEORA_GITBRANCH := main
 THEORA_GITVERSION := fb92ede9ba5162d0b8134cd1ff57751df6f3dbe6
 


=====================================
extras/package/win32/build.sh
=====================================
@@ -162,6 +162,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
@@ -405,6 +408,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/-/compare/a6e8d271fa69dc7c0875f0c6955e3b6bb995f4bb...1ddc41ebe836bee2d5995997e90d118cfa7cee9c

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a6e8d271fa69dc7c0875f0c6955e3b6bb995f4bb...1ddc41ebe836bee2d5995997e90d118cfa7cee9c
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