Source: wcc
Severity: normal
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: timestamps
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

The build path is embedded in various binaries:

  
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/diffoscope-results/wcc.html

  /usr/bin/wcc

  /build/1st/wcc-0.0.2+dfsg/src/wcc/wcc.c:3989
  vs.
  /build/2/wcc-0.0.2+dfsg/2nd/src/wcc/wcc.c:3989

The attached patches fix this by appending EXTRA_CFLAGS to CFLAGS in the
upstream Makefile, and the second patch passes CFLAGS via EXTRA_CFLAGS
in debian/rules. The Default CFLAGS include -ffile-prefix-map to avoid
embedding the build path.

According to my local tests, with these patches applied, wcc should
build reproducibly on tests.reproducible-builds.org!

Thanks for maintaining wcc!

live well,
  vagrant
From 1490de0c3bcb0a088c013b390d267cb0763e202a Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@reproducible-builds.org>
Date: Tue, 27 Jun 2023 13:40:18 -0700
Subject: [PATCH 1/2] Makefile: Append CFLAGS_EXTRA to CFLAGS.

---
 Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Makefile b/Makefile
index 55e2d3f..306d129 100644
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,7 @@
 #
 
 CFLAGS := -W -Wall -Wno-discarded-qualifiers -Wno-int-conversion -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -fpie -pie -fPIC -g3 -ggdb -I../../include  -I./include/sflib/ -I./include -I../../include/  -Wno-incompatible-pointer-types  -fstack-protector-all -Wl,-z,relro,-z,now -DPACKAGE -DPACKAGE_VERSION -masm=intel -rdynamic -D_fORTIFY_SOURCE=2 -O2
+CFLAGS += $(CFLAGS_EXTRA)
 
 all:
 	mkdir -p bin
-- 
2.39.2

From 4b0d7aa287e7a324fbea6a05d8db9b673e0efb7c Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@reproducible-builds.org>
Date: Tue, 27 Jun 2023 13:41:41 -0700
Subject: [PATCH 2/2] debian/rules: Pass CFLAGS via CFLAGS_EXTRA in
 dh_auto_build.

---
 debian/rules | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/debian/rules b/debian/rules
index 80f6c6d..b6d5cb6 100755
--- a/debian/rules
+++ b/debian/rules
@@ -9,6 +9,9 @@ override_dh_fixperms:
 	chmod 644 debian/wcc/usr/share/wcc/scripts/debug
 	dh_fixperms
 
+override_dh_auto_build:
+	CFLAGS_EXTRA="$(CFLAGS)" dh_auto_build
+
 %:
 	dh $@
 
-- 
2.39.2

Attachment: signature.asc
Description: PGP signature

Reply via email to