Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package mingw32-binutils for 
openSUSE:Factory checked in at 2023-10-08 12:18:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/mingw32-binutils (Old)
 and      /work/SRC/openSUSE:Factory/.mingw32-binutils.new.28202 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "mingw32-binutils"

Sun Oct  8 12:18:41 2023 rev:8 rq:1116193 version:2.39

Changes:
--------
--- /work/SRC/openSUSE:Factory/mingw32-binutils/mingw32-binutils.changes        
2022-09-13 15:11:08.376938302 +0200
+++ 
/work/SRC/openSUSE:Factory/.mingw32-binutils.new.28202/mingw32-binutils.changes 
    2023-10-08 12:22:11.142500061 +0200
@@ -1,0 +2,5 @@
+Fri Oct  6 12:11:03 UTC 2023 - Bernhard Wiedemann <bwiedem...@suse.com>
+
+- Add reproducible.patch to override build date (boo#1047218)
+
+-------------------------------------------------------------------
mingw32-cross-binutils.changes: same change

New:
----
  reproducible.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ mingw32-binutils.spec ++++++
--- /var/tmp/diff_new_pack.DUOlVA/_old  2023-10-08 12:22:13.194573841 +0200
+++ /var/tmp/diff_new_pack.DUOlVA/_new  2023-10-08 12:22:13.198573985 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package mingw32-binutils
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -30,6 +30,7 @@
 Patch0:         0001-PR29362-some-binutils-memory-leaks.patch
 Patch1:         0001-Fix-bug-not-showing-correct-path-with-objdump-WL-wit.patch
 Patch2:         0001-dllwrap-windres-and-dlltools-use-mktemp-which-should.patch
+Patch3:         reproducible.patch
 #!BuildIgnore: post-build-checks
 BuildRequires:  bison
 BuildRequires:  flex

++++++ mingw32-cross-binutils.spec ++++++
--- /var/tmp/diff_new_pack.DUOlVA/_old  2023-10-08 12:22:13.330578731 +0200
+++ /var/tmp/diff_new_pack.DUOlVA/_new  2023-10-08 12:22:13.342579163 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package mingw32-cross-binutils
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -29,6 +29,7 @@
 Patch0:         0001-PR29362-some-binutils-memory-leaks.patch
 Patch1:         0001-Fix-bug-not-showing-correct-path-with-objdump-WL-wit.patch
 Patch2:         0001-dllwrap-windres-and-dlltools-use-mktemp-which-should.patch
+Patch3:         reproducible.patch
 #!BuildIgnore:  post-build-checks
 #!BuildIgnore:  mingw32-cross-binutils-utils
 #!BuildIgnore:  mingw32-cross-pkgconf-utils

++++++ reproducible.patch ++++++
>From bdbdaf4f9dace4ba60cb3debe9afc876a6567ffa Mon Sep 17 00:00:00 2001
From: Johannes Schauer Marin Rodrigues <jo...@mister-muffin.de>
Date: Thu, 20 Jul 2023 07:11:44 +0200
Subject: [PATCH] bfd/peXXigen.c: respect SOURCE_DATE_EPOCH environment
 variable

Instead of obtaining the current time via time(0), use the seconds since
Unix epoch stored in the SOURCE_DATE_EPOCH environment variable to
create a reproducible timestamp.

Signed-off-by: Johannes Schauer Marin Rodrigues <jo...@mister-muffin.de>
---
 bfd/peXXigen.c             | 11 ++++++++++-
 binutils/doc/binutils.texi |  4 ++++
 ld/ld.texi                 |  5 ++++-
 ld/pe-dll.c                | 11 ++++++++++-
 4 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
index da53f349dd0..7a5e5961162 100644
--- a/bfd/peXXigen.c
+++ b/bfd/peXXigen.c
@@ -838,7 +838,16 @@ _bfd_XXi_only_swap_filehdr_out (bfd * abfd, void * in, 
void * out)
   /* Use a real timestamp by default, unless the no-insert-timestamp
      option was chosen.  */
   if ((pe_data (abfd)->timestamp) == -1)
-    H_PUT_32 (abfd, time (0), filehdr_out->f_timdat);
+    {
+      time_t now;
+      char *source_date_epoch;
+      source_date_epoch = getenv("SOURCE_DATE_EPOCH");
+      if (source_date_epoch)
+       now = (time_t)strtoll(source_date_epoch, NULL, 10);
+      else
+       now = time(NULL);
+      H_PUT_32 (abfd, now, filehdr_out->f_timdat);
+    }
   else
     H_PUT_32 (abfd, pe_data (abfd)->timestamp, filehdr_out->f_timdat);
 
diff --git a/ld/ld.texi b/ld/ld.texi
index 75e82eda004..02ace7778d9 100644
--- a/ld/ld.texi
+++ b/ld/ld.texi
@@ -3569,7 +3569,10 @@ will result in slightly different images being produced 
each time the
 same sources are linked.  The option @option{--no-insert-timestamp}
 can be used to insert a zero value for the timestamp, this ensuring
 that binaries produced from identical sources will compare
-identically.
+identically. Instead of inserting a zero value for the timestamp,
+an arbitrary reproducible timestamp can be inserted by setting the
+@code{SOURCE_DATE_EPOCH} environment variable to the desired number of
+seconds since Unix epoch.
 
 @kindex --enable-reloc-section
 @item --enable-reloc-section
diff --git a/ld/pe-dll.c b/ld/pe-dll.c
index 02e03d16948..e1465d4d115 100644
--- a/ld/pe-dll.c
+++ b/ld/pe-dll.c
@@ -1231,7 +1231,16 @@ fill_edata (bfd *abfd, struct bfd_link_info *info 
ATTRIBUTE_UNUSED)
   memset (edata_d, 0, edata_sz);
 
   if (pe_data (abfd)->timestamp == -1)
-    H_PUT_32 (abfd, time (0), edata_d + 4);
+    {
+      time_t now;
+      char *source_date_epoch;
+      source_date_epoch = getenv("SOURCE_DATE_EPOCH");
+      if (source_date_epoch)
+       now = (time_t)strtoll(source_date_epoch, NULL, 10);
+      else
+       now = time(NULL);
+      H_PUT_32 (abfd, now, edata_d + 4);
+    }
   else
     H_PUT_32 (abfd, pe_data (abfd)->timestamp, edata_d + 4);
 
-- 
2.40.0

Reply via email to