Sun Studio 12: Fortran Programming Guide

4.4.2.2 Ordering Routines in a Static Library

To order the elements in a static library when it is being built by ar, use the commands lorder(1) and tsort(1):


demo% ar -cr mylib.a ’lorder exg.o fofx.o diffz.o | tsort’