Re: [PERFORM] Sun performance - Major discovery! - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PERFORM] Sun performance - Major discovery!
Date
Msg-id 1253.1066083904@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PERFORM] Sun performance - Major discovery!  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: [PERFORM] Sun performance - Major discovery!  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> OK, patch attached and applied.  It centralizes the optimization
> defaults into configure.in, rather than having CFLAGS= in the template
> files.

I think there's a problem here:

> + # configure sets CFLAGS to -O2 for gcc, so this is only for non-gcc
> + if test x"$CFLAGS" = x""; then
> +     CFLAGS="-O"
> + fi
>   if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
>     CFLAGS="$CFLAGS -g"
>   fi

since this will cause "configure --enable-debug" to default to selecting
CFLAGS="-O -g" for non-gcc compilers.  On a lot of compilers that
combination does not work, and will generate tons of useless warnings.
I think it might be better to do

  if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
    CFLAGS="$CFLAGS -g"
+ else
+   # configure sets CFLAGS to -O2 for gcc, so this is only for non-gcc
+   if test x"$CFLAGS" = x""; then
+     CFLAGS="-O"
+   fi
  fi

            regards, tom lane

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: IDE Drives and fsync
Next
From: Tom Lane
Date:
Subject: Re: postgres --help-config