From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 EMf3A6sqCGIxNAEAgWs5BA (envelope-from ) for ; Sat, 12 Feb 2022 22:46:19 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id oJVkOKoqCGIRvQAAG6o9tA (envelope-from ) for ; Sat, 12 Feb 2022 22:46:18 +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 71EA32D2AD for ; Sat, 12 Feb 2022 22:46:18 +0100 (CET) Received: from localhost ([::1]:47696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJ0Dh-0004KP-Mf for larch@yhetil.org; Sat, 12 Feb 2022 16:46:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJ0DS-0004CH-Nh for guix-patches@gnu.org; Sat, 12 Feb 2022 16:46:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:41933) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nJ0DS-0002ws-Bm for guix-patches@gnu.org; Sat, 12 Feb 2022 16:46:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nJ0DS-0008Ur-9y for guix-patches@gnu.org; Sat, 12 Feb 2022 16:46:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53964] [PATCH 3/4] gnu: ghc@4: Build without referring to packages in commencement.scm. 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:02 +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.164470235132047 (code B ref 53964); Sat, 12 Feb 2022 21:46:02 +0000 Received: (at 53964) by debbugs.gnu.org; 12 Feb 2022 21:45:51 +0000 Received: from localhost ([127.0.0.1]:35825 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJ0DG-0008KL-GU for submit@debbugs.gnu.org; Sat, 12 Feb 2022 16:45:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45594) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJ0DB-0008As-Px for 53964@debbugs.gnu.org; Sat, 12 Feb 2022 16:45:46 -0500 Received: from [2001:470:142:3::e] (port=50940 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 1nJ0D6-0002ok-H4; Sat, 12 Feb 2022 16:45:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=/4EUAAdCkImrVqyDctEiP86lChukfdr0xNIJzt+TtLs=; b=ldyWt4lsUIati3g5E6Dc aJRjYtgzcey1mG4Xgmq/LNk8IcUMcxEm+MPtqN3WwzKq45P1cJuEvAIwKCao2uKcYiHCo1IKvzgPi Q+k+twI2DStVqwX2kj7QlCdGxM2xEKAubKHi6hJIXluT+h1ZyeOzeQTM5570h8kT/Kjo8arXau8Tb guNqIspOZLU+y+BsWKFaDKpkq3zCk1acphJgFfcl1R5+B/Qgl0YOP9UTrYDa+DkEWzzzYvqu6JcuL nUUL9FGZj2aiZWXBMgqillWrfgt+MnWHRq9E4MMtaGtSKaxj6Vx2VdxX3raEirUm9KuvqgRxOpvxQ XeH7mLjn/xwe7w==; 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 1nJ0D6-00034N-55; Sat, 12 Feb 2022 16:45:40 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Sat, 12 Feb 2022 22:45:31 +0100 Message-Id: <20220212214532.23087-3-ludo@gnu.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220212214532.23087-1-ludo@gnu.org> References: <20220212214532.23087-1-ludo@gnu.org> 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=1644702378; 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=/4EUAAdCkImrVqyDctEiP86lChukfdr0xNIJzt+TtLs=; b=qp9uEinvgO5HM9Vo1/aeS6nL4JeMeoRS+bveljs2U+ZMFwKuKMVE28sEfFxFyeFjLVwi/y zl1OTAxCuOqmz6VA2IVPijMfeSFsBL/SVaKUM/esj7ChyqFjXb827eJ177zQDizYP2yrbh qF85pVovvl0joQEQ+K/R/07os8O8xMSu1ufRm1xmuc4SAeT3jLJfg1GMo609zSfh9ukAIp so7rHiGP3utSSUP5I8FRwN3SwkslgcGJrZ8dmPt3XttYCDS3y9lzPwsSMVwnW2I79SHlap 1h52w/tvXP12DaRqKIvdhySkzu3he41ZGjTTdvjeEGUfvVtUIO87IV3a0elqOw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644702378; a=rsa-sha256; cv=none; b=RR2xwAzwsHUfAgBI1PzIrzxaHPWlk+F3pLmoB1Kwm78hwnWeFZ3GxtuM+WCeoBvJWavrb3 xpTPzZdfyyFneJaIn41qjVTh98f7zLhICkkz7B4s4Ro3vWrusorlmeLuqkvqXIK/pmBfjk 7AfFbH+GA/a7PMA5gX4xFgL98N0M3N8FjdkqNMBCe/ECt+bJKrQ8SqPUT04JcErSGBLY3D VXkJ+DUErMB0E1VDTLPwATnsqFGcToLc3KPsfEpwiHPkf6bS2n46XtRgscRXpQY1NKR70Q b+KC9cT9SjSfoORH6O/I5GOuTZPKmdhcFJ5LoPyV89Gnw0kggXxnldBh7wgYXw== 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=ldyWt4ls; 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=ldyWt4ls; 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: 71EA32D2AD X-Spam-Score: -2.33 X-Migadu-Scanner: scn1.migadu.com X-TUID: EgM7l/LOLjkk * gnu/packages/haskell.scm (ghc-4)[arguments]: Remove #:implicit-inputs?. In 'bootstrap' phase, pass '-optc-D_GNU_SOURCE=1'. Use 'search-input-file' to locate lib{bfd,iberty}.a, and 'which' for cpp. Patch 'mk/config.mk.in'. In 'configure' phase, emit "config.cache". In 'make-boot' phase, replace "CLK_TCK" in 'nHandle.c'. [native-inputs]: Remove now-implicit inputs; remove GLIBC-2.2.5, GCC-MESBOOT0, and BINUTILS-MESBOOT. Add GCC-2.95 and BINUTILS-2.33. Remove input labels. --- gnu/packages/haskell.scm | 82 +++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 47 deletions(-) diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm index c3706fca6c..6a1ca7c7e8 100644 --- a/gnu/packages/haskell.scm +++ b/gnu/packages/haskell.scm @@ -193,12 +193,11 @@ (define-public ghc-4 (sha256 (base32 "0ar4nxy4cr5vwvfj71gmc174vx0n3lg9ka05sa1k60c8z0g3xp1q")) - (patches (list (search-patch "ghc-4.patch"))))) + (patches (search-patches "ghc-4.patch")))) (build-system gnu-build-system) (supported-systems '("i686-linux" "x86_64-linux")) (arguments `(#:system "i686-linux" - #:implicit-inputs? #f #:strip-binaries? #f #:phases (modify-phases %standard-phases @@ -223,8 +222,8 @@ (define-public ghc-4 #HsLibsFor=hugs # Setting this leads to building the interpreter. GhcHcOpts=-DDEBUG -GhcRtsHcOpts=-optc-DDEBUG -optc-D__HUGS__ -unreg -optc-g -GhcRtsCcOpts=-optc-DDEBUG -optc-g -optc-D__HUGS__ +GhcRtsHcOpts=-optc-DDEBUG -optc-D__HUGS__ -unreg -optc-g -optc-D_GNU_SOURCE=1 +GhcRtsCcOpts=-optc-DDEBUG -optc-g -optc-D__HUGS__ -optc-D_GNU_SOURCE=1 SplitObjs=NO "))) @@ -247,8 +246,8 @@ (define-public ghc-4 ;; this old linker understands. (substitute* "ghc/interpreter/Makefile" (("-lbfd -liberty") - (string-append (assoc-ref inputs "binutils") "/lib/libbfd.a " - (assoc-ref inputs "binutils") "/lib/libiberty.a"))) + (string-append (search-input-file inputs "/lib/libbfd.a") " " + (search-input-file inputs "/lib/libiberty.a")))) (let ((bash (which "bash"))) (substitute* '("configure.in" @@ -271,7 +270,13 @@ (define-public ghc-4 (setenv "CONFIG_SHELL" bash) (setenv "SHELL" bash)) - (setenv "CPP" (string-append (assoc-ref inputs "gcc") "/bin/cpp")) + ;; The 'hscpp' script invokes GCC 2.95's 'cpp' (RAWCPP), which + ;; segfaults unless passed '-x c'. + (substitute* "mk/config.mk.in" + (("-traditional") + "-traditional -x c")) + + (setenv "CPP" (which "cpp")) (invoke "autoreconf" "--verbose" "--force"))) (add-before 'configure 'configure-gmp (lambda* (#:key build inputs outputs #:allow-other-keys) @@ -283,6 +288,12 @@ (define-public ghc-4 (lambda* (#:key build inputs outputs #:allow-other-keys) (let ((bash (which "bash")) (out (assoc-ref outputs "out"))) + (call-with-output-file "config.cache" + (lambda (port) + ;; GCC 2.95 fails to deal with anonymous unions in glibc's + ;; 'struct_rusage.h', so skip that. + (display "ac_cv_func_getrusage=no\n" port))) + (invoke bash "./configure" "--enable-hc-boot" (string-append "--prefix=" out) @@ -290,14 +301,15 @@ (define-public ghc-4 (string-append "--host=" build))))) (add-before 'build 'make-boot (lambda _ + ;; CLK_TCK has been removed from recent libc. + (substitute* "ghc/interpreter/nHandle.c" + (("CLK_TCK") "sysconf (_SC_CLK_TCK)")) + ;; Only when building with more recent GCC (when #false ;; GCC 2.95 is fine with these comments, but GCC 4.6 is not. (substitute* "ghc/rts/universal_call_c.S" - (("^# .*") "")) - ;; CLK_TCK has been removed - (substitute* "ghc/interpreter/nHandle.c" - (("CLK_TCK") "sysconf(_SC_CLK_TCK)"))) + (("^# .*") ""))) ;; Only when using more recent Perl (when #false @@ -334,45 +346,21 @@ (define-public ghc-4 (copy-recursively "ghc/interpreter/lib" lib) (install-file "ghc/interpreter/nHandle.so" lib))))))) (native-inputs - `(("findutils" ,findutils) - ("tar" ,tar) - ("bzip2" ,bzip2) - ("xz" ,xz) - ("diffutils" ,diffutils) - ("file" ,file) - ("gawk" ,gawk) - ("autoconf" ,autoconf-2.13) - ("automake" ,automake) - ("bison" ,bison) ;for parser.y + (list autoconf-2.13 + automake + bison ;for parser.y - ("make" ,gnu-make) - ("sed" ,sed) - ("grep" ,grep) - ("coreutils" ,coreutils) - ("bash" ,bash-minimal) + ;; Needed to support lvalue casts. + gcc-2.95 - ("libc" ,glibc-2.2.5) - ;; Lazily resolve binutils-mesboot in (gnu packages commencement) to - ;; avoid a cycle. - ("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) + ;; Use an older assembler to work around this error in GMP: + ;; Error: `%edx' not allowed with `testb' + binutils-2.33 - ;; TODO: Perl used to allow setting $* to enable multi-line - ;; matching. If we want to use a more recent Perl we need to - ;; patch all expressions that require multi-line matching. Hard - ;; to tell. - ("perl" ,perl-5.14))) + ;; TODO: Perl used to allow setting $* to enable multi-line + ;; matching. If we want to use a more recent Perl we need to patch + ;; all expressions that require multi-line matching. Hard to tell. + perl-5.14)) (home-page "https://www.haskell.org/ghc") (synopsis "The Glasgow Haskell Compiler") (description -- 2.34.0