From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id uHpbDZ5p52NeEAAAbAwnHQ (envelope-from ) for ; Sat, 11 Feb 2023 11:10:38 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id eDdhDZ5p52PqewAA9RJhRA (envelope-from ) for ; Sat, 11 Feb 2023 11:10:38 +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 EEF4AF73E for ; Sat, 11 Feb 2023 11:10:37 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pQmop-0004ss-KE; Sat, 11 Feb 2023 05:09:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQmok-0004or-Ud for guix-patches@gnu.org; Sat, 11 Feb 2023 05:09:15 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pQmoe-0000AA-CC for guix-patches@gnu.org; Sat, 11 Feb 2023 05:09:11 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pQmoe-0004De-6A for guix-patches@gnu.org; Sat, 11 Feb 2023 05:09:08 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61420] [PATCH 20/31] gnu: ghc-9.2: Support static linking with glibc < 2.34. Resent-From: Lars-Dominik Braun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 11 Feb 2023 10:09:08 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61420 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61420@debbugs.gnu.org Cc: Lars-Dominik Braun Received: via spool by 61420-submit@debbugs.gnu.org id=B61420.167611013816049 (code B ref 61420); Sat, 11 Feb 2023 10:09:08 +0000 Received: (at 61420) by debbugs.gnu.org; 11 Feb 2023 10:08:58 +0000 Received: from localhost ([127.0.0.1]:38886 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQmoT-0004Ah-Qb for submit@debbugs.gnu.org; Sat, 11 Feb 2023 05:08:58 -0500 Received: from mout-p-201.mailbox.org ([80.241.56.171]:38656) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQmoK-00046h-Hq for 61420@debbugs.gnu.org; Sat, 11 Feb 2023 05:08:50 -0500 Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4PDRBx09Jcz9sW7; Sat, 11 Feb 2023 11:08:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001; t=1676110121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mlMJEaqYJWb9Wl/e4GZ5Zog9fE/IFUQ8AF3PLEefDzY=; b=TMOkbRA5QBueqV0Rej8xSi9JfWblkPoR20LlB+fVgTnjYf8motCwjIVYjzOB7KrYWZNyrJ WCq1Uvm9Y1SqYJnGSK5gus5biXnhdSb7JeaP7WNBiEfG2izwyiUzyAIoK6hEpaf0MeH7hE cb0jpDIT2/A432NrFvX8+r4AvMe94SnIoqAdzeWu6a+nRPssgdtJeznJyt2DULVGLRo79F BrcbtCtEz58ohWQUihh0/mvcCGNmHt/Egb9ZRvoBYDIFqDcoRX2FTqw7/lF6p95ZxCeLGr 1a93wZ0H2zdz/Da12KOqX3qXtR0kRdSBTspdXlRah79yJppd5+gNccaWK5uqLg== From: Lars-Dominik Braun Date: Sat, 11 Feb 2023 11:08:14 +0100 Message-Id: <20230211100825.47971-17-lars@6xq.net> In-Reply-To: <20230211100825.47971-1-lars@6xq.net> References: <20230211100825.47971-1-lars@6xq.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4PDRBx09Jcz9sW7 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1676110238; a=rsa-sha256; cv=none; b=IYNB7l3+C5AMef53Wf0H4pxpVcB1H095DMnk17lI+CEy/EVv2S//VgW/mlI5VWZih1oMrS McbPIDTWVwfNjNAlZw24rFqSWeSjenjmhirKd7PYlaVIPrElplw3EqfHTXHXPXMIhlxKoj 1OegMX8IQZyVADeec5SXybP7i0GtrfwghhFcSDjOQ0Ur3zxIqQaVtP1BppWlXv8WPPKsqa Nmjb9Y4M+osH7yYNpn0/eTz4d1At57Z4Stgm0NMblBnB7/fIAsjKcpwpIm217HslOT/p8j AbT21NX7/MYvmxCz/1z3qfyDAjQ61LuppSD7CoR6bB52ZWYUgHstgwjTHXKiig== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=6xq.net header.s=MBO0001 header.b=TMOkbRA5; dmarc=fail reason="SPF not aligned (relaxed)" header.from=6xq.net (policy=none); 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1676110238; 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=mlMJEaqYJWb9Wl/e4GZ5Zog9fE/IFUQ8AF3PLEefDzY=; b=QZ50xtKbJWSFJcUCtlARf6YFlve0xWuCsQQ1OP67LrgaPy1zjfJ5zr6TlOEpcsrjuqaOaj nGEbWyl3FP/JQdek08dNsHuEvNsq1u3neUOvEnq9GBIUJx+ptds0gAeCAbN80/4d+uzPTD bbguzu6OKcJPhX9ckSnomwJGQF/JEPWMX8QD92QVgdeaJ0O9oh3T7uk4QH5t0mSqxd2OpQ TaQxsXe6/NZqa2u17YH4AQMmLvEXttkz/z9Gg1QBCNxzCtZQ066/hmhhTgG5A1AliPopvY JdgXFAsBFwK9qpYz+eVV1fcQLaHVaHltNOO6tVOtFSG+EBS2voncJbYS0dGIIg== Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=6xq.net header.s=MBO0001 header.b=TMOkbRA5; dmarc=fail reason="SPF not aligned (relaxed)" header.from=6xq.net (policy=none); 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: 7.20 X-Spam-Score: 7.20 X-Migadu-Queue-Id: EEF4AF73E X-Migadu-Scanner: scn1.migadu.com X-TUID: 9PLsi2cBHd7z * gnu/packages/patches/ghc-9.2-glibc-2.33-link-order.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/haskell.scm (ghc-9.2)[origin]: Use it. --- gnu/local.mk | 1 + gnu/packages/haskell.scm | 3 +- .../ghc-9.2-glibc-2.33-link-order.patch | 35 +++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/ghc-9.2-glibc-2.33-link-order.patch diff --git a/gnu/local.mk b/gnu/local.mk index b6b44f7836..5cb34a7b3b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1195,6 +1195,7 @@ dist_patch_DATA = \ %D%/packages/patches/genimage-mke2fs-test.patch \ %D%/packages/patches/geoclue-config.patch \ %D%/packages/patches/ghc-8.0-fall-back-to-madv_dontneed.patch \ + %D%/packages/patches/ghc-9.2-glibc-2.33-link-order.patch \ %D%/packages/patches/ghc-testsuite-dlopen-pie.patch \ %D%/packages/patches/ghc-bloomfilter-ghc9.2.patch \ %D%/packages/patches/ghc-bytestring-handle-ghc9.patch \ diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm index 60d846e841..a2815814ed 100644 --- a/gnu/packages/haskell.scm +++ b/gnu/packages/haskell.scm @@ -1286,7 +1286,8 @@ (define-public ghc-9.2 "/ghc-" version "-src.tar.xz")) (sha256 (base32 - "07028i0hm74svvq9b3jpkczaj6lsdgn3hgr4wa7diqiq3dypj1h6")))) + "07028i0hm74svvq9b3jpkczaj6lsdgn3hgr4wa7diqiq3dypj1h6")) + (patches (search-patches "ghc-9.2-glibc-2.33-link-order.patch")))) (arguments (substitute-keyword-arguments (package-arguments base) ((#:phases phases '%standard-phases) diff --git a/gnu/packages/patches/ghc-9.2-glibc-2.33-link-order.patch b/gnu/packages/patches/ghc-9.2-glibc-2.33-link-order.patch new file mode 100644 index 0000000000..5d4afa28c1 --- /dev/null +++ b/gnu/packages/patches/ghc-9.2-glibc-2.33-link-order.patch @@ -0,0 +1,35 @@ +Slightly modified version of +https://gitlab.haskell.org/ghc/ghc/-/issues/19029#note_447989, required +for older, buggy glibc versions < 2.34. + +diff -Naur ghc-9.2.5/compiler/GHC/Linker/Unit.hs ghc-9.2.5.patched/compiler/GHC/Linker/Unit.hs +--- ghc-9.2.5/compiler/GHC/Linker/Unit.hs 2022-11-06 20:40:29.000000000 +0100 ++++ ghc-9.2.5.patched/compiler/GHC/Linker/Unit.hs 2023-01-15 14:52:57.511275338 +0100 +@@ -31,11 +31,26 @@ + ps <- mayThrowUnitErr $ preloadUnitsInfo' unit_env pkgs + return (collectLinkOpts dflags ps) + ++fixOrderLinkOpts :: [String] -> [String] ++fixOrderLinkOpts opts ++ | have_bad_glibc_version -- glibc version strictly less than 2.34 ++ , let (before, rest) = break (== libc) opts ++ , not (pthread `elem` before) ++ , pthread `elem` rest -- optional if we know pthread is definitely present ++ = before ++ pthread_and_deps ++ rest ++ | otherwise ++ = opts ++ where ++ pthread = "-lpthread" ++ libc = "-lc" ++ pthread_and_deps = [ "-lrt", pthread ] -- should depend on the environment ++ have_bad_glibc_version = True ++ + collectLinkOpts :: DynFlags -> [UnitInfo] -> ([String], [String], [String]) + collectLinkOpts dflags ps = + ( + concatMap (map ("-l" ++) . unitHsLibs (ghcNameVersion dflags) (ways dflags)) ps, +- concatMap (map ("-l" ++) . map ST.unpack . unitExtDepLibsSys) ps, ++ fixOrderLinkOpts $ concatMap (map ("-l" ++) . map ST.unpack . unitExtDepLibsSys) ps, + concatMap (map ST.unpack . unitLinkerOptions) ps + ) + -- 2.38.2