[vlc-commits] [Git][videolan/vlc][master] 13 commits: package/win32: favor the static version of winpthread with clang

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Jan 11 14:13:43 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
cd7e35c6 by Steve Lhomme at 2025-01-11T13:39:55+00:00
package/win32: favor the static version of winpthread with clang

Just like we favor the static version of libunwind.

We don't need any extra flags for the compiler. It's all handled in the linker.

Ref. #28903

- - - - -
5e125e3a by Steve Lhomme at 2025-01-11T13:39:55+00:00
contrib: gme: switch to github

This is the new official home.

- - - - -
3c60f146 by Steve Lhomme at 2025-01-11T13:39:55+00:00
contrib: gme: fix -Wl,-l: linker flag escaping in implicit libraries

- - - - -
a57a1c04 by Steve Lhomme at 2025-01-11T13:39:55+00:00
contrib: gme: use proper patch format for underrun

- - - - -
17cb1afc by Steve Lhomme at 2025-01-11T13:39:55+00:00
contrib: chromaprint: fix -Wl,-l: linker flag escaping in implicit libraries

- - - - -
27acbe02 by Steve Lhomme at 2025-01-11T13:39:55+00:00
contrib: chromaprint: use proper patch format for library fixes

- - - - -
252472aa by Steve Lhomme at 2025-01-11T13:39:55+00:00
contrib: srt: use the MOVE call

- - - - -
248ddae0 by Steve Lhomme at 2025-01-11T13:39:55+00:00
contrib: srt: fix -Wl,-l: linker flag escaping in implicit libraries

- - - - -
49eb55d9 by Steve Lhomme at 2025-01-11T13:39:55+00:00
contrib: x265: fix -Wl,-l: linker flag escaping in implicit libraries

- - - - -
9800e3de by Steve Lhomme at 2025-01-11T13:39:55+00:00
contrib: x265: use proper patch format for old fixes

- - - - -
7a583c50 by Steve Lhomme at 2025-01-11T13:39:55+00:00
contrib: vulkan-loader: disable ASM usage on Windows

- - - - -
0a3fb61a by Steve Lhomme at 2025-01-11T13:39:55+00:00
contrib: vulkan-loader: fix -Wl,-l: linker flag escaping in implicit libraries

- - - - -
280e11a5 by Steve Lhomme at 2025-01-11T13:39:55+00:00
contrib: vulkan-loader: don't assume the build is static

On Windows the build is never static. We should not
pretend it has built a static library.

- - - - -


18 changed files:

- contrib/src/chromaprint/linklibs.patch → contrib/src/chromaprint/0001-contribs-chromaprint-more-fixes-for-.pc-file.patch
- contrib/src/chromaprint/0002-add-the-C-runtime-to-the-packages-to-link-to.patch
- contrib/src/chromaprint/rules.mak
- + contrib/src/gme/0001-don-t-skip-negative-fixes-14088.patch
- contrib/src/gme/0003-fix-android-toolchain-broken-CMAKE_CXX_IMPLICIT_LINK.patch
- contrib/src/gme/SHA512SUMS
- contrib/src/gme/rules.mak
- − contrib/src/gme/skip-underrun.patch
- + contrib/src/srt/0001-build-fix-implicit-libraries-set-using-Wl-l-libname..patch
- contrib/src/srt/rules.mak
- contrib/src/vulkan-loader/0003-fix-libunwind-usage-when-static-linking.patch
- contrib/src/vulkan-loader/rules.mak
- contrib/src/x265/0001-Fix-libunwind-static-linking-on-Android-toolchains.patch
- contrib/src/x265/x265-ldl-linking.patch → contrib/src/x265/0001-fix-ldl-linking-error-of-x265.patch
- contrib/src/x265/x265-no-pdb-install.patch → contrib/src/x265/0002-do-not-copy-.pdb-files-that-don-t-exist.patch
- contrib/src/x265/x265-enable-detect512.patch → contrib/src/x265/0003-add-patch-to-enable-detect512.patch
- contrib/src/x265/rules.mak
- extras/package/win32/build.sh


Changes:

