From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7536 Path: news.gmane.org!not-for-mail From: Andre McCurdy Newsgroups: gmane.linux.lib.musl.general Subject: Re: building musl libc.so with gcc -flto Date: Mon, 27 Apr 2015 23:23:40 -0700 Message-ID: References: <1429742932-6026-1-git-send-email-armccurdy@gmail.com> <20150423022309.GH6817@brightrain.aerifal.cx> <20150423094520.GA17573@brightrain.aerifal.cx> <20150428002402.GJ17573@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1430202243 17254 80.91.229.3 (28 Apr 2015 06:24:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 Apr 2015 06:24:03 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7549-gllmg-musl=m.gmane.org@lists.openwall.com Tue Apr 28 08:23:54 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 1Ymyvx-0007Su-Rm for gllmg-musl@m.gmane.org; Tue, 28 Apr 2015 08:23:53 +0200 Original-Received: (qmail 32426 invoked by uid 550); 28 Apr 2015 06:23:52 -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 32408 invoked from network); 28 Apr 2015 06:23:51 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=/IJhDdbO3ZOFjaxm9iskHqUW5x2cxK7IcYhJxYoxVIQ=; b=0cTk611nGbW6lpx3NEND6tUyWOVrjV0x9jk3YMcB+kha+wtsBaGhTowu8zij+JexrL Rc4pcCMoPW13jIvRcdYpsYNfATeAbuRW/Hz3x/XakoxOkBCeb6XNT/qjQ1b08S9CVGUt XUmCnSzP1f2dcIkizHQcvkDDWXmwCocwDtTreaSG5GpMXcpTQAExYxhEhA1P25aKpXn+ nQEtxdfF9aPof5dhGyXQIYvLt8GxtCwxg+MtTSoqACCJJZEKQiJSWjfZhh8GQAWGAE0M RU34JeCkRei67fNxvlwY21F+frO0WnbNW5GNYrEqkWHMo9o5ag9gCS8d2O3bqSPE+bSu KsDQ== X-Received: by 10.202.96.212 with SMTP id u203mr8376319oib.29.1430202220322; Mon, 27 Apr 2015 23:23:40 -0700 (PDT) In-Reply-To: <20150428002402.GJ17573@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:7536 Archived-At: On Mon, Apr 27, 2015 at 5:24 PM, Rich Felker wrote: > 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. Patch sent. I think the crt files might be OK as they are, since the _start_c symbol isn't being hidden? >> >> > 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