[vlc-commits] contrib: harfbuzz: turn local patches into patches against the harfbuzz git

Steve Lhomme git at videolan.org
Fri Jun 19 09:06:50 CEST 2020


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon May 18 14:19:24 2020 +0200| [9f8664e2fcd66bc7f6c46384706ba96952768cbc] | committer: Steve Lhomme

contrib: harfbuzz: turn local patches into patches against the harfbuzz git

It's easier to apply & rebase patches when updating to a newer version.

(cherry picked from commit d7c824529ceab78909e8239cc422b756ceb87710)

Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=9f8664e2fcd66bc7f6c46384706ba96952768cbc
---

 ...h => 0001-fix-OSAtomic-calls-for-AArch64.patch} | 22 +++++++++++---
 ...=> 0002-Update-the-bundled-ax_pthread.m4.patch} | 34 +++++++++++++++++-----
 contrib/src/harfbuzz/rules.mak                     |  4 +--
 3 files changed, 46 insertions(+), 14 deletions(-)

diff --git a/contrib/src/harfbuzz/harfbuzz-aarch64.patch b/contrib/src/harfbuzz/0001-fix-OSAtomic-calls-for-AArch64.patch
similarity index 58%
rename from contrib/src/harfbuzz/harfbuzz-aarch64.patch
rename to contrib/src/harfbuzz/0001-fix-OSAtomic-calls-for-AArch64.patch
index 21825299af..275f012946 100644
--- a/contrib/src/harfbuzz/harfbuzz-aarch64.patch
+++ b/contrib/src/harfbuzz/0001-fix-OSAtomic-calls-for-AArch64.patch
@@ -1,6 +1,17 @@
---- harfbuzz-2.0.0/src/hb-atomic.hh.orig	2018-10-01 19:49:23.000000000 +0200
-+++ harfbuzz-2.0.0/src/hb-atomic.hh	2020-03-29 16:44:27.520441550 +0200
-@@ -163,10 +163,8 @@
+From f110dc32b2a0f3fccfc80007916efcc9f62c56fa Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <felix at feepk.net>
+Date: Fri, 15 May 2020 09:14:15 +0200
+Subject: [PATCH 1/3] fix OSAtomic calls for AArch64
+
+---
+ src/hb-atomic.hh | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/src/hb-atomic.hh b/src/hb-atomic.hh
+index b3fb296b..20dae7e3 100644
+--- a/src/hb-atomic.hh
++++ b/src/hb-atomic.hh
+@@ -164,10 +164,8 @@ static inline bool _hb_compare_and_swap_ptr (void **P, void *O, void *N)
  #elif !defined(HB_NO_MT) && defined(__APPLE__)
  
  #include <libkern/OSAtomic.h>
@@ -12,7 +23,7 @@
  #endif
  
  #define _hb_memory_barrier()			OSMemoryBarrier ()
-@@ -174,7 +172,11 @@
+@@ -175,7 +173,11 @@ static inline bool _hb_compare_and_swap_ptr (void **P, void *O, void *N)
  #define hb_atomic_int_impl_add(AI, V)		(OSAtomicAdd32Barrier ((V), (AI)) - (V))
  
  #if (MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4 || __IPHONE_VERSION_MIN_REQUIRED >= 20100)
@@ -24,3 +35,6 @@
  #else
  #if __ppc64__ || __x86_64__ || __aarch64__
  #define hb_atomic_ptr_impl_cmpexch(P,O,N)	OSAtomicCompareAndSwap64Barrier ((int64_t) (O), (int64_t) (N), (int64_t*) (P))
