diff options
author | fanquake <fanquake@gmail.com> | 2025-06-16 11:48:33 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2025-06-26 17:43:13 +0200 |
commit | a13351ade28f9a2e9b3371dfed3dadb1059bda87 (patch) | |
tree | e0d0da0da5d2327bab7ff58d760a9819da6e71e7 | |
parent | 4fec118cdd7be2c3604d162788da6a9d4d357118 (diff) |
gnu: Remove no-longer needed cross-binutils patch.
This patch landed upstream in Binutils 2.41. It has also been dropped
from Debian in
https://salsa.debian.org/mingw-w64-team/binutils-mingw-w64/-/commit/1c70e29cafe59e1f099a546ae157eef62bbab0e6.
* gnu/packages/cross-base.scm (cross-binutils*): Remove
binutils-mingw-w64-timestamp.patch.
* gnu/packages/patches/binutils-mingw-w64-timestamp.patch: Remove file.
* gnu/local.mk (dist_patch_DATA): Remove
binutils-mingw-w64-timestamp.patch reference.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
-rw-r--r-- | gnu/local.mk | 1 | ||||
-rw-r--r-- | gnu/packages/cross-base.scm | 3 | ||||
-rw-r--r-- | gnu/packages/patches/binutils-mingw-w64-timestamp.patch | 136 |
3 files changed, 1 insertions, 139 deletions
diff --git a/gnu/local.mk b/gnu/local.mk index 0f73571990..5a0f84f2b9 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1066,7 +1066,6 @@ 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-timestamp.patch \ %D%/packages/patches/binutils-mingw-w64-deterministic.patch \ %D%/packages/patches/bloomberg-bde-cmake-module-path.patch \ %D%/packages/patches/bloomberg-bde-tools-fix-install-path.patch \ diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 7f29549144..d3dfe5047d 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -146,8 +146,7 @@ ;; TODO: This seems like a deeper problem that warrants ;; deeper investigation. binutils "--enable-compressed-debug-sections" "no") - (search-patches "binutils-mingw-w64-timestamp.patch" - "binutils-mingw-w64-deterministic.patch"))) + (search-patches "binutils-mingw-w64-deterministic.patch"))) (else binutils)) target))) diff --git a/gnu/packages/patches/binutils-mingw-w64-timestamp.patch b/gnu/packages/patches/binutils-mingw-w64-timestamp.patch deleted file mode 100644 index fcfe4a36aa..0000000000 --- a/gnu/packages/patches/binutils-mingw-w64-timestamp.patch +++ /dev/null @@ -1,136 +0,0 @@ -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 faf7c64:debian/patches/specify-timestamp.patch - -Description: Allow the PE timestamp to be specified -Author: Stephen Kitt <skitt@debian.org> - ---- a/bfd/peXXigen.c -+++ b/bfd/peXXigen.c -@@ -77,6 +77,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 -@@ -876,9 +879,36 @@ - - /* 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); -- else -+ if ((pe_data (abfd)->timestamp) == -1) { -+ 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, pe_data (abfd)->timestamp, filehdr_out->f_timdat); - - PUT_FILEHDR_SYMPTR (abfd, filehdr_in->f_symptr, ---- a/ld/pe-dll.c -+++ b/ld/pe-dll.c -@@ -27,6 +27,8 @@ - #include "safe-ctype.h" - #include "ctf-api.h" - -+#include <errno.h> -+#include <limits.h> - #include <time.h> - - #include "ld.h" -@@ -1218,9 +1220,36 @@ - - memset (edata_d, 0, edata_sz); - -- if (pe_data (abfd)->timestamp == -1) -- H_PUT_32 (abfd, time (0), edata_d + 4); -- else -+ if (pe_data (abfd)->timestamp == -1) { -+ 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); -+ } else - H_PUT_32 (abfd, pe_data (abfd)->timestamp, edata_d + 4); - - if (pe_def_file->version_major != -1) ---- a/ld/emultempl/pe.em -+++ b/ld/emultempl/pe.em -@@ -304,7 +304,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 -@@ -323,7 +323,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}, - {"enable-reloc-section", no_argument, NULL, OPTION_ENABLE_RELOC_SECTION}, |