cabal: library archive index and Mac OS X?

Isaac Jones ijones at syntaxpolice.org
Sun Mar 20 22:57:08 EST 2005


I've gotten a bug report that Mac OS X complains when trying to link
against cabal-generated archives, because it lacks an index:

> ghc --make Main -o prog
> Chasing modules from: Test
> Compiling  Main             ( Test.hs, Test.o )
> Linking ...
> ld: archive: /usr/local/lib/uust-1.0/libHSuust-1.0.a has no table of
> contents, add one with ranlib(1) (can't load from it)

In reading the man page of ranlib (on Linux), it sounds like an
optional optimization.  It also looks like a "-s" flag to ar will
generate the index, so that's easy enough to fix.

Can anyone explain to me whether / why Mac OS X needs this index, and
whether it'll hurt for any other arches?  Should we just pass the -s
flag to ar?

peace,

 isaac


More information about the Libraries mailing list