[vlc-commits] contrib: harfbuzz: Skip using the _BitScan intrinsics on mingw
Martin Storsjö
git at videolan.org
Mon May 21 13:57:02 CEST 2018
vlc | branch: master | Martin Storsjö <martin at martin.st> | Mon May 21 14:55:15 2018 +0300| [28f8d6217e1d3e0d3b1806548a5ae36a51288c35] | committer: Martin Storsjö
contrib: harfbuzz: Skip using the _BitScan intrinsics on mingw
In mingw targets, both when using GCC and Clang, the __GNUC__
intrinsics right above can be used in most cases anyway.
This fixes building with mingw-w64 for armv7/aarch64, which doesn't
implement the _BitScanForward/_BitScanReverse intrinsics yet.
Not upstreaming this fix yet since the correct fix would be to
implement these intrinsics in mingw-w64 for armv7 and aarch64 as well.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=28f8d6217e1d3e0d3b1806548a5ae36a51288c35
---
...ip-using-the-_BitScan-intrinsics-on-mingw.patch | 39 ++++++++++++++++++++++
contrib/src/harfbuzz/rules.mak | 1 +
2 files changed, 40 insertions(+)
diff --git a/contrib/src/harfbuzz/0001-Skip-using-the-_BitScan-intrinsics-on-mingw.patch b/contrib/src/harfbuzz/0001-Skip-using-the-_BitScan-intrinsics-on-mingw.patch
new file mode 100644
index 0000000000..b933f626ee
--- /dev/null
+++ b/contrib/src/harfbuzz/0001-Skip-using-the-_BitScan-intrinsics-on-mingw.patch
@@ -0,0 +1,39 @@
+From 35bda45cd1a96de1802c2174d4c4469c4e204154 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
+Date: Mon, 21 May 2018 14:52:41 +0300
+Subject: [PATCH] Skip using the _BitScan intrinsics on mingw
+
+In mingw targets, both when using GCC and Clang, the __GNUC__
+intrinsics right above can be used in most cases anyway.
+
+This fixes building with mingw-w64 for armv7/aarch64, which doesn't
+implement the _BitScanForward/_BitScanReverse intrinsics yet.
+---
+ src/hb-private.hh | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/hb-private.hh b/src/hb-private.hh
+index daa496e..2fb6e71 100644
+--- a/src/hb-private.hh
++++ b/src/hb-private.hh
+@@ -380,7 +380,7 @@ _hb_bit_storage (T v)
+ return sizeof (unsigned long long) * 8 - __builtin_clzll (v);
+ #endif
+
+-#if defined(_MSC_VER) || defined(__MINGW32__)
++#if defined(_MSC_VER)
+ if (sizeof (T) <= sizeof (unsigned int))
+ {
+ unsigned long where;
+@@ -453,7 +453,7 @@ _hb_ctz (T v)
+ return __builtin_ctzll (v);
+ #endif
+
+-#if defined(_MSC_VER) || defined(__MINGW32__)
++#if defined(_MSC_VER)
+ if (sizeof (T) <= sizeof (unsigned int))
+ {
+ unsigned long where;
+--
+2.7.4
+
diff --git a/contrib/src/harfbuzz/rules.mak b/contrib/src/harfbuzz/rules.mak
index 294deb2ca9..45cb10d784 100644
--- a/contrib/src/harfbuzz/rules.mak
+++ b/contrib/src/harfbuzz/rules.mak
@@ -21,6 +21,7 @@ harfbuzz: harfbuzz-$(HARFBUZZ_VERSION).tar.bz2 .sum-harfbuzz
$(APPLY) $(SRC)/harfbuzz/harfbuzz-aarch64.patch
$(APPLY) $(SRC)/harfbuzz/harfbuzz-clang.patch
$(APPLY) $(SRC)/harfbuzz/Cmake-test.patch
+ $(APPLY) $(SRC)/harfbuzz/0001-Skip-using-the-_BitScan-intrinsics-on-mingw.patch
$(MOVE)
DEPS_harfbuzz = freetype2 $(DEPS_freetype2)
More information about the vlc-commits
mailing list