=====================================
contrib/src/chromaprint/linklibs.patch → contrib/src/chromaprint/0001-contribs-chromaprint-more-fixes-for-.pc-file.patch
=====================================
@@ -1,7 +1,21 @@
-diff -urN chromaprint.orig/CMakeLists.txt chromaprint/CMakeLists.txt
---- chromaprint.orig/CMakeLists.txt	2016-12-28 21:10:42.000000000 +0100
-+++ chromaprint/CMakeLists.txt	2017-12-08 14:59:39.000000000 +0100
-@@ -135,12 +135,16 @@
+From e0ef879e98b2aabb2aaf9124b6260d4af5e820d4 Mon Sep 17 00:00:00 2001
+From: Pavlov Konstantin <thresh at videolan.org>
+Date: Fri, 8 Dec 2017 13:12:30 +0100
+Subject: [PATCH 1/2] contribs: chromaprint: more fixes for .pc file.
+
+- Moved AVFFT check: FFMPEG_LIBRARIES might be unset even if
+all needed FFmpeg libraries were found.
+- Added an ability to link with VDSP/Accelerate Framework on macOS.
+---
+ CMakeLists.txt          | 4 ++++
+ libchromaprint.pc.cmake | 2 +-
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index fd6374e..c14e32b 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -135,12 +135,16 @@ endif()
  if(FFT_LIB STREQUAL "vdsp")
  	if(ACCELERATE_LIBRARIES)
  		set(USE_VDSP ON)
@@ -18,25 +32,18 @@ diff -urN chromaprint.orig/CMakeLists.txt chromaprint/CMakeLists.txt
  	else()
  		message(FATAL_ERROR "Selected ${FFT_LIB} for FFT calculations, but the library is not found")
  	endif()
-diff -urN chromaprint.orig/libchromaprint.pc.cmake chromaprint/libchromaprint.pc.cmake
---- chromaprint.orig/libchromaprint.pc.cmake	2016-12-28 21:10:42.000000000 +0100
-+++ chromaprint/libchromaprint.pc.cmake	2017-12-08 14:56:22.000000000 +0100
-@@ -7,6 +7,6 @@
+diff --git a/libchromaprint.pc.cmake b/libchromaprint.pc.cmake
+index 3799329..120e85d 100644
+--- a/libchromaprint.pc.cmake
++++ b/libchromaprint.pc.cmake
+@@ -7,6 +7,6 @@ Name: ${PROJECT_NAME}
  Description: Audio fingerprint library
  URL: http://acoustid.org/chromaprint
  Version: ${PROJECT_VERSION}
 -Libs: -L${LIB_INSTALL_DIR} -lchromaprint
-+Libs: -L${LIB_INSTALL_DIR} -lchromaprint ${CHROMAPRINT_ADDITIONAL_LIBS}
++Libs: -L${LIB_INSTALL_DIR} -lchromaprint @CHROMAPRINT_ADDITIONAL_LIBS@
  Cflags: -I${INCLUDE_INSTALL_DIR}
  
-diff -urN chromaprint.orig/src/fft_lib_avfft.h chromaprint/src/fft_lib_avfft.h
---- chromaprint.orig/src/fft_lib_avfft.h	2016-12-28 21:10:42.000000000 +0100
-+++ chromaprint/src/fft_lib_avfft.h	2017-12-08 14:55:35.000000000 +0100
-@@ -5,6 +5,7 @@
- #define CHROMAPRINT_FFT_LIB_AVFFT_H_
- 
- extern "C" {
-+#include <libavutil/mem.h>
- #include <libavcodec/avcodec.h>
- #include <libavcodec/avfft.h>
- #include <libavutil/mem.h>
+-- 
+2.45.0.windows.1
+


=====================================
contrib/src/chromaprint/0002-add-the-C-runtime-to-the-packages-to-link-to.patch
=====================================
@@ -1,26 +1,31 @@
-From 78e7305d566b81f34470a4f21519a47d635ee147 Mon Sep 17 00:00:00 2001
+From b4075d5b76b3efc717de27db5c093eed1be7a985 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4 at ycbcr.xyz>
 Date: Mon, 5 Sep 2022 16:13:05 +0200
 Subject: [PATCH 2/2] add the C++ runtime to the packages to link to
 
 gcc needs libstdc++ and clang needs libc++.
 ---
- CMakeLists.txt | 17 +++++++++++++++++
- 1 file changed, 17 insertions(+)
+ CMakeLists.txt | 22 ++++++++++++++++++++++
+ 1 file changed, 22 insertions(+)
 
 diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 0dbd9bd..6facfdf 100644
+index c14e32b..b2545b7 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -197,6 +197,23 @@ else()
+@@ -205,6 +205,28 @@ else()
  endif()
  
  if(NOT BUILD_FRAMEWORK)
 +	foreach(LIB ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES})
-+		if (IS_ABSOLUTE ${LIB} AND EXISTS ${LIB})
++		if(IS_ABSOLUTE ${LIB} AND EXISTS ${LIB})
++			list(APPEND PKG_CXX_LIBS "${LIB}")
++		elseif(LIB MATCHES "-l:lib.*.a")
++			string(LENGTH ${LIB} LIBLEN)
++			math(EXPR LIBLEN "${LIBLEN}-8")
++			string(SUBSTRING ${LIB} 6 ${LIBLEN} DIRECT_LIB)
++			list(APPEND PKG_CXX_LIBS "-l${DIRECT_LIB}")
++		elseif(LIB MATCHES "-l.*")
 +			list(APPEND PKG_CXX_LIBS "${LIB}")
-+		elseif(${LIB} MATCHES "-l:libunwind.a") # android toolchain
-+			list(APPEND IMPLICITS_LIST "-lunwind")
 +		else()
 +			list(APPEND PKG_CXX_LIBS "-l${LIB}")
 +		endif()
@@ -34,8 +39,8 @@ index 0dbd9bd..6facfdf 100644
 +		set(CHROMAPRINT_ADDITIONAL_LIBS "${CHROMAPRINT_ADDITIONAL_LIBS} ${PKG_LIBS}")
 +	endif()
  	configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libchromaprint.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/libchromaprint.pc)
