[vlc-commits] [Git][videolan/vlc][3.0.x] 21 commits: contrib: call meson from the current directory

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Nov 9 09:19:34 UTC 2024



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


Commits:
589c8fcd by Steve Lhomme at 2024-11-06T11:22:55+01:00
contrib: call meson from the current directory

(cherry picked from commit 7d6501b210ff8b6e20148bcd1a98161deb715744) (edited)
edited:
- 3.0 doesn't build libplacebo with meson
- 3.0 doesn't have basu
- 3.0 doesn't have librist
- 3.0 doesn't have medialibrary

- - - - -
e767f48b by Steve Lhomme at 2024-11-06T11:24:02+01:00
contrib: remove the meson build folders from the top directory

(cherry picked from commit aa8b38be5ee076f9ee3b7e7e7e4eb48d9c159819) (edited)
edited:
- 3.0 doesn't build libplacebo with meson
- 3.0 doesn't have basu
- 3.0 doesn't have librist
- 3.0 doesn't have medialibrary

- - - - -
b0330f9f by Steve Lhomme at 2024-11-06T11:24:23+01:00
contrib: call meson install instead of ninja

Just like we have CMAKEBUILD we can use meson to call build and use whatever
it picks for the build system.

(cherry picked from commit ddbfe0bd07761cdd1af88eb9f2ca7e5cd29132b7) (edited)
edited:
- 3.0 doesn't build libplacebo with meson
- 3.0 doesn't have basu
- 3.0 doesn't have librist
- 3.0 doesn't have medialibrary

- - - - -
c4bb5e34 by Steve Lhomme at 2024-11-06T11:24:42+01:00
contrib: add MESONBUILD similar to CMAKEBUILD

We don't use the '+' in front because it doesn't use the jobserver from our
make call, because of ninja:
https://github.com/ninja-build/ninja/issues/1139

(cherry picked from commit 0b2008e9fe3d8235b94c02feb4809dfd0b98b3c8) (edited)
edited:
- DCMAKE_VERBOSE_MAKEFILE is placed differently on 3.0
- 3.0 doesn't build libplacebo with meson
- 3.0 doesn't have basu
- 3.0 doesn't have librist
- 3.0 doesn't have medialibrary

- - - - -
48a314c2 by Steve Lhomme at 2024-11-06T11:25:39+01:00
contrib: allow adding custom parameters to the meson build phase

like MESON_BUILD="-v -j4"

We need to split the compile and install phases as install doesn't have as many
options as compile.

(cherry picked from commit 0773a89ed61faf9a933d4c715d2773d71e866598) (rebased)
rebased:
- DCMAKE_VERBOSE_MAKEFILE is placed differently on 3.0

- - - - -
f484ef09 by Steve Lhomme at 2024-11-06T11:25:46+01:00
contrib: move the build and source folders in the MESON command

This simplifies the meson calls without worrying where the files will be put.

(cherry picked from commit 159d86097020310dfad14f971b818c2a3a8d3034) (edited)
edited:
- 3.0 doesn't build libplacebo with meson
- 3.0 doesn't have basu
- 3.0 doesn't have librist
- 3.0 doesn't have medialibrary

- - - - -
ae3ce0c8 by Steve Lhomme at 2024-11-06T11:26:11+01:00
contrib: use a command to clean the meson contrib before rebuilding

Now the meson build folder is handled in a single place.

(cherry picked from commit d0055d6cb397e91351d3b0363a32bcb640220537) (edited)
edited:
- 3.0 doesn't build libplacebo with meson
- 3.0 doesn't have basu
- 3.0 doesn't have librist
- 3.0 doesn't have medialibrary

- - - - -
e7700590 by Steve Lhomme at 2024-11-06T11:26:25+01:00
contrib: build meson with jobserver support

If the installed ninja supports it, it will play nice with the other build
jobs.

(cherry picked from commit 72f38f5cbb1b9b25323b0045010411a9dc3aa601) (edited)
edited:
- 3.0 doesn't build libplacebo with meson
- 3.0 doesn't build glib with meson
- 3.0 doesn't have basu
- 3.0 doesn't have librist
- 3.0 doesn't have medialibrary

