From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/768 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 17:41:27 -0400 Message-ID: <20120424214127.GQ14673@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> 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 1335303521 19626 80.91.229.3 (24 Apr 2012 21:38:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 24 Apr 2012 21:38:41 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-769-gllmg-musl=m.gmane.org@lists.openwall.com Tue Apr 24 23:38:40 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 1SMnRU-0002rT-C8 for gllmg-musl@plane.gmane.org; Tue, 24 Apr 2012 23:38:36 +0200 Original-Received: (qmail 17788 invoked by uid 550); 24 Apr 2012 21:38:35 -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 17780 invoked from network); 24 Apr 2012 21:38:35 -0000 Content-Disposition: inline In-Reply-To: <20120424212840.GA13491@openwall.com> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:768 Archived-At: 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. Rich