GNU bug report logs - #40362
[PATCH] gnu: cross-base: Add mingw-w64 specific binutils patches.

Previous Next

Package: guix-patches;

Reported by: Carl Dong <contact <at> carldong.me>

Date: Tue, 31 Mar 2020 22:49:01 UTC

Severity: normal

Tags: patch

Done: Mathieu Othacehe <m.othacehe <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 40362 in the body.
You can then email your comments to 40362 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

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


Report forwarded to guix-patches <at> gnu.org:
bug#40362; Package guix-patches. (Tue, 31 Mar 2020 22:49:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Carl Dong <contact <at> carldong.me>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 31 Mar 2020 22:49:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Carl Dong <contact <at> carldong.me>
To: "guix-patches <at> gnu.org" <guix-patches <at> gnu.org>
Subject: [PATCH] gnu: cross-base: Add mingw-w64 specific binutils patches.
Date: Tue, 31 Mar 2020 22:48:24 +0000
These patches were originally found at the debian mingw-w64 team's
binutils repo, and should improve the reproducibility of our mingw-w64
toolchain.

* gnu/packages/patches/binutils-mingw-w64-reproducible-import-libraries.patch:
New file.
* gnu/packages/patches/binutils-mingw-w64-specify-timestamp.patch:
New file.
* gnu/packages/cross-base.scm (cross-binutils): Apply relevant patches
if target is mingw-w64.
(package-with-extra-patches): New procedure.
---
 gnu/packages/cross-base.scm                   |  21 ++-
 ...gw-w64-reproducible-import-libraries.patch |  22 +++
 ...binutils-mingw-w64-specify-timestamp.patch | 137 ++++++++++++++++++
 3 files changed, 175 insertions(+), 5 deletions(-)
 create mode 100755 gnu/packages/patches/binutils-mingw-w64-reproducible-import-libraries.patch
 create mode 100755 gnu/packages/patches/binutils-mingw-w64-specify-timestamp.patch

diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index ab866eebc6..571a47f72a 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -76,6 +76,12 @@
     (source (origin (inherit (package-source original))
               (patches (list patch))))))

+(define (package-with-extra-patches original patches)
+  "Return package ORIGINAL with all PATCHES appended to its list of patches."
+  (package-with-patch original
+                      `(,@(origin-patches (package-source original))
+                        ,@patches))
+
 (define (cross-binutils target)
   "Return a cross-Binutils for TARGET."
   (let ((binutils (package (inherit binutils)
@@ -97,11 +103,16 @@
                         `(cons "--with-sysroot=/" ,flags)))))))

     ;; For Xtensa, apply Qualcomm's patch.
