[vlc-commits] [Git][videolan/vlc][master] 6 commits: contrib: vpx: always pass the CFLAGS

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Jan 17 16:51:53 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
5e251ce2 by Steve Lhomme at 2025-01-17T16:02:18+00: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.

- - - - -
4fe2e588 by Steve Lhomme at 2025-01-17T16:02:18+00:00
contrib: vpx: only force mstackrealign for x86 targets

And it should be done on all OS.

- - - - -
2aeb39a8 by Steve Lhomme at 2025-01-17T16:02:18+00:00
contrib: vpx: remove redundant option on iOS

It's already set in the global VPX_CONF

- - - - -
eae7e767 by Steve Lhomme at 2025-01-17T16:02:18+00:00
contrib: vpx: put extra configuration flags in VPX_CONF

- - - - -
8df3acd6 by Steve Lhomme at 2025-01-17T16:02:18+00:00
contrib: vpx: remove dead code

The ifndef HAVE_IOS is inside a ifdef HAVE_IOS

- - - - -
9c267df4 by Steve Lhomme at 2025-01-17T16:02:18+00:00
contrib: vpx: fix compilation for tvos

- - - - -


2 changed files:

- + contrib/src/vpx/0001-vp9-rc-fix-sizeof-of-member-in-static-function.patch
- contrib/src/vpx/rules.mak


Changes:

=====================================
contrib/src/vpx/0001-vp9-rc-fix-sizeof-of-member-in-static-function.patch
=====================================
@@ -0,0 +1,32 @@
+From ca8306ea5c292f41057e124ab23760551753ef85 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Thu, 16 Jan 2025 13:11:54 +0100
+Subject: [PATCH] vp9 rc: fix sizeof of member in static function
+
+It generates a compilation in AppleClang 15.0.0.15000309:
+
+```
+../vp9/ratectrl_rtc.cc:29:67: error: invalid use of member 'cpi_' in static member function
+  rc_api->cpi_ = static_cast<VP9_COMP *>(vpx_memalign(32, sizeof(*cpi_)));
+                                                                  ^~~~
+```
+---
+ vp9/ratectrl_rtc.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/vp9/ratectrl_rtc.cc b/vp9/ratectrl_rtc.cc
+index b29e1ec23..43948fb7e 100644
+--- a/vp9/ratectrl_rtc.cc
++++ b/vp9/ratectrl_rtc.cc
+@@ -26,7 +26,7 @@ std::unique_ptr<VP9RateControlRTC> VP9RateControlRTC::Create(
+   std::unique_ptr<VP9RateControlRTC> rc_api(new (std::nothrow)
+                                                 VP9RateControlRTC());
+   if (!rc_api) return nullptr;
+-  rc_api->cpi_ = static_cast<VP9_COMP *>(vpx_memalign(32, sizeof(*cpi_)));
++  rc_api->cpi_ = static_cast<VP9_COMP *>(vpx_memalign(32, sizeof(*rc_api->cpi_)));
+   if (!rc_api->cpi_) return nullptr;
+   vp9_zero(*rc_api->cpi_);
+ 
+-- 
+2.45.0.windows.1
+


=====================================
contrib/src/vpx/rules.mak
=====================================
@@ -31,6 +31,7 @@ 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
+	$(APPLY) $(SRC)/vpx/0001-vp9-rc-fix-sizeof-of-member-in-static-function.patch
 	$(MOVE)
 
 DEPS_vpx =
@@ -97,7 +98,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
@@ -109,36 +112,33 @@ 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_MACOSX
-VPX_CONF += --extra-cflags="$(CFLAGS) $(EXTRA_CFLAGS)"
-endif
 ifdef HAVE_IOS
 ifeq ($(ARCH),arm)
 # As of libvpx 1.14.0 we have to explicitly disable runtime CPU detection for iOS arm7
 VPX_CONF += --disable-runtime-cpu-detect
 endif
-VPX_CONF += --enable-vp8-decoder --disable-tools
-VPX_CONF += --extra-cflags="$(CFLAGS) $(EXTRA_CFLAGS)"
+VPX_CONF += --enable-vp8-decoder
 VPX_LDFLAGS := -L$(IOS_SDK)/usr/lib -isysroot $(IOS_SDK) $(LDFLAGS)
 ifeq ($(ARCH),aarch64)
 VPX_LDFLAGS += -arch arm64
-else
-ifndef HAVE_IOS
-VPX_LDFLAGS += -arch $(ARCH)
-endif
 endif
 endif
 
@@ -147,7 +147,7 @@ VPX_CONF += --disable-optimizations
 endif
 
 ifdef HAVE_EMSCRIPTEN
-VPX_CONF += --extra-cflags="$(CFLAGS) -pthread"
+VPX_CFLAGS += -pthread
 endif
 
 # Always enable debug symbols, we strip in the final executables if needed
@@ -168,11 +168,12 @@ VPX_CONF += --disable-neon_asm
 endif
 endif
 
+VPX_CONF += --extra-cflags="$(VPX_CFLAGS)"
+
 .vpx: libvpx
 	rm -rf $(PREFIX)/include/vpx
 	$(MAKEBUILDDIR)
-	cd $(BUILD_DIR) && LDFLAGS="$(VPX_LDFLAGS)" CROSS=$(VPX_CROSS) $(VPX_HOSTVARS) $(BUILD_SRC)/configure --target=$(VPX_TARGET) \
-		$(VPX_CONF) --prefix=$(PREFIX)
+	cd $(BUILD_DIR) && LDFLAGS="$(VPX_LDFLAGS)" CROSS=$(VPX_CROSS) $(VPX_HOSTVARS) $(BUILD_SRC)/configure $(VPX_CONF)
 	+CONFIG_DEBUG=1 $(MAKEBUILD)
 	$(call pkg_static,"$(BUILD_DIRUNPACK)/vpx.pc")
 	+CONFIG_DEBUG=1 $(MAKEBUILD) install



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6c0826012d06582b560989d981bd17f35cf118cf...9c267df45ab3978deed9e34c43b47a7461081e0e

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6c0826012d06582b560989d981bd17f35cf118cf...9c267df45ab3978deed9e34c43b47a7461081e0e
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