- - - - -
8ea9144d by Felix Paul Kühne at 2024-11-06T11:26:58+01:00
contrib: add support for bitcode

(cherry picked from commit e4b58707be272b76abc7aff51f673fd017a4e083) (rebased)
rebased:
- the code around is different

- - - - -
8f8b16de by Hugo Beauzée-Luyssen at 2024-11-06T11:41:59+01:00
contrib: meson: Use meson properties to pass PKG_CONFIG_PATH/LIBDIR

In addition to environment variables. Those are ignored when cross
compiling starting with meson 0.54
Use of environment variables should be removed in the future

(cherry picked from commit 583a941d13996d96d45a7f0d886666abbf64c260)

- - - - -
61df2e7e by Mehdi Sabwat at 2024-11-06T11:42:15+01:00
contrib: set pkg_config_libdir in meson crossfile

pkg_config_libdir is not a builtin option, to use
it we need to define it either in the meson.build of the
project or in the crossfile.

This used to fail silently, but since PR#8974 (meson 0.60.0.rc1)
it is a fatal error.

(cherry picked from commit 791c4833683a19bcf5de2ce946c07425224c901d)

- - - - -
56c89ccf by Marvin Scholz at 2024-11-06T11:42:15+01:00
contrib: meson: fix writing pkg_config_libdir

Write pkg_config_libdir to the correct crossfile section, should
fix the build after 74060949afbbca285fefdc746f61ff43ed2cb213.

(cherry picked from commit 09154ece03233a1f01e20aea5430b70616d58a93)

- - - - -
61be44b0 by Hugo Beauzée-Luyssen at 2024-11-06T11:42:15+01:00
contrib: meson: Provide objc & objcpp compiler to crossfile

(cherry picked from commit fb67f4b79b3d2c5ba49c71e656c33f0c7c36900a)

- - - - -
32b551aa by Steve Lhomme at 2024-11-06T11:42:15+01:00
contrib: pass compiler flags to Meson via the command line

Rather than the cross file which generates warnings. It also allows to override
each flag per target.

(cherry picked from commit 6e912b40384f4be0bd5ce7632d2034fb4c03e23b)

- - - - -
a35c6058 by Alaric Senat at 2024-11-06T11:42:15+01:00
contrib: meson: always use meson `setup`

"meson builddir" has been deprecated since 0.64.0.

Please see 3c7ab542c0c4770241eae149b0d4cd8de329aee0 [1] upstream for the
complete explanation.

[1] https://github.com/mesonbuild/meson/commit/3c7ab542c0c4770241eae149b0d4cd8de329aee0

(cherry picked from commit f16229374002d796979f3b6b5cb95cc5e8d45c4d) (rebased)
- 3.0 doesn't use BUILD_DIR with meson

- - - - -
ee92e20f by Steve Lhomme at 2024-11-06T11:42:15+01:00
contrib: use HOSTTOOLS instead of HOSTVARS_MESON

They are always the same. No need for an extra variable with a confusing name.

(cherry picked from commit dedaffaf5fb896a1a85f3420fe55f75687b41a41) (edited)
edited:
- the code around the edited code is slightly different
- 3.0 doesn't build libplacebo with meson
- 3.0 doesn't build glib with meson
- 3.0 doesn't build opus with meson
- 3.0 doesn't have basu
- 3.0 doesn't have librist
- 3.0 doesn't have medialibrary

- - - - -
8222277c by Steve Lhomme at 2024-11-06T11:42:15+01:00
contrib: only pass the tools to meson when not cross-compiling

When cross-compiling they are included in the crossfile.

(cherry picked from commit cb0ebea6f3ece814b7b4b70b2d4b7f0eab68f372) (edited)
edited:
- 3.0 doesn't use BUILD_DIR with meson
- 3.0 doesn't build libplacebo with meson
- 3.0 doesn't build glib with meson
- 3.0 doesn't build opus with meson
- 3.0 doesn't have basu
- 3.0 doesn't have librist
- 3.0 doesn't have medialibrary

- - - - -
724f0518 by Steve Lhomme at 2024-11-06T12:23:28+01:00
contrib: orc: update to 0.4.33

Fixes a crash in diracpromo-tr1000.ts

The upstream submission of the meson patch can be found at
https://gitlab.freedesktop.org/gstreamer/orc/-/merge_requests/70

(cherry picked from commit 0ca61cd3fdebfc06177bb5b7dd03597705cd6c10) (edited)
edited:
- 4.0 update to 0.4.40 but the last one compatible with XP is 0.4.33
- 3.0 was not using the cleaner autotools calls
- 3.0 was not using the config.* updates
- 3.0 was not using alloweduwp

- - - - -
4229f747 by Steve Lhomme at 2024-11-06T14:00:08+01:00
contrib: orc: backport macos/ios fix

- - - - -
16024a57 by Steve Lhomme at 2024-11-06T14:00:08+01:00
contrib: schroedinger: compile the same core in native and cross-compiled builds

(cherry picked from commit b5cfbf6e1431a23698ea4f13d4cadabeba597e90)

- - - - -
db369b45 by Steve Lhomme at 2024-11-06T14:04:53+01:00
contrib: orc: replace FORMAT_MESSAGE_ALLOCATE_BUFFER which may not be available in older UWP

- - - - -


14 changed files:

- contrib/bootstrap
- contrib/src/dav1d/rules.mak
- contrib/src/fribidi/rules.mak
- contrib/src/gen-meson-crossfile.py
- contrib/src/harfbuzz/rules.mak
- contrib/src/libdsm/rules.mak
- contrib/src/main.mak
- contrib/src/microdns/rules.mak
- + contrib/src/orc/0001-Fix-usage-of-pthread_jit_write_protect_np-on-macOS-a.patch
- contrib/src/orc/SHA512SUMS
- contrib/src/orc/rules.mak
- − contrib/src/orc/use-proper-func-detection.patch
- contrib/src/schroedinger/rules.mak
- + contrib/src/schroedinger/schroedinger-disable-orcc.patch


Changes:

=====================================
contrib/bootstrap
=====================================
@@ -36,6 +36,7 @@ usage()
 	echo "                   (USE AT YOUR OWN LEGAL RISKS)"
 	echo "  --disable-optim  disable optimization in libraries"
 	echo "  --enable-pdb     generate debug information in PDB format"
+	echo "  --enable-bitcode generate bitcode information"
 }
 
 BUILD=
@@ -51,6 +52,7 @@ GNUV3="1"
 AD_CLAUSES=
 WITH_OPTIMIZATION="1"
 ENABLE_PDB=
+ENABLE_BITCODE=
 
 while test -n "$1"
 do
@@ -83,6 +85,9 @@ do
 		--enable-pdb)
 			ENABLE_PDB=1
 			;;
+		--enable-bitcode)
+			ENABLE_BITCODE=1
+			;;
 		--enable-small)
 			ENABLE_SMALL=1
 			;;
@@ -320,6 +325,10 @@ case "${OS}" in
 		then
 			add_make_enabled "HAVE_TVOS"
 		fi
+		if test "$ENABLE_BITCODE"
+		then
+			add_make_enabled "HAVE_BITCODE_ENABLED"
+		fi
 		;;
 	*bsd*)
 		add_make_enabled "HAVE_BSD"


=====================================
contrib/src/dav1d/rules.mak
=====================================
@@ -21,7 +21,7 @@ dav1d: dav1d-$(DAV1D_VERSION).tar.xz .sum-dav1d
 	$(MOVE)
 
 .dav1d: dav1d crossfile.meson
-	cd $< && rm -rf ./build
-	cd $< && $(HOSTVARS_MESON) $(MESON) $(DAV1D_CONF) build
-	cd $< && cd build && ninja install
+	$(MESONCLEAN)
+	$(MESON) $(DAV1D_CONF)
+	+$(MESONBUILD)
 	touch $@


=====================================
contrib/src/fribidi/rules.mak
=====================================
@@ -18,7 +18,7 @@ fribidi: fribidi-$(FRIBIDI_VERSION).tar.xz .sum-fribidi
 
 # FIXME: DEPS_fribidi = iconv $(DEPS_iconv)
 .fribidi: fribidi crossfile.meson
