]> gitweb @ CieloNegro.org - pkgsrc-ghc.git/blob - patches/patch-rts_StgCRun.c
7.6.2 for powerpc-apple-darwin
[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
14 --- rts/StgCRun.c.orig  2013-01-27 13:21:52.000000000 +0000
15 +++ rts/StgCRun.c
16 @@ -246,6 +246,7 @@ StgRunIsImplementedInAssembler(void)
17           * save callee-saves registers on behalf of the STG code.
18           */
19          ".globl " STG_RUN "\n"
20 +        ".hidden " STG_RUN "\n"
21          STG_RUN ":\n\t"
22          "subq %1, %%rsp\n\t"
23          "movq %%rsp, %%rax\n\t"
24 @@ -280,6 +281,7 @@ StgRunIsImplementedInAssembler(void)
25          "jmp *%%rax\n\t"
26  
27          ".globl " STG_RETURN "\n"
28 +        ".hidden " STG_RETURN "\n"
29           STG_RETURN ":\n\t"
30  
31          "movq %%rbx, %%rax\n\t"   /* Return value in R1  */