Re: Patch - Debug builds without optimization

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Patch - Debug builds without optimization
Дата
Msg-id 8779.1308254421@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Patch - Debug builds without optimization  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: Patch - Debug builds without optimization  (Radosław Smogura <rsmogura@softperience.eu>)
Re: Patch - Debug builds without optimization  (Greg Stark <stark@mit.edu>)
Список pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> I disagree with this change.  Debug builds are very useful to have in
> production, and you don't want to be running -O0 there.  I have found
> that you can use a src/Makefile.custom like this for those times when you
> want to debug stuff in a particular set of files:

> CFLAGS := $(patsubst -O2,-O0,$(CFLAGS))

> Then you remove the .o files that you want to debug, and rerun make.

FWIW, I only use Makefile.custom for more-or-less-permanent changes to
the build behavior of a particular machine.  For one-shot things like
recompiling some particular file(s) at -O0, it's easier to do this:
rm foo.omake PROFILE=-O0reinstall postgres executable

The makefiles automatically add PROFILE at the end of CFLAGS, so you can
inject any compile flag this way --- I think the original intent was to
use it to add -pg for gprof-enabled builds.  But it's handy for this.

BTW, if you're hacking Postgres code and don't already have a
"reinstall" script, you need one.  Mine is basically
pg_ctl stopcd $PGBLDROOT/src/backendmake install-binpg_ctl start
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: flexible array members
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Boolean operators without commutators vs. ALL/ANY