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

Different build paths trigger reproducibility issues with binaries such
as /usr/bin/BAGEL and relevent debugging symbols.

The attached patch fixes this by passing -ffile-prefix-map to CXXFLAGS
to avoid embedding the build path into the binaries.

Another possibility would be to use dpkg-buildflags, which includes this
flag by default.


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


Thanks for maintaining bagel!


live well,
  vagrant
From e7c8200cb457d886a634f383623d693a961b1a06 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@reproducible-builds.org>
Date: Wed, 19 Jan 2022 16:04:53 +0000
Subject: [PATCH] debian/rules: Pass -ffile-prefix-map in CXXFLAGS.

The -ffile-prefix-map argument is used to avoid embedding the build
path in binaries, which allows for reproducible builds regardless of
the build path in the build environment.
---
 debian/rules | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/rules b/debian/rules
index 62d1d08..b6e0afa 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,7 +3,7 @@
 
 export LIBS=-lblas -llapack -lpthread
 
-export CXXFLAGS=-g1 -O2 -DNDEBUG -DZDOT_RETURN
+export CXXFLAGS=-g1 -O2 -DNDEBUG -DZDOT_RETURN -ffile-prefix-map=$(CURDIR)=.
 
 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 B_LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)
-- 
2.34.1

Attachment: signature.asc
Description: PGP signature

Reply via email to