Re: [PATCH] Pass COPT and PROFILE to CXXFLAGS as well - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [PATCH] Pass COPT and PROFILE to CXXFLAGS as well
Date
Msg-id 20190131021911.GG16781@paquier.xyz
Whole thread Raw
In response to Re: [PATCH] Pass COPT and PROFILE to CXXFLAGS as well  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [PATCH] Pass COPT and PROFILE to CXXFLAGS as well  (Michael Paquier <michael@paquier.xyz>)
List 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

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: A few new options for vacuumdb
Next
From: "Bossart, Nathan"
Date:
Subject: Re: A few new options for vacuumdb