curl-library
Re: [RFC PATCH] symbols versioning
Date: Sun, 18 Dec 2011 15:19:36 +0100
On Sat, Dec 17, 2011 at 03:31:38PM +0100, Daniel Stenberg wrote:
> On Fri, 16 Dec 2011, Alessandro Ghedini wrote:
>
> >>1 - The warning on line 22-23 seems to assume that --with-gnu-ld can be used
> >> which we really cannot know. I suggest a more generic error message that
> >> will work even for non-gnu compilers and linkers.
> >
> >Would something like "You should use a GNU ld compatible linker to
> >enable symbols versioning." be ok?
>
> Or even more generic:
>
> "You need an ld version offering the --version-script option"
>
> I could very well imagine that GNU ld is not the only one offering
> this, even though I haven't actually checked.
>
> >Regarding your previous remarks [0], I am not sure what would be
> >the best ways to address points 1 and 2.
> >
> >For point 1 I may test the output of the call to "$LD
> >--version-script=file" but this is not optimal since different
> >linkers usually have different outputs (e.g. ld and gold).
>
> Well, for most things configure does it runs them and then verify if
> they worked or not. You shouldn't have to check any output for this
> option, just check return code on a simple test.
>
> But okay, leave the --help check for now. We can extend the check
> more when someone comes up with a linker that uses a different
> command line option or an ld version that doesn't list the option in
> its help output...
>
> >For point 2 I am testing whether the compiler is gcc, clang, icc
> >or tcc, but it doesn't look like the best way to me (also, I may
> >have missed other usable compilers).
>
> Point 2 would be the same as 1. You should most probably test it by
> invoking the compiler with that command line option set to see if
> the compiler used works with it. We cannot know which compilers that
> exist out there that tries/wants to be gcc compatible.
>
> But if you bail out and figure out --version-script ability by
> checking the --help output, we can probably assume that a compiler
> that supports --version-script also supports -Wl,. I think we can
> live with it, even if it is less than perfect.
Attached is the (hopefully) final version of the patch :)
A little note: currently the major soname version ("4") is hardcoded in the
lib/libcurl.vers.in file, so that it will need to be manually changed when
the soname will be bumped. AFAICT, currently the version info to pass to ld
is only set in lib/Makefile.am so that there is no easy way to make this
process automatic.
Cheers
-- perl -E'$_=q;$/= @{[@_]};and s;\S+;<inidehG ordnasselA>;eg;say~~reverse'Received on 2011-12-18