Keep C main separate from rts lib and link it in for standalone progs
authorDuncan Coutts <duncan@well-typed.com>
Fri, 15 May 2009 16:08:14 +0000 (16:08 +0000)
committerDuncan Coutts <duncan@well-typed.com>
Fri, 15 May 2009 16:08:14 +0000 (16:08 +0000)
commitfa00cc50ecd1aa292657720b7594b7bdb82c970c
treed95b663f69a1da11e86923c129b785537497d2e5
parent3d411991d3c697e5a93e6922582fe8299210e83d
Keep C main separate from rts lib and link it in for standalone progs
Previously the object code for the C main function lived in the rts
lib, however this is a problem when the rts is built as a shared lib.
With Windows DLLs it always causes problems while on ELF systems it's a
problem when the user decides to use their own C main function rather
than a Haskell Main.main. So instead we now put main in it's own tiny
little static lib libHSrtsmain.a which we install next to the rts libs.
Whenever ghc links a program (without -no-hs-main) then it also links
in -lHSrtsmain. For consistency we always do it this way now rather
than trying to do it differently for static vs shared libraries.
compiler/main/DriverPipeline.hs
rts/Main.c
rts/RtsMain.c [new file with mode: 0644]
rts/RtsMain.h [new file with mode: 0644]
rts/ghc.mk