- 	install(
-         FILES ${CMAKE_CURRENT_BINARY_DIR}/libchromaprint.pc
+ 	install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libchromaprint.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+ endif()
 -- 
 2.45.0.windows.1
 


=====================================
contrib/src/chromaprint/rules.mak
=====================================
@@ -15,7 +15,7 @@ $(TARBALLS)/chromaprint-$(CHROMAPRINT_VERSION).tar.gz:
 
 chromaprint: chromaprint-$(CHROMAPRINT_VERSION).tar.gz .sum-chromaprint
 	$(UNPACK)
-	$(APPLY) $(SRC)/chromaprint/linklibs.patch
+	$(APPLY) $(SRC)/chromaprint/0001-contribs-chromaprint-more-fixes-for-.pc-file.patch
 	$(APPLY) $(SRC)/chromaprint/0002-add-the-C-runtime-to-the-packages-to-link-to.patch
 	$(MOVE)
 


=====================================
contrib/src/gme/0001-don-t-skip-negative-fixes-14088.patch
=====================================
@@ -0,0 +1,26 @@
+From f070646738428aa1f237f4c3ab3318db3ed77165 Mon Sep 17 00:00:00 2001
+From: Hannes Domani <ssbssa at yahoo.de>
+Date: Fri, 6 Mar 2015 14:43:45 +0100
+Subject: [PATCH] don't skip negative (fixes #14088)
+
+Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
+---
+ gme/Fir_Resampler.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/gme/Fir_Resampler.cpp b/gme/Fir_Resampler.cpp
+index d8dd683..ae5f2df 100644
+--- a/gme/Fir_Resampler.cpp
++++ b/gme/Fir_Resampler.cpp
+@@ -188,6 +188,8 @@ int Fir_Resampler_::skip_input( long count )
+ {
+ 	int remain = write_pos - buf.begin();
+ 	int max_count = remain - width_ * stereo;
++	if ( max_count < 0 )
++		return 0;
+ 	if ( count > max_count )
+ 		count = max_count;
+ 	
+-- 
+2.45.0.windows.1
+


=====================================
contrib/src/gme/0003-fix-android-toolchain-broken-CMAKE_CXX_IMPLICIT_LINK.patch
=====================================
@@ -1,7 +1,7 @@
-From 5fb77ca7127ab4343281920d79a87a899c6bc6bb Mon Sep 17 00:00:00 2001
+From b618db8f750d1201dceb05620978236aa44ce265 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4 at ycbcr.xyz>
 Date: Tue, 6 Sep 2022 11:56:30 +0200
-Subject: [PATCH 3/3] fix android toolchain broken
+Subject: [PATCH 3/4] fix android toolchain broken
  CMAKE_CXX_IMPLICIT_LINK_LIBRARIES
 
 CMake 3.17.0 and Android NDK 25 the CMAKE_CXX_IMPLICIT_LINK_LIBRARIES is
@@ -10,22 +10,27 @@ c++;m;-l:libunwind.a;dl;c;-l:libunwind.a;dl
 When it should be
 c++;m;unwind;dl;c;unwind;dl
 ---
- gme/CMakeLists.txt | 2 ++
- 1 file changed, 2 insertions(+)
+ gme/CMakeLists.txt | 7 +++++++
+ 1 file changed, 7 insertions(+)
 
 diff --git a/gme/CMakeLists.txt b/gme/CMakeLists.txt
-index da23ea8..77738c4 100644
+index da23ea8..cc058c7 100644
 --- a/gme/CMakeLists.txt
 +++ b/gme/CMakeLists.txt
-@@ -196,6 +196,8 @@ set_target_properties(gme
+@@ -196,6 +196,13 @@ set_target_properties(gme
  foreach(LIB ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES})
      if(IS_ABSOLUTE ${LIB} AND EXISTS ${LIB})
          list(APPEND IMPLICITS_LIST "${LIB}")
-+    elseif(${LIB} MATCHES "-l:libunwind.a") # android toolchain
-+        list(APPEND IMPLICITS_LIST "-lunwind")
++    elseif(LIB MATCHES "-l:lib.*.a")
++        string(LENGTH ${LIB} LIBLEN)
++        math(EXPR LIBLEN "${LIBLEN}-8")
++        string(SUBSTRING ${LIB} 6 ${LIBLEN} DIRECT_LIB)
++        list(APPEND IMPLICITS_LIST "-l${DIRECT_LIB}")
++    elseif(LIB MATCHES "-l.*")
++        list(APPEND IMPLICITS_LIST "${LIB}")
      else()
          list(APPEND IMPLICITS_LIST "-l${LIB}")
      endif()
 -- 
-2.27.0.windows.1
+2.45.0.windows.1
 


=====================================
contrib/src/gme/SHA512SUMS
=====================================
@@ -1 +1 @@
-4b20c69ced696bb879c34bcb7ce0f5f276642458d4cebca8ede673eed7d50664e527626e2077f85a3411a26660f1b3f01e43cccd72945e1edb2994421efeb552  game-music-emu-0.6.3.tar.xz
+fb4e8026f7b1565ef7884fabfcdedd97546bbe30d3047f06f0487dc752963ea37e5e4320cb0311eabe8fb7ed122f7958c388c7873ccff812fa3b612c9523491e  game-music-emu-0.6.3.tar.gz


=====================================
contrib/src/gme/rules.mak
=====================================
@@ -1,20 +1,20 @@
 # Game Music Emu
 
 GME_VERSION := 0.6.3
-GME_URL := https://bitbucket.org/mpyne/game-music-emu/downloads/game-music-emu-$(GME_VERSION).tar.xz
+GME_URL := $(GITHUB)/libgme/game-music-emu/archive/refs/tags/$(GME_VERSION).tar.gz
 
 PKGS += gme
 
-$(TARBALLS)/game-music-emu-$(GME_VERSION).tar.xz:
+$(TARBALLS)/game-music-emu-$(GME_VERSION).tar.gz:
 	$(call download_pkg,$(GME_URL),gme)
 
 DEPS_gme = zlib $(DEPS_zlib)
 
-.sum-gme: game-music-emu-$(GME_VERSION).tar.xz
+.sum-gme: game-music-emu-$(GME_VERSION).tar.gz
 
-game-music-emu: game-music-emu-$(GME_VERSION).tar.xz .sum-gme
+game-music-emu: game-music-emu-$(GME_VERSION).tar.gz .sum-gme
 	$(UNPACK)
-	$(APPLY) $(SRC)/gme/skip-underrun.patch
+	$(APPLY) $(SRC)/gme/0001-don-t-skip-negative-fixes-14088.patch
 	$(APPLY) $(SRC)/gme/0001-Export-the-proper-C-runtime-library.patch
 	$(APPLY) $(SRC)/gme/0002-link-with-libm-and-set-it-in-pkg-config-when-buildin.patch
 	$(APPLY) $(SRC)/gme/0003-fix-android-toolchain-broken-CMAKE_CXX_IMPLICIT_LINK.patch


=====================================
contrib/src/gme/skip-underrun.patch deleted
=====================================
@@ -1,11 +0,0 @@
---- a/gme/Fir_Resampler.cpp	2013-03-17 02:38:55.000000000 +0100
-+++ b/gme/Fir_Resampler.cpp	2015-03-06 14:33:01.061577900 +0100
-@@ -188,6 +188,8 @@
- {
- 	int remain = write_pos - buf.begin();
- 	int max_count = remain - width_ * stereo;
-+	if ( max_count < 0 )
-+		return 0;
- 	if ( count > max_count )
- 		count = max_count;
- 	


=====================================
contrib/src/srt/0001-build-fix-implicit-libraries-set-using-Wl-l-libname..patch
=====================================
@@ -0,0 +1,33 @@
+From 64157b23fd0359fdbe706a17154be3733fc0deb2 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Fri, 10 Jan 2025 13:04:59 +0100
+Subject: [PATCH] [build] fix implicit libraries set using -Wl,-l:libname.a
+
+We need to turn it to a more generic name in the pkg-config file.
+---
+ CMakeLists.txt | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 1492306..49d4869 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1183,7 +1183,14 @@ endif()
+ # obtained by `pkg-config --libs`.
+ if(ENABLE_CXX_DEPS)
+ 	foreach(LIB ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES})
+-		if((IS_ABSOLUTE ${LIB} AND EXISTS ${LIB}) OR (${LIB} MATCHES "^-l"))
++		if(IS_ABSOLUTE ${LIB} AND EXISTS ${LIB})
++			set(SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE} ${LIB})
++		elseif(${LIB} MATCHES "-l:lib.*.a")
++			string(LENGTH ${LIB} LIBLEN)
++			math(EXPR LIBLEN "${LIBLEN}-8")
++			string(SUBSTRING ${LIB} 6 ${LIBLEN} DIRECT_LIB)
++			set(SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE} "-l${DIRECT_LIB}")
++		elseif(${LIB} MATCHES "^-l")
+ 			set(SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE} ${LIB})
+ 		else()
+ 			set(SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE} "-l${LIB}")
+-- 
+2.45.0.windows.1
+


