From patchwork Fri Apr 3 19:00:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Dong X-Patchwork-Id: 21074 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 2F67127BBE4; Fri, 3 Apr 2020 20:02:27 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 7C7C727BBE1 for ; Fri, 3 Apr 2020 20:02:26 +0100 (BST) Received: from localhost ([::1]:59926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jKRaE-0008GA-12 for patchwork@mira.cbaines.net; Fri, 03 Apr 2020 15:02:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44168) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jKRZw-0008E3-61 for guix-patches@gnu.org; Fri, 03 Apr 2020 15:02:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jKRZt-0006lv-Q9 for guix-patches@gnu.org; Fri, 03 Apr 2020 15:02:08 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59898) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jKRZq-0006kB-MU for guix-patches@gnu.org; Fri, 03 Apr 2020 15:02:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jKRZq-0006pz-IG for guix-patches@gnu.org; Fri, 03 Apr 2020 15:02:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#40414] [PATCH] gnu: mingw: Add mingw-w64 reproducibility patches. Resent-From: Carl Dong Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 03 Apr 2020 19:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 40414 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 40414@debbugs.gnu.org X-Debbugs-Original-To: "guix-patches@gnu.org" Received: via spool by submit@debbugs.gnu.org id=B.158594048026182 (code B ref -1); Fri, 03 Apr 2020 19:02:02 +0000 Received: (at submit) by debbugs.gnu.org; 3 Apr 2020 19:01:20 +0000 Received: from localhost ([127.0.0.1]:43211 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jKRZ7-0006oB-Uw for submit@debbugs.gnu.org; Fri, 03 Apr 2020 15:01:20 -0400 Received: from lists.gnu.org ([209.51.188.17]:39947) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jKRZ2-0006nq-As for submit@debbugs.gnu.org; Fri, 03 Apr 2020 15:01:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42094) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jKRZ0-0007YE-Hu for guix-patches@gnu.org; Fri, 03 Apr 2020 15:01:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jKRYt-00055Y-Am for guix-patches@gnu.org; Fri, 03 Apr 2020 15:01:09 -0400 Received: from mail-40134.protonmail.ch ([185.70.40.134]:35864) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jKRYs-00050I-SZ for guix-patches@gnu.org; Fri, 03 Apr 2020 15:01:03 -0400 Date: Fri, 03 Apr 2020 19:00:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=carldong.me; s=protonmail; t=1585940458; bh=MMrhTTxwuAFxgabfVVlXBC5X/GEGSE3NGTTb+Ual8U4=; h=Date:To:From:Reply-To:Subject:From; b=fmdtv1AlfatkX7RV98AJm2wk2OvCYUGSaYgc/ca7HFW0Qe4k2vUNR9tRfEfBcm5+6 yVDY5UBUBJalgtbSHHBSLgV0JxAiiJf6IA0nvVWOIhqZt+1wUzj6CpuU23Py/x1H6S j5BmWDH0XFYqozOzrUMmBmwYHIPojeHG9+XnkFck= From: Carl Dong Message-ID: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Carl Dong Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Round 2! Now for some patches applied to mingw-w64 itself, rather than just binutils. I've checked: - That the mode of the patches are correct - guix build mingw-w64-{x86_64,i686}{,-winpthreads} - guix build hello ----- These patches were originally found at the debian mingw-w64 team's mingw-w64 repo, and should improve the reproducibility of our mingw-w64 toolchain. * gnu/packages/patches/mingw-w64-dlltool-temp-prefix.patch: New file. * gnu/packages/patches/mingw-w64-reproducible-gendef.patch: New file. * gnu/local.mk (dist_patch_DATA): Update accordingly. * gnu/packages/mingw.scm (make-mingw-w64): Apply patches. --- gnu/local.mk | 2 ++ gnu/packages/mingw.scm | 4 ++- .../mingw-w64-dlltool-temp-prefix.patch | 26 +++++++++++++++++++ .../mingw-w64-reproducible-gendef.patch | 23 ++++++++++++++++ 4 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/mingw-w64-dlltool-temp-prefix.patch create mode 100644 gnu/packages/patches/mingw-w64-reproducible-gendef.patch -- 2.25.1 diff --git a/gnu/local.mk b/gnu/local.mk index 8328165e17..713d97da86 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1201,6 +1201,8 @@ dist_patch_DATA = \ %D%/packages/patches/metabat-fix-compilation.patch \ %D%/packages/patches/mhash-keygen-test-segfault.patch \ %D%/packages/patches/mingw-w64-6.0.0-gcc.patch \ + %D%/packages/patches/mingw-w64-dlltool-temp-prefix.patch \ + %D%/packages/patches/mingw-w64-reproducible-gendef.patch \ %D%/packages/patches/minisat-friend-declaration.patch \ %D%/packages/patches/minisat-install.patch \ %D%/packages/patches/mpc123-initialize-ao.patch \ diff --git a/gnu/packages/mingw.scm b/gnu/packages/mingw.scm index d0785c5067..37726e5851 100644 --- a/gnu/packages/mingw.scm +++ b/gnu/packages/mingw.scm @@ -53,7 +53,9 @@ specified, recurse and return a mingw-w64 with support for winpthreads." "mingw-w64-release/mingw-w64-v" version ".tar.bz2")) (sha256 (base32 "0a5njsa2zw2ssdz10jkb10mhrf3cb8qp9avs89zqmw4n6pzxy85a")) - (patches (search-patches "mingw-w64-6.0.0-gcc.patch")))) + (patches (search-patches "mingw-w64-6.0.0-gcc.patch" + "mingw-w64-dlltool-temp-prefix.patch" + "mingw-w64-reproducible-gendef.patch")))) (native-inputs `(("xgcc-core" ,(if xgcc xgcc (cross-gcc triplet))) ("xbinutils" ,(if xbinutils xbinutils (cross-binutils triplet))) ,@(if with-winpthreads? diff --git a/gnu/packages/patches/mingw-w64-dlltool-temp-prefix.patch b/gnu/packages/patches/mingw-w64-dlltool-temp-prefix.patch new file mode 100644 index 0000000000..432cafc162 --- /dev/null +++ b/gnu/packages/patches/mingw-w64-dlltool-temp-prefix.patch @@ -0,0 +1,26 @@ +This following patch was originally found at the debian mingw-w64 team's +mingw-w64 repo located here: +https://salsa.debian.org/mingw-w64-team/mingw-w64.git + +Invoke the following in the aforementioned repo to see the original patch: + + $ git show 4974e2c:debian/patches/dlltool-temp-prefix.patch + +Description: Specify dlltool's temp prefix +Author: Stephen Kitt + +By default dlltool uses its pid for the object files it generates. +Enforcing its temp prefix allows the files it generates to be +reproducible. + +--- a/mingw-w64-crt/Makefile.am ++++ b/mingw-w64-crt/Makefile.am +@@ -36,7 +36,7 @@ + DTDEF32=$(GENLIB) $(DLLTOOLFLAGS32) $(AM_DLLTOOLFLAGS) + DTDEF64=$(GENLIB) $(DLLTOOLFLAGS64) $(AM_DLLTOOLFLAGS) + else +- AM_DLLTOOLFLAGS=-k --as=$(AS) --output-lib $@ ++ AM_DLLTOOLFLAGS=-k --as=$(AS) --output-lib $@ --temp-prefix $$(basename $@ .a) + DLLTOOLFLAGSARM32=-m arm + DLLTOOLFLAGSARM64=-m arm64 + DLLTOOLFLAGS32=--as-flags=--32 -m i386 diff --git a/gnu/packages/patches/mingw-w64-reproducible-gendef.patch b/gnu/packages/patches/mingw-w64-reproducible-gendef.patch new file mode 100644 index 0000000000..ee676af7a0 --- /dev/null +++ b/gnu/packages/patches/mingw-w64-reproducible-gendef.patch @@ -0,0 +1,23 @@ +This following patch was originally found at the debian mingw-w64 team's +mingw-w64 repo located here: +https://salsa.debian.org/mingw-w64-team/mingw-w64.git + +Invoke the following in the aforementioned repo to see the original patch: + + $ git show 4974e2c:debian/patches/reproducible-gendef.patch + +Description: Drop __DATE__ from gendef +Author: Stephen Kitt + +This allows gendef to be built reproducibly. + +--- a/mingw-w64-tools/gendef/src/gendef.c ++++ b/mingw-w64-tools/gendef/src/gendef.c +@@ -196,7 +196,6 @@ + " By default, the output files are named after their DLL counterparts\n" + " gendef MYDLL.DLL Produces MYDLL.def\n" + " gendef - MYDLL.DLL Prints the exports to stdout\n"); +- fprintf (stderr, "\nBuilt on %s\n", __DATE__); + fprintf (stderr, "\nReport bugs to \n"); + exit (0); + }