Re: [BUGS] solaris non gcc compiler debug options - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: [BUGS] solaris non gcc compiler debug options
Date
Msg-id 200411270503.iAR531115641@candle.pha.pa.us
Whole thread Raw
Responses Re: [BUGS] solaris non gcc compiler debug options  (Kris Jurka <books@ejurka.com>)
List pgsql-patches
Kris Jurka wrote:
>
> Compiling on solaris with a non gcc compiler does not correctly enable
> debugging when --enable-debug is specified.  src/template/solaris is
> specifying CFLAGS="-O -v" and -O overrides the -g that --enable-debug
> adds.

Good point.  Our template files should be _adding_ to CFLAGS and
CPPFLAGS, not overriding them.  Later optimization flags on the
command line override earlier ones, so this patch should fix the
problem, and it exists in a few platforms.  Applied.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: src/template/aix
===================================================================
RCS file: /cvsroot/pgsql/src/template/aix,v
retrieving revision 1.15
diff -c -c -r1.15 aix
*** src/template/aix    1 Nov 2003 20:45:30 -0000    1.15
--- src/template/aix    27 Nov 2004 05:01:00 -0000
***************
*** 1,10 ****
  if test "$GCC" != yes ; then
    case $host_os in
      aix3.2.5 | aix4.1*)
!       CFLAGS="-O -qmaxmem=16384 -qsrcmsg"
        ;;
      *)
!       CFLAGS="-O2 -qmaxmem=16384 -qsrcmsg -qlonglong"
        ;;
    esac
  fi
--- 1,10 ----
  if test "$GCC" != yes ; then
    case $host_os in
      aix3.2.5 | aix4.1*)
!       CFLAGS="$CFLAGS -O -qmaxmem=16384 -qsrcmsg"
        ;;
      *)
!       CFLAGS="$CFLAGS -O2 -qmaxmem=16384 -qsrcmsg -qlonglong"
        ;;
    esac
  fi
Index: src/template/freebsd
===================================================================
RCS file: /cvsroot/pgsql/src/template/freebsd,v
retrieving revision 1.32
diff -c -c -r1.32 freebsd
*** src/template/freebsd    26 Apr 2004 04:04:42 -0000    1.32
--- src/template/freebsd    27 Nov 2004 05:01:00 -0000
***************
*** 1,3 ****
  case $host_cpu in
!   alpha*)   CFLAGS="-O";;  # alpha has problems with -O2
  esac
--- 1,3 ----
  case $host_cpu in
!   alpha*)   CFLAGS="$CFLAGS -O";;  # alpha has problems with -O2
  esac
Index: src/template/hpux
===================================================================
RCS file: /cvsroot/pgsql/src/template/hpux,v
retrieving revision 1.12
diff -c -c -r1.12 hpux
*** src/template/hpux    23 Dec 2003 22:15:07 -0000    1.12
--- src/template/hpux    27 Nov 2004 05:01:00 -0000
***************
*** 1,8 ****
! CPPFLAGS="-D_XOPEN_SOURCE_EXTENDED"

  if test "$GCC" != yes ; then
    CC="$CC -Ae"
!   CFLAGS="+O2"
  fi

  # Pick right test-and-set (TAS) code.  We need out-of-line assembler
--- 1,8 ----
! CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"

  if test "$GCC" != yes ; then
    CC="$CC -Ae"
!   CFLAGS="$CFLAGS +O2"
  fi

  # Pick right test-and-set (TAS) code.  We need out-of-line assembler
Index: src/template/linux
===================================================================
RCS file: /cvsroot/pgsql/src/template/linux,v
retrieving revision 1.25
diff -c -c -r1.25 linux
*** src/template/linux    26 Apr 2004 04:04:42 -0000    1.25
--- src/template/linux    27 Nov 2004 05:01:00 -0000
***************
*** 1,2 ****
  # Force _GNU_SOURCE on; plperl is broken with Perl 5.8.0 otherwise
! CPPFLAGS="-D_GNU_SOURCE"
--- 1,2 ----
  # Force _GNU_SOURCE on; plperl is broken with Perl 5.8.0 otherwise
! CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
Index: src/template/osf
===================================================================
RCS file: /cvsroot/pgsql/src/template/osf,v
retrieving revision 1.17
diff -c -c -r1.17 osf
*** src/template/osf    23 Apr 2004 18:15:55 -0000    1.17
--- src/template/osf    27 Nov 2004 05:01:00 -0000
***************
*** 1,4 ****
  if test "$GCC" != yes ; then
    CC="$CC -std"
!   CFLAGS="-O -ieee"
  fi
--- 1,4 ----
  if test "$GCC" != yes ; then
    CC="$CC -std"
!   CFLAGS="$CFLAGS -O -ieee"
  fi
Index: src/template/solaris
===================================================================
RCS file: /cvsroot/pgsql/src/template/solaris,v
retrieving revision 1.20
diff -c -c -r1.20 solaris
*** src/template/solaris    24 Sep 2004 00:21:32 -0000    1.20
--- src/template/solaris    27 Nov 2004 05:01:00 -0000
***************
*** 1,6 ****
  if test "$GCC" != yes ; then
    CC="$CC -Xa"            # relaxed ISO C mode
!   CFLAGS="-O -v"        # -v is like gcc -Wall
  fi

  # Pick right test-and-set (TAS) code.  We need out-of-line assembler
--- 1,6 ----
  if test "$GCC" != yes ; then
    CC="$CC -Xa"            # relaxed ISO C mode
!   CFLAGS="$CFLAGS -O -v"        # -v is like gcc -Wall
  fi

  # Pick right test-and-set (TAS) code.  We need out-of-line assembler
Index: src/template/univel
===================================================================
RCS file: /cvsroot/pgsql/src/template/univel,v
retrieving revision 1.16
diff -c -c -r1.16 univel
*** src/template/univel    25 Oct 2003 15:32:11 -0000    1.16
--- src/template/univel    27 Nov 2004 05:01:00 -0000
***************
*** 1,2 ****
! CFLAGS="-v -O -K i486,host,inline,loop_unroll -Dsvr4"
  LIBS="-lc89"
--- 1,2 ----
! CFLAGS="$CFLAGS -v -O -K i486,host,inline,loop_unroll -Dsvr4"
  LIBS="-lc89"
Index: src/template/unixware
===================================================================
RCS file: /cvsroot/pgsql/src/template/unixware,v
retrieving revision 1.37
diff -c -c -r1.37 unixware
*** src/template/unixware    14 May 2004 16:29:12 -0000    1.37
--- src/template/unixware    27 Nov 2004 05:01:00 -0000
***************
*** 13,21 ****
  __EOF__

    if $CC -c -O -Kinline conftest.c >conftest.err 2>&1; then
!     CFLAGS="-O -Kinline"
    else
!     CFLAGS="-O -Kinline,no_host"
    fi
    rm -f conftest.*

--- 13,21 ----
  __EOF__

    if $CC -c -O -Kinline conftest.c >conftest.err 2>&1; then
!     CFLAGS="$CFLAGS -O -Kinline"
    else
!     CFLAGS="$CFLAGS -O -Kinline,no_host"
    fi
    rm -f conftest.*


pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: psql: customizable readline history filename
Next
From: Bruce Momjian
Date:
Subject: Re: FAQ update