Re: Undefined symbols on new install of ghc 6.2.2

2005-08-22 Thread Sigbjorn Finne

Can't think of a reasonable explanation for the behaviour
you're seeing, I'm afraid. If you look at the undefined
symbols from the link, _ZCMain_main_closure
isn't being found -- it should be in Build.o, which is included
on the command line. The weird thing is that the linker
does report undefined symbols from that closure's
entry point, _ZCMain_main_entry (in Build.o), but fails to
see the (.data) symbol for the closure itself.

On the off-chance you haven't tried this already, could you try
to delete the object files and re-do the --make? Add -fvia-C
while you're at it.

If you want to examine what the linker actually slurps in,
try -optl-Wl,--verbose

GHC binary installs on Windows are islands as far as tools
needed to compile&link Haskell code goes. You may run into
trouble if you compile a .c file with a local installation of
gcc and then try to link the object file with ghc, but I don't
think that's the case here.

--sigbjorn

- Original Message - 
From: "Alastair Reid" <[EMAIL PROTECTED]>

To: "Sigbjorn Finne" <[EMAIL PROTECTED]>
Cc: 
Sent: Monday, August 22, 2005 06:16
Subject: RE: Undefined symbols on new install of ghc 6.2.2



Thanks Sigbjorn,

Chris gave these a shot and everything looks right.  (i.e., the symbols
exist, tmpdir is big and changing it doesn't help and invoking ghc on
the .o files directly doesn't help.)

Also, building with the latest release of ghc works fine.  (This is
slightly tedious because we need both 6.2.2 and 6.4 at the moment but
we'll probably update our code to work with 6.4 sometime soon anyway.)

One interesting detail was that the .a file has names with
triple-underscore prefixes but the linker error messages have
single-underscore prefixes.  Is this just the linker deleting _'s when
displaying error messages or is this the real problem?
I'm not sure what Chris has installed on his machine but is it possible
that if he had cygwin (say) installed the gcc from that install would be
used instead of the one that comes in the ghc package?  



--
Alastair Reid, Principal Engineer, R&D
ARM Ltd, 110 Fulbourn Rd, Cambridge, CB1 9NJ.
T: +44 1223 406 109



___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


RE: Undefined symbols on new install of ghc 6.2.2

2005-08-22 Thread Alastair Reid
Thanks Sigbjorn,

Chris gave these a shot and everything looks right.  (i.e., the symbols
exist, tmpdir is big and changing it doesn't help and invoking ghc on
the .o files directly doesn't help.)

Also, building with the latest release of ghc works fine.  (This is
slightly tedious because we need both 6.2.2 and 6.4 at the moment but
we'll probably update our code to work with 6.4 sometime soon anyway.)

One interesting detail was that the .a file has names with
triple-underscore prefixes but the linker error messages have
single-underscore prefixes.  Is this just the linker deleting _'s when
displaying error messages or is this the real problem?
I'm not sure what Chris has installed on his machine but is it possible
that if he had cygwin (say) installed the gcc from that install would be
used instead of the one that comes in the ghc package?  


--
Alastair Reid, Principal Engineer, R&D
ARM Ltd, 110 Fulbourn Rd, Cambridge, CB1 9NJ.
T: +44 1223 406 109

This e-mail message is intended for the addressee(s) only and may
contain information that is the property of, and/or subject to a
confidentiality agreement between the intended recipient(s), their
organisation and/or the ARM Group of Companies. If you are not an
intended recipient of this e-mail message, you should not read, copy,
forward or otherwise distribute or further disclose the information in
it; misuse of the contents of this e-mail message may violate various
laws in your state, country or jurisdiction. If you have received this
e-mail message in error, please contact the originator of this e-mail
message via e-mail and delete all copies of this message from your
computer or network, thank you.


-Original Message-
From: Sigbjorn Finne [mailto:[EMAIL PROTECTED] 
Sent: 21 August 2005 13:56
To: Alastair Reid
Cc: glasgow-haskell-bugs@haskell.org
Subject: Re: Undefined symbols on new install of ghc 6.2.2

Puzzling; couple of things to check for:

- nm -o c:/ghc/ghc-6.2.2/libHSbase.a | grep 'T ___stginit_Prelude'

  is successful.

- the TMPDIR setting appears to be w:/tmp -- make sure that actually
  exists & isn't clogged up. Does changing it to "." (or somesuch) alter
  the behaviour?

- does an invocation of the form "ghc -o build.exe MakeUtils.o Build.o 
"
  succeed?

--sigbjorn

- Original Message - 
From: "Alastair Reid" <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, August 17, 2005 05:59
Subject: Undefined symbols on new install of ghc 6.2.2


One of my colleagues just installed ghc 6.2.2 on their Windows machine.
GHC compiles fine but ghc --make fails at the linking stage with a bunch
of undefined symbols that ought to have been part of the ghc install
like:

./MakeUtils.o(.text+0x43): In function `_stginit_MakeUtils_':
: undefined reference to `_stginit_IO_'
./MakeUtils.o(.text+0x4d): In function `_stginit_MakeUtils_':
: undefined reference to `_stginit_Prelude_'
./MakeUtils.o(.text+0x5c): In function `r1pU_srt':
: undefined reference to `GHCziBase_zdfEqZMZN_closure'

(see attached file for complete list of undefined symbols).

We've checked that the lib files exist and confirmed that he installed
ghc in the normal place (see message at end of this message).
ghc-6.2.2 works just fine on my machine.

Does this ring any bells for anyone?

--
Alastair Reid, Principal Engineer, R&D
ARM Ltd, 110 Fulbourn Rd, Cambridge, CB1 9NJ.
T: +44 1223 406 109



-Original Message-

Alastair Reid wrote:
> Can you try:
>
>   ghc -v
>
> this will produce a few hundred lines of output amongst which
> there's a bunch of filenames like
>
>   c:/ghc/ghc-6.2.2
>   c:/ghc/ghc-6.2.2/imports
>   c:/ghc/ghc-6.2.2/hslibs-imports/util
>
> The first should have a bunch of files with names like
> libHS*.a and is the most important
> The latter should have a bunch of *.hi files (and seem to be
> fine since you got as far as linking).

Assuming you mean that these directories should have the files you name
(not the output of ghc -v), then, yes, they are present.

> Check you're not really low on diskspace in case the install
> silently failed (e.g., the 100s of Mbytes of libHS*.a files
> weren't all installed).

Plenty of disc space.

> If that looks plausible, try adding the -v flag to the ghc
> --make command line to see if you get any useful info about
> the failure.
> If still nothing, try -v4 and -v5 to get extra verbosity.

I tried this but learnt nothing new (see attached). Is it possible that
I need to set some environment variables other than PATH (e.g.
LD_LIBRARY_PATH)?


___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


RE: Erroneous warning with n+k patterns

2005-08-22 Thread Simon Peyton-Jones
OK, well I've fixed this one.  But not overlap warnings in general

Simon

| -Original Message-
| From: [EMAIL PROTECTED]
[mailto:glasgow-haskell-bugs-
| [EMAIL PROTECTED] On Behalf Of Ian Lynagh
| Sent: 20 August 2005 02:39
| To: glasgow-haskell-bugs@haskell.org
| Subject: Erroneous warning with n+k patterns
| 
| 
| Hi all,
| 
| This function:
| 
| g :: Int -> Int
| g (x+1) = 1
| g _ = 0
| 
| (erroneously) gives this warning:
| 
| Warning: Pattern match(es) are overlapped
|  In the definition of `g': g _ = ...
| 
| I'm not sure if this is covered by the first item on
| http://www.haskell.org/ghc/docs/latest/html/users_guide/bugs.html
| but if so (well, probably even if not; I've grown quite attached to
| -Wall -Werror) then I'd like to add my voice to those who would like
to
| see the mentioned overhaul done.
| 
| 
| Thanks
| Ian
| 
| ___
| Glasgow-haskell-bugs mailing list
| Glasgow-haskell-bugs@haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs