[Haskell-cafe] GHC RTS question

Max Bolingbroke batterseapower at hotmail.com
Sun Feb 21 14:10:10 EST 2010


On 21 February 2010 18:58, Artyom Kazak <artyom.kazak at gmail.com> wrote:
> So, if I type "./prog +RTS --RTS +RTS", the output will be "+RTS". But
> I want the output to be equal to the input IN ALL CASES, without any
> quotes, additional options, etc. I want all the command line to go to
> my program. How can I do it? (The only way I know now - hacking the
> GHC. If there are no other ways, I'll do it.)

You might be able to get somewhere by writing a custom "main" function
in C and linking it in. According to
http://haskell.org/ghc/docs/latest/html/users_guide/options-phases.html
if a lib specified with the -l option during compilation contains a
"main", that will be used in preference to the one from HSrts.

You could presumably just extend argv with the "+RTS" "--RTS" entries
and then call into the one from HSrts, so this might even be quite
easy.

Cheers,
Max


More information about the Haskell-Cafe mailing list