[Haskell-cafe] Re: Cabal and linking with static libs (.a files)
Simon Marlow
simonmarhaskell at gmail.com
Wed Jun 28 07:58:50 EDT 2006
Ketil Malde wrote:
> GHC puts the C library (-lafi) *before* Haskell library
> (-lHSfmi-0.0) that refers to it. Redoing the collect2 command but
> moving -lafi last does, in fact, work. Also, specifying
> extra-libraries in the cabal package works, as long as they are
> specified in the correct order.
>
> The remaining question is whether inserting command line specified
> libraries this early is a good choice. Perhaps one option that
> appears harmless is to specify it multiple times?
The idea is that a package should be self-contained; that is, it should
include any external libraries that it depends on in its extra-libraries
field. If you follow this rule, then everything should work.
Specifying a library multiple times might work, but it would slow down
linking, so I'd like to avoid it if possible.
Cheers,
Simon
More information about the Haskell-Cafe
mailing list