[Haskell-cafe] GHC ignores RTS options

Simon Marlow simonmar at microsoft.com
Wed Nov 16 10:48:09 EST 2005


On 16 November 2005 13:24, Tomasz Zielonka wrote:

> On Wed, Nov 16, 2005 at 01:09:07PM -0000, Simon Marlow wrote:
>>> BTW - it would be nice if it was easier to override the default RTS
>>> options when compiling the program. Perhaps a nice task for a newbie
>>> GHC developer?
>> 
>> Already possible, see:
>> 
>>
http://www.haskell.org/ghc/docs/latest/html/users_guide/runtime-control.
>> html#rts-hooks
> 
> I was aware of this, and I should write about it.
> 
>> Admittedly it's a bit more fiddly than a command-line flag to GHC,
>> though.
> 
> And because of this I wrote that it would be nice if it was easier :-)

Sorry, I misread the message.

> I've bitten several times by the default values of RTS options,
> especially the stack size limit (-K). But it was always easier to
> set GHCRTS or use +RTS -RTS, so I never used the rts-hooks.
> 
> Do you think I could do this? I am not sure how difficult it would be.

Sure, it shouldn't be too hard.  You need to generate a .c file
containing the ghc_rts_opts setting, and then compile & link it into the
final binary.  It's just a matter of plumbing the various bits together
in GHC's front end.

(it might be nicer to generate Cmm and then push this through the back
end, to avoid the dependence on the C compiler, though).

Cheers,
	Simon


More information about the Haskell-Cafe mailing list