beta3 CFLAGS issue on openbsd

Started by Jeremy Drakeover 19 years ago3 messageshackers
Jump to latest
#1Jeremy Drake
pgsql@jdrake.com

I was trying to compile 8.2beta3 on openbsd, and ran into an interesting
issue. My account on the particular openbsd box has some restrictive
ulimit settings, so I don't have a lot of memory to work with. I was
getting an out of memory issue linking postgres, while I did not before.
I figured out that the -g flag was being surreptitiously added to my
CFLAGS. It was like pulling teeth trying to get the -g flag out. I tried
--disable-debug to configure, which did not work. I had to do
CFLAGS=-O2 ./configure ...

Is this a known feature in the betas to get people running with -g in case
things break, or is this a configure bug, or expected?

Here is the first bit from configure, note the -g in the using CFLAGS line
at the end.

jeremyd@resin(~/build/postgres/postgresql-8.2beta3)$ ./configure --prefix=/home/jeremyd/progs/pg82 --with-perl --with-openssl --with-pgport=54322
checking build system type... x86_64-unknown-openbsd3.9
checking host system type... x86_64-unknown-openbsd3.9
checking which template to use... openbsd
checking whether to build with 64-bit integer date/time support... no
checking whether NLS is wanted... no
checking for default port number... 54322
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ANSI C... none needed
checking if cc supports -Wdeclaration-after-statement... no
checking if cc supports -Wendif-labels... yes
checking if cc supports -fno-strict-aliasing... yes
configure: using CFLAGS=-O2 -g -pipe -Wall -Wmissing-prototypes -Wpointer-arith -Winline -Wendif-labels -fno-strict-aliasing

--
It's odd, and a little unsettling, to reflect upon the fact that
English is the only major language in which "I" is capitalized; in many
other languages "You" is capitalized and the "i" is lower case.
-- Sydney J. Harris

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Jeremy Drake (#1)
Re: beta3 CFLAGS issue on openbsd

Jeremy Drake <pgsql@jdrake.com> writes:

I figured out that the -g flag was being surreptitiously added to my
CFLAGS. It was like pulling teeth trying to get the -g flag out.

I believe that this is a default behavior of autoconf scripts.
I remember having done some ugly hacks years ago to prevent an autoconf
configure script from adding -g by default to libjpeg builds... and
the argument for not having -g has gotten ever weaker since then,
so I really doubt you'll get far complaining to the autoconf maintainers
about it.

regards, tom lane

#3Peter Eisentraut
peter_e@gmx.net
In reply to: Jeremy Drake (#1)
Re: beta3 CFLAGS issue on openbsd

Am Freitag, 10. November 2006 08:29 schrieb Jeremy Drake:

I figured out that the -g flag was being surreptitiously added to my
CFLAGS. It was like pulling teeth trying to get the -g flag out. I tried
--disable-debug to configure, which did not work. I had to do
CFLAGS=-O2 ./configure ...

Apparently you have some CFLAGS setting in your environment.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/