Обсуждение: CFLAGS and configure options

Поиск
Список
Период
Сортировка

CFLAGS and configure options

От
Martín Marqués
Дата:
Hi all,

I've just joined this list and wanted to salute you all, and just say
that I've been from now and then working on RH systems for many years
(IIRC, since Red Hat Linux 5.0 in the late nineties), I have built
rpms in the past but just for internal use.

So, now I'm building some PostgreSQL rpms and was going through the
different parameters (and checking on what options they set to
configure), and I see that --debug is only used when beta is 1.

I'd actually expect --debug and --cassert to be separated with 2
distinct rpm parameters, some thing like:

* debug 1 to get only --debug
* beta 1 to get --debug and --cassert

Is there a reason why rpms are not built with --debug as a default
configure option?

Cheers,

--
Martín Marqués http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


Re: CFLAGS and configure options

От
Pavel Raiskup
Дата:
Hello Martín,

On Thursday, March 06, 2014 10:00:48 Martín Marqués wrote:
> So, now I'm building some PostgreSQL rpms and was going through the
> different parameters (and checking on what options they set to
> configure), and I see that --debug is only used when beta is 1.
>
> I'd actually expect --debug and --cassert to be separated with 2
> distinct rpm parameters, some thing like:
>
> * debug 1 to get only --debug
> * beta 1 to get --debug and --cassert
>
> Is there a reason why rpms are not built with --debug as a default
> configure option?

I'm not the correct person to answer why it is like that (the %beta part
of *spec file is quite old).  But at least in Fedora/RHEL we build with
debugging information by default (we are passing the -g option to gcc via
CFLAGS).  This may be pretty likely historic leftover nobody cared of
until now.

As a workaround, you may use 'export CFLAGS="$CFLAGS -g"' before you'll
rpmbuild, or so.

Pavel



Re: CFLAGS and configure options

От
Martín Marqués
Дата:
Hi Pavel,

2014-03-07 6:44 GMT-03:00 Pavel Raiskup <praiskup@redhat.com>:
>
> I'm not the correct person to answer why it is like that (the %beta part
> of *spec file is quite old).  But at least in Fedora/RHEL we build with
> debugging information by default (we are passing the -g option to gcc via
> CFLAGS).  This may be pretty likely historic leftover nobody cared of
> until now.

Yes, that's correct, it is using -g in CFLAGS, just got curious when I
compared configure options with the debian build.

> As a workaround, you may use 'export CFLAGS="$CFLAGS -g"' before you'll
> rpmbuild, or so.

I'm actually adding -fno-omit-frame-pointer to CFLAGS so in case we
need it, we can get hierarchical perf reports without having to
recompile/install/restart.

Cheers,

--
Martín Marqués http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services