[Ecls-list] C:MAKE-BUILD composition and hierarchical ar shrink-wrapping
_deepfire at feelingofgreen.ru
Tue Mar 25 10:52:50 UTC 2008
To sum up my findings, ASDF:MAKE-BUILD seems to dislike ASD systems which
don't specify their total system dependencies, resulting in a link failure.
This problem apparently stems from faulty scheme of composition of ar archives
employed by ECL, namely assumption that hierarchically composed ar archives
readily yield the non-root archive contents for final link-time observation.
Let me illustrate the point, by the use of two ASD systems, A and B:
- A is standalone,
- B depends on A.
What ECL appears to do, when you call (C:MAKE-BUILD :B :TYPE :STATIC-LIBRARY):
1. compile A/*.o, ECLINIT..a.o
2. link all that into liba.a
3. compile B/*.o, ECLINIT..b.o
4. link B/*.o, ECLINIT..b.o, liba.a into libb.a
Then, when you try to link that into a final executable, it fails to find
init_lib_A, because the linker is unable to peek recursively into
It is also illustrative to observe that requesting :SHARED-LIBRARY type
works with this example, because .A -> .SO composition isn't simple ar
shrink-wrapping, but rather partial linking.
Of course this still fails when the implicit dependency hierarchy depth is more
than two, because then ECL still folds the leaf dependencies into .a files,
thereby obscuring them as described above.
The problem can be side-stepped, with obvious downsides, by specifying
the complete sum of dependencies in the root system's :DEPENDS-ON _and_
employing the :SHARED-LIBRARY trick, so that all the contents of .a archives
is accessible at link time.
This doesn't cover all of the issues I've encountered on the journey towards
the holy grail of having complete ASDF system composition, but the rest
is for later time.
regards, Samium Gromoff
More information about the ecl-devel