]> gitweb @ CieloNegro.org - pkgsrc-ghc.git/blob - patches/patch-rts_StgCRun.c
ghc-7.4.1 for x86_64-unknown-linux
[pkgsrc-ghc.git] / patches / patch-rts_StgCRun.c
1 $NetBSD$
2
3 We have to make the visiblity of StgRun and StgReturn to "hidden" not
4 to trigger a bug in old binutils which results in:
5
6    ld: rts/dist/build/RtsStartup.dyn_o: relocation R_X86_64_PC32
7    against `StgRun' can not be used when making a shared object;
8    recompile with -fPIC
9
10 With this workaround we can no longer override those two symbols using
11 LD_PRELOAD, but I think there is no reason to do so anyway.
12
13 --- rts/StgCRun.c.orig  2012-03-21 03:41:49.000000000 +0000
14 +++ rts/StgCRun.c
15 @@ -238,6 +238,7 @@ StgRunIsImplementedInAssembler(void)
16           * save callee-saves registers on behalf of the STG code.
17           */
18          ".globl " STG_RUN "\n"
19 +        ".hidden " STG_RUN "\n"
20          STG_RUN ":\n\t"
21          "subq %0, %%rsp\n\t"
22          "movq %%rsp, %%rax\n\t"
23 @@ -259,6 +260,7 @@ StgRunIsImplementedInAssembler(void)
24          "jmp *%%rax\n\t"
25  
26          ".globl " STG_RETURN "\n"
27 +        ".hidden " STG_RETURN "\n"
28           STG_RETURN ":\n\t"
29  
30          "movq %%rbx, %%rax\n\t"   /* Return value in R1  */