=====================================
contrib/src/srt/rules.mak
=====================================
@@ -35,8 +35,9 @@ $(TARBALLS)/srt-$(SRT_VERSION).tar.gz:
 
 srt: srt-$(SRT_VERSION).tar.gz .sum-srt
 	$(UNPACK)
+	$(APPLY) $(SRC)/srt/0001-build-fix-implicit-libraries-set-using-Wl-l-libname..patch
 	$(call pkg_static,"scripts/srt.pc.in")
-	mv srt-$(SRT_VERSION) $@ && touch $@
+	$(MOVE)
 
 SRT_CONF := -DENABLE_SHARED=OFF -DUSE_ENCLIB=gnutls -DENABLE_CXX11=OFF -DENABLE_APPS=OFF
 


=====================================
contrib/src/vulkan-loader/0003-fix-libunwind-usage-when-static-linking.patch
=====================================
@@ -1,4 +1,4 @@
-From ce897781c15a650f59b0c2ffa7dced738b34fa60 Mon Sep 17 00:00:00 2001
+From c2b51b82c5dc3e62dc6bc9778261555a2ebdd67d Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4 at ycbcr.xyz>
 Date: Thu, 17 Oct 2024 11:56:18 +0200
 Subject: [PATCH 3/3] fix libunwind usage when static linking
@@ -7,22 +7,27 @@ It ends up with
 - set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "atomic;m;-l:libunwind.a;dl;c;-l:libunwind.a;dl")
 - set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "windowsapp;windowsapp;ucrt;windowsapp;ucrtapp;c++;mingw32;-l:libunwind.a;moldname;mingwex;mingw32;-l:libunwind.a;moldname;mingwex")
 ---
- loader/CMakeLists.txt | 8 +++++++-
- 1 file changed, 7 insertions(+), 1 deletion(-)
+ loader/CMakeLists.txt | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
 
 diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt
-index 98da79ab8..93ab25f06 100644
+index b29c81a8d..cd5a6a441 100644
 --- a/loader/CMakeLists.txt
 +++ b/loader/CMakeLists.txt
-@@ -335,7 +335,13 @@ include(FindPkgConfig QUIET)
+@@ -335,7 +335,18 @@ include(FindPkgConfig QUIET)
  if(PKG_CONFIG_FOUND)
      set(VK_API_VERSION "${LOADER_GENERATED_HEADER_VERSION}")
      foreach(LIB ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES} ${PLATFORM_LIBS})
 -        set(PRIVATE_LIBS "${PRIVATE_LIBS} -l${LIB}")
-+        if (IS_ABSOLUTE ${LIB} AND EXISTS ${LIB})
++        if(IS_ABSOLUTE ${LIB} AND EXISTS ${LIB})
++            set(PRIVATE_LIBS "${PRIVATE_LIBS} ${LIB}")
++        elseif(${LIB} MATCHES "-l:lib.*.a")
++            string(LENGTH ${LIB} LIBLEN)
++            math(EXPR LIBLEN "${LIBLEN}-8")
++            string(SUBSTRING ${LIB} 6 ${LIBLEN} DIRECT_LIB)
++            set(PRIVATE_LIBS "${PRIVATE_LIBS} -l${DIRECT_LIB}")
++        elseif(${LIB} MATCHES "-l.*")
 +            set(PRIVATE_LIBS "${PRIVATE_LIBS} ${LIB}")
-+        elseif(${LIB} MATCHES "-l:libunwind.a") # android toolchain
-+            set(PRIVATE_LIBS "${PRIVATE_LIBS} -lunwind")
 +        else()
 +            set(PRIVATE_LIBS "${PRIVATE_LIBS} -l${LIB}")
 +        endif()


=====================================
contrib/src/vulkan-loader/rules.mak
=====================================
@@ -29,6 +29,11 @@ VULKAN_LOADER_CONF := \
 	-DENABLE_WERROR=OFF \
 	-DBUILD_TESTS=OFF
 
+ifndef HAVE_VISUALSTUDIO
+# can only use masm or jwasm on Windows
+VULKAN_LOADER_CONF += -DUSE_MASM=OFF
+endif
+
 $(TARBALLS)/Vulkan-Loader-$(VULKAN_LOADER_VERSION).tar.gz:
 	$(call download_pkg,$(VULKAN_LOADER_URL),vulkan-loader)
 
@@ -60,6 +65,8 @@ ifdef HAVE_WIN32
 # CMake will generate a .pc file with -lvulkan even if the static library
 # generated is libvulkan.dll.a. It also forget to link with libcfgmgr32.
 	sed -i.orig -e "s,-lvulkan,-lvulkan.dll -lcfgmgr32," $(BUILD_DIR)/loader/vulkan.pc
+else
+	$(call pkg_static,"build/loader/vulkan.pc")
 endif
 
 	+$(CMAKEBUILD)


=====================================
contrib/src/x265/0001-Fix-libunwind-static-linking-on-Android-toolchains.patch
=====================================
@@ -1,23 +1,28 @@
-From c5dd262ca6a31ec77a12fe0141fa4de875c6e7ba Mon Sep 17 00:00:00 2001
+From 6e5f1a13bf5abaa1a84a65d6bb4fa3c9eb5fb41a Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4 at ycbcr.xyz>
 Date: Wed, 16 Oct 2024 10:43:58 +0200
 Subject: [PATCH] Fix libunwind static linking on Android toolchains
 
 As well as llvm-mingw with -static-libgcc.
 ---
- source/CMakeLists.txt | 2 ++
- 1 file changed, 2 insertions(+)
+ source/CMakeLists.txt | 7 +++++++
+ 1 file changed, 7 insertions(+)
 
 diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
-index 8a3128bb7..8250f9ec7 100755
+index 33b6523f1..4d452e2c0 100644
 --- a/source/CMakeLists.txt
 +++ b/source/CMakeLists.txt
-@@ -882,6 +882,8 @@ if(X265_LATEST_TAG)
+@@ -649,6 +649,13 @@ if(X265_LATEST_TAG)
      foreach(LIB ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES} ${PLATFORM_LIBS})
          if(IS_ABSOLUTE ${LIB} AND EXISTS ${LIB})
              list(APPEND PLIBLIST "${LIB}")
-+        elseif(${LIB} MATCHES "-l:libunwind.a") # android toolchain
-+            list(APPEND IMPLICITS_LIST "-lunwind")
++        elseif(${LIB} MATCHES "-l:lib.*.a")
++            string(LENGTH ${LIB} LIBLEN)
++            math(EXPR LIBLEN "${LIBLEN}-8")
++            string(SUBSTRING ${LIB} 6 ${LIBLEN} DIRECT_LIB)
++            list(APPEND PLIBLIST "-l${DIRECT_LIB}")
++        elseif(${LIB} MATCHES "-l.*")
++            list(APPEND PLIBLIST ${LIB})
          else()
              list(APPEND PLIBLIST "-l${LIB}")
          endif()


=====================================
contrib/src/x265/x265-ldl-linking.patch → contrib/src/x265/0001-fix-ldl-linking-error-of-x265.patch
=====================================
@@ -1,6 +1,18 @@
---- x265/source/CMakeLists.txt.orig	2022-03-20 16:40:01.560434700 +0000
-+++ x265/source/CMakeLists.txt	2022-03-20 16:41:20.563787600 +0000
-@@ -713,7 +713,7 @@
+From 6a859d8fc1b064dd9db9f5807b95d621604aab7c Mon Sep 17 00:00:00 2001
+From: Gilles Sabourin <gilles.sabourin at free.fr>
+Date: Sun, 10 Jul 2016 15:21:38 +0200
+Subject: [PATCH 1/3] fix ldl linking error of x265
+
+Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
+---
+ source/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
+index 33b6523f1..0ea2487c7 100644
+--- a/source/CMakeLists.txt
++++ b/source/CMakeLists.txt
+@@ -713,7 +713,7 @@ if(ENABLE_CLI)
          if(WIN32 OR NOT ENABLE_SHARED OR INTEL_CXX)
              # The CLI cannot link to the shared library on Windows, it
              # requires internal APIs not exported from the DLL
@@ -9,3 +21,6 @@
          else()
              target_link_libraries(cli x265-shared ${PLATFORM_LIBS})
          endif()
+-- 
+2.45.0.windows.1
+


=====================================
contrib/src/x265/x265-no-pdb-install.patch → contrib/src/x265/0002-do-not-copy-.pdb-files-that-don-t-exist.patch
=====================================
@@ -1,6 +1,17 @@
---- x265/source/CMakeLists.txt.nopdb	2022-03-20 16:50:06.435395700 +0000
-+++ x265/source/CMakeLists.txt	2022-03-20 16:50:23.988474200 +0000
-@@ -554,7 +554,7 @@
+From 0a77b8c80bc3ae6b10fa159102dc78d1b0fc6918 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Fri, 18 May 2018 16:32:17 +0200
+Subject: [PATCH 2/3] do not copy .pdb files that don't exist
+
+---
+ source/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
+index 0ea2487c7..f6649ced1 100644
+--- a/source/CMakeLists.txt
++++ b/source/CMakeLists.txt
+@@ -554,7 +554,7 @@ if(ENABLE_HDR10_PLUS)
          ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
  endif()
  install(FILES x265.h "${PROJECT_BINARY_DIR}/x265_config.h" DESTINATION include)
@@ -9,3 +20,6 @@
      if(MSVC_IDE)
          install(FILES "${PROJECT_BINARY_DIR}/Debug/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug)
          install(FILES "${PROJECT_BINARY_DIR}/RelWithDebInfo/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo)
+-- 
+2.45.0.windows.1
+


=====================================
contrib/src/x265/x265-enable-detect512.patch → contrib/src/x265/0003-add-patch-to-enable-detect512.patch
=====================================
@@ -1,8 +1,18 @@
-This function is used on all architectures, not just X86.
+From 84f315deced14f7541fb68a637391bd6eaab9f6c Mon Sep 17 00:00:00 2001
+From: rego21 <miguelfrego at gmail.com>
+Date: Sun, 20 Mar 2022 23:27:21 +0100
+Subject: [PATCH 3/3] add patch to enable detect512
 
---- x265/source/common/cpu.cpp
-+++ x265/source/common/cpu.cpp
-@@ -110,6 +110,11 @@
+Enables detect512 for all architectures
+---
+ source/common/cpu.cpp | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/source/common/cpu.cpp b/source/common/cpu.cpp
+index 0681ff55b..fa687da7c 100644
+--- a/source/common/cpu.cpp
++++ b/source/common/cpu.cpp
+@@ -110,6 +110,11 @@ const cpu_name_t cpu_names[] =
      { "", 0 },
  };
  
@@ -14,7 +24,7 @@ This function is used on all architectures, not just X86.
  #if X265_ARCH_X86
  
  extern "C" {
-@@ -123,10 +128,6 @@
+@@ -123,10 +128,6 @@ uint64_t PFX(cpu_xgetbv)(int xcr);
  #pragma warning(disable: 4309) // truncation of constant value
  #endif
  
@@ -24,3 +34,7 @@ This function is used on all architectures, not just X86.
 -}
  uint32_t cpu_detect(bool benableavx512 )
  {
+ 
+-- 
+2.45.0.windows.1
+


=====================================
contrib/src/x265/rules.mak
=====================================
@@ -30,9 +30,9 @@ $(TARBALLS)/x265_$(X265_VERSION).tar.gz:
 
 x265: x265_$(X265_VERSION).tar.gz .sum-x265
 	$(UNPACK)
-	$(APPLY) $(SRC)/x265/x265-ldl-linking.patch
-	$(APPLY) $(SRC)/x265/x265-no-pdb-install.patch
-	$(APPLY) $(SRC)/x265/x265-enable-detect512.patch
+	$(APPLY) $(SRC)/x265/0001-fix-ldl-linking-error-of-x265.patch
+	$(APPLY) $(SRC)/x265/0002-do-not-copy-.pdb-files-that-don-t-exist.patch
+	$(APPLY) $(SRC)/x265/0003-add-patch-to-enable-detect512.patch
 	$(APPLY) $(SRC)/x265/0001-api-use-LoadLibraryExA-instead-of-LoadLibraryA.patch
 	$(APPLY) $(SRC)/x265/0001-threadpool-disable-group-affinity-in-UWP-builds.patch
 	$(APPLY) $(SRC)/x265/0001-Fix-libunwind-static-linking-on-Android-toolchains.patch


=====================================
extras/package/win32/build.sh
=====================================
@@ -369,7 +369,7 @@ if [ "$COMPILING_WITH_CLANG" -gt 0 ]; then
     # avoid using gcc-ranlib with the clang toolchain, if both are installed
     VLC_RANLIB="$TRIPLET-ranlib"
     # force linking with the static C++ runtime of LLVM
-    VLC_LDFLAGS="$VLC_LDFLAGS --start-no-unused-arguments -Wl,-l:libunwind.a -static-libstdc++ --end-no-unused-arguments"
+    VLC_LDFLAGS="$VLC_LDFLAGS --start-no-unused-arguments -Wl,-l:libunwind.a -Wl,-l:libpthread.a -static-libstdc++ --end-no-unused-arguments"
     VLC_CXXFLAGS="$VLC_CXXFLAGS --start-no-unused-arguments -Wl,-l:libunwind.a --end-no-unused-arguments"
 fi
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/97c00b5819379e631b705666ad13993dbefdecf3...280e11a5251c005eab9444f5087b9064efd67ec1

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/97c00b5819379e631b705666ad13993dbefdecf3...280e11a5251c005eab9444f5087b9064efd67ec1
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