2015-02-05 01:59:10 +01:00
|
|
|
$NetBSD: patch-rts_StgCRun.c,v 1.2 2015/02/05 00:59:10 pho Exp $
|
Import ghc-7.6.3 as lang/ghc7.
Based on wip/ghc, mostly worked by phonohawk, with patches from jperkin@.
And some modifications and buit of Bootstrap binaries for 7.6.3 by me.
GHC: The Glasgow Haskell Compiler.
The Glasgow Haskell Compiler is a robust, fully-featured, optimising
compiler for the functional programming language Haskell 98
(http://www.haskell.org). GHC compiles Haskell to either native code
or C. It implements numerous experimental language extensions to
Haskell, including concurrency, a foreign language interface, several
type-system extensions, exceptions, and so on. GHC comes with a
generational garbage collector, a space and time profiler, and a
comprehensive set of libraries.
2013-12-12 13:47:17 +01:00
|
|
|
|
|
|
|
We have to make the visiblity of StgRun and StgReturn to "hidden" not
|
|
|
|
to trigger a bug in old binutils which results in:
|
|
|
|
|
|
|
|
ld: rts/dist/build/RtsStartup.dyn_o: relocation R_X86_64_PC32
|
|
|
|
against `StgRun' can not be used when making a shared object;
|
|
|
|
recompile with -fPIC
|
|
|
|
|
|
|
|
With this workaround we can no longer override those two symbols using
|
|
|
|
LD_PRELOAD, but I think there is no reason to do so anyway.
|
|
|
|
|
2015-02-05 01:59:10 +01:00
|
|
|
This has already been fixed in the upstream:
|
|
|
|
https://ghc.haskell.org/trac/ghc/ticket/7813
|
Import ghc-7.6.3 as lang/ghc7.
Based on wip/ghc, mostly worked by phonohawk, with patches from jperkin@.
And some modifications and buit of Bootstrap binaries for 7.6.3 by me.
GHC: The Glasgow Haskell Compiler.
The Glasgow Haskell Compiler is a robust, fully-featured, optimising
compiler for the functional programming language Haskell 98
(http://www.haskell.org). GHC compiles Haskell to either native code
or C. It implements numerous experimental language extensions to
Haskell, including concurrency, a foreign language interface, several
type-system extensions, exceptions, and so on. GHC comes with a
generational garbage collector, a space and time profiler, and a
comprehensive set of libraries.
2013-12-12 13:47:17 +01:00
|
|
|
|
|
|
|
--- rts/StgCRun.c.orig 2013-01-27 13:21:52.000000000 +0000
|
|
|
|
+++ rts/StgCRun.c
|
|
|
|
@@ -246,6 +246,7 @@ StgRunIsImplementedInAssembler(void)
|
|
|
|
* save callee-saves registers on behalf of the STG code.
|
|
|
|
*/
|
|
|
|
".globl " STG_RUN "\n"
|
|
|
|
+ ".hidden " STG_RUN "\n"
|
|
|
|
STG_RUN ":\n\t"
|
|
|
|
"subq %1, %%rsp\n\t"
|
|
|
|
"movq %%rsp, %%rax\n\t"
|
|
|
|
@@ -280,6 +281,7 @@ StgRunIsImplementedInAssembler(void)
|
|
|
|
"jmp *%%rax\n\t"
|
|
|
|
|
|
|
|
".globl " STG_RETURN "\n"
|
|
|
|
+ ".hidden " STG_RETURN "\n"
|
|
|
|
STG_RETURN ":\n\t"
|
|
|
|
|
|
|
|
"movq %%rbx, %%rax\n\t" /* Return value in R1 */
|