From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2221 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [RFC] pcc support for configure Date: Fri, 26 Oct 2012 16:35:23 -0400 Message-ID: <20121026203523.GA254@brightrain.aerifal.cx> References: <20121015211231.08cbd071.idunham@lavabit.com> <20121016101743.GM24157@port70.net> <20121016132120.GR254@brightrain.aerifal.cx> <11994.132.241.155.248.1350413736.squirrel@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 1351283739 4156 80.91.229.3 (26 Oct 2012 20:35:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Oct 2012 20:35:39 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2222-gllmg-musl=m.gmane.org@lists.openwall.com Fri Oct 26 22:35:48 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 1TRqd4-0002Qf-3I for gllmg-musl@plane.gmane.org; Fri, 26 Oct 2012 22:35:42 +0200 Original-Received: (qmail 30584 invoked by uid 550); 26 Oct 2012 20:35:33 -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 30575 invoked from network); 26 Oct 2012 20:35:33 -0000 Content-Disposition: inline In-Reply-To: <11994.132.241.155.248.1350413736.squirrel@lavabit.com> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:2221 Archived-At: On Tue, Oct 16, 2012 at 11:55:36AM -0700, idunham@lavabit.com wrote: > > On Tue, Oct 16, 2012 at 12:17:43PM +0200, Szabolcs Nagy wrote: > >> * Isaac Dunham [2012-10-15 21:12:31 -0700]: > >> > +# Older PCC versions don't define __PIC__ with -fPIC > >> > +# > >> > +tryflag CFLAG_TEST "-x c" > >> > +printf '#ifndef __PIC__\n__PIC__=0\n#endif\n' | \ > >> > +$CC -E $CFLAG_TEST -fPIC - | grep __PIC__ && \ > >> > +CFLAGS_SHARED_ALL="$CFLAGS_SHARED_ALL -D__PIC__=1" > >> > + > >> > >> i don't think it's worth adding such checks > >> > > Agreed. I don't think there's a point in supporting old compiler > > versions except when there are possibly-compelling reasons to use > > them. > > Dropping that. As of latest commit, pcc should work out of the box. > diff --git a/configure b/configure > index 9b06d2b..f45b87a 100755 > --- a/configure > +++ b/configure > @@ -162,6 +162,7 @@ printf "checking for C compiler... " > trycc ${CROSS_COMPILE}gcc > trycc ${CROSS_COMPILE}c99 > trycc ${CROSS_COMPILE}cc > +trycc ${CROSS_COMPILE}pcc This part was not included; use CC=pcc explicitly or have c99 symlinked to pcc. > printf "%s\n" "$CC" > test -n "$CC" || { echo "$0: cannot find a C compiler" ; exit 1 ; } > > @@ -269,8 +270,8 @@ tryflag CFLAGS_AUTO -falign-jumps=1 > # work anyway (issues with atomic ops). > # > if test "$ARCH" = "i386" ; then > -fnmatch '-march=*|*\ -march=*' "$CFLAGS" || tryflag CFLAGS_AUTO -march=i486 > -fnmatch '-mtune=*|*\ -mtune=*' "$CFLAGS" || tryflag CFLAGS_AUTO -mtune=generic > +fnmatch '-march=*|*\ -march=*' "$CFLAGS" || tryldflag CFLAGS_AUTO -march=i486 > +fnmatch '-mtune=*|*\ -mtune=*' "$CFLAGS" || tryldflag CFLAGS_AUTO -mtune=generic This was committed a day or two ago. > fi > > if test "x$warnings" = xyes ; then > @@ -299,6 +300,7 @@ shared=no > # Find compiler runtime library > test -z "$LIBCC" && tryldflag LIBCC -lgcc && tryldflag LIBCC -lgcc_eh > test -z "$LIBCC" && tryldflag LIBCC -lcompiler_rt > +test -z "$LIBCC" && tryldflag LIBCC `$CC -print-file-name=libpcc.a || true` This was replaced with a simple test for -lpcc, which works with my version of pcc. See the comments in the commit and let me know if it doesn't work for you. Rich