Use CXXFLAGS instead of CFLAGS for linking C++ code
authorPeter Eisentraut <[email protected]>
Sun, 4 Aug 2024 09:17:46 +0000 (11:17 +0200)
committerPeter Eisentraut <[email protected]>
Sun, 4 Aug 2024 09:17:46 +0000 (11:17 +0200)
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.

Reported-by: Tom Lane <[email protected]>
Discussion: https://www.postgresql.org/message-id/228700.1722717983@sss.pgh.pa.us

src/backend/jit/llvm/Makefile

index 0036c4f55209c6e16735f337b1e3bd112046e2de..bfe5c207a2ba9074f8e8ad6700a5f83b227d7585 100644 (file)
@@ -37,7 +37,7 @@ SHLIB_LINK += $(LLVM_LIBS)
 # Because this module includes C++ files, we need to use a C++
 # compiler for linking. Makefile.shlib uses $(COMPILER) to build
 # loadable modules.
-override COMPILER = $(CXX) $(CFLAGS)
+override COMPILER = $(CXX) $(CXXFLAGS)
 
 OBJS = \
    $(WIN32RES)