summaryrefslogtreecommitdiff
path: root/etc/patches/gcc-4.7.4/reproducibility/0001-strip-build-directory-from-fixinclues.patch
blob: 885c7d0b8cc4c6a98896603cdb93f7c2055a02b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From 95563f6ef2366acb57557c11b8301d468a87e04f Mon Sep 17 00:00:00 2001
From: Oliver Reiche <oliver.reiche@huawei.com>
Date: Fri, 18 Aug 2023 14:36:57 +0200
Subject: [PATCH 1/2] Strip build directory from fixinclues

... to achieve a reproducible binary, which contains the
configure string. For this to work, the user needs to set
"BUILD_ROOT_DIR" before building.
---
 fixincludes/configure | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fixincludes/configure b/fixincludes/configure
index 4a28cd1f3..45fdab2be 100755
--- a/fixincludes/configure
+++ b/fixincludes/configure
@@ -6236,6 +6236,9 @@ cat >"$tmp/defines.awk" <<\_ACAWK ||
 BEGIN {
 _ACEOF
 
+# Remove host machine's build path from confdefs.h
+sed -i 's|'${BUILD_ROOT_DIR:-/nonexistent}'|/build|g' confdefs.h
+
 # Transform confdefs.h into an awk script `defines.awk', embedded as
 # here-document in config.status, that substitutes the proper values into
 # config.h.in to produce config.h.
-- 
2.30.2