[PATCH v2] shlib: Create a default symbol version on Linux-like ELF

Eric Christopher echristo at gmail.com
Fri Aug 8 18:03:11 PDT 2014


On Wed, Aug 6, 2014 at 10:28 AM, Adam Jackson <ajax at redhat.com> wrote:
> (apologies for the slow response)
>
> On Thu, 2014-07-31 at 23:25 -0700, Eric Christopher wrote:
>> Ah thanks Sylvestre. Wonder why gold doesn't have the option?
>
> If I'm being uncharitable: because gold is unfinished demoware.
>
>> Adam: feel like a configure and cmake time check for the option?
>
> Not really?  Not because I don't want to do the work, because it's a bad
> idea to make it conditional.  Binaries linked against a symbol-versioned
> libLLVM will fail to run when installed on a system that decided to
> build an unversioned libLLVM.  For the binary to be portable it would
> need to link against an unversioned libLLVM, but besides imposing
> additional complexity on the app developer it would defeat the purpose
> of the change: the unversioned binary would resolve symbols against
> whichever library happens to be first in the ELF search order and
> provides the symbol name, instead of being assured of getting the ABI it
> was built against.
>
> Probably better is to pass --version-script, which both bfd and gold
> appear to support.  lld does not yet, but I guess that's not a problem
> since it also doesn't support --no-undefined which the shlib build is
> already using.  Are there other linkers people think are worth caring
> about?
>

I think for ELF then depending on gold or binutils is just fine. We
can make lld accept the option as well if necessary.

-eric



More information about the llvm-commits mailing list