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

Bug#1024126: hunt: reproducible-builds: build path embedded in various binaries



Source: hunt
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/hunt.html

  /usr/sbin/hunt

  /build/1st/hunt-1.5/main.c:461
  vs.
  /build/2/hunt-1.5/2nd/main.c:461

The attached patch to upstream Makefiles fixes this by adding the
-ffile-prefix-map argument to CFLAGS, which avoids embedding the full
build path.

According to my local tests, with this patch applied hunt should build
reproducibly on tests.reproducible-builds.org!

Thanks for maintaining hunt!

live well,
  vagrant
From 928b51d50a0d756ef3ca77a42c6e9df5b8a8341e Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Tue, 15 Nov 2022 02:34:43 +0000
Subject: [PATCH] Makefile, tpserv/Makefile: Add -ffile-prefix-map to CFLAGS to
 avoid embedding build paths.

https://reproducible-builds.org/docs/build-path/
---
 Makefile        | 2 +-
 tpserv/Makefile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 1631984..98b5af1 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-CFLAGS=-Wall -O2 -g -D_REENTRANT -std=gnu89
+CFLAGS=-Wall -O2 -g -D_REENTRANT -std=gnu89 -ffile-prefix-map=$(CURDIR)=.
 #CFLAGS+=-DSYNC_FAST
 #CFLAGS+=-D_WITH_LINUX_KERNEL_HDR
 
diff --git a/tpserv/Makefile b/tpserv/Makefile
index a24cf4c..751be46 100644
--- a/tpserv/Makefile
+++ b/tpserv/Makefile
@@ -1,4 +1,4 @@
-CFLAGS=-Wall -O2 -g
+CFLAGS=-Wall -O2 -g -ffile-prefix-map=$(CURDIR)=.
 
 all: tpserv
 
-- 
2.38.1

Attachment: signature.asc
Description: PGP signature


Reply to: