1009931">

Debian Bug report logs - #1009931
gmp: reproducible-builds: Embedded build paths in various files

version graph

Package: src:gmp; Maintainer for src:gmp is Debian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>;

Reported by: Vagrant Cascadian <vagrant@reproducible-builds.org>

Date: Wed, 20 Apr 2022 21:54:02 UTC

Severity: normal

Tags: patch

Fixed in version gmp/2:6.2.1+dfsg1-1.1

Done: Holger Levsen <holger@debian.org>

Bug is archived. No further changes may be made.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, reproducible-bugs@lists.alioth.debian.org, Debian Science Team <debian-science-maintainers@lists.alioth.debian.org>:
Bug#1009931; Package src:gmp. (Wed, 20 Apr 2022 21:54:04 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 Science Team <debian-science-maintainers@lists.alioth.debian.org>. (Wed, 20 Apr 2022 21:54:04 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, vs. > #define·__GMP_CFLAGS·"-g·-O2·-ffile-prefix-map=/build/2/gmp-6.2.1+dfsg/2nd=.·-fstack-..." > > /usr/lib/x86_64-linux-gnu/libgmp.so.10.4.1 > > /build/1st/gmp-6.2.1+dfsg/build/mpn/tmp-add_n.s:97 > vs. > /build/2/gmp-6.2.1+dfsg/2nd/build/mpn/tmp-add_n.s:97 > > The attached patches fix this by replacing the build path with > "BUILDPATH" from in debian/rules, and passing a --debug-prefix-map > argument to use relative paths via ASMFLAGS in configure. > > > With these patches applied gmp should build reproducibly on > tests.reproducible-builds.org! > > > Thanks for maintaining gmp! > > > live well, > vagrant &References=<87v8v32zlb.fsf@contorta>&In-Reply-To=<87v8v32zlb.fsf@contorta>&subject=Re: gmp: reproducible-builds: Embedded build paths in various files">reply):

From: Vagrant Cascadian <vagrant@reproducible-builds.org>
To: submit@bugs.debian.org
Subject: gmp: reproducible-builds: Embedded build paths in various files
Date: Wed, 20 Apr 2022 14:51:12 -0700
[Message part 1 (text/plain, inline)]
Source: gmp
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 files:

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

  /usr/include/x86_64-linux-gnu/gmp.h

  #define·__GMP_CFLAGS·"-g·-O2·-ffile-prefix-map=/build/1st/gmp-6.2.1+dfsg=.·-fstack-..."
  vs.
  #define·__GMP_CFLAGS·"-g·-O2·-ffile-prefix-map=/build/2/gmp-6.2.1+dfsg/2nd=.·-fstack-..."

  /usr/lib/x86_64-linux-gnu/libgmp.so.10.4.1

  /build/1st/gmp-6.2.1+dfsg/build/mpn/tmp-add_n.s:97
  vs.
  /build/2/gmp-6.2.1+dfsg/2nd/build/mpn/tmp-add_n.s:97

The attached patches fix this by replacing the build path with
"BUILDPATH" from in debian/rules, and passing a --debug-prefix-map
argument to use relative paths via ASMFLAGS in configure.


With these patches applied gmp should build reproducibly on
tests.reproducible-builds.org!


Thanks for maintaining gmp!


live well,
  vagrant
[0001-debian-rules-Pass-ASMFLAGS-with-debug-prefix-map-to-.patch (text/x-diff, inline)]
From df942b2fed320e95465625870e8832574a37ab5e Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Wed, 20 Apr 2022 21:33:25 +0000
Subject: [PATCH 1/2] debian/rules: Pass ASMFLAGS with debug-prefix-map to
 configure.

The absolute build path can be embedded in generated assembly
code. Instead, passing --debug-prefix-map is used to adjust the
absolute paths to relative paths within the source code.

https://tests.reproducible-builds.org/debian/issues/build_path_captured_in_assembly_objects_issue.html
---
 debian/rules | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/rules b/debian/rules
index 164d9e3..905d95b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -89,7 +89,7 @@ configure-stamp:
 	mkdir -p build
 	cd build && ../configure $(confflags_ma) \
 	    AR=$(AR) CC="$(CC)" CFLAGS="$(CFLAGS)" \
-	    CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)"
+	    CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)" ASMFLAGS="--debug-prefix-map=$(CURDIR)=."
 	touch $@
 
 build: build-stamp
