Debian Bug report logs -
#1021464
stfl: reproducible-builds: build path embedded in binaries
Reply or subscribe to this bug.
Toggle useless messages
Report forwarded
to debian-bugs-dist@lists.debian.org, reproducible-bugs@lists.alioth.debian.org, Debian QA Group <packages@qa.debian.org>:
Bug#1021464; Package src:stfl.
(Sun, 09 Oct 2022 00:03:03 GMT) (full text, mbox, link).
Acknowledgement sent
to Vagrant Cascadian <vagrant@reproducible-builds.org>:
New Bug report received and forwarded. Copy sent to reproducible-bugs@lists.alioth.debian.org, Debian QA Group <packages@qa.debian.org>.
(Sun, 09 Oct 2022 00:03:03 GMT) (full text, mbox, link).
Message #5 received at submit@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
Source: stfl
Severity: normal
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: buildpath
X-Debbugs-Cc: reproducible-bugs@lists.alioth.debian.org
The build path is embedded in various binaries:
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/diffoscope-results/stfl.html
/usr/lib/x86_64-linux-gnu/perl5/5.34/auto/stfl/stfl.so
/build/1st/stfl-0.22/public.c:401
vs.
/build/2/stfl-0.22/2nd/public.c:401
The attached three patches to debian/rules fix this by adjusting the
make call to use dh_auto_make and passing CFLAGS via the CC variable,
adds -ffile-prefix-map to CFLAGS, and patches the generated
perl5/Makefile to add -ffile-prefix-map to CCFLAGS.
According to my local tests, with these patches applied, stfl should
build reproducibly on tests.reproducible-builds.org!
Thanks for maintaining stfl!
live well,
vagrant
[0001-debian-rules-Use-dh_auto_build-and-pass-CFLAGS-via-C.patch (text/x-diff, inline)]
From c3082dcef861f562cf07ce389566766a2275688a Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Sat, 8 Oct 2022 23:42:42 +0000
Subject: [PATCH 1/3] debian/rules: Use dh_auto_build and pass CFLAGS via CC
variable.
---
debian/rules | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/debian/rules b/debian/rules
index 702e49f..d7967f9 100755
--- a/debian/rules
+++ b/debian/rules
@@ -16,7 +16,7 @@ build-indep: build-stamp
build-stamp:
dh_testdir
- $(MAKE) $(MAKE_FOUND_INTERPR)
+ dh_auto_build -- $(MAKE_FOUND_INTERPR) CC="$(CC) -pthread $(CFLAGS)"
# perl
test ! -f perl5/Makefile || $(MAKE) -C perl5 clean
cd perl5 && swig -perl5 stfl.i && perl Makefile.PL INSTALLDIRS=vendor
--
2.37.2
[0002-debian-rules-Add-ffile-prefix-map-to-CFLAGS-to-avoid.patch (text/x-diff, inline)]
From 196634cef1ad5215457096d78ba4ff585fb58f48 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Sat, 8 Oct 2022 23:43:20 +0000
Subject: [PATCH 2/3] debian/rules: Add -ffile-prefix-map to CFLAGS to avoid
embedding build paths.
https://reproducible-builds.org/docs/build-path/
---
debian/rules | 1 +
1 file changed, 1 insertion(+)
diff --git a/debian/rules b/debian/rules
index d7967f9..a215bdc 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,6 +5,7 @@ MAKE_DESTDIR := $(CURDIR)/debian/tmp
MAKE_FOUND_INTERPR := FOUND_PERL5=0 FOUND_SWIG=1 FOUND_SPL=0 FOUND_RUBY=0 FOUND_PYTHON=0
MAKE_INSTALL_TARGET := DESTDIR=$(MAKE_DESTDIR) prefix=/usr
CFLAGS += -fPIC
+CFLAGS += -ffile-prefix-map=$(CURDIR)=.
include /usr/share/dpkg/architecture.mk
PERL_VERSION := $(shell perl -MConfig -e 'print $$Config{version}')
--
2.37.2
[0003-debian-rules-Add-ffile-prefix-map-to-CCFLAGS-in-perl.patch (text/x-diff, inline)]
From 37b01a1266e36d7202ed293af7efd85a916bce7a Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Sat, 8 Oct 2022 23:51:42 +0000
Subject: [PATCH 3/3] debian/rules: Add -ffile-prefix-map to CCFLAGS in
perl5/Makefile to avoid embedding build paths.
https://reproducible-builds.org/docs/build-path/
---
debian/rules | 2 ++
1 file changed, 2 insertions(+)
diff --git a/debian/rules b/debian/rules
index a215bdc..0682f15 100755
--- a/debian/rules
+++ b/debian/rules
@@ -21,6 +21,8 @@ build-stamp:
# perl
test ! -f perl5/Makefile || $(MAKE) -C perl5 clean
cd perl5 && swig -perl5 stfl.i && perl Makefile.PL INSTALLDIRS=vendor
+ # Avoid embedding build paths
+ sed -i -e 's,CCFLAGS =,CCFLAGS = -ffile-prefix-map=$(CURDIR)=.,g' perl5/Makefile
$(MAKE) -C perl5
# ruby
dh_ruby --build
--
2.37.2
[signature.asc (application/pgp-signature, inline)]
Send a report that this bug log contains spam.
Debian bug tracking system administrator <owner@bugs.debian.org>.
Last modified:
Wed May 17 12:42:53 2023;
Machine Name:
buxtehude
Debian Bug tracking system
Debbugs is free software and licensed under the terms of the GNU
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.
Copyright © 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.