In ld.lld, when an ObjFile/BitcodeFile is read in --start-lib state, the file is
given archive semantics. --end-lib closes the previous --start-lib. A build
system can use this feature as an alternative to archives. This patch ports
the feature to lld-macho.
--start-lib and --end-lib are positional, unlike usual ld64 options.
I think the slight drawback does not matter as (a) reusing option names
make build systems convenient (b) --start-lib a.o b.o --end-lib conveys more
information than an alternative design: -objlib a.o -objlib b.o because
--start-lib makes it clear which objects are in the same conceptual archive.
This provides flexibility (c) -objlib/-filelist interaction may be weird.
can this be a parameter to the addFile() function instead?
Having it as a global makes it harder to introduce any kind parallelization in processing the input (which i'm working on a POC for, since lld-macho is currently proven to be too slow to link Youtube)
Also I've said this on the bug but I'm kind concerned about introducing stateful flags like this given there's no precedence for it in LD64.