From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13096 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: musl-gcc with default-pie toolchains Date: Wed, 1 Aug 2018 12:44:20 -0400 Message-ID: <20180801164420.GH1392@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="m+jEI8cDoTn6Mu9E" X-Trace: blaine.gmane.org 1533141756 460 195.159.176.226 (1 Aug 2018 16:42:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 1 Aug 2018 16:42:36 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-13112-gllmg-musl=m.gmane.org@lists.openwall.com Wed Aug 01 18:42:32 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1fkuCh-0008MG-LO for gllmg-musl@m.gmane.org; Wed, 01 Aug 2018 18:42:27 +0200 Original-Received: (qmail 12247 invoked by uid 550); 1 Aug 2018 16:44:34 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 12213 invoked from network); 1 Aug 2018 16:44:33 -0000 Content-Disposition: inline Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:13096 Archived-At: --m+jEI8cDoTn6Mu9E Content-Type: text/plain; charset=us-ascii Content-Disposition: inline A number of users have hit problems with the musl-gcc wrapper and underlying gccs built for default-pie, due to the specfile assuming non-pie is the default. The attached patch should fix that by using the pic-compatible versions of the crt files regardless of whether the output is pie or not. There's really no reason for the non-pic-compatible files to ever be used except saving (likely a single-digit number of) bytes of text. For static-pie, where a special rcrt1.o file is needed in place of the normal crt1, this will not work, but as far as I know all deployed gcc toolchains with default-pie do not honor the default-pie with -static and don't even support -static -pie (only -static-pie if anything) since glibc didn't support it until very recently. We could probably make -static-pie (and maybe -static -pie?) work with musl-gcc on such toolchains if we wanted as a separate patch, but right now I just want to fix the defaults that are breaking things for users.. Let me know if there's anything wrong with this or if it doesn't fix the problem. Rich --m+jEI8cDoTn6Mu9E Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="gccwrapper.diff" diff --git a/tools/musl-gcc.specs.sh b/tools/musl-gcc.specs.sh index 294e24f..3049257 100644 --- a/tools/musl-gcc.specs.sh +++ b/tools/musl-gcc.specs.sh @@ -17,10 +17,10 @@ cat <