From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2099 Path: news.gmane.org!not-for-mail From: Isaac Dunham Newsgroups: gmane.linux.lib.musl.general Subject: shared musl with PCC as system compiler Date: Sun, 14 Oct 2012 00:15:34 -0700 Message-ID: <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 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1350198953 15858 80.91.229.3 (14 Oct 2012 07:15:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Oct 2012 07:15:53 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2100-gllmg-musl=m.gmane.org@lists.openwall.com Sun Oct 14 09:16:01 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 1TNIQa-0000Cp-53 for gllmg-musl@plane.gmane.org; Sun, 14 Oct 2012 09:16:00 +0200 Original-Received: (qmail 20286 invoked by uid 550); 14 Oct 2012 07:15:49 -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 20275 invoked from network); 14 Oct 2012 07:15:48 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=lavabit; d=lavabit.com; b=gQW2tH1O3xo3dsZMxBR/BicNZ8chqEGd/di4IV0FUpkanFA8GZlCGpfmyoHHXjq++GgLix2S4KJ7FNHcNxCamCnnx28qcet9pLKD1XDpCBj4zhHHgGEb5Ck3Q67twMe19yyaGyJuwc8ZQ4P7g8lEILYFqniiPjCN6v/nmsVDQKg=; h=Date:From:To:Subject:Message-Id:X-Mailer:Mime-Version:Content-Type:Content-Transfer-Encoding; X-Mailer: Sylpheed 3.0.2 (GTK+ 2.20.1; i486-pc-linux-gnu) Xref: news.gmane.org gmane.linux.lib.musl.general:2099 Archived-At: 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 2. Add CFLAGS_ALL_SHARED += -D__PIC__=1 to config.mak (pcc doesn't define this with -fPIC at present, which is a bug) 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) 4. Now you should be set to compile. -- Isaac Dunham