[comp.unix.aix] ar, lorder & tsort

jkcohen@csm9a.UUCP ( Math/CWP) (03/14/90)

Question about PS/2 AIX, v1.1:

I read the 2nd sentence of DESCRIPTION on ar man page to say that
ranlib isn't needed.  Indeed, ranlib is *not* in the distribution.
What muddies the water for me is that the lorder and tsort man pages
say that the old lorder|tsort methodology *should* be used.

So do I just "ar" or do I "lorder|tsort|ar" ?
-- 
Jack K. Cohen
jkc@dix.mines.colorado.edu

jsalter@slo.uucp (James Salter) (03/15/90)

In article <2394@csm9a.UUCP> jkcohen@csm9a.UUCP ( Math/CWP) writes:
>Question about PS/2 AIX, v1.1:
>
>I read the 2nd sentence of DESCRIPTION on ar man page to say that
>ranlib isn't needed.  Indeed, ranlib is *not* in the distribution.
>What muddies the water for me is that the lorder and tsort man pages
>say that the old lorder|tsort methodology *should* be used.
>
>So do I just "ar" or do I "lorder|tsort|ar" ?

Neither.  You type:

	ar qv <libname> `lorder <files> | tsort`

It should be relatively simple to create a shell script which would take
an existing archive and make sure it's in the correct order using lorder
and tsort, also.

>Jack K. Cohen
>jkc@dix.mines.colorado.edu

jim/jsalter   IBM AWD   T465/(415)855-4427    VNET: JSALTER at PALOALTO
UUCP: ..!uunet!ibmsupt!jsalter               Disc: Any opinions are mine.
IP: ibmsupt!jsalter@uunet.uu.net                 "PS/2 it, or DIE!"

hue@netcom.UUCP (Jonathan Hue) (03/23/90)

In article <4500@ibmpa.UUCP> jsalter@slo.UUCP (James Salter) writes:
>	ar qv <libname> `lorder <files> | tsort`
>
>It should be relatively simple to create a shell script which would take
>an existing archive and make sure it's in the correct order using lorder
>and tsort, also.

What's "correct order"?  I'm using AIX 1.1 and ld seems to be able to link
fine from an archive full of .o's with cyclic dependencies.

Too bad the shared library generator thinks ld can't handle cyclic
dependencies.  It's useless for all but the most trivial shared libraries.
The workaround I'm using is to write a phony tsort program that forces
the X******.o file to the end of the file name list.  Works fine for me.

-Jonathan