While working on making extension modules built reproducibly, I
noticed that extra flags passed via COPT (notably -ffile-prefix-map)
do not get added to CXXFLAGS.

This causes postgresql-hll to still store the full build path in the
.so file built: 
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/diffoscope-results/postgresql-hll.html

Christoph
-- 
Senior Berater, Tel.: +49 2166 9901 187
credativ GmbH, HRB Mönchengladbach 12080, USt-ID-Nummer: DE204566209
Trompeterallee 108, 41189 Mönchengladbach
Geschäftsführung: Dr. Michael Meskes, Jörg Folz, Sascha Heuer
Unser Umgang mit personenbezogenen Daten unterliegt
folgenden Bestimmungen: https://www.credativ.de/datenschutz
>From 1c9a12d24169edb5343df28036adbf1d09a9ab2c Mon Sep 17 00:00:00 2001
From: Christoph Berg <christoph.b...@credativ.de>
Date: Tue, 13 Nov 2018 11:35:26 +0100
Subject: [PATCH] Pass COPT and PROFILE to CXXFLAGS as well

The existing machinery for extending CFLAGS and LDFLAGS via COPT and
PROFILE neglected to extend CXXFLAGS as well, causing third party
extensions written in C++ not to get the extra flags.
---
 src/Makefile.global.in | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index 956fd274cd..5e7eb550cc 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -671,11 +671,13 @@ endif
 #
 ifdef COPT
    CFLAGS += $(COPT)
+   CXXFLAGS += $(COPT)
    LDFLAGS += $(COPT)
 endif
 
 ifdef PROFILE
    CFLAGS += $(PROFILE)
+   CXXFLAGS += $(PROFILE)
    LDFLAGS += $(PROFILE)
 endif
 
-- 
2.19.1

Reply via email to