summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2019-11-15 12:30:08 +0000
committerSergei Trofimovich <slyfox@gentoo.org>2019-11-15 12:31:00 +0000
commit328509762ae5fa834d72e58858252200ed52f6a8 (patch)
tree5e00114ff5c3bc65b6f1925c0973e2b581351554 /app-emulation/dosemu
parentapp-emulation/ganeti-instance-debootstrap: amd64 stable wrt bug #648100 (diff)
downloadgentoo-328509762ae5fa834d72e58858252200ed52f6a8.tar.gz
gentoo-328509762ae5fa834d72e58858252200ed52f6a8.tar.bz2
gentoo-328509762ae5fa834d72e58858252200ed52f6a8.zip
app-emulation/dosemu: fix LTO build, bug #700126
Reported-by: Robert Gill Closes: https://bugs.gentoo.org/700126 Package-Manager: Portage-2.3.79, Repoman-2.3.18 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'app-emulation/dosemu')
-rw-r--r--app-emulation/dosemu/dosemu-1.4.1_pre20130107-r5.ebuild1
-rw-r--r--app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-lto.patch27
2 files changed, 28 insertions, 0 deletions
diff --git a/app-emulation/dosemu/dosemu-1.4.1_pre20130107-r5.ebuild b/app-emulation/dosemu/dosemu-1.4.1_pre20130107-r5.ebuild
index d6de58d0a4b9..f25169144560 100644
--- a/app-emulation/dosemu/dosemu-1.4.1_pre20130107-r5.ebuild
+++ b/app-emulation/dosemu/dosemu-1.4.1_pre20130107-r5.ebuild
@@ -54,6 +54,7 @@ PATCHES=(
"${FILESDIR}"/${P}-flex-2.6.3.patch
"${FILESDIR}"/${P}-ia16-ldflags.patch
"${FILESDIR}"/${P}-fix-inline.patch
+ "${FILESDIR}"/${P}-lto.patch
)
src_prepare() {
diff --git a/app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-lto.patch b/app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-lto.patch
new file mode 100644
index 000000000000..730ad4e5d5fd
--- /dev/null
+++ b/app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-lto.patch
@@ -0,0 +1,27 @@
+'asmlinkage' macros are supposed to make symbol available
+for calling from inline (or not) assembly.
+
+'static' keyword is not compatible to it and breaks -flto
+when gcc's LTO partitioner separates assembly definitions
+from C definitions. This causes symbol resolution failures:
+
+ ld: /tmp/dosemu.bin.h8Y59G.ltrans0.ltrans.o: in function `stub_rep__':
+ <artificial>:(.text+0xe): undefined reference to `rep_movs_stos'
+
+The changes turns 'asmlinkage' into exported symbol.
+
+https://bugs.gentoo.org/700126
+--- a/src/emu-i386/simx86/cpatch.c
++++ b/src/emu-i386/simx86/cpatch.c
+@@ -37,9 +37,9 @@
+ #include "codegen-arch.h"
+
+ #ifdef __i386__
+-#define asmlinkage static __attribute__((used)) __attribute__((cdecl))
++#define asmlinkage __attribute__((used)) __attribute__((cdecl))
+ #else
+-#define asmlinkage static __attribute__((used))
++#define asmlinkage __attribute__((used))
+ #endif
+
+ int s_munprotect(unsigned int addr)