cabal: library archive index and Mac OS X?

Wolfgang Thaller wolfgang.thaller at
Mon Mar 21 01:35:52 EST 2005

Isaac Jones wrote:

> I've gotten a bug report that Mac OS X complains when trying to link
> against cabal-generated archives, because it lacks an index:
> [...]
> 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?

Mac OS X needs the index. The -s flag to ar will generate the index 
just as a separate invocation of "ranlib" will, but there's one big Mac 
OS X-specific problem:
The index stores a time stamp; if the .a file's modification date is 
newer, then ld will refuse to load from it until you re-run ranlib. 
This commonly happens when you first build your .a files and then touch 
their modification date while installing.



More information about the Libraries mailing list