Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-emulation/vbam/, games-emulation/vbam/files/
Date: Sun, 07 Nov 2021 02:51:21
Message-Id: 1636253455.d9c52de97ac8da18f8ec9f7863950582aee3e71c.sam@gentoo
1 commit: d9c52de97ac8da18f8ec9f7863950582aee3e71c
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Sun Nov 7 02:50:55 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sun Nov 7 02:50:55 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d9c52de9
7
8 games-emulation/vbam: fix build on arm(64)
9
10 Closes: https://bugs.gentoo.org/799362
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12
13 .../vbam/files/vbam-2.1.4-arm-asm.patch | 33 ++++++++++++++++++++++
14 games-emulation/vbam/vbam-2.1.4.ebuild | 1 +
15 2 files changed, 34 insertions(+)
16
17 diff --git a/games-emulation/vbam/files/vbam-2.1.4-arm-asm.patch b/games-emulation/vbam/files/vbam-2.1.4-arm-asm.patch
18 new file mode 100644
19 index 00000000000..bf6e2bd70e9
20 --- /dev/null
21 +++ b/games-emulation/vbam/files/vbam-2.1.4-arm-asm.patch
22 @@ -0,0 +1,33 @@
23 +https://github.com/visualboyadvance-m/visualboyadvance-m/commit/af0de1c4b308ef8d9a081ecf407805b75a99d877.patch
24 +https://bugs.gentoo.org/799362
25 +
26 +From: Rafael Kitover <rkitover@×××××.com>
27 +Date: Fri, 4 Oct 2019 07:35:49 +0000
28 +Subject: [PATCH] xbrz: fix inline asm check
29 +
30 +Use correct cpp code to detect x86/amd64 architecture to use inline asm.
31 +
32 +Signed-off-by: Rafael Kitover <rkitover@×××××.com>
33 +--- a/src/filters/xBRZ/xbrz.cpp
34 ++++ b/src/filters/xBRZ/xbrz.cpp
35 +@@ -66,17 +66,17 @@ uint32_t gradientARGB(uint32_t pixFront, uint32_t pixBack) //find intermediate c
36 +
37 + inline double fastSqrt(double n)
38 + {
39 +-#ifdef __GNUC__ || __clang__ || __MINGW64_VERSION_MAJOR || __MINGW32_MAJOR_VERSION
40 ++#if (defined(__GNUC__) || defined(__clang__)) && (defined(__x86_64__) || defined(__i386__))
41 + __asm__ ("fsqrt" : "+t" (n));
42 + return n;
43 +-#elif _MSC_VER && _M_IX86
44 ++#elif defined(_MSC_VER) && defined(_M_IX86)
45 + // speeds up xBRZ by about 9% compared to std::sqrt which internally uses
46 + // the same assembler instructions but adds some "fluff"
47 + __asm {
48 + fld n
49 + fsqrt
50 + }
51 +-#else // _MSC_VER && _M_X64 OR other platforms
52 ++#else // defined(_MSC_VER) && defined(_M_X64) OR other platforms
53 + // VisualStudio x86_64 does not allow inline ASM
54 + return std::sqrt(n);
55 + #endif
56
57 diff --git a/games-emulation/vbam/vbam-2.1.4.ebuild b/games-emulation/vbam/vbam-2.1.4.ebuild
58 index 21f3c2cf4a2..8fe87b4e148 100644
59 --- a/games-emulation/vbam/vbam-2.1.4.ebuild
60 +++ b/games-emulation/vbam/vbam-2.1.4.ebuild
61 @@ -57,6 +57,7 @@ BDEPEND="
62 PATCHES=(
63 "${FILESDIR}"/${P}-cmake_fix.patch
64 "${FILESDIR}"/${P}-libsdl2-2.0.14.patch #762208
65 + "${FILESDIR}"/${P}-arm-asm.patch
66 )
67
68 src_configure() {