-    (cross (if (string-prefix? "xtensa-" target)
-               (package-with-patch binutils
-                                   (search-patch
-                                    "ath9k-htc-firmware-binutils.patch"))
-               binutils)
+    (cross (cond ((string-prefix? "xtensa-" target)
+                  (package-with-patch binutils
+                                      (search-patch
+                                       "ath9k-htc-firmware-binutils.patch")))
+                 ((target-mingw? target)
+                  (package-with-extra-patches binutils
+                                              (search-patches
+                                               "binutils-mingw-w64-specify-timestamp.patch"
+                                               "binutils-mingw-w64-reproducible-import-libraries.patch")))
+                 (else binutils))
            target)))

 (define (cross-gcc-arguments target xgcc libc)
diff --git a/gnu/packages/patches/binutils-mingw-w64-reproducible-import-libraries.patch b/gnu/packages/patches/binutils-mingw-w64-reproducible-import-libraries.patch
new file mode 100755
index 0000000000..3e48b87935
--- /dev/null
+++ b/gnu/packages/patches/binutils-mingw-w64-reproducible-import-libraries.patch
@@ -0,0 +1,22 @@
+This following patch was originally found at the debian mingw-w64 team's
+binutils repo located here:
+https://salsa.debian.org/mingw-w64-team/binutils-mingw-w64.git
+
+Invoke the following in the aforementioned repo to see the original patch:
+
+  $ git show da63f6b:debian/patches/reproducible-import-libraries.patch
+
+Description: Make DLL import libraries reproducible
+Author: Benjamin Moody <benjamin.moody <at> gmail.com>
+Bug-Debian: https://bugs.debian.org/915055
+
+--- a/ld/pe-dll.c
++++ b/ld/pe-dll.c
+@@ -2844,6 +2844,7 @@
+
+   bfd_set_format (outarch, bfd_archive);
+   outarch->has_armap = 1;
++  outarch->flags |= BFD_DETERMINISTIC_OUTPUT;
+
+   /* Work out a reasonable size of things to put onto one line.  */
+   ar_head = make_head (outarch);
diff --git a/gnu/packages/patches/binutils-mingw-w64-specify-timestamp.patch b/gnu/packages/patches/binutils-mingw-w64-specify-timestamp.patch
new file mode 100755
index 0000000000..b785043b62
--- /dev/null
+++ b/gnu/packages/patches/binutils-mingw-w64-specify-timestamp.patch
@@ -0,0 +1,137 @@
+This following patch was originally found at the debian mingw-w64 team's
+binutils repo located here:
+https://salsa.debian.org/mingw-w64-team/binutils-mingw-w64.git
+
+Invoke the following in the aforementioned repo to see the original patch:
+
+  $ git show da63f6b:debian/patches/specify-timestamp.patch
+
+Description: Allow the PE timestamp to be specified
+Author: Stephen Kitt <skitt <at> debian.org>
+
+--- a/bfd/peXXigen.c
++++ b/bfd/peXXigen.c
+@@ -70,6 +70,9 @@
+ #include <wctype.h>
+ #endif
+
++#include <errno.h>
++#include <limits.h>
++
+ /* NOTE: it's strange to be including an architecture specific header
+    in what's supposed to be general (to PE/PEI) code.  However, that's
+    where the definitions are, and they don't vary per architecture
+@@ -879,10 +882,38 @@
+
+   /* Use a real timestamp by default, unless the no-insert-timestamp
+      option was chosen.  */
+-  if ((pe_data (abfd)->insert_timestamp))
+-    H_PUT_32 (abfd, time (0), filehdr_out->f_timdat);
+-  else
++  if (pe_data (abfd)->insert_timestamp) {
++    time_t now;
++    char *source_date_epoch;
++    unsigned long long epoch;
++    char *endptr;
++
++    now = time(NULL);
++    source_date_epoch = getenv("SOURCE_DATE_EPOCH");
++    if (source_date_epoch) {
++      errno = 0;
++      epoch = strtoull(source_date_epoch, &endptr, 10);
++      if ((errno == ERANGE && (epoch == ULLONG_MAX || epoch == 0))
++          || (errno != 0 && epoch == 0)) {
++        _bfd_error_handler("Environment variable $SOURCE_DATE_EPOCH: strtoull: %s\n",
++                           strerror(errno));
++      } else if (endptr == source_date_epoch) {
++        _bfd_error_handler("Environment variable $SOURCE_DATE_EPOCH: No digits were found: %s\n",
++                           endptr);
++      } else if (*endptr != '\0') {
++        _bfd_error_handler("Environment variable $SOURCE_DATE_EPOCH: Trailing garbage: %s\n",
++                           endptr);
++      } else if (epoch > ULONG_MAX) {
++        _bfd_error_handler("Environment variable $SOURCE_DATE_EPOCH: value must be smaller than or equal to: %lu but was found to be: %llu\n",
++                           ULONG_MAX, epoch);
++      } else {
++        now = epoch;
++      }
++    }
++    H_PUT_32 (abfd, now, filehdr_out->f_timdat);
++  } else {
+     H_PUT_32 (abfd, 0, filehdr_out->f_timdat);
++  }
+
+   PUT_FILEHDR_SYMPTR (abfd, filehdr_in->f_symptr,
+ 		      filehdr_out->f_symptr);
+--- a/ld/pe-dll.c
++++ b/ld/pe-dll.c
+@@ -26,6 +26,8 @@
+ #include "filenames.h"
+ #include "safe-ctype.h"
+
++#include <errno.h>
++#include <limits.h>
+ #include <time.h>
+
+ #include "ld.h"
+@@ -1202,8 +1204,36 @@
+
+   memset (edata_d, 0, edata_sz);
+
+-  if (pe_data (abfd)->insert_timestamp)
+-    H_PUT_32 (abfd, time (0), edata_d + 4);
++  if (pe_data (abfd)->insert_timestamp) {
++    time_t now;
++    char *source_date_epoch;
++    unsigned long long epoch;
++    char *endptr;
++
++    now = time(NULL);
++    source_date_epoch = getenv("SOURCE_DATE_EPOCH");
++    if (source_date_epoch) {
++      errno = 0;
++      epoch = strtoull(source_date_epoch, &endptr, 10);
++      if ((errno == ERANGE && (epoch == ULLONG_MAX || epoch == 0))
++	  || (errno != 0 && epoch == 0)) {
++	einfo("Environment variable $SOURCE_DATE_EPOCH: strtoull: %s\n",
++	      strerror(errno));
++      } else if (endptr == source_date_epoch) {
++	einfo("Environment variable $SOURCE_DATE_EPOCH: No digits were found: %s\n",
++	      endptr);
++      } else if (*endptr != '\0') {
++	einfo("Environment variable $SOURCE_DATE_EPOCH: Trailing garbage: %s\n",
++	      endptr);
++      } else if (epoch > ULONG_MAX) {
++	einfo("Environment variable $SOURCE_DATE_EPOCH: value must be smaller than or equal to: %lu but was found to be: %llu\n",
++	      ULONG_MAX, epoch);
++      } else {
++	now = epoch;
++      }
++    }
++    H_PUT_32 (abfd, now, edata_d + 4);
++  }
+
+   if (pe_def_file->version_major != -1)
+     {
+--- a/ld/emultempl/pe.em
++++ b/ld/emultempl/pe.em
+@@ -303,7 +303,7 @@
+      OPTION_USE_NUL_PREFIXED_IMPORT_TABLES},
+     {"no-leading-underscore", no_argument, NULL, OPTION_NO_LEADING_UNDERSCORE},
+     {"leading-underscore", no_argument, NULL, OPTION_LEADING_UNDERSCORE},
+-    {"insert-timestamp", no_argument, NULL, OPTION_INSERT_TIMESTAMP},
++    {"insert-timestamp", optional_argument, NULL, OPTION_INSERT_TIMESTAMP},
+     {"no-insert-timestamp", no_argument, NULL, OPTION_NO_INSERT_TIMESTAMP},
+ #ifdef DLL_SUPPORT
+     /* getopt allows abbreviations, so we do this to stop it
+--- a/ld/emultempl/pep.em
++++ b/ld/emultempl/pep.em
+@@ -321,7 +321,7 @@
+     {"no-bind", no_argument, NULL, OPTION_NO_BIND},
+     {"wdmdriver", no_argument, NULL, OPTION_WDM_DRIVER},
+     {"tsaware", no_argument, NULL, OPTION_TERMINAL_SERVER_AWARE},
+-    {"insert-timestamp", no_argument, NULL, OPTION_INSERT_TIMESTAMP},
++    {"insert-timestamp", optional_argument, NULL, OPTION_INSERT_TIMESTAMP},
+     {"no-insert-timestamp", no_argument, NULL, OPTION_NO_INSERT_TIMESTAMP},
+     {"build-id", optional_argument, NULL, OPTION_BUILD_ID},
+     {NULL, no_argument, NULL, 0}
--
2.25.1






Information forwarded to guix-patches <at> gnu.org:
bug#40362; Package guix-patches. (Wed, 01 Apr 2020 14:15:02 GMT) Full text and rfc822 format available.

Message #8 received at 40362 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <m.othacehe <at> gmail.com>
To: Carl Dong <contact <at> carldong.me>
Cc: 40362 <at> debbugs.gnu.org
Subject: Re: [bug#40362] [PATCH] gnu: cross-base: Add mingw-w64 specific
 binutils patches.
Date: Wed, 01 Apr 2020 16:14:14 +0200
Hello Carl!

> * gnu/packages/patches/binutils-mingw-w64-reproducible-import-libraries.patch:
> New file.
> * gnu/packages/patches/binutils-mingw-w64-specify-timestamp.patch:
> New file.

You also need to add those patches to gnu/local.mk.

> +(define (package-with-extra-patches original patches)
> +  "Return package ORIGINAL with all PATCHES appended to its list of patches."
> +  (package-with-patch original
> +                      `(,@(origin-patches (package-source original))
> +                        ,@patches))

Nitpick, maybe we could just name it package-with-patches?

> +                  (package-with-extra-patches binutils
> +                                              (search-patches
> +                                               "binutils-mingw-w64-specify-timestamp.patch"
> +                                               "binutils-mingw-w64-reproducible-import-libraries.patch")))

This is over the 78 column limit.

Otherwise, seems fine!

Thanks,

Mathieu




Information forwarded to guix-patches <at> gnu.org:
bug#40362; Package guix-patches. (Wed, 01 Apr 2020 19:55:01 GMT) Full text and rfc822 format available.

Message #11 received at 40362 <at> debbugs.gnu.org (full text, mbox):

From: Carl Dong <accounts <at> carldong.me>
To: Mathieu Othacehe <m.othacehe <at> gmail.com>
Cc: "40362 <at> debbugs.gnu.org" <40362 <at> debbugs.gnu.org>
Subject: Re: [bug#40362] [PATCH] gnu: cross-base: Add mingw-w64 specific
 binutils patches.
Date: Wed, 01 Apr 2020 19:54:39 +0000
Hey Mathieu!

> > -   gnu/packages/patches/binutils-mingw-w64-reproducible-import-libraries.patch:
> >     New file.
> > -   gnu/packages/patches/binutils-mingw-w64-specify-timestamp.patch:
> >     New file.
>
> You also need to add those patches to gnu/local.mk.

Added!

> > +(define (package-with-extra-patches original patches)
> > -   "Return package ORIGINAL with all PATCHES appended to its list of patches."
> > -   (package-with-patch original
> > -                        `(,@(origin-patches (package-source original))
> > -                          ,@patches))
>
> Nitpick, maybe we could just name it package-with-patches?

I named it this way to make it clear that PACKAGE-WITH-PATCH overrides the
patches, whereas PACKAGE-WITH-EXTRA-PATCHES appends the patches (just like
PACKAGE-WITH-EXTRA-CONFIGURE-VARIABLE)... In fact, I'm not sure that Ludovic
originally intended PACKAGE-WITH-PATCH to override rather than append?

> > -                    (package-with-extra-patches binutils
> > -                                                (search-patches
> > -                                                 "binutils-mingw-w64-specify-timestamp.patch"
> > -                                                 "binutils-mingw-w64-reproducible-import-libraries.patch")))
>
> This is over the 78 column limit.

See the updated patch below, is this the right solution?

Many thanks for the review!

Cheers,
Carl Dong
accounts <at> carldong.me
"I fight for the users"


From c2d53e94eef8bc0b6750e1c1218335cd1461f1be Mon Sep 17 00:00:00 2001
From: Carl Dong <contact <at> carldong.me>
Date: Tue, 24 Mar 2020 15:39:06 -0400
Subject: [PATCH v2] gnu: cross-base: Add mingw-w64 specific binutils patches.

These patches were originally found at the debian mingw-w64 team's
binutils repo, and should improve the reproducibility of our mingw-w64
toolchain.

* gnu/packages/patches/binutils-mingw-w64-reproducible-import-libraries.patch:
New file.
* gnu/packages/patches/binutils-mingw-w64-specify-timestamp.patch:
New file.
* gnu/local.mk (dist_patch_DATA): Update accordingly.
* gnu/packages/cross-base.scm (cross-binutils): Apply relevant patches
if target is mingw-w64.
(package-with-extra-patches): New procedure.
---
 gnu/local.mk                                  |   2 +
 gnu/packages/cross-base.scm                   |  23 ++-
 ...gw-w64-reproducible-import-libraries.patch |  22 +++
 ...binutils-mingw-w64-specify-timestamp.patch | 137 ++++++++++++++++++
 4 files changed, 179 insertions(+), 5 deletions(-)
 create mode 100755 gnu/packages/patches/binutils-mingw-w64-reproducible-import-libraries.patch
 create mode 100755 gnu/packages/patches/binutils-mingw-w64-specify-timestamp.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 19ab32c0f5..fe685c4e1b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -768,6 +768,8 @@ dist_patch_DATA =						\
   %D%/packages/patches/bidiv-update-fribidi.patch		\
   %D%/packages/patches/binutils-boot-2.20.1a.patch		\
   %D%/packages/patches/binutils-loongson-workaround.patch	\
+  %D%/packages/patches/binutils-mingw-w64-specify-timestamp.patch \
+  %D%/packages/patches/binutils-mingw-w64-reproducible-import-libraries.patch \
   %D%/packages/patches/blender-2.79-newer-ffmpeg.patch		\
   %D%/packages/patches/blender-2.79-python-3.7-fix.patch	\
   %D%/packages/patches/bluez-CVE-2020-0556.patch		\
diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index ab866eebc6..858ee743ed 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -76,6 +76,12 @@
     (source (origin (inherit (package-source original))
               (patches (list patch))))))

+(define (package-with-extra-patches original patches)
+  "Return package ORIGINAL with all PATCHES appended to its list of patches."
+  (package-with-patch original
+                      `(,@(origin-patches (package-source original))
+                        ,@patches))
+
 (define (cross-binutils target)
   "Return a cross-Binutils for TARGET."
   (let ((binutils (package (inherit binutils)
@@ -97,11 +103,18 @@
                         `(cons "--with-sysroot=/" ,flags)))))))

     ;; For Xtensa, apply Qualcomm's patch.
-    (cross (if (string-prefix? "xtensa-" target)
-               (package-with-patch binutils
-                                   (search-patch
-                                    "ath9k-htc-firmware-binutils.patch"))
-               binutils)
+    (cross (cond ((string-prefix? "xtensa-" target)
+                  (package-with-patch binutils
+                                      (search-patch
+                                       "ath9k-htc-firmware-binutils.patch")))
+                 ((target-mingw? target)
+                  (package-with-extra-patches binutils
+                                              (search-patches
+                                               "binutils-mingw-w64-specify-tim\
+estamp.patch"
+                                               "binutils-mingw-w64-reproducibl\
+e-import-libraries.patch")))
+                 (else binutils))
            target)))

 (define (cross-gcc-arguments target xgcc libc)
diff --git a/gnu/packages/patches/binutils-mingw-w64-reproducible-import-libraries.patch b/gnu/packages/patches/binutils-mingw-w64-reproducible-import-libraries.patch
new file mode 100755
index 0000000000..3e48b87935
--- /dev/null
+++ b/gnu/packages/patches/binutils-mingw-w64-reproducible-import-libraries.patch
@@ -0,0 +1,22 @@
+This following patch was originally found at the debian mingw-w64 team's
+binutils repo located here:
+https://salsa.debian.org/mingw-w64-team/binutils-mingw-w64.git
+
+Invoke the following in the aforementioned repo to see the original patch:
+
+  $ git show da63f6b:debian/patches/reproducible-import-libraries.patch
+
+Description: Make DLL import libraries reproducible
+Author: Benjamin Moody <benjamin.moody <at> gmail.com>
+Bug-Debian: https://bugs.debian.org/915055
+
+--- a/ld/pe-dll.c
++++ b/ld/pe-dll.c
+@@ -2844,6 +2844,7 @@
+
+   bfd_set_format (outarch, bfd_archive);
+   outarch->has_armap = 1;
++  outarch->flags |= BFD_DETERMINISTIC_OUTPUT;
+
+   /* Work out a reasonable size of things to put onto one line.  */
+   ar_head = make_head (outarch);
diff --git a/gnu/packages/patches/binutils-mingw-w64-specify-timestamp.patch b/gnu/packages/patches/binutils-mingw-w64-specify-timestamp.patch
new file mode 100755
index 0000000000..b785043b62
--- /dev/null
+++ b/gnu/packages/patches/binutils-mingw-w64-specify-timestamp.patch
@@ -0,0 +1,137 @@
+This following patch was originally found at the debian mingw-w64 team's
+binutils repo located here:
+https://salsa.debian.org/mingw-w64-team/binutils-mingw-w64.git
+
+Invoke the following in the aforementioned repo to see the original patch:
+
+  $ git show da63f6b:debian/patches/specify-timestamp.patch
+
+Description: Allow the PE timestamp to be specified
+Author: Stephen Kitt <skitt <at> debian.org>
+
+--- a/bfd/peXXigen.c
++++ b/bfd/peXXigen.c
+@@ -70,6 +70,9 @@
+ #include <wctype.h>
+ #endif
+
++#include <errno.h>
++#include <limits.h>
++
+ /* NOTE: it's strange to be including an architecture specific header
+    in what's supposed to be general (to PE/PEI) code.  However, that's
+    where the definitions are, and they don't vary per architecture
+@@ -879,10 +882,38 @@
+
+   /* Use a real timestamp by default, unless the no-insert-timestamp
+      option was chosen.  */
+-  if ((pe_data (abfd)->insert_timestamp))
+-    H_PUT_32 (abfd, time (0), filehdr_out->f_timdat);
+-  else
++  if (pe_data (abfd)->insert_timestamp) {
++    time_t now;
++    char *source_date_epoch;
++    unsigned long long epoch;
++    char *endptr;
++
++    now = time(NULL);
++    source_date_epoch = getenv("SOURCE_DATE_EPOCH");
++    if (source_date_epoch) {
++      errno = 0;
++      epoch = strtoull(source_date_epoch, &endptr, 10);
++      if ((errno == ERANGE && (epoch == ULLONG_MAX || epoch == 0))
++          || (errno != 0 && epoch == 0)) {
++        _bfd_error_handler("Environment variable $SOURCE_DATE_EPOCH: strtoull: %s\n",
++                           strerror(errno));
++      } else if (endptr == source_date_epoch) {
++        _bfd_error_handler("Environment variable $SOURCE_DATE_EPOCH: No digits were found: %s\n",
++                           endptr);
++      } else if (*endptr != '\0') {
++        _bfd_error_handler("Environment variable $SOURCE_DATE_EPOCH: Trailing garbage: %s\n",
++                           endptr);
++      } else if (epoch > ULONG_MAX) {
++        _bfd_error_handler("Environment variable $SOURCE_DATE_EPOCH: value must be smaller than or equal to: %lu but was found to be: %llu\n",
++                           ULONG_MAX, epoch);
++      } else {
++        now = epoch;
++      }
++    }
++    H_PUT_32 (abfd, now, filehdr_out->f_timdat);
++  } else {
+     H_PUT_32 (abfd, 0, filehdr_out->f_timdat);
++  }
+
+   PUT_FILEHDR_SYMPTR (abfd, filehdr_in->f_symptr,
+ 		      filehdr_out->f_symptr);
+--- a/ld/pe-dll.c
++++ b/ld/pe-dll.c
+@@ -26,6 +26,8 @@
+ #include "filenames.h"
+ #include "safe-ctype.h"
+
++#include <errno.h>
++#include <limits.h>
+ #include <time.h>
+
+ #include "ld.h"
+@@ -1202,8 +1204,36 @@
+
+   memset (edata_d, 0, edata_sz);
+
+-  if (pe_data (abfd)->insert_timestamp)
+-    H_PUT_32 (abfd, time (0), edata_d + 4);
++  if (pe_data (abfd)->insert_timestamp) {
++    time_t now;
++    char *source_date_epoch;
++    unsigned long long epoch;
++    char *endptr;
++
++    now = time(NULL);
++    source_date_epoch = getenv("SOURCE_DATE_EPOCH");
++    if (source_date_epoch) {
++      errno = 0;
++      epoch = strtoull(source_date_epoch, &endptr, 10);
++      if ((errno == ERANGE && (epoch == ULLONG_MAX || epoch == 0))
++	  || (errno != 0 && epoch == 0)) {
++	einfo("Environment variable $SOURCE_DATE_EPOCH: strtoull: %s\n",
++	      strerror(errno));
++      } else if (endptr == source_date_epoch) {
++	einfo("Environment variable $SOURCE_DATE_EPOCH: No digits were found: %s\n",
++	      endptr);
++      } else if (*endptr != '\0') {
++	einfo("Environment variable $SOURCE_DATE_EPOCH: Trailing garbage: %s\n",
++	      endptr);
++      } else if (epoch > ULONG_MAX) {
++	einfo("Environment variable $SOURCE_DATE_EPOCH: value must be smaller than or equal to: %lu but was found to be: %llu\n",
++	      ULONG_MAX, epoch);
++      } else {
++	now = epoch;
++      }
++    }
++    H_PUT_32 (abfd, now, edata_d + 4);
++  }
+
+   if (pe_def_file->version_major != -1)
+     {
+--- a/ld/emultempl/pe.em
++++ b/ld/emultempl/pe.em
+@@ -303,7 +303,7 @@
+      OPTION_USE_NUL_PREFIXED_IMPORT_TABLES},
+     {"no-leading-underscore", no_argument, NULL, OPTION_NO_LEADING_UNDERSCORE},
+     {"leading-underscore", no_argument, NULL, OPTION_LEADING_UNDERSCORE},
+-    {"insert-timestamp", no_argument, NULL, OPTION_INSERT_TIMESTAMP},
++    {"insert-timestamp", optional_argument, NULL, OPTION_INSERT_TIMESTAMP},
+     {"no-insert-timestamp", no_argument, NULL, OPTION_NO_INSERT_TIMESTAMP},
+ #ifdef DLL_SUPPORT
+     /* getopt allows abbreviations, so we do this to stop it
+--- a/ld/emultempl/pep.em
++++ b/ld/emultempl/pep.em
+@@ -321,7 +321,7 @@
+     {"no-bind", no_argument, NULL, OPTION_NO_BIND},
+     {"wdmdriver", no_argument, NULL, OPTION_WDM_DRIVER},
+     {"tsaware", no_argument, NULL, OPTION_TERMINAL_SERVER_AWARE},
+-    {"insert-timestamp", no_argument, NULL, OPTION_INSERT_TIMESTAMP},
++    {"insert-timestamp", optional_argument, NULL, OPTION_INSERT_TIMESTAMP},
+     {"no-insert-timestamp", no_argument, NULL, OPTION_NO_INSERT_TIMESTAMP},
+     {"build-id", optional_argument, NULL, OPTION_BUILD_ID},
+     {NULL, no_argument, NULL, 0}
--
2.25.1





Information forwarded to guix-patches <at> gnu.org:
bug#40362; Package guix-patches. (Thu, 02 Apr 2020 09:46:03 GMT) Full text and rfc822 format available.

Message #14 received at 40362 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <m.othacehe <at> gmail.com>
To: Carl Dong <accounts <at> carldong.me>
Cc: "40362 <at> debbugs.gnu.org" <40362 <at> debbugs.gnu.org>
Subject: Re: [bug#40362] [PATCH] gnu: cross-base: Add mingw-w64 specific
 binutils patches.
Date: Thu, 02 Apr 2020 11:45:08 +0200
Hey,

> I named it this way to make it clear that PACKAGE-WITH-PATCH overrides the
> patches, whereas PACKAGE-WITH-EXTRA-PATCHES appends the patches (just like
> PACKAGE-WITH-EXTRA-CONFIGURE-VARIABLE)... In fact, I'm not sure that Ludovic
> originally intended PACKAGE-WITH-PATCH to override rather than append?

Well I'm also unsure, but yes it makes sense to name it this way then!

> See the updated patch below, is this the right solution?

In general, its preferred to send one of the procedure call to the next
line and let Emacs indent everything. Like this:

--8<---------------cut here---------------start------------->8---
    (cross (cond ((string-prefix? "xtensa-" target)
                  (package-with-patch binutils
                                      (search-patch
                                       "ath9k-htc-firmware-binutils.patch")))
                 ((target-mingw? target)
                  (package-with-extra-patches
                   binutils
                   (search-patches
                    "binutils-mingw-w64-specify-timestamp.patch"
                    "binutils-mingw-w64-reproducible-import-libraries.patch")))
                 (else binutils))
           target)))
--8<---------------cut here---------------end--------------->8---

This patch will trigger a rebuild of all cross-compiled packages, so it
would be better to send it to core-updates maybe? And as core-updates
has been frozen a few days ago, you may need to wait for
core-updates-next to open.

Thanks,

Mathieu




Information forwarded to guix-patches <at> gnu.org:
bug#40362; Package guix-patches. (Thu, 02 Apr 2020 15:54:02 GMT) Full text and rfc822 format available.

Message #17 received at 40362 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <mbakke <at> fastmail.com>
To: Mathieu Othacehe <m.othacehe <at> gmail.com>, Carl Dong <accounts <at> carldong.me>
Cc: "40362 <at> debbugs.gnu.org" <40362 <at> debbugs.gnu.org>
Subject: Re: [bug#40362] [PATCH] gnu: cross-base: Add mingw-w64 specific
 binutils patches.
Date: Thu, 02 Apr 2020 17:53:52 +0200
[Message part 1 (text/plain, inline)]
Mathieu Othacehe <m.othacehe <at> gmail.com> writes:

> This patch will trigger a rebuild of all cross-compiled packages, so it
> would be better to send it to core-updates maybe? And as core-updates
> has been frozen a few days ago, you may need to wait for
> core-updates-next to open.

We traditionally only cared about native builds for the rebuild limit as
the CI only cross-compiles a handful of packages.  So 'master' is
probably fine.

Perhaps that will change now that people can cross-compile full system
configurations.  What is your opinion Mathieu, as a major stakeholder in
the cross-compilation camp?  :-)
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#40362; Package guix-patches. (Thu, 02 Apr 2020 16:13:02 GMT) Full text and rfc822 format available.

Message #20 received at 40362 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <m.othacehe <at> gmail.com>
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: Carl Dong <accounts <at> carldong.me>,
 "40362 <at> debbugs.gnu.org" <40362 <at> debbugs.gnu.org>
Subject: Re: [bug#40362] [PATCH] gnu: cross-base: Add mingw-w64 specific
 binutils patches.
Date: Thu, 02 Apr 2020 18:12:50 +0200
> Perhaps that will change now that people can cross-compile full system
> configurations.  What is your opinion Mathieu, as a major stakeholder in
> the cross-compilation camp?  :-)

Hehe, for now that is fine with me :) I guess you can then push to
master Carl.

Thanks,

Mathieu




bug closed, send any further explanations to 40362 <at> debbugs.gnu.org and Carl Dong <contact <at> carldong.me> Request was from Mathieu Othacehe <m.othacehe <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 03 Apr 2020 16:27:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 02 May 2020 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 357 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.