svn commit: r236137 - head/contrib/gcc/config/i386

Dimitry Andric dim at FreeBSD.org
Mon May 28 19:33:56 UTC 2012


On 2012-05-27 22:31, Roman Divacky wrote:
> Fwiw, to enable the same thing in clang you want this simple patch:
> 
> ===================================================================
> --- Tools.cpp   (revision 157545)
> +++ Tools.cpp   (working copy)
> @@ -4794,6 +4794,7 @@
>    if (Args.hasArg(options::OPT_static)) {
>      CmdArgs.push_back("-Bstatic");
>    } else {
> +    CmdArgs.push_back("--hash-style=both");
>      if (Args.hasArg(options::OPT_rdynamic))
>        CmdArgs.push_back("-export-dynamic");
>      CmdArgs.push_back("--eh-frame-hdr");
> 
> 
> 
> I cant commit this upstream as this option doesn't work with ld 2.15. What
> should be done here? Commit this to local FreeBSD version? Commit it upstream
> making it not work with old ld? Leave it out completely?

I think this can be committed locally in our version, especially if it
is better for performance.  We already have a few local modifications,
this one isn't very shocking. :)

For upstream, you should really add a configure check for gnu hash
support in ld, and then surround the above addition with conditionals,
e.g. #ifdef HAVE_LINK_GNU_HASH or something.

On the other hand, it's really platform-dependent: I've checked several
Linux distributions, and it is fairly unpredictable whether their gcc
passes --hash-style to the linker, or if they do, which option they use.

For example, Debian stable uses --hash-style=both, while Ubuntu 12.04
uses --hash-style=gnu.  So the correct mechanism for this is tricky.  It
should be discussed on the clang mailing list, not here.

Lastly, my personal preference would be to adjust these defaults in the
linker itself, depending on platform, but apparently nobody does that...


More information about the svn-src-all mailing list