From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/769 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: New gcc wrapper to try Date: Tue, 24 Apr 2012 18:10:40 -0400 Message-ID: <20120424221040.GS14673@brightrain.aerifal.cx> References: <20120421064933.GF14673@brightrain.aerifal.cx> <20120421203751.GG14673@brightrain.aerifal.cx> <20120422225704.75a67b0b@newbook> <20120423091905.GM14673@brightrain.aerifal.cx> <20120424122828.50cdc737@newbook> <20120424212840.GA13491@openwall.com> <20120424214127.GQ14673@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: dough.gmane.org 1335305272 10094 80.91.229.3 (24 Apr 2012 22:07:52 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 24 Apr 2012 22:07:52 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-770-gllmg-musl=m.gmane.org@lists.openwall.com Wed Apr 25 00:07:49 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1SMntl-0007Lk-68 for gllmg-musl@plane.gmane.org; Wed, 25 Apr 2012 00:07:49 +0200 Original-Received: (qmail 28554 invoked by uid 550); 24 Apr 2012 22:07:48 -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 28546 invoked from network); 24 Apr 2012 22:07:48 -0000 Content-Disposition: inline In-Reply-To: <20120424214127.GQ14673@brightrain.aerifal.cx> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:769 Archived-At: On Tue, Apr 24, 2012 at 05:41:27PM -0400, Rich Felker wrote: > On Wed, Apr 25, 2012 at 01:28:40AM +0400, Solar Designer wrote: > > Rich, Isaac - > > > > On Tue, Apr 24, 2012 at 12:28:28PM -0700, Isaac Dunham wrote: > > > On Mon, 23 Apr 2012 05:19:05 -0400 Rich Felker wrote: > > > > Somebody has enabled stack protector. Either your distro (what distro > > > > are you using) has hacked gcc in a way different from what musl-gcc > > > > expects, or wireless-tools' makefile is adding -fstack-protector... > > > > > > There's no -fstack-protector, so it's Ubuntu's fault. > > > > Several distros do it these days (and Owl will start doing it soon as > > well), so it's becoming standard and needs to be supported. > > Technically, -fno-stack-protector in the musl-gcc wrapper would probably > > make things appear to work, but it's not necessarily a good thing to do > > since it might violate reasonable expectations of the user. I think > > it'd be better for musl to start providing the necessary symbols. > > The problem is that the default gcc build incorporates glibc ABI > knowledge (layout of the thread structure) and the assumption that the > thread pointer has been initialized into any binary built with stack > protector. Just adding symbols will not fix anything. > > If gcc's stack protector support is built without TLS support so that > it uses a global variable for the canary, instead of a thread-local > variable, then we could support it with no work at all. Unfortunately > I don't believe there's any way to override the type of canary access > gcc does via command line options; you have to rebuild gcc. Thus, for > the time being (until/unless we do TLS and mimic glibc's structure > layout), disabling stack protector is the only option for the wrapper > to use. For our own native gcc builds, we can already support it if I > just add the symbol it needs. ......but since you requested it, I'm working on trying to make it work anyway. We'll see how it goes. Preliminary support was just committed. Rich