From owner-svn-src-all@FreeBSD.ORG Mon May 28 19:33:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89881106566C; Mon, 28 May 2012 19:33:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 43E818FC12; Mon, 28 May 2012 19:33:56 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:4c1c:92fb:538c:83ed] (unknown [IPv6:2001:7b8:3a7:0:4c1c:92fb:538c:83ed]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 748635C59; Mon, 28 May 2012 21:33:55 +0200 (CEST) Message-ID: <4FC3D320.1070709@FreeBSD.org> Date: Mon, 28 May 2012 21:33:52 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120522 Thunderbird/13.0 MIME-Version: 1.0 To: Roman Divacky References: <201205270527.q4R5Rm44028055@svn.freebsd.org> <20120527203100.GA22921@freebsd.org> In-Reply-To: <20120527203100.GA22921@freebsd.org> X-Enigmail-Version: 1.5a1pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov Subject: Re: svn commit: r236137 - head/contrib/gcc/config/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 May 2012 19:33:56 -0000 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...