Re: [PATCH] Pass COPT and PROFILE to CXXFLAGS as well

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Christoph Berg <christoph(dot)berg(at)credativ(dot)de>, Andres Freund <andres(at)anarazel(dot)de>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Pass COPT and PROFILE to CXXFLAGS as well
Date: 2019-01-31 02:19:11
Message-ID: 20190131021911.GG16781@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 30, 2019 at 08:18:31PM -0500, Tom Lane wrote:
> This looks a bit copy-and-paste-y to me, in particular no thought
> has been taken for the order of flags. We found in configure that
> it's better to add user-specified CFLAGS at the *end*, even though
> injecting user-specified CPPFLAGS at the beginning is the right
> thing. This is because in, eg, "-O2 -O0" the last flag wins.
> Presumably the same goes for CXXFLAGS. I think it's right to
> put user LDFLAGS first, though. (The argument for CPPFLAGS and
> LDFLAGS is that you want the user's -I and -L flags to go first.)

Ah yes, good point about CFLAGS and LDFLAGS. It would be better to
add a comment about that and document the difference, aka "prepend" or
"append" the flag values.

CXXFLAGS applies to compiler options like -g -O2 which you would like
to enforce for the C++ compiler, so it seems to me that like CFLAGS
the custom values should be added at the end and not at the beginning,
no?
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bossart, Nathan 2019-01-31 02:28:05 Re: A few new options for vacuumdb
Previous Message Michael Paquier 2019-01-31 02:03:35 Re: A few new options for vacuumdb