1 |
commit: 328509762ae5fa834d72e58858252200ed52f6a8 |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Nov 15 12:30:08 2019 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Nov 15 12:31:00 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=32850976 |
7 |
|
8 |
app-emulation/dosemu: fix LTO build, bug #700126 |
9 |
|
10 |
Reported-by: Robert Gill |
11 |
Closes: https://bugs.gentoo.org/700126 |
12 |
Package-Manager: Portage-2.3.79, Repoman-2.3.18 |
13 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
14 |
|
15 |
.../dosemu/dosemu-1.4.1_pre20130107-r5.ebuild | 1 + |
16 |
.../files/dosemu-1.4.1_pre20130107-lto.patch | 27 ++++++++++++++++++++++ |
17 |
2 files changed, 28 insertions(+) |
18 |
|
19 |
diff --git a/app-emulation/dosemu/dosemu-1.4.1_pre20130107-r5.ebuild b/app-emulation/dosemu/dosemu-1.4.1_pre20130107-r5.ebuild |
20 |
index d6de58d0a4b..f2516914456 100644 |
21 |
--- a/app-emulation/dosemu/dosemu-1.4.1_pre20130107-r5.ebuild |
22 |
+++ b/app-emulation/dosemu/dosemu-1.4.1_pre20130107-r5.ebuild |
23 |
@@ -54,6 +54,7 @@ PATCHES=( |
24 |
"${FILESDIR}"/${P}-flex-2.6.3.patch |
25 |
"${FILESDIR}"/${P}-ia16-ldflags.patch |
26 |
"${FILESDIR}"/${P}-fix-inline.patch |
27 |
+ "${FILESDIR}"/${P}-lto.patch |
28 |
) |
29 |
|
30 |
src_prepare() { |
31 |
|
32 |
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 |
33 |
new file mode 100644 |
34 |
index 00000000000..730ad4e5d5f |
35 |
--- /dev/null |
36 |
+++ b/app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-lto.patch |
37 |
@@ -0,0 +1,27 @@ |
38 |
+'asmlinkage' macros are supposed to make symbol available |
39 |
+for calling from inline (or not) assembly. |
40 |
+ |
41 |
+'static' keyword is not compatible to it and breaks -flto |
42 |
+when gcc's LTO partitioner separates assembly definitions |
43 |
+from C definitions. This causes symbol resolution failures: |
44 |
+ |
45 |
+ ld: /tmp/dosemu.bin.h8Y59G.ltrans0.ltrans.o: in function `stub_rep__': |
46 |
+ <artificial>:(.text+0xe): undefined reference to `rep_movs_stos' |
47 |
+ |
48 |
+The changes turns 'asmlinkage' into exported symbol. |
49 |
+ |
50 |
+https://bugs.gentoo.org/700126 |
51 |
+--- a/src/emu-i386/simx86/cpatch.c |
52 |
++++ b/src/emu-i386/simx86/cpatch.c |
53 |
+@@ -37,9 +37,9 @@ |
54 |
+ #include "codegen-arch.h" |
55 |
+ |
56 |
+ #ifdef __i386__ |
57 |
+-#define asmlinkage static __attribute__((used)) __attribute__((cdecl)) |
58 |
++#define asmlinkage __attribute__((used)) __attribute__((cdecl)) |
59 |
+ #else |
60 |
+-#define asmlinkage static __attribute__((used)) |
61 |
++#define asmlinkage __attribute__((used)) |
62 |
+ #endif |
63 |
+ |
64 |
+ int s_munprotect(unsigned int addr) |