package for ghci

Dirk Evers D.Evers@artemis-pharmaceuticals.de
Thu, 31 May 2001 09:45:48 +0200


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: glasgow-haskell-users-admin@haskell.org
> [mailto:glasgow-haskell-users-admin@haskell.org]On Behalf Of
> S.D.Mechveliani
> Sent: Thursday, May 31, 2001 8:00 AM
> To: glasgow-haskell-users@haskell.org
> Cc: simonmar@microsoft.com
> Subject: package for ghci
>=20
>=20
> To my question on packages for  ghci
> Simon Marlow <simonmar@microsoft.com> responds
>=20
> >> 5.  ar -q libHSfoo.a  *.o
> >>     ld -r --whole-archive libHSdocon.a -o libHSdocon.o
>=20
> > 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
> >=20
> > [..]
>=20
>=20
> Thank you.=20
> The matter was indeed in the name.
> And it was due to the `lib' prefix, not due to `docon'.
>=20
> Because there was a typo in my letter:=20
>                                 ...--whole-archive libHSfdocon.a ...
> while in real experiment it was ...--whole-archive libHSfoo.a    ...
>=20
> And I doubt whether the GHC implementation agrees at this point with=20
> the GHC User's guide. Section 4.11.2 says
>=20
> ----------------------------------------------
>   A package specification looks like this:
>=20
>   Package {name         =3D "mypkg"
>            hs_libraries =3D ["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.
>=20
>     extra_libraries  ...=20
> ----------------------------------------------
>=20
> The user (myself) thinks at this:
> "HSmypkg" in package specification --> <prefix?>HSmypkg.a
>                                        <prefix?>HSmypkg.o
>                                        in the library directory.
>=20
> But  " `lib' is also omitted "   - similarly as `.a'.
> Hence, the library directory should contain
>                                            libHSmypkg.a libHSmypkg.o
> Now,       ghci -package-mypkg =20
>=20
> sees "HSmypkg" in package specification but searches for the file =20
> HSmypkg.o. =20
> It adds `.o', but skips `lib'.
> On the other hand, `.o' has different status, it is separated by
> period. So I wonder.
>=20
> Regards,
>=20
> -----------------
> Serge Mechveliani
> mechvel@botik.ru
>=20
>=20
>=20
>=20
>=20
>=20
>=20
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users@haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users