summaryrefslogtreecommitdiff
blob: 730ad4e5d5fdb4101330b72e87f0b74f173b69db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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)