[LLVMdev] Compiling zlib to static bytecode archive
Chris Lattner
sabre at nondot.org
Thu Sep 27 11:25:10 PDT 2007
On Wed, 26 Sep 2007, Maarten ter Huurne wrote:
>>> process,
>>> which is called instead of collect2, does some processing and then
>>> runs the
>>> original, unmodified collect2:
>>> llvm-gcc -> llvm-collect2(liblto) -> collect2 -> ld
>>
>> Sure, this would also work. Is there any reason not to merge them
>> together?
>
> Ease of maintenance, mainly. Having it in a separate file makes it
> easier to migrate the code to new GCC releases. Also, collect2.c is
> already 2658 lines, which is more than I typically like to have in a
> single source file.
My impression is that collect2 doesn't change very much. In any case, the
idea here would be that collect2 only has minimally invasive hooks to call
into liblto. It seems like this would be much simpler than handling all
the command line argument swizzling needed for forking subprocesses, and
having the LTO app have to read all the .o files and analyze them (which
collect2 is already doing).
> I'd like to turn the question around: is there an advantage to merging them?
I think it would end up being simpler, and it would fit more naturally
with liblto.
-Chris
--
http://nondot.org/sabre/
http://llvm.org/
More information about the llvm-dev
mailing list