commit:     0440c6f4dc3c200a4b8a6ce08b74dfdd7dc35d7b
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 22 10:16:04 2018 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sun Jul 22 10:16:29 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0440c6f4

games-emulation/dolphin: xgetbv tweak for gcc-8

Package-Manager: Portage-2.3.43, Repoman-2.3.10

 games-emulation/dolphin/dolphin-5.0.ebuild         |  5 ++++-
 .../dolphin/files/dolphin-5.0-xgetbv.patch         | 24 ++++++++++++++++++++++
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/games-emulation/dolphin/dolphin-5.0.ebuild 
b/games-emulation/dolphin/dolphin-5.0.ebuild
index 6110f03b0a0..65b49e8a79d 100644
--- a/games-emulation/dolphin/dolphin-5.0.ebuild
+++ b/games-emulation/dolphin/dolphin-5.0.ebuild
@@ -70,7 +70,10 @@ DEPEND="${RDEPEND}
        sys-devel/gettext
        virtual/pkgconfig"
 
-PATCHES=( "${FILESDIR}"/${P}-CHAR_WIDTH-collision.patch )
+PATCHES=(
+       "${FILESDIR}"/${P}-CHAR_WIDTH-collision.patch
+       "${FILESDIR}"/${P}-xgetbv.patch
+)
 
 src_prepare() {
        cmake-utils_src_prepare

diff --git a/games-emulation/dolphin/files/dolphin-5.0-xgetbv.patch 
b/games-emulation/dolphin/files/dolphin-5.0-xgetbv.patch
new file mode 100644
index 00000000000..ffa7cc81c13
--- /dev/null
+++ b/games-emulation/dolphin/files/dolphin-5.0-xgetbv.patch
@@ -0,0 +1,24 @@
+Workaround collision of _xgetbv intrinsic redeclaration:
+
+Source/Core/Common/x64CPUDetect.cpp:45:12: error: ambiguating new declaration 
of ‘u64 _xgetbv(u32)’
+ static u64 _xgetbv(u32 index)
+            ^~~~~~~
+In file included from 
/usr/lib/gcc/x86_64-pc-linux-gnu/8.1.0/include/x86intrin.h:74,
+                 from Source/Core/Common/Intrinsics.h:12,
+                 from Source/Core/Common/x64CPUDetect.cpp:10:
+/usr/lib/gcc/x86_64-pc-linux-gnu/8.1.0/include/xsaveintrin.h:60:1: note: old 
declaration ‘long long int _xgetbv(unsigned int)’
+ _xgetbv (unsigned int __A)
+ ^~~~~~~
+
+Upstream fied it in
+    commit 823fdda30c38be953c3d425874f2adeabed2b5a8
+    intrinsics: stop defining _xgetbv/_XCR_XFEATURE_ENABLED_MASK, which are 
reserved
+
+--- a/Source/Core/Common/x64CPUDetect.cpp
++++ b/Source/Core/Common/x64CPUDetect.cpp
+@@ -45 +45 @@ static inline void __cpuid(int info[4], int function_id)
+-static u64 _xgetbv(u32 index)
++static u64 _xgetbv_dolphin(u32 index)
+@@ -137 +137 @@ void CPUInfo::Detect()
+-                      if ((_xgetbv(_XCR_XFEATURE_ENABLED_MASK) & 0x6) == 0x6)
++                      if ((_xgetbv_dolphin(_XCR_XFEATURE_ENABLED_MASK) & 0x6) 
== 0x6)

Reply via email to