pgsql: Use CXXFLAGS instead of CFLAGS for linking C++ code

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Use CXXFLAGS instead of CFLAGS for linking C++ code
Date: 2026-02-26 17:07:15
Message-ID: E1vvepX-001HNA-2y@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Use CXXFLAGS instead of CFLAGS for linking C++ code

Otherwise, this would break if using C and C++ compilers from
different families and they understand different options. It already
used the right flags for compiling, this is only for linking. Also,
the meson setup already did this correctly.

Back-patch of v18 commit 365b5a345 into older supported branches.
At the time we were only aware of trouble in v18, but as shown
by buildfarm member siren, older branches can hit the problem too.

Reported-by: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Author: Peter Eisentraut <peter(at)eisentraut(dot)org>
Discussion: https://www.postgresql.org/message-id/228700.1722717983@sss.pgh.pa.us
Discussion: https://postgr.es/m/3109540.1771698685@sss.pgh.pa.us
Backpatch-through: 14-17

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/41d75b9a4a1c7f84bafd331428c005e5743bac3d

Modified Files
--------------
src/backend/jit/llvm/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2026-02-26 17:27:00 pgsql: Fix Solution.pm for change in pg_config.h contents.
Previous Message Álvaro Herrera 2026-02-26 17:06:34 pgsql: Don't include latch.h in libpq/libpq.h