[commit: ghc] ghc-7.8: change deriveConstants to use nm in a POSIX way (fixes #8781) (e7563ec)

Jost Berthold berthold at Mathematik.Uni-Marburg.de
Mon Mar 24 10:35:01 UTC 2014

On 03/24/2014 11:25 AM, Christian Maeder wrote:
> Hi,
> sorry, I've missed this thread.
> Did you just run "nm" or "nm -P" on
> includes/dist-derivedconstants/header/tmp.o?

I ran "nm -P".

> The comment should say how the output looks like. For GNU nm (without
> option -P) is was:
> "0000000b C derivedConstantMAX_Vanilla_REG"
> if it is now:
> "_derivedConstantBlaBlah_Blah C 000001b"
> for "nm -P" on Windows the patch could (and should) be adjusted, easily.
> (The 4th word only needs to be present and taken if the second word is
> not a "C", which is only the case under Solaris.)

The output (with option "-P") was

"_derivedConstantBlaBlah_Blah C 000001b"

I agree the code of the previous patch is easy to adjust.
While several ways are possible, my own suggestion was to add a new 
specialised case rather than trying to integrate into the existing code.

/ Jost

More information about the ghc-devs mailing list