[comp.os.minix] >Question about lorder

u31b3hs@cip-s02.informatik.rwth-aachen.de (Michael Haardt) (03/14/91)

Hello world,

in "Question about lorder(1)" Gregory Larkin writes:

>I have /usr/src/lib split into ibm, posix, string,
>and ansi.  I have the compiler support routines in
>/usr/lib/support.  If I try:
>
>cd /usr/src/lib
>lorder */*.s /usr/lib/suppport/*.s > libc.lorder
>
>It says:
>
>lorder: Argument list too long.
That's true.  The manual says, that lorder is able to use
assembler files and archived assembler files.  I copy all
assembler files to a subdirectory 'allasm' and use

     rm foo.a
     ls | xargs ar q foo.a
     lorder foo.a | tsort | xargs ar q libc.a
 
to build a new library, if I remember rightly.

>I tried running lorder in each subdirectory, directing
>the output to a file in each case.  I then cat'ted the
>files together and ran tsort on the file.  I got
>a library order, but it gives a different one if I
>cat the files together differently.
lorder produces a partial ordered set (poset).  tsort does a
topological sort to produce a total ordered set.  With a given
partial order, there could be more than one total order:
 
       a needs c
       a needs b
 
The two possible orders are: abc and acb.  The resulting order
produced by tsort depends on the order of the partial order rules.
 
>May I assume that the library order is correct, as long
>as tsort does not report any cycles?
No.  Not with the tsort_1_5_* versions.
 
>BTW, I am using tsort_1_5_9 as included in the V1.5.10
>upgrade kit.
tsort_1_5_9 is the best official version from PH.  Unfortunately,
this best version has bugs.  Sometimes you get a correct total
order, but do not rely on it.  Last year, someone posted a new
tsort which is very fast *and* correct.  I never had any problems
while using it.  You can get it from:
 
       server: ftp.thp.uni-koeln.de
       path:   ~ftp/pub/minix/commands

Hope this helps & Namaskaar
 
Michael Haardt (u31b3hs%cip-s01.informatik.rwth-aachen.de@unido.bitnet)