RE: cabal: library archive index and Mac OS X?

On 21 March 2005 07:55, Isaac Jones wrote:
Wolfgang Thaller
writes: (snip)
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.
Owch. That's some odd behavior; any links to an explanation for why it works that way? Does this happen on other arches?
I don't see a cabal-side workaround... maybe GHC should run ranlib before linking? Is there any drawback to that? Are there any flags to ln to change this behavior?
Can't you run ranlib after install? It wouldn't be right for GHC to run ranlib, because the libraries might not be writable by the current user. Cheers, Simon

"Simon Marlow"
Can't you run ranlib after install? It wouldn't be right for GHC to run ranlib, because the libraries might not be writable by the current user.
Oh, good idea; sorry I'm not feeling too well today ;) I don't see any problems with this. Anyone else see a problem? I'm guessing that's what most systems do. peace, isaac

Can't you run ranlib after install? It wouldn't be right for GHC to run ranlib, because the libraries might not be writable by the current user.
I don't see any problems with this. Anyone else see a problem? I'm guessing that's what most systems do.
nhc98 gets round the problem in a slightly different way: at installation time, just copy the .a archives preserving their datestamps. I use tar cf - libFoo.a | ( cd $DEST; tar xf - ) but a simpler cp -p libFoo.a $DEST would probably work as well, if tar is not available on the end machine. Remember you must still have run ranlib previously at /build/ time however. Regards, Malcolm
participants (3)
-
Isaac Jones
-
Malcolm Wallace
-
Simon Marlow