Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 26 Oct 2012 16:35:23 -0400
From: Rich Felker <dalias@...ifal.cx>
To: musl@...ts.openwall.com
Subject: Re: [RFC] pcc support for configure

On Tue, Oct 16, 2012 at 11:55:36AM -0700, idunham@...abit.com wrote:
> > On Tue, Oct 16, 2012 at 12:17:43PM +0200, Szabolcs Nagy wrote:
> >> * Isaac Dunham <idunham@...abit.com> [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

Powered by blists - more mailing lists

Your e-mail address:

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.