From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2102 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: shared musl with PCC as system compiler Date: Sun, 14 Oct 2012 11:29:18 -0400 Message-ID: <20121014152918.GL254@brightrain.aerifal.cx> References: <20121014001534.0ee7a5f0.idunham@lavabit.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: ger.gmane.org 1350229080 3906 80.91.229.3 (14 Oct 2012 15:38:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Oct 2012 15:38:00 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2103-gllmg-musl=m.gmane.org@lists.openwall.com Sun Oct 14 17:38:07 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 1TNQGV-0006ZK-Fi for gllmg-musl@plane.gmane.org; Sun, 14 Oct 2012 17:38:07 +0200 Original-Received: (qmail 17471 invoked by uid 550); 14 Oct 2012 15:38:00 -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 17463 invoked from network); 14 Oct 2012 15:38:00 -0000 Content-Disposition: inline In-Reply-To: <20121014001534.0ee7a5f0.idunham@lavabit.com> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:2102 Archived-At: On Sun, Oct 14, 2012 at 12:15:34AM -0700, Isaac Dunham wrote: > This is mainly a mix of what I've worked out previously and what Rich and I worked out on IRC. I figured posting it on the list would help those who want to use pcc as compiler... > 0. Get today's (Oct 13) git HEAD or later! Otherwise libc.so will be broken. > Get a fairly recent pcc from CVS (the last month should be good enough) > When compiling pcc-libs, use > make CFLAGS="-fPIC ${OPTFLAGS}" > (otherwise you get textrels in libc.so, which doesn't work) > 1. Set LIBCC to -L$(dirname `pcc -print-file-name=libpcc.a`) -lpcc > #-lpccsoftfloat may be needed for some systems I think just $(pcc -print-file-name=libpcc.a) would work. > 3. Find the right -m* options: > ld -march=native > #look for the elf_* in the "Supported emulations" that matches your CPU > Change all occurences of -m* in config.mak to "-melf_" > (pcc doesn't parse -m*, which is at best an incompatible behavior) Step 3 is entirely unnecessary. No -m options are needed. The problem is that pcc wrongly passes-thru -march as an option to the linker. Just remove -march and -mtune from the CFLAGS and the problem goes away. Rich