-- 
2.35.2

[0002-debian-rules-Replace-embedded-build-path-in-gmp.h-wi.patch (text/x-diff, inline)]
From df301d96468c6248f103b6c16270aeb379e3b3fd Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Wed, 20 Apr 2022 21:38:46 +0000
Subject: [PATCH 2/2] debian/rules: Replace embedded build path in gmp.h with a
 placeholder string.

Frequently builds of debian packages are done in a randomized
directory path which is unlikely to be present on the end-user
system.

https://reproducible-builds.org/docs/build-path/
---
 debian/rules | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/debian/rules b/debian/rules
index 905d95b..9304487 100755
--- a/debian/rules
+++ b/debian/rules
@@ -117,6 +117,9 @@ install: build-stamp install-prep
 	# so override it at install.
 	$(MAKE) DESTDIR=`pwd`/debian/tmp includeexecdir=/usr/include/$(DEB_HOST_MULTIARCH) -C build install
 
+	# Replace embedded build path with a placeholder string
+	sed -i -e "s,$(CURDIR),BUILDPATH,g" debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/gmp.h
+
 	dh_install -plibgmp10 usr/lib/*/libgmp.so.*
 	dh_install -plibgmpxx4ldbl usr/lib/*/libgmpxx.so.*
 
-- 
2.35.2

