From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7531 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: building musl libc.so with gcc -flto Date: Mon, 27 Apr 2015 20:24:02 -0400 Message-ID: <20150428002402.GJ17573@brightrain.aerifal.cx> References: <1429742932-6026-1-git-send-email-armccurdy@gmail.com> <20150423022309.GH6817@brightrain.aerifal.cx> <20150423094520.GA17573@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1430180664 27282 80.91.229.3 (28 Apr 2015 00:24:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 Apr 2015 00:24:24 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7544-gllmg-musl=m.gmane.org@lists.openwall.com Tue Apr 28 02:24:18 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1YmtJx-0006I3-V6 for gllmg-musl@m.gmane.org; Tue, 28 Apr 2015 02:24:18 +0200 Original-Received: (qmail 17638 invoked by uid 550); 28 Apr 2015 00:24:16 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 17616 invoked from network); 28 Apr 2015 00:24:15 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:7531 Archived-At: On Mon, Apr 27, 2015 at 05:16:12PM -0700, Andre McCurdy wrote: > > OK, it looks like the _dlstart_c symbol got removed before linking the > > asm. What about selectively compiling this file with -fno-lto via > > something like this in config.mak: > > > > src/ldso/dlstart.lo: CFLAGS += -fno-lto > > That works. Should I send a patch? Yes, but configure would need to detect support for -fno-lto and add it appropriately. See what's done for CFLAGS_NOSSP. I suspect the crt files also need -fno-lto in principle even if they're not currently breaking for lack of it. > >> > Also seems rather like what I would expect. Any idea if performance is > >> > significantly better? It's not very comprehensive but you could try > >> > libc-bench. > >> > >> I modified libc-bench so that it loops though everything in main() ten > >> times and then ran the same libc-bench binary with each version of > >> libc.so, sending output to /dev/null. > >> > >> The -O3 -flto build seems to be consistently very slightly *slower* > >> than the non -flto version... > > > > That makes the whole thing somewhat less interesting. LTO is probably > > more interesting for static libc. > > Yes, quite disappointing... > > I'll try to experiment a little with static linking. Great. Let us know how it goes. Rich