[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1011479: fstrcmp: reproducible-builds: embedded build paths



Source: fstrcmp
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 debug symbols:

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

  ./usr/lib/debug/usr/bin/fstrcmp

  0»      (line_strp)»   (offset:·0x0):·/build/1st/fstrcmp-0.7.D001
  vs.
  0»      (line_strp)»   (offset:·0xf):·/build/2/fstrcmp-0.7.D001/2nd

The attached patch fixes this by setting -ffile-prefix-map in CFLAGS in
debian/rules, which avoids embedding the absolute build path.


Alternately, switching to use a newer debhelper compat level and the dh
build system would likely also fix this, as it includes -ffile-prefix-map
by default.


With this patch applied, fstrcmp should build reproducibly on
tests.reproducible-builds.org!


live well,
  vagrant
From 2427b3099e9ab739f9a9e6e1395fb978fd394e62 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Mon, 23 May 2022 19:36:47 +0000
Subject: [PATCH] debian/rules: Pass -ffile-prefix-map via CFLAGS.

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

diff --git a/debian/rules b/debian/rules
index 9c76c56..9ffe622 100755
--- a/debian/rules
+++ b/debian/rules
@@ -10,6 +10,9 @@ else
 CFLAGS += -O2
 endif
 
+# Avoid embedding the build path
+CFLAGS += -ffile-prefix-map=$(CURDIR)=.
+
 config.status: configure
 	dh_testdir
 	dh_autotools-dev_updateconfig
-- 
2.36.1

Attachment: signature.asc
Description: PGP signature


Reply to: