Or use rescan
from pg 41 of Oracle Solaris 11.1 Linkers and Libraries Guide:
Interdependencies between archives can exist, such that the extraction
of members from one archive must be resolved by extracting members
from another archive. If these dependencies are cyclic, the archives
must be specified repeatedly on the command line to satisfy previous
references.
$ cc -o prog .... -lA -lB -lC -lA -lB -lC -lA
The determination, and maintenance, of repeated archive specifications can
be tedious.
The
-z rescan-now option makes this process simpler. The -z rescan-now option is processed by the link-editor immediately when the option is
encountered on the command line. All archives that have been processed
from the command line prior to this option are immediately
reprocessed. This processing attempts to locate additional archive
members that resolve symbol references. This archive rescanning
continues until a pass over the archive list occurs in which no new
members are extracted. The previous example can be simplified as
follows.
$ cc -o prog .... -lA -lB -lC -z rescan-now
Alternatively, the -z rescan-start and -z rescan-end options can be used to group
mutually dependent archives together into an archive group. These
groups are reprocessed by the link-editor immediately when the closing
delimiter is encountered on the command line. Archives found within
the group are reprocessed in an attempt to locate additional archive
members that resolve symbol references. This archive rescanning
continues until a pass over the archive group occurs in which no new
members are extracted. Using archive groups, the previous example can
be written as follows.
$ cc -o prog .... -z rescan-start -lA -lB -lC -z rescan-end