games-roguelike/angband: fix build on pie gcc, bug #617982
authorSergei Trofimovich <slyfox@gentoo.org>
Sat, 9 Sep 2017 20:41:13 +0000 (21:41 +0100)
committerSergei Trofimovich <slyfox@gentoo.org>
Sat, 9 Sep 2017 20:41:24 +0000 (21:41 +0100)
Reported-by: Toralf Förster
Bug: https://bugs.gentoo.org/617982
Package-Manager: Portage-2.3.8, Repoman-2.3.3

games-roguelike/angband/angband-4.0.5-r1.ebuild
games-roguelike/angband/files/angband-4.0.5-pie-gcc.patch [new file with mode: 0644]

index 473728f8c4ab402c898afca666a17e5d9f6d45a7..48866f7631764e6c6872c8c4adb5c36a9dc5e9fd 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -27,6 +27,8 @@ DEPEND="${RDEPEND}
        dev-python/docutils
        virtual/pkgconfig"
 
+PATCHES=("${FILESDIR}"/${P}-pie-gcc.patch)
+
 src_prepare() {
        default
 
diff --git a/games-roguelike/angband/files/angband-4.0.5-pie-gcc.patch b/games-roguelike/angband/files/angband-4.0.5-pie-gcc.patch
new file mode 100644 (file)
index 0000000..b4f3c57
--- /dev/null
@@ -0,0 +1,13 @@
+Allow gcc to construct correct partial linking command to ld.
+Otherwise ld gets an incompatible mix of '-pie -r'.
+
+https://bugs.gentoo.org/617982
+diff --git a/src/Makefile b/src/Makefile
+index 79be4cc..d27bb91 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -33,3 +33,3 @@ win/$(PROGNAME).res: win/$(PROGNAME).rc
+ $(PROGNAME).o: $(OBJECTS)
+-      $(LD) -nostdlib -Wl,-r -o $@ $(OBJECTS)
++      $(LD) -nostdlib -r -o $@ $(OBJECTS)
+       @printf "%10s %-20s\n" LINK $@