[lto][plugin] How to find libc?
Ian Lance Taylor
iant@google.com
Thu Oct 1 00:49:00 GMT 2009
Rafael Espindola <espindola@google.com> writes:
> Ian noted that when linking libc statically into a program and using
> the gold plugin, we have to ask gold to rescan libc. The problem is,
> gcc normally doesn't know which libc is being used. It will just pass
> -lc to the linker and the linker searches for it.
>
> On way to fix this is to implement the same algorithms used in the
> linker in gcc.
Please, no.
> Another way is to add a new callback into gold: add_input_library. It
> would be similar to add_input_file, but the linker would search for
> library. With this callback we would be able to do
>
> -pass-through=libgcc.a -pass-through=-lc
This seems reasonable, or add an extra option to add_input_file.
Within gold, add_input_file should do exactly the right thing if you
set the name to "c" and change the second argument to the
Input_file_argument constructor to true.
Ian
More information about the Gcc-patches
mailing list