[vlc-commits] [Git][videolan/vlc][master] 2 commits: contrib: gpg-error: sanitise POSIX lock object

Rémi Denis-Courmont (@Courmisch) gitlab at videolan.org
Fri Feb 4 21:22:04 UTC 2022



Rémi Denis-Courmont pushed to branch master at VideoLAN / VLC


Commits:
ba314fb4 by Rémi Denis-Courmont at 2022-02-04T19:56:00+00:00
contrib: gpg-error: sanitise POSIX lock object

This provides a sane portable lock object definition for all platforms
with basic POSIX threads. This replaces the insane gpg-error build
system attempting and failing to second guess the platform-specific
size and alignment of pthread_mutex_t.

- - - - -
7c047fa9 by Rémi Denis-Courmont at 2022-02-04T19:56:00+00:00
contrib: gpg-error: remove broken Android hacks

Proper handling of errors and interrupts of course requires that the
target only exists on succesful completion. .DELETE_ON_ERROR cannot be
used for directories. The contribs source README indeed has required to
keep $(MOVE) for as long as the current incarnation of contribs has
existed.

This hack is no longer necessary anyway as per the previous change.

- - - - -


2 changed files:

- + contrib/src/gpg-error/lock-obj-pub.posix.h
- contrib/src/gpg-error/rules.mak


Changes:

=====================================
contrib/src/gpg-error/lock-obj-pub.posix.h
=====================================
@@ -0,0 +1,18 @@
+## lock-obj-pub.posix.h
+## File created by Rémi Denis-Courmont - DO EDIT
+## To be included by mkheader into gpg-error.h
+
+#include <pthread.h>
+
+typedef struct
+{
+  long vers;
+  union {
+    pthread_mutex_t mtx;
+    /* In theory, pointers could have a higher alignment than pthread_mutex_t,
+     * so keep in the union to match _gpgrt_lock_t. */
+    long *alignme;
+  } u;
+} gpgrt_lock_t;
+
+#define GPGRT_LOCK_INITIALIZER { 1, { PTHREAD_MUTEX_INITIALIZER } }


=====================================
contrib/src/gpg-error/rules.mak
=====================================
@@ -25,15 +25,11 @@ endif
 	$(APPLY) $(SRC)/gpg-error/version-bump-gawk-5.patch
 	$(APPLY) $(SRC)/gpg-error/win32-extern-struct.patch
 	$(APPLY) $(SRC)/gpg-error/darwin-triplet.patch
-	$(MOVE)
-ifdef HAVE_ANDROID
-ifeq ($(ARCH),aarch64)
-	# x86_64-linux-gnu matches exactly what gets generated by gen-posix-lock-obj on arm64
-	cp $@/src/syscfg/lock-obj-pub.x86_64-pc-linux-gnu.h $@/src/syscfg/lock-obj-pub.linux-android.h
-else
-	cp $@/src/syscfg/lock-obj-pub.arm-unknown-linux-androideabi.h $@/src/syscfg/lock-obj-pub.linux-android.h
-endif
+ifndef HAVE_WIN32
+	cp -f -- "$(SRC)/gpg-error/lock-obj-pub.posix.h" \
+		"$(UNPACK_DIR)/src/lock-obj-pub.native.h"
 endif
+	$(MOVE)
 
 GPGERROR_CONF := $(HOSTCONF) \
 	--disable-nls \
@@ -44,5 +40,6 @@ GPGERROR_CONF := $(HOSTCONF) \
 .gpg-error: libgpg-error
 	$(RECONF)
 	cd $< && $(HOSTVARS) ./configure $(GPGERROR_CONF)
-	cd $< && $(MAKE) install
+	# pre_mkheader_cmds would delete our lock-obj-pub-native.h
+	cd $< && $(MAKE) pre_mkheader_cmds=true install
 	touch $@



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/94ec8d99386c3e3daa84404d264282bdd264a255...7c047fa9d9ba82b699cb4acf3eb4e94ed2f2c404

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/94ec8d99386c3e3daa84404d264282bdd264a255...7c047fa9d9ba82b699cb4acf3eb4e94ed2f2c404
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list