cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [RFC PATCH] symbols versioning

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 17 Dec 2011 15:31:38 +0100 (CET)

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.

> [0] http://curl.haxx.se/mail/lib-2005-09/0176.html

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-12-17