link problems under darwin5.2

Tom Tromey tromey@redhat.com
Thu Jan 10 20:41:00 GMT 2002


>>>>> "Andreas" == Andreas Tobler <toa@pop.agri.ch> writes:

Tom> I ran into this building on PPC Linux yesterday.
Tom> I hacked the libtool script to set ARFLAGS=u and rebuild the .a/.la
Tom> files.  Unfortunately, that didn't work :-(.

Andreas> As mentioned, with 'qc' I succeed on darwin(ppc).

I think I've found my problem.
According to the GNU ar info page:

     However, too many different systems assume quick append rebuilds
     the index, so GNU ar implements `q' as a synonym for `r'.

It turns out that if you do something like:

    ar cru libdumb.a foo.o z/foo.o

... then GNU ar will put both into the archive.

But if you do this:

    ar cru libdumb.a foo.o
    ar cru libdumb.a z/foo.o

... then only one foo.o will end up in the archive.  This is odd, and
apparently undocumented.


It would be nice if we could make an archive with a relative path in
it, but GNU ar can't do that:

`P'
     Use the full path name when matching names in the archive.  GNU
     `ar' can not create an archive with a full path name (such archives
     are not POSIX complaint), but other archive creators can.  This
     option will cause GNU `ar' to match file names using a complete
     path name, which can be convenient when extracting a single file
     from an archive created by another tool.


Any opinions on whether we should try to fix this in ar or in libtool?
Or maybe in the libjava Makefile?  Whatever we do, it's going to be a
pain...


I found one weird possibility.  We could use GNU ar's MRI
compatibility mode.  What's nice about this mode is that, in it, GNU
ar reads commands from stdin.  So this nicely sidesteps line length
limits and the like.  Hacking libtool to do this might be really hard
though.

Tom



More information about the Java mailing list