llvm-link and ld option --whole-archive

Hello list,

On linux, ld has the following option:

–whole-archive
For each archive mentioned on the command line after the
–whole-archive option, include every object file in the archive in
the link, rather than searching the archive for the required object
files. This is normally used to turn an archive file into a shared
library, forcing every object to be included in the resulting
shared library. This option may be used more than once.

It would be convenient for similar functionality to exist in llvm-link for handling archive files being transformed into shared libraries. The equivalent functionality can be achieved in a straightforward manner by exploding the archive files first, but this makes integration into existing build systems difficult and/or tedious.

Generally speaking, is the goal of llvm-link to be full featured, or just to fill in as a bitcode linker for the time being?

-Nathan McCauley

Generally speaking, is the goal of llvm-link to be full featured, or just to
fill in as a bitcode linker for the time being?

I think the idea is for llvm-link to be a very simple linker and
llvm-ld the one that looks a bit more like a system linker. You can
also try using the gold linker. It *is* a system linker, so all
options you expect will be there and it can handle LLVM bitcode via a
plugin.

-Nathan McCauley

Cheers,