-	cd $< && rm -rf ./build
-	cd $< && $(HOSTVARS_MESON) $(MESON) -Ddocs=false -Dbin=false -Dtests=false build
-	cd $< && cd build && ninja install
+	$(MESONCLEAN)
+	$(MESON) -Ddocs=false -Dbin=false -Dtests=false
+	+$(MESONBUILD)
 	touch $@


=====================================
contrib/src/gen-meson-crossfile.py
=====================================
@@ -28,6 +28,9 @@ args.file.write("# Automatically generated by contrib makefile\n")
 args.file.write("\n[binaries]\n")
 _add_environ_val('c', 'CC')
 _add_environ_val('cpp', 'CXX')
+if os.environ.get('HOST_SYSTEM') == 'darwin':
+    _add_environ_val('objc', 'OBJC')
+    _add_environ_val('objcpp', 'OBJCXX')
 _add_environ_val('ar', 'AR')
 _add_environ_val('strip', 'STRIP')
 _add_environ_val('pkgconfig', 'PKG_CONFIG')
@@ -36,10 +39,7 @@ _add_environ_val('windres', 'WINDRES')
 # Properties section
 args.file.write("\n[properties]\n")
 args.file.write("needs_exe_wrapper = true\n")
-_add_environ_arr('c_args', 'CFLAGS')
-_add_environ_arr('c_link_args', 'LDFLAGS')
-_add_environ_arr('cpp_args', 'CXXFLAGS')
-_add_environ_arr('cpp_link_args', 'LDFLAGS')
+_add_environ_val('pkg_config_libdir', 'PKG_CONFIG_LIBDIR')
 
 # Host machine section
 args.file.write("\n[host_machine]\n")


=====================================
contrib/src/harfbuzz/rules.mak
=====================================
@@ -32,7 +32,7 @@ HARFBUZZ_CONF += -Dcoretext=enabled
 endif
 
 .harfbuzz: harfbuzz crossfile.meson
-	cd $< && rm -rf ./build
-	cd $< && $(HOSTVARS_MESON) $(MESON) $(HARFBUZZ_CONF) build
-	cd $< && cd build && ninja install
+	$(MESONCLEAN)
+	$(MESON) $(HARFBUZZ_CONF)
+	+$(MESONBUILD)
 	touch $@


=====================================
contrib/src/libdsm/rules.mak
=====================================
@@ -27,7 +27,7 @@ DEPS_libdsm += pthreads $(DEPS_pthreads)
 endif
 
 .libdsm: libdsm crossfile.meson
-	cd $< && rm -rf ./build
-	cd $< && $(HOSTVARS_MESON) $(MESON) -Dauto_features=disabled -Dbinaries=false build
-	cd $< && cd build && ninja install
+	$(MESONCLEAN)
+	$(MESON) -Dauto_features=disabled -Dbinaries=false
+	+$(MESONBUILD)
 	touch $@


=====================================
contrib/src/main.mak
=====================================
@@ -296,12 +296,6 @@ HOSTTOOLS := \
 	PATH="$(PREFIX)/bin:$(PATH)" \
 	PKG_CONFIG="$(PKG_CONFIG)"
 
-HOSTVARS_MESON := $(HOSTTOOLS) \
-	CPPFLAGS="$(CPPFLAGS)" \
-	CFLAGS="$(CFLAGS)" \
-	CXXFLAGS="$(CXXFLAGS)" \
-	LDFLAGS="$(LDFLAGS)"
-
 # Add these flags after Meson consumed the CFLAGS/CXXFLAGS
 # as when setting those for Meson, it would apply to tests
 # and cause the check if symbols have underscore prefix to
@@ -314,6 +308,11 @@ CFLAGS := $(CFLAGS) -g -O2
 CXXFLAGS := $(CXXFLAGS) -g -O2
 endif
 
+ifdef HAVE_BITCODE_ENABLED
+CFLAGS := $(CFLAGS) -fembed-bitcode
+CXXFLAGS := $(CXXFLAGS) -fembed-bitcode
+endif
+
 ifdef ENABLE_PDB
 ifdef HAVE_CLANG
 ifneq ($(findstring $(ARCH),i686 x86_64),)
@@ -425,13 +424,20 @@ ifeq ($(findstring mingw32,$(BUILD)),mingw32)
 CMAKE += -DCMAKE_LINK_LIBRARY_SUFFIX:STRING=.a
 endif
 
-MESONFLAGS = --default-library static --prefix "$(PREFIX)" --backend ninja \
-	-Dlibdir=lib
+MESONFLAGS = $</build $< --default-library static --prefix "$(PREFIX)" \
+	--backend ninja -Dlibdir=lib
 ifndef WITH_OPTIMIZATION
 MESONFLAGS += --buildtype debug
 else
 MESONFLAGS += --buildtype debugoptimized
 endif
+ifdef HAVE_BITCODE_ENABLED
+MESONFLAGS += -Db_bitcode=true
+endif
+MESONFLAGS += -Dc_args="$(CFLAGS)" -Dc_link_args="$(LDFLAGS)" -Dcpp_args="$(CXXFLAGS)" -Dcpp_link_args="$(LDFLAGS)"
+ifdef HAVE_DARWIN_OS
+MESONFLAGS += -Dobjc_args="$(CFLAGS)" -Dobjc_link_args="$(LDFLAGS)" -Dobjcpp_args="$(CXXFLAGS)" -Dobjcpp_link_args="$(LDFLAGS)"
+endif
 
 ifdef HAVE_CROSS_COMPILE
 # When cross-compiling meson uses the env vars like
@@ -446,10 +452,15 @@ ifdef HAVE_CROSS_COMPILE
 # expected.
 MESONFLAGS += --cross-file $(abspath crossfile.meson)
 MESON = env -i PATH="$(PREFIX)/bin:$(PATH)" PKG_CONFIG_LIBDIR="$(PKG_CONFIG_LIBDIR)" \
-	PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" meson $(MESONFLAGS)
+	PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" \
+	meson -Dpkg_config_path="$(PKG_CONFIG_PATH)" \
+	$(MESONFLAGS)
+
 else
-MESON = meson $(MESONFLAGS)
+MESON = $(HOSTTOOLS) meson setup $(MESONFLAGS)
 endif
+MESONCLEAN = rm -rf $</build
+MESONBUILD = meson compile -C $</build $(MESON_BUILD) && meson install -C $</build
 
 ifeq ($(V),1)
 CMAKE += -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
@@ -647,7 +658,7 @@ endif
 
 
 crossfile.meson: $(SRC)/gen-meson-crossfile.py
-	$(HOSTVARS_MESON) \
+	$(HOSTTOOLS) \
 	WINDRES="$(WINDRES)" \
 	PKG_CONFIG="$(PKG_CONFIG)" \
 	HOST_SYSTEM="$(MESON_SYSTEM_NAME)" \


=====================================
contrib/src/microdns/rules.mak
=====================================
@@ -22,7 +22,7 @@ microdns: microdns-$(LIBMICRODNS_VERSION).tar.xz .sum-microdns
 	$(MOVE)
 
 .microdns: microdns crossfile.meson
-	cd $< && rm -rf ./build
-	cd $< && $(HOSTVARS_MESON) $(MESON) -Dauto_features=disabled build
-	cd $< && cd build && ninja install
+	$(MESONCLEAN)
+	$(MESON) -Dauto_features=disabled
+	+$(MESONBUILD)
 	touch $@


