public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sergei Trofimovich" <slyfox@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: games-emulation/dolphin/files/, games-emulation/dolphin/
Date: Sun, 22 Jul 2018 21:06:39 +0000 (UTC)	[thread overview]
Message-ID: <1532293591.5c1629567172efd3e05e6b9629d18f8fb98c485e.slyfox@gentoo> (raw)

commit:     5c1629567172efd3e05e6b9629d18f8fb98c485e
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 22 20:59:04 2018 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sun Jul 22 21:06:31 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5c162956

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

 games-emulation/dolphin/dolphin-5.0.ebuild         |  1 +
 .../dolphin/files/dolphin-5.0-no-pie.patch         | 26 ++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/games-emulation/dolphin/dolphin-5.0.ebuild b/games-emulation/dolphin/dolphin-5.0.ebuild
index 65b49e8a79d..908b571cf42 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 00000000000..949e42e50de
--- /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()


             reply	other threads:[~2018-07-22 21:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-22 21:06 Sergei Trofimovich [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-03-04 23:15 [gentoo-commits] repo/gentoo:master commit in: games-emulation/dolphin/files/, games-emulation/dolphin/ Andreas Sturmlechner
2025-01-18 16:45 Michał Górny
2022-09-05  5:33 Michał Górny
2015-12-12  4:59 Devan Franchini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1532293591.5c1629567172efd3e05e6b9629d18f8fb98c485e.slyfox@gentoo \
    --to=slyfox@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox