Hi,

(second time: Outlook tricked me: wrong email address
I really love this mailer. :-( )

The lib prefix convention is only for .a and .so files,
.o files do not fall under this convention, so:

ld -r --whole-archive libHSfoo.a -o HSfoo.o

is what should work for you.

Cheers
Dirk

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of
> S.D.Mechveliani
> Sent: Thursday, May 31, 2001 8:00 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: package for ghci
> 
> 
> To my question on packages for  ghci
> Simon Marlow <[EMAIL PROTECTED]> responds
> 
> >> 5.  ar -q libHSfoo.a  *.o
> >>     ld -r --whole-archive libHSdocon.a -o libHSdocon.o
> 
> > Here's your problem: you named the output libHSdocon.o, but GHCi is
> > looking for HSfoo.o (because that's the name you gave in the package
> > spec).
> >
> > ld -r --whole-archive libHSfoo.a -o libHSfoo.o
> > 
> > [..]
> 
> 
> Thank you. 
> The matter was indeed in the name.
> And it was due to the `lib' prefix, not due to `docon'.
> 
> Because there was a typo in my letter: 
>                                 ...--whole-archive libHSfdocon.a ...
> while in real experiment it was ...--whole-archive libHSfoo.a    ...
> 
> And I doubt whether the GHC implementation agrees at this point with 
> the GHC User's guide. Section 4.11.2 says
> 
> ----------------------------------------------
>   A package specification looks like this:
> 
>   Package {name         = "mypkg"
>            hs_libraries = ["HSmypkg"]
>            ...
>           }
>   ...
>     hs_libraries
>       A list of libraries containing Haskell code for this package,
>       with the .a or .dll suffix omitted.
>       On Unix, the `lib' prefix is also omitted.
> 
>     extra_libraries  ... 
> ----------------------------------------------
> 
> The user (myself) thinks at this:
> "HSmypkg" in package specification --> <prefix?>HSmypkg.a
>                                        <prefix?>HSmypkg.o
>                                        in the library directory.
> 
> But  " `lib' is also omitted "   - similarly as `.a'.
> Hence, the library directory should contain
>                                            libHSmypkg.a libHSmypkg.o
> Now,       ghci -package-mypkg  
> 
> sees "HSmypkg" in package specification but searches for the file  
> HSmypkg.o.  
> It adds `.o', but skips `lib'.
> On the other hand, `.o' has different status, it is separated by
> period. So I wonder.
> 
> Regards,
> 
> -----------------
> Serge Mechveliani
> [EMAIL PROTECTED]
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Glasgow-haskell-users mailing list
> [EMAIL PROTECTED]
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


_______________________________________________
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to