Problem with ghc-6.5.20061008 on Mac OS X Intel

Hi, I was able to build this release using the 20060915 Intel build that's available, on 10.4.8. ghci seems to work OK (except for Readline), but an attempt to compile gives: $ ghc example25.hs /usr/bin/ld: Undefined symbols: _mtlzm1zi0_ControlziMonadziState_evalStateT_closure _mtlzm1zi0_ControlziMonadziState_gets_closure _mtlzm1zi0_ControlziMonadziState_zdf1_closure _mtlzm1zi0_ControlziMonadziState_zdf7_closure _mtlzm1zi0_ControlziMonadziState_zdf9_closure _mtlzm1zi0_ControlziMonadziWriter_zdf5_closure _mtlzm1zi0_ControlziMonadziWriter_zdf7_closure collect2: ld returned 1 exit status This didn't happen before. Any ideas? Am I doing something wrong, or is there something wrong with the 20061008 snapshot? Thanks, Deborah

On Mon, Oct 09, 2006 at 05:42:14PM -0700, Deborah Goldsmith wrote:
I was able to build this release using the 20060915 Intel build that's available, on 10.4.8. ghci seems to work OK (except for Readline),
That sounds like good news, thanks :-)
but an attempt to compile gives:
$ ghc example25.hs /usr/bin/ld: Undefined symbols: _mtlzm1zi0_ControlziMonadziState_evalStateT_closure _mtlzm1zi0_ControlziMonadziState_gets_closure _mtlzm1zi0_ControlziMonadziState_zdf1_closure _mtlzm1zi0_ControlziMonadziState_zdf7_closure _mtlzm1zi0_ControlziMonadziState_zdf9_closure _mtlzm1zi0_ControlziMonadziWriter_zdf5_closure _mtlzm1zi0_ControlziMonadziWriter_zdf7_closure collect2: ld returned 1 exit status
This didn't happen before.
Any ideas? Am I doing something wrong, or is there something wrong with the 20061008 snapshot?
Are you sure it used to work before, exactly like that? It looks like it is failing to link because you didn't use "-package mtl" or "--make". Thanks Ian

Thanks, Spencer Janssen already set me straight. It was indeed the lack of --package mtl. I'm pretty sure I didn't have that before, but my memory could be faulty. Thanks again, Deborah On Oct 9, 2006, at 5:57 PM, Ian Lynagh wrote:
On Mon, Oct 09, 2006 at 05:42:14PM -0700, Deborah Goldsmith wrote:
I was able to build this release using the 20060915 Intel build that's available, on 10.4.8. ghci seems to work OK (except for Readline),
That sounds like good news, thanks :-)
but an attempt to compile gives:
$ ghc example25.hs /usr/bin/ld: Undefined symbols: _mtlzm1zi0_ControlziMonadziState_evalStateT_closure _mtlzm1zi0_ControlziMonadziState_gets_closure _mtlzm1zi0_ControlziMonadziState_zdf1_closure _mtlzm1zi0_ControlziMonadziState_zdf7_closure _mtlzm1zi0_ControlziMonadziState_zdf9_closure _mtlzm1zi0_ControlziMonadziWriter_zdf5_closure _mtlzm1zi0_ControlziMonadziWriter_zdf7_closure collect2: ld returned 1 exit status
This didn't happen before.
Any ideas? Am I doing something wrong, or is there something wrong with the 20061008 snapshot?
Are you sure it used to work before, exactly like that? It looks like it is failing to link because you didn't use "-package mtl" or "--make".
Thanks Ian

Strange. Should it really get to link time before it notices that you haven't used the necessary --package flags? I would have expected an error earlier on. Aaron On Oct 9, 2006, at 6:03 PM, Deborah Goldsmith wrote:
Thanks, Spencer Janssen already set me straight. It was indeed the lack of --package mtl. I'm pretty sure I didn't have that before, but my memory could be faulty.
Thanks again, Deborah
On Oct 9, 2006, at 5:57 PM, Ian Lynagh wrote:
On Mon, Oct 09, 2006 at 05:42:14PM -0700, Deborah Goldsmith wrote:
I was able to build this release using the 20060915 Intel build that's available, on 10.4.8. ghci seems to work OK (except for Readline),
That sounds like good news, thanks :-)
but an attempt to compile gives:
$ ghc example25.hs /usr/bin/ld: Undefined symbols: _mtlzm1zi0_ControlziMonadziState_evalStateT_closure _mtlzm1zi0_ControlziMonadziState_gets_closure _mtlzm1zi0_ControlziMonadziState_zdf1_closure _mtlzm1zi0_ControlziMonadziState_zdf7_closure _mtlzm1zi0_ControlziMonadziState_zdf9_closure _mtlzm1zi0_ControlziMonadziWriter_zdf5_closure _mtlzm1zi0_ControlziMonadziWriter_zdf7_closure collect2: ld returned 1 exit status
This didn't happen before.
Any ideas? Am I doing something wrong, or is there something wrong with the 20061008 snapshot?
Are you sure it used to work before, exactly like that? It looks like it is failing to link because you didn't use "-package mtl" or "--make".
Thanks Ian
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Ian Lynagh wrote:
On Mon, Oct 09, 2006 at 05:42:14PM -0700, Deborah Goldsmith wrote:
I was able to build this release using the 20060915 Intel build that's available, on 10.4.8. ghci seems to work OK (except for Readline),
That sounds like good news, thanks :-)
but an attempt to compile gives:
$ ghc example25.hs /usr/bin/ld: Undefined symbols: _mtlzm1zi0_ControlziMonadziState_evalStateT_closure _mtlzm1zi0_ControlziMonadziState_gets_closure _mtlzm1zi0_ControlziMonadziState_zdf1_closure _mtlzm1zi0_ControlziMonadziState_zdf7_closure _mtlzm1zi0_ControlziMonadziState_zdf9_closure _mtlzm1zi0_ControlziMonadziWriter_zdf5_closure _mtlzm1zi0_ControlziMonadziWriter_zdf7_closure collect2: ld returned 1 exit status
This didn't happen before.
Any ideas? Am I doing something wrong, or is there something wrong with the 20061008 snapshot?
Are you sure it used to work before, exactly like that? It looks like it is failing to link because you didn't use "-package mtl" or "--make".
I think that ghc foo.hs should imply --make, since that's usually what you want. The tricky thing is deciding exactly which command lines fall into this category, and devising a rule that isn't too obscure. Perhaps the old "default is to compile everything in one-shot mode and link" should be replaced by "default is --make". There's a couple of problems with this: 'ghc -o prog foo.o bar.o' should just link as it does now, and 'ghc -c foo.hs' should *not* invoke --make. The -c flag does not however force one-shot mode - it used to, but now it just means "don't link" and works with --make too. So perhaps the rule is: - if the command line doesn't contain any mode flags or -c - and there are one or more Haskell source files on the command line - then default to --make, otherwise default to one-shot compile & link This means to get the '--make but don't link' behaviour you have to say 'ghc --make -c' rather than just 'ghc -c'. It's slightly obscure, perhaps there's a better formulation? Or perhaps we should drop backwards compatibility and design a better command-line syntax? Cheers, Simon

Hi Deborah, The first thing that springs to mind is that the mtl library (which contains Control.Monad.State, the source of the link errors below) isn't included in the 20060915 binary distribution, though it should be easy to check it out and compile it separately. So, the question is, why does it get all the way to link time before noticing that the library isn't available? It's possible that one version of GHC is trying to use object or library files created by another version. I came across that problem myself, at one point. You might check that only one copy of the ghc-6.5/lib/ directory exists anywhere that GHC might find it. When you say "this didn't happen before", do you mean that the 20060915 build can compile example25.hs, but trying to compile it with your own build of 20061008 fails as you've described? By the way, does readline work for you with the ghci from the 20060915 binary distribution, and just not with the version you compiled yourself? I ask because one of the people I was talking to as I build the distribution had trouble with it. Aaron On Oct 9, 2006, at 5:42 PM, Deborah Goldsmith wrote:
Hi,
I was able to build this release using the 20060915 Intel build that's available, on 10.4.8. ghci seems to work OK (except for Readline), but an attempt to compile gives:
$ ghc example25.hs /usr/bin/ld: Undefined symbols: _mtlzm1zi0_ControlziMonadziState_evalStateT_closure _mtlzm1zi0_ControlziMonadziState_gets_closure _mtlzm1zi0_ControlziMonadziState_zdf1_closure _mtlzm1zi0_ControlziMonadziState_zdf7_closure _mtlzm1zi0_ControlziMonadziState_zdf9_closure _mtlzm1zi0_ControlziMonadziWriter_zdf5_closure _mtlzm1zi0_ControlziMonadziWriter_zdf7_closure collect2: ld returned 1 exit status
This didn't happen before.
Any ideas? Am I doing something wrong, or is there something wrong with the 20061008 snapshot?
Thanks, Deborah
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
participants (4)
-
Aaron Tomb
-
Deborah Goldsmith
-
Ian Lynagh
-
Simon Marlow