+-- 
+2.26.0.windows.1
+
diff --git a/contrib/src/harfbuzz/update-ax_pthread.m4.patch b/contrib/src/harfbuzz/0002-Update-the-bundled-ax_pthread.m4.patch
similarity index 91%
rename from contrib/src/harfbuzz/update-ax_pthread.m4.patch
rename to contrib/src/harfbuzz/0002-Update-the-bundled-ax_pthread.m4.patch
index 920e068b9d..3a8258fd89 100644
--- a/contrib/src/harfbuzz/update-ax_pthread.m4.patch
+++ b/contrib/src/harfbuzz/0002-Update-the-bundled-ax_pthread.m4.patch
@@ -1,5 +1,20 @@
---- harfbuzz/m4/ax_pthread.m4.orig	2020-04-08 14:31:17.385627420 +0300
-+++ harfbuzz/m4/ax_pthread.m4	2020-04-08 14:31:42.361091349 +0300
+From dc5815a2cc756a29c01a85081e16e43131f18411 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
+Date: Fri, 15 May 2020 09:16:42 +0200
+Subject: [PATCH 2/3] Update the bundled ax_pthread.m4
+
+This fixes building for Windows with clang, where the bundled
+version of ax_pthread.m4 assumes that Clang doesn't need the
+pthread option in LDFLAGS (assuming that a system that Clang
+supports doesn't need an external library for pthreads).
+---
+ m4/ax_pthread.m4 | 224 ++++++++++++++++++++++++++---------------------
+ 1 file changed, 123 insertions(+), 101 deletions(-)
+
+diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4
+index 5fbf9fe0..1598d077 100644
+--- a/m4/ax_pthread.m4
++++ b/m4/ax_pthread.m4
 @@ -55,6 +55,7 @@
  #
  #   Copyright (c) 2008 Steven G. Johnson <stevenj at alum.mit.edu>
@@ -17,7 +32,7 @@
  
  AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
  AC_DEFUN([AX_PTHREAD], [
-@@ -123,10 +124,12 @@
+@@ -123,10 +124,12 @@ fi
  # (e.g. DEC) have both -lpthread and -lpthreads, where one of the
  # libraries is broken (non-POSIX).
  
@@ -34,7 +49,7 @@
  
  ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
  
-@@ -194,14 +197,47 @@
+@@ -194,14 +197,47 @@ case $host_os in
          # that too in a future libc.)  So we'll check first for the
          # standard Solaris way of linking pthreads (-mt -lpthread).
  
@@ -84,7 +99,7 @@
  
  # The presence of a feature test macro requesting re-entrant function
  # definitions is, on some systems, a strong hint that pthreads support is
-@@ -224,25 +260,86 @@
+@@ -224,25 +260,86 @@ AS_IF([test "x$ax_pthread_check_macro" = "x--"],
        [ax_pthread_check_cond=0],
        [ax_pthread_check_cond="!defined($ax_pthread_check_macro)"])
  
@@ -188,7 +203,7 @@
  
  # Clang needs special handling, because older versions handle the -pthread
  # option in a rather... idiosyncratic way
-@@ -261,11 +358,6 @@
+@@ -261,11 +358,6 @@ if test "x$ax_pthread_clang" = "xyes"; then
          # -pthread does define _REENTRANT, and while the Darwin headers
          # ignore this macro, third-party headers might not.)
  
@@ -200,7 +215,7 @@
          # However, older versions of Clang make a point of warning the user
          # that, in an invocation where only linking and no compilation is
          # taking place, the -pthread option has no effect ("argument unused
-@@ -320,78 +412,7 @@
+@@ -320,78 +412,7 @@ if test "x$ax_pthread_clang" = "xyes"; then
  
  fi # $ax_pthread_clang = yes
  
@@ -279,7 +294,7 @@
  
  # Various other checks:
  if test "x$ax_pthread_ok" = "xyes"; then
-@@ -438,7 +459,8 @@
+@@ -438,7 +459,8 @@ if test "x$ax_pthread_ok" = "xyes"; then
          AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
              [ax_cv_PTHREAD_PRIO_INHERIT],
              [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
@@ -289,3 +304,6 @@
                              [ax_cv_PTHREAD_PRIO_INHERIT=yes],
                              [ax_cv_PTHREAD_PRIO_INHERIT=no])
              ])
+-- 
+2.26.0.windows.1
+
diff --git a/contrib/src/harfbuzz/rules.mak b/contrib/src/harfbuzz/rules.mak
index 04e46c6ebd..00898af3a4 100644
--- a/contrib/src/harfbuzz/rules.mak
+++ b/contrib/src/harfbuzz/rules.mak
@@ -14,8 +14,8 @@ $(TARBALLS)/harfbuzz-$(HARFBUZZ_VERSION).tar.xz:
 
 harfbuzz: harfbuzz-$(HARFBUZZ_VERSION).tar.xz .sum-harfbuzz
 	$(UNPACK)
-	$(APPLY) $(SRC)/harfbuzz/harfbuzz-aarch64.patch
-	$(APPLY) $(SRC)/harfbuzz/update-ax_pthread.m4.patch
+	$(APPLY) $(SRC)/harfbuzz/0001-fix-OSAtomic-calls-for-AArch64.patch
+	$(APPLY) $(SRC)/harfbuzz/0002-Update-the-bundled-ax_pthread.m4.patch
 	$(MOVE)
 
 DEPS_harfbuzz = freetype2 $(DEPS_freetype2)



More information about the vlc-commits mailing list