forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information
Sergei Trofimovich
committed
Nov 15, 2019
1 parent
132bb62
commit 3285097
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-lto.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |