From patchwork Sat Feb 12 21:45:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 37219 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 9260C27BBEA; Sat, 12 Feb 2022 21:46:14 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0651E27BBE9 for ; Sat, 12 Feb 2022 21:46:14 +0000 (GMT) Received: from localhost ([::1]:47528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJ0Dd-0004DJ-6c for patchwork@mira.cbaines.net; Sat, 12 Feb 2022 16:46:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJ0DS-0004BU-7q for guix-patches@gnu.org; Sat, 12 Feb 2022 16:46:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:41932) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nJ0DR-0002wl-UF for guix-patches@gnu.org; Sat, 12 Feb 2022 16:46:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nJ0DR-0008UI-TG for guix-patches@gnu.org; Sat, 12 Feb 2022 16:46:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53964] [PATCH 1/4] gnu: nhc98: Build with the current tool chain. References: <20220212214307.22962-1-ludo@gnu.org> In-Reply-To: <20220212214307.22962-1-ludo@gnu.org> Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 12 Feb 2022 21:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53964 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53964@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 53964-submit@debbugs.gnu.org id=B53964.164470234731859 (code B ref 53964); Sat, 12 Feb 2022 21:46:01 +0000 Received: (at 53964) by debbugs.gnu.org; 12 Feb 2022 21:45:47 +0000 Received: from localhost ([127.0.0.1]:35821 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJ0DC-0008Gn-43 for submit@debbugs.gnu.org; Sat, 12 Feb 2022 16:45:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45586) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJ0DA-00089S-Il for 53964@debbugs.gnu.org; Sat, 12 Feb 2022 16:45:45 -0500 Received: from [2001:470:142:3::e] (port=50936 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJ0D5-0002oW-9i; Sat, 12 Feb 2022 16:45:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=SMMkz27YeCWsD7Qq3jEyvR/bQXQqgvHYIEVhEIwmKDc=; b=db5KTCekVAcu+7 dNQ977JNcHt7XbzGzZQfDPLFzgDZltZ2PQZuo/ZV7r0cnH7Qc2qMldoTHdMZ4UF/TkbimqswtECtm uJ/yxnLPdBs10GNU/ZKQpL6hyAhnIl5oMCrVrteqqwjF8u4oTrrLqfbOqwY/eNSFIsHLGjnxIcnUF vgzk/8L2nJBtUUI5jOkuGFKOK1d66pECl8tFK57HJKqWUYMf44ENUNDlhmONwRdBw0MnJWCJZPFfd QHj2cVJphrdIoUvD2bTr9GQ+U4WaOFUoKGAfx/1286CD7Qjg6Dj++rBTGvVqJ/faSLQIN4Fxk3e0M tiNRbLlDrAD7e9337cAg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:56748 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nJ0D4-00034N-Ng; Sat, 12 Feb 2022 16:45:39 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 12 Feb 2022 22:45:29 +0100 Message-Id: <20220212214532.23087-1-ludo@gnu.org> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/patches/nhc98-c-update.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/haskell.scm (nhc98)[source]: Use it. [arguments]: Remove #:implicit-inputs?. [native-inputs]: Remove. --- gnu/local.mk | 1 + gnu/packages/haskell.scm | 34 ++---------------- gnu/packages/patches/nhc98-c-update.patch | 42 +++++++++++++++++++++++ 3 files changed, 45 insertions(+), 32 deletions(-) create mode 100644 gnu/packages/patches/nhc98-c-update.patch diff --git a/gnu/local.mk b/gnu/local.mk index a706409516..950b040c64 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1546,6 +1546,7 @@ dist_patch_DATA = \ %D%/packages/patches/nettle-3.5-check-_pkcs1_sec_decrypt-msg-len.patch \ %D%/packages/patches/nettle-3.5-CVE-2021-3580-pt1.patch \ %D%/packages/patches/nettle-3.5-CVE-2021-3580-pt2.patch \ + %D%/packages/patches/nhc98-c-update.patch \ %D%/packages/patches/nix-dont-build-html-doc.diff \ %D%/packages/patches/nfs4-acl-tools-0.3.7-fixpaths.patch \ %D%/packages/patches/ngircd-handle-zombies.patch \ diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm index 647b078dfd..c3706fca6c 100644 --- a/gnu/packages/haskell.scm +++ b/gnu/packages/haskell.scm @@ -123,14 +123,14 @@ (define-public nhc98 version ".tar.gz")) (sha256 (base32 - "0fkgxgsd2iqxvwcgnad1702kradwlbcal6rxdrgb22vd6dnc3i8l")))) + "0fkgxgsd2iqxvwcgnad1702kradwlbcal6rxdrgb22vd6dnc3i8l")) + (patches (search-patches "nhc98-c-update.patch")))) (build-system gnu-build-system) (supported-systems '("i686-linux" "x86_64-linux")) (arguments (list #:tests? #false ;there is no test target #:system "i686-linux" - #:implicit-inputs? #false #:parallel-build? #false ;not supported #:strip-binaries? #false ;doesn't work #:make-flags '(list "all-gcc") @@ -170,36 +170,6 @@ (define-public nhc98 "--ccoption=" "--ldoption=" "--install")))))) - (native-inputs - `(("findutils" ,findutils) - ("tar" ,tar) - ("bzip2" ,bzip2) - ("gzip" ,gzip) - ("xz" ,xz) - ("diffutils" ,diffutils) - ("file" ,file) - ("gawk" ,gawk) - - ("make" ,gnu-make) - ("sed" ,sed) - ("grep" ,grep) - ("coreutils" ,coreutils) - ("bash" ,bash-minimal) - - ("libc" ,glibc-2.2.5) - ("gcc-wrapper" - ,(module-ref (resolve-interface - '(gnu packages commencement)) - 'gcc-2.95-wrapper)) - ("gcc" - ,(module-ref (resolve-interface - '(gnu packages commencement)) - 'gcc-mesboot0)) - ("binutils" - ,(module-ref (resolve-interface - '(gnu packages commencement)) - 'binutils-mesboot)) - ("kernel-headers" ,linux-libre-headers))) (home-page "https://www.haskell.org/nhc98") (synopsis "Nearly a Haskell Compiler") (description diff --git a/gnu/packages/patches/nhc98-c-update.patch b/gnu/packages/patches/nhc98-c-update.patch new file mode 100644 index 0000000000..06e6928d14 --- /dev/null +++ b/gnu/packages/patches/nhc98-c-update.patch @@ -0,0 +1,42 @@ +This patch provides an update so that nhc98 can be built and works with +a modern C compiler (GCC 11) and libc (glibc 2.33). + +diff --git a/Makefile.inc b/Makefile.inc +index 4fbd47a..5bce5c9 100644 +--- a/Makefile.inc ++++ b/Makefile.inc +@@ -1,6 +1,10 @@ + ### Configurable variables: + +-OPT = -O3 ++# We want C89 semantics plus C++-style comments and things like the ++# 'setjmp_buf' and 'u_short' types. More importantly, build with '-O1' ++# only to avoid modern optimizations that break the code. ++OPT = -O1 -std=gnu89 -D_GNU_SOURCE=1 ++ + #ARCH = -m32 + ARCH = + +diff --git a/script/nhc98heap.c b/script/nhc98heap.c +index 534010e..a30d5cd 100644 +--- a/script/nhc98heap.c ++++ b/script/nhc98heap.c +@@ -1,5 +1,6 @@ + #include + #include ++#include + main(int argc, char **argv) + { + int prefix = 1; +diff --git a/src/runtime/Kernel/collector.c b/src/runtime/Kernel/collector.c +index b95a273..1f879c5 100644 +--- a/src/runtime/Kernel/collector.c ++++ b/src/runtime/Kernel/collector.c +@@ -2,6 +2,7 @@ + #include + #include + #include ++#include + #include "node.h" + /*#include "newmacros.h" -- already included in node.h */ + /*#include "runtime.h" -- already included in node.h */