=====================================
contrib/src/orc/0001-Fix-usage-of-pthread_jit_write_protect_np-on-macOS-a.patch
=====================================
@@ -0,0 +1,129 @@
+From 4d0144a9cc4efa195ae3e7f6b99b2daa9ad47b54 Mon Sep 17 00:00:00 2001
+From: Nirbheek Chauhan <nirbheek at centricular.com>
+Date: Fri, 3 Feb 2023 17:27:48 +0530
+Subject: [PATCH] Fix usage of pthread_jit_write_protect_np() on macOS and iOS
+
+The API is not available on iOS at all, and is only available on macOS
+starting from macOS 11, as can be seen in `pthread/pthread.h` in the
+Xcode SDK:
+
+```
+__API_AVAILABLE(macos(11.0))
+__API_UNAVAILABLE(ios, tvos, watchos, driverkit)
+void pthread_jit_write_protect_np(int enabled);
+
+__API_AVAILABLE(macos(11.0))
+__API_UNAVAILABLE(ios, tvos, watchos, driverkit)
+int pthread_jit_write_protect_supported_np(void);
+```
+
+The configuration check for this is actually wrong. We should detect
+availability of the API at compile time and use it conditionally at
+runtime. The code now checks the following cases:
+
+1. Are we building for macOS?
+2. Do we have a new-enough SDK that defines MAC_OS_VERSION_11_0 and
+   hence has pthread_jit_write_* available?
+3. Is the maximum macOS version allowed at least macOS 11.0, so we
+   have a possibility of using this API at runtime?
+4. Are we running on macOS 11.0 or newer?
+
+Also: we need to ensure that pthread_jit_write_protect_supported_np()
+actually returns true before using the API, because if you're shipping
+an app, you need to set `com.apple.security.cs.allow-jit` in your app
+otherwise the API won't work if you've opted in to Hardened Runtime.
+See: https://developer.apple.com/documentation/apple-silicon/porting-just-in-time-compilers-to-apple-silicon
+
+Fixes https://gitlab.freedesktop.org/gstreamer/orc/-/issues/44
+---
+ meson.build       |  8 --------
+ orc/orccompiler.c | 26 ++++++++++++++++----------
+ 2 files changed, 16 insertions(+), 18 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index ef636d0..b1901d3 100644
+--- a/meson.build
++++ b/meson.build
+@@ -130,14 +130,6 @@ cdata.set('HAVE_MONOTONIC_CLOCK', cc.compiles(monotonic_test))
+ cdata.set('HAVE_GETTIMEOFDAY', cc.has_function('gettimeofday'))
+ cdata.set('HAVE_POSIX_MEMALIGN', cc.has_function('posix_memalign', prefix : '#include <stdlib.h>'))
+ cdata.set('HAVE_MMAP', cc.has_function('mmap'))
+-
+-# pthread_jit_write_protect_np() is available but unusable on iOS simulator
+-if host_os == 'ios' and cpu_family == 'x86_64'
+-  cdata.set('HAVE_PTHREAD_JIT', false)
+-else
+-  cdata.set('HAVE_PTHREAD_JIT', cc.has_function('pthread_jit_write_protect_np'))
+-endif
+-
+ cdata.set('HAVE_SYS_TIME_H', cc.has_header('sys/time.h'))
+ cdata.set('HAVE_UNISTD_H', cc.has_header('unistd.h'))
+ cdata.set('HAVE_VALGRIND_VALGRIND_H', cc.has_header('valgrind/valgrind.h'))
+diff --git a/orc/orccompiler.c b/orc/orccompiler.c
+index a391e86..19bec9e 100644
+--- a/orc/orccompiler.c
++++ b/orc/orccompiler.c
+@@ -6,7 +6,7 @@
+ #include <stdlib.h>
+ #include <stdarg.h>
+ 
+-#if defined(HAVE_PTHREAD_JIT)
++#ifdef __APPLE__
+   #include <pthread.h>
+ #endif
+ 
+@@ -64,6 +64,17 @@ int _orc_compiler_flag_randomize;
+ /* For Windows */
+ int _orc_codemem_alignment;
+ 
++#if defined(MAC_OS_VERSION_11_0) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0
++G_ALWAYS_INLINE
++static void
++orc_pthread_jit_write_protect_np (int protect)
++{
++  if (__builtin_available (macOS 10.11, *))
++    if (pthread_jit_write_protect_supported_np ())
++      pthread_jit_write_protect_np (protect);
++}
++#endif
++
+ void
+ _orc_compiler_init (void)
+ {
+@@ -126,11 +137,6 @@ _orc_compiler_init (void)
+     }
+   }
+ #endif
+-
+-#if defined(HAVE_PTHREAD_JIT)
+-  ORC_INFO("pthread_jit_write_protect_supported_np() = %i",
+-      pthread_jit_write_protect_supported_np());
+-#endif
+ }
+ 
+ int
+@@ -456,8 +462,8 @@ orc_program_compile_full (OrcProgram *program, OrcTarget *target,
+   program->orccode->code_size = compiler->codeptr - compiler->code;
+   orc_code_allocate_codemem (program->orccode, program->orccode->code_size);
+ 
+-#if defined(HAVE_PTHREAD_JIT)
+-  pthread_jit_write_protect_np(0);
++#if defined(MAC_OS_VERSION_11_0) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0
++  orc_pthread_jit_write_protect_np (0);
+ #endif
+ #if defined(HAVE_CODEMEM_VIRTUALALLOC)
+   /* Ensure that code region is writable before memcpy */
+@@ -475,8 +481,8 @@ orc_program_compile_full (OrcProgram *program, OrcTarget *target,
+     compiler->target->flush_cache (program->orccode);
+   }
+ 
+-#if defined(HAVE_PTHREAD_JIT)
+-  pthread_jit_write_protect_np(1);
++#if defined(MAC_OS_VERSION_11_0) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_VERSION_11_0
++  orc_pthread_jit_write_protect_np (1);
+ #endif
+ #if defined(HAVE_CODEMEM_VIRTUALALLOC)
+   /* Code region is now ready for execution */
+-- 
+2.45.0.windows.1
+


=====================================
contrib/src/orc/SHA512SUMS
=====================================
@@ -1 +1 @@
-75f06d603f71077daa952533b33597fb2bce573647ed75496d55e436485b3c58cd6a43865e931c4def32217b0969bb4c07ef222845c28e9e711bfba80d0d9a21  orc-0.4.18.tar.gz
+e8981908f37a77a2638c3461622a8e5ed8b583a3067c525de0737eb951a57d8a6f22f8930c31e0c16dae5bc94f98a79c1aba976b35e58f5d59b33d5a1d721e68  orc-0.4.33.tar.bz2


=====================================
contrib/src/orc/rules.mak
=====================================
@@ -1,24 +1,30 @@
 # orc
 
-ORC_VERSION := 0.4.18
-ORC_URL := $(CONTRIB_VIDEOLAN)/orc/orc-$(ORC_VERSION).tar.gz
+ORC_VERSION := 0.4.33
+ORC_URL := https://gitlab.freedesktop.org/gstreamer/orc/-/archive/$(ORC_VERSION)/orc-$(ORC_VERSION).tar.bz2
 
 ifeq ($(call need_pkg,"orc-0.4"),)
 PKGS_FOUND += orc
 endif
 
-$(TARBALLS)/orc-$(ORC_VERSION).tar.gz:
+$(TARBALLS)/orc-$(ORC_VERSION).tar.bz2:
 	$(call download_pkg,$(ORC_URL),orc)
 
-.sum-orc: orc-$(ORC_VERSION).tar.gz
+.sum-orc: orc-$(ORC_VERSION).tar.bz2
 
-orc: orc-$(ORC_VERSION).tar.gz .sum-orc
+orc: orc-$(ORC_VERSION).tar.bz2 .sum-orc
 	$(UNPACK)
-	$(APPLY) $(SRC)/orc/use-proper-func-detection.patch
-	$(UPDATE_AUTOCONFIG)
+	$(APPLY) $(SRC)/orc/0001-Fix-usage-of-pthread_jit_write_protect_np-on-macOS-a.patch
+
+	# replace FORMAT_MESSAGE_ALLOCATE_BUFFER which may not be available in older mingw-w64 UWP
+	sed -i.orig -e s/FORMAT_MESSAGE_ALLOCATE_BUFFER/0x00000100/g $(UNPACK_DIR)/orc/orccompiler.c
+
 	$(MOVE)
 
+ORC_CONF := -Dauto_features=disabled
+
 .orc: orc
-	cd $< && $(HOSTVARS) ./configure $(HOSTCONF)
-	cd $< && $(MAKE) install
+	$(MESONCLEAN)
+	$(MESON) $(ORC_CONF)
+	+$(MESONBUILD)
 	touch $@


=====================================
contrib/src/orc/use-proper-func-detection.patch deleted
=====================================
@@ -1,70 +0,0 @@
---- orc/configure.ac.orig	2016-06-20 13:07:27.584543779 +0000
-+++ orc/configure.ac	2016-06-20 13:14:21.920651349 +0000
-@@ -90,20 +90,7 @@
-   AS_COMPILER_FLAG(-Werror, ERROR_CFLAGS="-Werror")
- fi
- 
--case "${host_os}" in
--  nobody_is_using_this_currently)
--    AC_DEFINE(HAVE_CODEMEM_MALLOC, 1, [Use malloc to allocate code for execution])
--    ;;
--  mingw*|pw32*|cygwin*)
--    AC_DEFINE(HAVE_CODEMEM_VIRTUALALLOC, 1, [Use VirtualAlloc to allocate code for execution])
--    ;;
--  linux*|darwin*|solaris*|netbsd*|freebsd*|openbsd*|kfreebsd*|dragonfly*|gnu*)
--    AC_DEFINE(HAVE_CODEMEM_MMAP, 1, [Use mmap to allocate code for execution])
--    ;;
--  *)
--    AC_ERROR([no code allocation backend])
--    ;;
--esac
-+AC_CHECK_FUNCS([VirtualAlloc mmap])
- 
- case "${host_os}" in
-   mingw*|pw32*|cygwin*)
---- orc/orc/orccodemem.c.orig	2016-06-20 16:43:22.126619599 +0200
-+++ orc/orc/orccodemem.c	2016-06-20 16:45:03.370771546 +0200
-@@ -11,10 +11,10 @@
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>
--#ifdef HAVE_CODEMEM_MMAP
-+#ifdef HAVE_MMAP
- #include <sys/mman.h>
- #endif
--#ifdef HAVE_CODEMEM_VIRTUALALLOC
-+#ifdef HAVE_VIRTUALALLOC
- #include <windows.h>
- #endif
- 
-@@ -190,7 +190,7 @@
-   }
- }
- 
--#ifdef HAVE_CODEMEM_MMAP
-+#ifdef HAVE_MMAP
- int
- orc_code_region_allocate_codemem_dual_map (OrcCodeRegion *region,
-     const char *dir, int force_unlink)
-@@ -285,9 +285,7 @@
-       "and $TMPDIR and $HOME are mounted noexec (bad).");
- }
- 
--#endif
--
--#ifdef HAVE_CODEMEM_VIRTUALALLOC
-+#elif defined(HAVE_VIRTUALALLOC)
- void
- orc_code_region_allocate_codemem (OrcCodeRegion *region)
- {
-@@ -295,9 +293,7 @@
-   region->exec_ptr = region->write_ptr;
-   region->size = SIZE;
- }
--#endif
--
--#ifdef HAVE_CODEMEM_MALLOC
-+#else
- void
- orc_code_region_allocate_codemem (OrcCodeRegion *region)
- {


=====================================
contrib/src/schroedinger/rules.mak
=====================================
@@ -16,6 +16,8 @@ $(TARBALLS)/schroedinger-$(SCHROEDINGER_VERSION).tar.gz:
 schroedinger: schroedinger-$(SCHROEDINGER_VERSION).tar.gz .sum-schroedinger
 	$(UNPACK)
 	$(APPLY) $(SRC)/schroedinger/schroedinger-notests.patch
+	# disable orc compilation, the old compiler matches what was used to precompile
+	$(APPLY) $(SRC)/schroedinger/schroedinger-disable-orcc.patch
 	$(call pkg_static,"schroedinger.pc.in")
 	$(MOVE)
 


=====================================
contrib/src/schroedinger/schroedinger-disable-orcc.patch
=====================================
@@ -0,0 +1,11 @@
+--- schroedinger/configure.ac.orig	2024-05-24 11:11:32.059775800 +0200
++++ schroedinger/configure.ac	2024-05-24 11:11:46.999404400 +0200
+@@ -56,7 +56,7 @@ fi
+ SCHRO_PKG_DEPS="$SCHRO_PKG_DEPS orc-0.4 >= $ORC_VER"
+ ORCC=`$PKG_CONFIG --variable=orcc orc-0.4`
+ AC_SUBST(ORCC)
+-AM_CONDITIONAL(HAVE_ORCC, test "x$cross_compiling" != xyes)
++AM_CONDITIONAL(HAVE_ORCC, test "x$cross_compiling" = none)
+ 
+ AC_ARG_WITH([thread],
+     AS_HELP_STRING([--with-thread=IMPL],[use threading library {auto,pthread,gthread,win32,none} [[default=auto]]]),



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/dd191b6f27a364a04c2a838b6a97aa8c9411a72e...db369b4534f3c1acac8da909eba9964e79dd1231

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