From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id mDfYJaMqCGIxNAEAgWs5BA (envelope-from ) for ; Sat, 12 Feb 2022 22:46:11 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id WCISI6MqCGIydwAA9RJhRA (envelope-from ) for ; Sat, 12 Feb 2022 22:46:11 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C62832D2AA for ; Sat, 12 Feb 2022 22:46:10 +0100 (CET) Received: from localhost ([::1]:47528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJ0DZ-0004DJ-Py for larch@yhetil.org; Sat, 12 Feb 2022 16:46:09 -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 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1644702370; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=SMMkz27YeCWsD7Qq3jEyvR/bQXQqgvHYIEVhEIwmKDc=; b=TEkqOalKwp88tCFUOkhKkmR73xDzqk0oOh8G7tAZ8rc5z+9s5f6d20ToGqABL3HsVE303H H4PvAvP8GLaau+Bk0fUpvHK1AANhM3vUzajEsPcSc09+3yEn2dyoYPF2fSmb2yZMy+L9WM mn6OU0haLlMNVZ4Nbxrm3YArBF7VYxZ/ZEeW+XlXdFW5H+qW4HH+QysVHxyDUQh13kdyru x6ECgH5Csm/7hZMUm7T9Ji4n+5jbjnSHPRGq7LvZCnyU2qkjIa6L7aGIBQmQ0Ts+bvhGmZ rwNWoACe4Qp+FQwqYEShZof8a8ei4Ck9F4cLfVM4O2MVTeiehyVo8Hc3xlfraA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644702370; a=rsa-sha256; cv=none; b=KjxAxt9tLxgVGUlmDJXOOp3eXo0qQCDtxwiZpOsxNHpjFHBQPLWHLBf274VDtqqwBe38aT rSingR8U0pXnI+20hENFQxuapEFcmi4ua2fqydCYxQks1xjcAtzfKN4vjTc/xdCFqI3rC3 erVRNPReesOYYYXj0XZIOG4kjEHzqaT2uC6TKmgvETiNnOBULtmvjMLAR/I2gk+FzlKWzy gnAqBLNdHUf/LuIXhDZIFzSHQsxn/E2Eu6Ugrog0EC1HfiVJsPtNcXvLg4reRKhkjBYQm9 2RwPa+TIHVnuGBvU89mxVeDXsCArs9MSGOyUsRTMbp4JVp8pzGajRs5gb4ZUYA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=db5KTCek; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.33 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=db5KTCek; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: C62832D2AA X-Spam-Score: -2.33 X-Migadu-Scanner: scn1.migadu.com X-TUID: IvF5GvXjpnCt * 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 */ -- 2.34.0