ar
is an archiving tool originating from Unix. It is used (almost exclusively) to combine multiple .oo
object files into a .oa
static library.
An Onramp static library is essentially the same as an Onramp object file, except that it contains metadata to delimit the contained object files. The metadata allows the archive to be modified and allows the linker to correctly treat each contained object file as individually scoped.
This tool helps us assemble our libc into a static library. This simplifies compilation, especially since libc stages are overlays over each other. This tool is also necessary to provide a POSIX-style compilation process. Libraries are used in the build process for popular compilers, and the -l
option to cc
must be able to find static libraries.
The archiver is written in two stages: