summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2018-07-22 21:59:04 +0100
committerSergei Trofimovich <slyfox@gentoo.org>2018-07-22 22:06:31 +0100
commit5c1629567172efd3e05e6b9629d18f8fb98c485e (patch)
tree58b2bded934b24d8a45e4136532be165209ac2d6
parentdev-perl/PlRPC-0.202.0-r3: arm64 stable (bug #661778) (diff)
downloadgentoo-5c1629567172efd3e05e6b9629d18f8fb98c485e.tar.gz
gentoo-5c1629567172efd3e05e6b9629d18f8fb98c485e.tar.bz2
gentoo-5c1629567172efd3e05e6b9629d18f8fb98c485e.zip
games-emulation/dolphin: fix crash on pie-by-default profiles
Disable PIE-compatible code generation via CXXFLAGS+=-fno-pie. Before upstream fix: https://github.com/dolphin-emu/dolphin/commit/daa03cd1060cc826aca93a1dffc6e94bc6af6d5f dolphin assumed executable image to be in low addresses (<2GB) and hardcoded 32-bit absolute addresses during JIT phase. PIE-compatible code does not have this restriction and allows mapping binaries above 2GB area (and breaks dolphin's JIT). Strictly speaking -no-pie (link-time flag) does not or guarantee or require low address mapping for binary if it was already built as PIC/PIE. But -fno-pie imposes additional restrictions on generated code by GCC and makes -no-pie to take effect. We don't need this fix for live ebuild. Closes: https://bugs.gentoo.org/640124 Package-Manager: Portage-2.3.43, Repoman-2.3.10
-rw-r--r--games-emulation/dolphin/dolphin-5.0.ebuild1
-rw-r--r--games-emulation/dolphin/files/dolphin-5.0-no-pie.patch26
2 files changed, 27 insertions, 0 deletions
diff --git a/games-emulation/dolphin/dolphin-5.0.ebuild b/games-emulation/dolphin/dolphin-5.0.ebuild
index 65b49e8a79de..908b571cf426 100644
--- a/games-emulation/dolphin/dolphin-5.0.ebuild
+++ b/games-emulation/dolphin/dolphin-5.0.ebuild
@@ -73,6 +73,7 @@ DEPEND="${RDEPEND}
PATCHES=(
"${FILESDIR}"/${P}-CHAR_WIDTH-collision.patch
"${FILESDIR}"/${P}-xgetbv.patch
+ "${FILESDIR}"/${P}-no-pie.patch
)
src_prepare() {
diff --git a/games-emulation/dolphin/files/dolphin-5.0-no-pie.patch b/games-emulation/dolphin/files/dolphin-5.0-no-pie.patch
new file mode 100644
index 000000000000..949e42e50de9
--- /dev/null
+++ b/games-emulation/dolphin/files/dolphin-5.0-no-pie.patch
@@ -0,0 +1,26 @@
+Disable PIE-compatible code generation via -fno-pie.
+
+Before upstream fix:
+https://github.com/dolphin-emu/dolphin/commit/daa03cd1060cc826aca93a1dffc6e94bc6af6d5f
+dolphin assumed executable image to be in low addresses (<2GB)
+and hardcoded 32-bit absolute addresses during JIT phase.
+
+PIE-compatible code does not have this restriction and
+allows mapping binaries above 2GB area (and breaks dolphin's JIT).
+
+Strictly speaking -no-pie (link-time flag) does not or guarantee
+or require low address mapping for binary if it was already built
+as PIC/PIE.
+
+But -fno-pie imposes additional restrictions on generated code by GCC
+and makes -no-pie to take effect.
+Bug: https://bugs.gentoo.org/640124
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -189,4 +189,4 @@ if(NOT ENABLE_GENERIC)
+ set(_M_X86_64 1)
+- add_definitions(-D_M_X86=1 -D_M_X86_64=1 -msse2)
+- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fno-pie")
++ add_definitions(-D_M_X86=1 -D_M_X86_64=1 -msse2 -fno-pie)
++ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fno-pie -no-pie")
+ else()