diff options
author | Sam James <sam@gentoo.org> | 2021-11-07 02:50:55 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2021-11-07 02:50:55 +0000 |
commit | d9c52de97ac8da18f8ec9f7863950582aee3e71c (patch) | |
tree | f84106b050db52572abb619255ea822c0849c34b /games-emulation/vbam | |
parent | app-misc/mosquitto: don't call c++ directly (fixes cross-compilation) (diff) | |
download | gentoo-d9c52de97ac8da18f8ec9f7863950582aee3e71c.tar.gz gentoo-d9c52de97ac8da18f8ec9f7863950582aee3e71c.tar.bz2 gentoo-d9c52de97ac8da18f8ec9f7863950582aee3e71c.zip |
games-emulation/vbam: fix build on arm(64)
Closes: https://bugs.gentoo.org/799362
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'games-emulation/vbam')
-rw-r--r-- | games-emulation/vbam/files/vbam-2.1.4-arm-asm.patch | 33 | ||||
-rw-r--r-- | games-emulation/vbam/vbam-2.1.4.ebuild | 1 |
2 files changed, 34 insertions, 0 deletions
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 new file mode 100644 index 000000000000..bf6e2bd70e9e --- /dev/null +++ b/games-emulation/vbam/files/vbam-2.1.4-arm-asm.patch @@ -0,0 +1,33 @@ +https://github.com/visualboyadvance-m/visualboyadvance-m/commit/af0de1c4b308ef8d9a081ecf407805b75a99d877.patch +https://bugs.gentoo.org/799362 + +From: Rafael Kitover <rkitover@gmail.com> +Date: Fri, 4 Oct 2019 07:35:49 +0000 +Subject: [PATCH] xbrz: fix inline asm check + +Use correct cpp code to detect x86/amd64 architecture to use inline asm. + +Signed-off-by: Rafael Kitover <rkitover@gmail.com> +--- a/src/filters/xBRZ/xbrz.cpp ++++ b/src/filters/xBRZ/xbrz.cpp +@@ -66,17 +66,17 @@ uint32_t gradientARGB(uint32_t pixFront, uint32_t pixBack) //find intermediate c + + inline double fastSqrt(double n) + { +-#ifdef __GNUC__ || __clang__ || __MINGW64_VERSION_MAJOR || __MINGW32_MAJOR_VERSION ++#if (defined(__GNUC__) || defined(__clang__)) && (defined(__x86_64__) || defined(__i386__)) + __asm__ ("fsqrt" : "+t" (n)); + return n; +-#elif _MSC_VER && _M_IX86 ++#elif defined(_MSC_VER) && defined(_M_IX86) + // speeds up xBRZ by about 9% compared to std::sqrt which internally uses + // the same assembler instructions but adds some "fluff" + __asm { + fld n + fsqrt + } +-#else // _MSC_VER && _M_X64 OR other platforms ++#else // defined(_MSC_VER) && defined(_M_X64) OR other platforms + // VisualStudio x86_64 does not allow inline ASM + return std::sqrt(n); + #endif diff --git a/games-emulation/vbam/vbam-2.1.4.ebuild b/games-emulation/vbam/vbam-2.1.4.ebuild index 21f3c2cf4a23..8fe87b4e1480 100644 --- a/games-emulation/vbam/vbam-2.1.4.ebuild +++ b/games-emulation/vbam/vbam-2.1.4.ebuild @@ -57,6 +57,7 @@ BDEPEND=" PATCHES=( "${FILESDIR}"/${P}-cmake_fix.patch "${FILESDIR}"/${P}-libsdl2-2.0.14.patch #762208 + "${FILESDIR}"/${P}-arm-asm.patch ) src_configure() { |