Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gMW79-00016d-Ai for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Nov 2018 10:40:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gMW76-0006US-QR for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Nov 2018 10:40:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gMW76-0006UL-JF for pgsql-hackers@lists.postgresql.org; Tue, 13 Nov 2018 10:40:08 +0000 Received: from gauss.credativ.com ([93.94.130.89]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gMW74-00011M-Ro for pgsql-hackers@postgresql.org; Tue, 13 Nov 2018 10:40:08 +0000 Received: from gauss.credativ.com (localhost [127.0.0.1]) by gauss.credativ.com (Postfix) with ESMTP id 76BD31E385E; Tue, 13 Nov 2018 11:40:05 +0100 (CET) Received: from msg.credativ.de (fw-front.credativ.com [62.154.226.94]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: cbe@gauss.credativ.com) by gauss.credativ.com (Postfix) with ESMTPSA id 5E03F1E29D1 for ; Tue, 13 Nov 2018 11:40:05 +0100 (CET) Date: Tue, 13 Nov 2018 11:40:05 +0100 From: Christoph Berg To: PostgreSQL Hackers Subject: [PATCH] Pass COPT and PROFILE to CXXFLAGS as well Message-ID: <20181113104005.GA32154@msg.credativ.de> Mail-Followup-To: Christoph Berg , PostgreSQL Hackers MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="PEIAKu/WMn1b1Hv9" Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --PEIAKu/WMn1b1Hv9 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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 --PEIAKu/WMn1b1Hv9 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-Pass-COPT-and-PROFILE-to-CXXFLAGS-as-well.patch" From 1c9a12d24169edb5343df28036adbf1d09a9ab2c Mon Sep 17 00:00:00 2001 From: Christoph Berg 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 --PEIAKu/WMn1b1Hv9--