From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6457 Path: news.gmane.org!not-for-mail From: John Spencer Newsgroups: gmane.linux.lib.musl.general Subject: Re: fixing -fPIE + -fstack-protector-all Date: Thu, 06 Nov 2014 13:40:43 +0100 Message-ID: <545B6C4B.5040704@barfooze.de> References: <545A414F.8000407@barfooze.de> <20141105180140.5d98fee9@vostro> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1415277793 16609 80.91.229.3 (6 Nov 2014 12:43:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Nov 2014 12:43:13 +0000 (UTC) Cc: musl@lists.openwall.com, Gregor Richards To: Timo Teras Original-X-From: musl-return-6470-gllmg-musl=m.gmane.org@lists.openwall.com Thu Nov 06 13:43:07 2014 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 1XmMOy-00031B-Po for gllmg-musl@m.gmane.org; Thu, 06 Nov 2014 13:43:00 +0100 Original-Received: (qmail 5601 invoked by uid 550); 6 Nov 2014 12:42:59 -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 5592 invoked from network); 6 Nov 2014 12:42:59 -0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 In-Reply-To: <20141105180140.5d98fee9@vostro> Xref: news.gmane.org gmane.linux.lib.musl.general:6457 Archived-At: Timo Teras wrote: > On Wed, 05 Nov 2014 16:25:03 +0100 > John Spencer wrote: > >> using -fPIE + -fstack-protector-all is currently broken for a number >> of architectures (most notably i386) in the default gcc setup >> (including the musl-cross patches), as it depends on a >> libssp_nonshared.a which provides __stack_chk_fail_local(). > > In Alpine Linux we are patching gcc to unconditionally to have > -lssp_nonshared: > http://git.alpinelinux.org/cgit/aports/tree/main/gcc/gcc-4.8-musl-libssp.patch > > And making musl package provide that library: > http://git.alpinelinux.org/cgit/aports/tree/main/musl/__stack_chk_fail_local.c > http://git.alpinelinux.org/cgit/aports/tree/main/musl/APKBUILD#n60 > yeah, i originally looked at what alpine does but then noticed that gcc builds its own libssp_nonshared.a anyway. btw: the gcc one is, unlike alpine's, built with hidden visibility (from ssp-local.c): extern void __stack_chk_fail (void); void __attribute__((visibility ("hidden"))) __stack_chk_fail_local (void) { __stack_chk_fail (); }