[lld] r234378 - Allow undefined symbols in shared library by default.

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed Apr 8 04:53:01 PDT 2015


> Are you sure this is correct? There are two different cases here:
> (1) The undefined symbol is in a dependency. While it is sometimes nice
> to see a warning, it should not be an error. GNU ld gets this wrong.
>
> (2) The undefined symbol is defined in a dependency. I think we get this
> wrong right now for indirect dependencies, e.g. we link against libfoo,
> which links against libbar and the symbol is defined by libbar. We
> certainly *do* want to complain by default here.

Can you give an example of both cases?

In general the thing I find broken about the bfd ld behavior is that
it is  presumptuous for the static linker to think it knows how the
dynamic one will do its job.

For example, if libxml.so has support for using zlib compression, one
build of it can include zlib and another might link with libzlib.so.
Both export the same interface, it is not the static linker's job to
go check for libzlib.so. In a distributed build, it shouldn't even be
necessary to have libzlib.so available to link with libxml.so.

Cheers,
Rafael



More information about the llvm-commits mailing list