[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Science Team <debian-science-maintainers@lists.alioth.debian.org>:
Bug#1009931; Package src:gmp. (Thu, 22 Sep 2022 20:51:03 GMT) (full text, mbox, link).


Acknowledgement sent to Holger Levsen <holger@layer-acht.org>:
Extra info received and forwarded to list. Copy sent to Debian Science Team <debian-science-maintainers@lists.alioth.debian.org>. (Thu, 22 Sep 2022 20:51:03 GMT) (full text, mbox, link).


Message #10 received at 1009931@bugs.debian.org (full text, mbox, reply):

From: Holger Levsen <holger@layer-acht.org>
To: 1009931@bugs.debian.org
Subject: gmp_6.2.1+dfsg1-1.1.diff
Date: Thu, 22 Sep 2022 20:47:55 +0000
[Message part 1 (text/plain, inline)]
hi,

i've uploaded gmp_6.2.1+dfsg1-1.1 with the attached diff to DELAYED/15.

gmp (2:6.2.1+dfsg1-1.1) unstable; urgency=medium

  * Non-maintainer upload by the Reproducible Builds team.
  * debian/rules changes by Vagrant Cascadian:
    - pass ASMFLAGS with debug-prefix-map to configure.
    - replace embedded build path in gmp.h with a placeholder string.
    Closes: #1009931


-- 
cheers,
	Holger

 ⢀⣴⠾⠻⢶⣦⠀
 ⣾⠁⢠⠒⠀⣿⡁  holger@(debian|reproducible-builds|layer-acht).org
 ⢿⡄⠘⠷⠚⠋⠀  OpenPGP: B8BF54137B09D35CF026FE9D 091AB856069AAA1C
 ⠈⠳⣄

Just 100 companies are responsible for 71% of global emissions.
https://www.theguardian.com/sustainable-business/2017/jul/10/100-fossil-fuel-companies-investors-responsible-71-global-emissions-cdp-study-climate-change
[gmp_6.2.1+dfsg1-1.1.diff (text/x-diff, attachment)]
[signature.asc (application/pgp-signature, inline)]

Added tag(s) pending. Request was from Holger Levsen <holger@layer-acht.org> to control@bugs.debian.org. (Thu, 22 Sep 2022 21:03:04 GMT) (full text, mbox, link).


Reply sent to Holger Levsen <holger@debian.org>:
You have taken responsibility. (Fri, 07 Oct 2022 19:51:06 GMT) (full text, mbox, link).


Notification sent to Vagrant Cascadian <vagrant@reproducible-builds.org>:
Bug acknowledged by developer. (Fri, 07 Oct 2022 19:51:06 GMT) (full text, mbox, link).


Message #17 received at 1009931-close@bugs.debian.org (full text, mbox, reply):

From: Debian FTP Masters <ftpmaster@ftp-master.debian.org>
To: 1009931-close@bugs.debian.org
Subject: Bug#1009931: fixed in gmp 2:6.2.1+dfsg1-1.1
Date: Fri, 07 Oct 2022 19:49:36 +0000
Source: gmp
Source-Version: 2:6.2.1+dfsg1-1.1
Done: Holger Levsen <holger@debian.org>

We believe that the bug you reported is fixed in the latest version of
gmp, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1009931@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Holger Levsen <holger@debian.org> (supplier of updated gmp package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Thu, 22 Sep 2022 20:43:57 +0200
Source: gmp
Architecture: source
Version: 2:6.2.1+dfsg1-1.1
Distribution: unstable
Urgency: medium
Maintainer: Debian Science Team <debian-science-maintainers@lists.alioth.debian.org>
Changed-By: Holger Levsen <holger@debian.org>
Closes: 1009931
Changes:
 gmp (2:6.2.1+dfsg1-1.1) unstable; urgency=medium
 .
   * Non-maintainer upload by the Reproducible Builds team.
   * debian/rules changes by Vagrant Cascadian:
     - pass ASMFLAGS with debug-prefix-map to configure.
     - replace embedded build path in gmp.h with a placeholder string.
     Closes: #1009931
Checksums-Sha1:
 1aa034a4b586256612fcf9c28b4f9f20a3e40d15 2238 gmp_6.2.1+dfsg1-1.1.dsc
 8c8bda6fc99fc20144835d6451664d2db7e6b7c2 19444 gmp_6.2.1+dfsg1-1.1.debian.tar.xz
 9bb13f48d67ea84845c6c214371a54354c4d4197 5910 gmp_6.2.1+dfsg1-1.1_source.buildinfo
Checksums-Sha256:
 2831ed4f83bc3304c2403474b335652ab2dc507cd517de44414d9142171748f0 2238 gmp_6.2.1+dfsg1-1.1.dsc
 4e3e324d72fe688e409c716d33b35aa8657f6016cc1aabd5d9c7ec137412e5ef 19444 gmp_6.2.1+dfsg1-1.1.debian.tar.xz
 353e921d58f564e35d9df92886b34da18f2bf6289783e0c4a6eea8c2fb4e9e9c 5910 gmp_6.2.1+dfsg1-1.1_source.buildinfo
Files:
 2bb7446fb8f884995d77047ab768f255 2238 libs optional gmp_6.2.1+dfsg1-1.1.dsc
 a74973e7c422027b188849d04d698cba 19444 libs optional gmp_6.2.1+dfsg1-1.1.debian.tar.xz
 94a450940b578128f222d0ba0811b20e 5910 libs optional gmp_6.2.1+dfsg1-1.1_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEuL9UE3sJ01zwJv6dCRq4VgaaqhwFAmMsru0ACgkQCRq4Vgaa
qhxgNBAAiLRF+9iZ46Mgk5aSnnfPIWOFrn5aacryRz9rZNvjaGi4AWzHR2t+eYy3
dQmxcNVtFPF3Sfy3kFL+knuBGw2SZSFKHECP64htJb7rSQGRBwULHxLUajlLQVVw
83T1ZYKEAXBc1O1l0VcTkHNpvQrcHxE1/t1suM1BemSNSfWU5wYU4O5BXlcaDJMg
DgDqq2RHtnCtiRHMrcOgxAl7r4eoJyMEJ76/4IYh0oGPUl4vCC7oQwfHX0JxDQny
z9PnfsNM+urj+1IA6V2neVy61XooRi4vQKZzWMCKUEVk4R8RWgipuEksaxmfiUeu
EJaKgMB/tnnms79823j22cV3vy0f3TQOxEg+WJzTVsMu5dSvV+1C8wE3OkMkbTGj
F9FS66Zj8hDbd6/74u1/G0GecWcSgOOj9NqpCTlHgbpaNvdvCVJR1chBQBF6gorK
pHn8J7QsgK3eQkZiUnrGTqOI7P688NgYo0snnoXQJ11MFIBVNAoaumve+EjPCZf5
6Mgaysix5UzZSNfIVDOOCPmcEuohWkZ6G0vubLQdJ+9MHFVfDqrEHto6ZtNg2RTY
5R0YBj8IjMqacahAr7ggHlI6nM3DhjjfgjnTDZI1xNpEe83+9Xf84ClgTlZJAxQT
Y/yHqzIy8EViSFx6qhBDoxmDzI9a9RugtFjunHvHw4KxNqsUoJw=
=GDj+
-----END PGP SIGNATURE-----




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Mon, 07 Nov 2022 07:25:47 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri Jan 31 06:55:26 2025; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General 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.