[vlc-commits] [Git][videolan/vlc][3.0.x] 10 commits: contrib: vpx: force using winpthreads

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Jan 21 07:02:01 UTC 2025



Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC


Commits:
ac6a290e by Steve Lhomme at 2025-01-17T16:29:24+01:00
contrib: vpx: force using winpthreads

We even have the dependency.
This is only necessary for 3.0 which needs to build for XP.

- - - - -
1b7f9571 by Alexandre Janniaux at 2025-01-17T16:29:24+01:00
contrib: vpx: remove strip step and fix debug symbols

Without CONFIG_DEBUG set, libvpx is calling `$(STRIP) --strip-debug`
on the final library and removes the debug symbols from it. With the
variable set, it becomes a simple copy operation.

In addition, debug symbols should be enabled for all builds since we
strip in the end, so as to have the debug symbols in a separate file
when doing releases. In case we build with optimization, remove the
assertions.

(cherry picked from commit 52e22b96239cc3784aa13495be92f5f3ce591bf1) (rebased)
rebased:
- the code before is slightly different

- - - - -
bed63dc2 by Steve Lhomme at 2025-01-17T16:29:24+01:00
contrib: vpx: remove unused VPX_CFLAGS variable

(cherry picked from commit 6fe9dfe0e6b17a1a9175ab2940a2feda1fec4372) (rebased)
rebased:
- the code before is slightly different

- - - - -
30863c9b by Sean McGovern at 2025-01-17T16:29:24+01:00
contrib: vpx: trust the value of ARCH when setting VPX_ARCH

(cherry picked from commit 973bccb6d6cbb71dc97de4ee22eeb6a61ca7f3f3)

- - - - -
8508e57e by Rémi Denis-Courmont at 2025-01-17T16:29:24+01:00
contrib: vpx: restrict architectures

VPX has an exclusive list of supported instruction sets.

This follows it, unblocking contrib builds on other targets.

(cherry picked from commit 293601d23044498ae6fd3d06020e9b2db07d326f) (rebased)
rebased:
- on 3.0 this was done when 1.13.1 was used

- - - - -
477a1ea3 by Steve Lhomme at 2025-01-17T17:03:09+01:00
contrib: vpx: always pass the CFLAGS

On Windows it doesn't contain the flags for PDB or UWP.
If we want CFLAGS for all contribs we build, that includes libvpx.

(cherry picked from commit 5e251ce24749f84c8785ca2a004f06e835aaebea) (edited)
edited:
- 3.0 doesn't have emscripten
- the darwin code is different from master since 7a5400bcb5031cd1f0b9298116f55bd0fe5540c3

- - - - -
6732c761 by Steve Lhomme at 2025-01-17T17:06:22+01:00
contrib: vpx: only force mstackrealign for x86 targets

And it should be done on all OS.

(cherry picked from commit 4fe2e588ee85195417cf191229cb5b092cd5157c)

- - - - -
bb0ee3fc by Steve Lhomme at 2025-01-17T17:56:53+01:00
contrib: vpx: remove redundant option on iOS

It's already set in the global VPX_CONF

(cherry picked from commit 2aeb39a816882af33e8cee1e01d69ba59224df65) (rebased)
rebased:
- the call was located in a different place on 3.0

- - - - -
92e51392 by Steve Lhomme at 2025-01-17T17:57:28+01:00
contrib: vpx: build out of tree with more threads

Integrates backports of:
- 3ce55c39551fb6188718330b333a1fd24a8cb1ee
- 697a2fcda3321c44f0ef2898b513851ba699ade7
- d4c40209e85d51e1681a9aa8b7d38d0eb4caf39a
- aa530aec17403e0971ea5af17ba07001c65a3d50
- 8d0461dd448142545aa447d45edf1c226153ddf0

- - - - -
38c5c239 by Steve Lhomme at 2025-01-17T17:57:28+01:00
contrib: vpx: put extra configuration flags in VPX_CONF

(cherry picked from commit eae7e7673d0a52da34226e036d5ef482f16ae31c)

- - - - -


2 changed files:

- + contrib/src/vpx/0001-force-detection-of-pthread-on-Windows.patch
- contrib/src/vpx/rules.mak


Changes:

=====================================
contrib/src/vpx/0001-force-detection-of-pthread-on-Windows.patch
=====================================
@@ -0,0 +1,27 @@
+From 31d0b0f8b637ad92b505ba0b696721afb9a16c1a Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Tue, 14 Jan 2025 15:12:48 +0100
+Subject: [PATCH] force detection of pthread on Windows
+
+---
+ configure | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/configure b/configure
+index 97e78996e..84a6fa093 100755
+--- a/configure
++++ b/configure
+@@ -598,10 +598,6 @@ process_detect() {
+ 
+             # Specialize windows and POSIX environments.
+             case $toolchain in
+-                *-win*-*)
+-                    # Don't check for any headers in Windows builds.
+-                    false
+-                ;;
+                 *)
+                     case $header in
+                         pthread.h) true;;
+-- 
+2.43.0
+


=====================================
contrib/src/vpx/rules.mak
=====================================
@@ -3,7 +3,9 @@
 VPX_VERSION := 1.15.0
 VPX_URL := $(GITHUB)/webmproject/libvpx/archive/v${VPX_VERSION}.tar.gz
 
+ifneq ($(filter arm aarch64 i386 loongarch64 mipsel mips64el ppc64le x86_64, $(ARCH)),)
 PKGS += vpx
+endif
 ifeq ($(call need_pkg,"vpx >= 1.5.0"),)
 PKGS_FOUND += vpx
 endif
@@ -30,6 +32,8 @@ endif
 	# Disable automatic addition of -fembed-bitcode for iOS
 	# as it is enabled through --extra-cflags if necessary.
 	$(APPLY) $(SRC)/vpx/libvpx-remove-bitcode.patch
+	# make sure we can build when targetting Windows XP
+	$(APPLY) $(SRC)/vpx/0001-force-detection-of-pthread-on-Windows.patch
 	$(MOVE)
 
 DEPS_vpx =
@@ -62,14 +66,10 @@ else ifeq ($(ARCH),mips)
 VPX_ARCH := mips32
 else ifeq ($(ARCH),ppc)
 VPX_ARCH := ppc32
-else ifeq ($(ARCH),ppc64)
-VPX_ARCH := ppc64
-else ifeq ($(ARCH),sparc)
-VPX_ARCH := sparc
-else ifeq ($(ARCH),x86_64)
-VPX_ARCH := x86_64
 else ifeq ($(ARCH),aarch64)
 VPX_ARCH := arm64
+else
+VPX_ARCH := $(ARCH)
 endif
 
 ifdef HAVE_ANDROID
@@ -108,7 +108,9 @@ VPX_CONF := \
 	--disable-install-docs \
 	--disable-dependency-tracking \
 	--enable-vp9-highbitdepth \
-	--disable-tools
+	--disable-tools \
+	--target=$(VPX_TARGET) \
+	--prefix=$(PREFIX)
 
 ifneq ($(filter arm aarch64, $(ARCH)),)
 # Only enable runtime cpu detect on architectures other than arm/aarch64
@@ -120,22 +122,26 @@ endif
 endif
 endif
 
+VPX_CFLAGS=$(CFLAGS)
+
 ifndef BUILD_ENCODERS
 VPX_CONF += --disable-vp8-encoder --disable-vp9-encoder
 endif
 
+ifeq ($(ARCH),i386)
+VPX_CFLAGS += -mstackrealign
+endif
+
 ifndef HAVE_WIN32
 VPX_CONF += --enable-pic
 else
-VPX_CONF += --extra-cflags="-mstackrealign"
 ifeq ($(ARCH),arm)
 # As of libvpx 1.14.0 we have to explicitly disable runtime CPU detection for Windows armv7
 VPX_CONF += --disable-runtime-cpu-detect
 endif
 endif
 ifdef HAVE_DARWIN_OS
-VPX_CONF += --enable-vp8-decoder --disable-tools
-VPX_CONF += --extra-cflags="$(CFLAGS) $(EXTRA_CFLAGS)"
+VPX_CONF += --enable-vp8-decoder
 ifdef HAVE_IOS
 ifeq ($(ARCH),arm)
 # As of libvpx 1.14.0 we have to explicitly disable runtime CPU detection for iOS arm7
@@ -150,9 +156,12 @@ VPX_LDFLAGS += -arch $(PLATFORM_SHORT_ARCH)
 endif
 
 ifndef WITH_OPTIMIZATION
-VPX_CONF += --enable-debug --disable-optimizations
+VPX_CONF += --disable-optimizations
 endif
 
+# Always enable debug symbols, we strip in the final executables if needed
+VPX_CONF += --enable-debug
+
 ifdef HAVE_ANDROID
 # Starting NDK19, standalone toolchains are deprecated and gcc is not shipped.
 # The presence of gcc can be used to detect if we are using an old standalone
@@ -163,11 +172,13 @@ VPX_HOSTVARS = $(HOSTVARS)
 endif
 endif
 
+VPX_CONF += --extra-cflags="$(VPX_CFLAGS)"
+
 .vpx: libvpx
 	rm -rf $(PREFIX)/include/vpx
-	cd $< && LDFLAGS="$(VPX_LDFLAGS)" CROSS=$(VPX_CROSS) $(VPX_HOSTVARS) ./configure --target=$(VPX_TARGET) \
-		$(VPX_CONF) --prefix=$(PREFIX)
-	cd $< && $(MAKE)
-	$(call pkg_static,"vpx.pc")
-	cd $< && $(MAKE) install
+	$(MAKEBUILDDIR)
+	cd $(BUILD_DIR) && LDFLAGS="$(VPX_LDFLAGS)" CROSS=$(VPX_CROSS) $(VPX_HOSTVARS) $(BUILD_SRC)/configure $(VPX_CONF)
+	+CONFIG_DEBUG=1 $(MAKEBUILD)
+	$(call pkg_static,"_build/vpx.pc")
+	+CONFIG_DEBUG=1 $(MAKEBUILD) install
 	touch $@



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/10aa0e6e1bba557409c9173c89dd3a9c199fccd4...38c5c239a8729f8d04430f41dfc677ade0f22ad1

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/10aa0e6e1bba557409c9173c89dd3a9c199fccd4...38c5c239a8729f8d04430f41dfc677ade0f22ad1
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