[vlc-commits] contrib: qt: Cherrypick a patch for fixing compilation with latest clang

Martin Storsjö git at videolan.org
Wed Jan 23 09:21:00 CET 2019


vlc | branch: master | Martin Storsjö <martin at martin.st> | Wed Jan 23 09:40:03 2019 +0200| [5501494caecd7bdfe7aa731ae69a76d5661bfbc7] | committer: Martin Storsjö

contrib: qt: Cherrypick a patch for fixing compilation with latest clang

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5501494caecd7bdfe7aa731ae69a76d5661bfbc7
---

 ...ix-compilation-with-trunk-clang-for-mingw.patch | 40 ++++++++++++++++++++++
 contrib/src/qt/rules.mak                           |  1 +
 2 files changed, 41 insertions(+)

diff --git a/contrib/src/qt/0005-qsimd-Fix-compilation-with-trunk-clang-for-mingw.patch b/contrib/src/qt/0005-qsimd-Fix-compilation-with-trunk-clang-for-mingw.patch
new file mode 100644
index 0000000000..c56ba89d5a
--- /dev/null
+++ b/contrib/src/qt/0005-qsimd-Fix-compilation-with-trunk-clang-for-mingw.patch
@@ -0,0 +1,40 @@
+From e94d33db32d43c4c99318fc6a5213f629c1c0087 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
+Date: Fri, 18 Jan 2019 09:31:10 +0200
+Subject: [PATCH 5/5] qsimd: Fix compilation with trunk clang for mingw
+
+Current tip-of-tree clang (after Clang 8 was branched) added an
+intrinsic function __builtin_ia32_xgetbv, and added the following
+define that provides _xgetbv:
+    #define _xgetbv(A) __builtin_ia32_xgetbv((long long)(A))
+
+This fallback declaration of the _xgetbv function only is used
+in case the Q_OS_WIN branch of the #if/#elif below is used, if
+the #if (defined(Q_CC_GNU) && !defined(Q_CC_EMSCRIPTEN)) ||
+defined(Q_CC_GHS) wasn't taken. I left out the
+!defined(Q_CC_EMSCRIPTEN) part as I believe Q_OS_WIN and
+Q_CC_EMSCRIPTEN are mutually exclusive.
+
+Change-Id: I257fc4283ff9f0845df51ab764cf58acdf285c66
+Reviewed-by: Thiago Macieira <thiago.macieira at intel.com>
+Cherry-picked-from: 9818af7d436f7aa1bf5c635041cc5d08fec599b5
+---
+ src/corelib/tools/qsimd.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp
+index 25340f2d02..4ae310b164 100644
+--- a/src/corelib/tools/qsimd.cpp
++++ b/src/corelib/tools/qsimd.cpp
+@@ -248,7 +248,7 @@ static void cpuidFeatures07_00(uint &ebx, uint &ecx)
+ #endif
+ }
+ 
+-#ifdef Q_OS_WIN
++#if defined(Q_OS_WIN) && !(defined(Q_CC_GNU) || defined(Q_CC_GHS))
+ // fallback overload in case this intrinsic does not exist: unsigned __int64 _xgetbv(unsigned int);
+ inline quint64 _xgetbv(__int64) { return 0; }
+ #endif
+-- 
+2.17.2 (Apple Git-113)
+
diff --git a/contrib/src/qt/rules.mak b/contrib/src/qt/rules.mak
index 8a50a7ad2e..d579b5d47b 100644
--- a/contrib/src/qt/rules.mak
+++ b/contrib/src/qt/rules.mak
@@ -30,6 +30,7 @@ ifdef HAVE_WIN32
 	$(APPLY) $(SRC)/qt/0002-Windows-QPA-Disable-systray-notification-sounds.patch
 	$(APPLY) $(SRC)/qt/0003-configure-Treat-win32-clang-g-the-same-as-win32-g.patch
 	$(APPLY) $(SRC)/qt/0004-qmake-Fix-building-with-lld-with-mingw-makefiles.patch
+	$(APPLY) $(SRC)/qt/0005-qsimd-Fix-compilation-with-trunk-clang-for-mingw.patch
 ifndef HAVE_WIN64
 	$(APPLY) $(SRC)/qt/0001-disable-qt_random_cpu.patch
 endif



More information about the vlc-commits mailing list