From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id KMDJKn8ic2S9AAAASxT56A (envelope-from ) for ; Sun, 28 May 2023 11:44:31 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id iEThKX8ic2SLSwEAG6o9tA (envelope-from ) for ; Sun, 28 May 2023 11:44:31 +0200 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 65F7E14B8C for ; Sun, 28 May 2023 11:44:31 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q3Cwa-0008EU-Kq; Sun, 28 May 2023 05:44:08 -0400 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 1q3CwX-0008Dy-81 for guix-patches@gnu.org; Sun, 28 May 2023 05:44:05 -0400 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 1q3CwX-0003Jq-09 for guix-patches@gnu.org; Sun, 28 May 2023 05:44:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q3CwU-0001bd-Si for guix-patches@gnu.org; Sun, 28 May 2023 05:44:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63766] [PATCH 4/4] gnu: glibc-2.33: Fix building for riscv64-linux. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: , guix-patches@gnu.org Resent-Date: Sun, 28 May 2023 09:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63766 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63766@debbugs.gnu.org Cc: Efraim Flashner , ( , Christopher Baines , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Raghav Gururajan , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice , jgart X-Debbugs-Original-Xcc: ( , Christopher Baines , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Raghav Gururajan , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice , jgart Received: via spool by 63766-submit@debbugs.gnu.org id=B63766.16852670306119 (code B ref 63766); Sun, 28 May 2023 09:44:02 +0000 Received: (at 63766) by debbugs.gnu.org; 28 May 2023 09:43:50 +0000 Received: from localhost ([127.0.0.1]:53299 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3CwH-0001aY-BU for submit@debbugs.gnu.org; Sun, 28 May 2023 05:43:49 -0400 Received: from mail-wm1-f50.google.com ([209.85.128.50]:51281) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3CwD-0001Zn-N3 for 63766@debbugs.gnu.org; Sun, 28 May 2023 05:43:46 -0400 Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-3f6d7abe9a4so15131735e9.2 for <63766@debbugs.gnu.org>; Sun, 28 May 2023 02:43:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685267020; x=1687859020; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=5Xl1ezPXOHAiG3o+I7NjWj3Qx6GsjyUpDCS00OVHGp0=; b=TnIXFMNe1drs0LEleUk3PpP63KHlhJcLu2EeeiHpFj3wT7hK8FrPiXZoCoai0XgGH+ db5wxfdUAbRhqSbxsckxIdvn7sfX0leNpkxT1DTYP90tVx/fBImLoZb4TA/ytkedbLca Uxxfem/Dy1gmeiJb0p1mfGe4kHaUC17797va5V1HmScSmYxrSmpbH7jLUq2EK333wMu5 9WtPBQC2Aa/Y6cPpK86STGEG9BtFQix+BJtw9mgarM1ledP752F9IKOTOiZKiIKEyMpm mPsoxmA9OwO7eTIuX/Bywku4fLpSeUlznSsPCq8CUDYEC8f3ZYio4l/mqPBUz5kjGhJm 7dGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685267020; x=1687859020; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=5Xl1ezPXOHAiG3o+I7NjWj3Qx6GsjyUpDCS00OVHGp0=; b=K9b3h9PbhC1NzfztWfDx4NniKCnJ3i27bsGjEj8rt2OSmTecVqgIDV5ZAOUTDaQzhs JTB8WU7I9oinoilGltugeo3bb7wUG1KcsU+/GsSgorwpAZVkC6HdI94Hoa+YMG7Mv3ib vL6mYskek1V9ro0XuvW3gUHslu37wbelMtDW2LiVvqhOKTJMbwV+8vf1aMjoYk0ykzYW yjVr51x4IlewUvqJVGzs6ixi+yg4T+UIyj55sDOJRTRNjOPLeB0CIerTNZugdDTj3cNT wm2FhPQaOvKLuOMu8BCvfqR2vH+KSbpK4jPw2lVSSLzzjbAiaQQfT8CqcWazq5+UCrp1 CJ5A== X-Gm-Message-State: AC+VfDwZA2dYObn/UWzWFEfTXeylYVkI0oYW3XrGPtqg5djSW3gfIM6d QIRnE2fdE51KDNvOBD92czDswlb7e55foQ== X-Google-Smtp-Source: ACHHUZ7GNdNAndxBK+QXbS25UG1F7NBk+4deimbFroIzZxiB2r0lVCZNaTOlhBvYi0ZhoHb7ZkBfBQ== X-Received: by 2002:a7b:c416:0:b0:3f5:1240:ace4 with SMTP id k22-20020a7bc416000000b003f51240ace4mr6708277wmi.25.1685267019974; Sun, 28 May 2023 02:43:39 -0700 (PDT) Received: from localhost ([37.46.46.3]) by smtp.gmail.com with ESMTPSA id o9-20020a5d6849000000b003078c535277sm10293494wrw.91.2023.05.28.02.43.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 May 2023 02:43:39 -0700 (PDT) From: Efraim Flashner Date: Sun, 28 May 2023 12:44:21 +0300 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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-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=1685267071; a=rsa-sha256; cv=none; b=PZ2UPOX/8gPE8cTU3INQ4+06XgXjMSGPCMjCMSNHkqwPsDcghhmsquVQkXTmLk3XoIp051 CAcFohaF6e5XfawUoPoAGY+eo2U5DNP8GBi/EWhK7Zy6Z+CVb4FoDfTazKbRENyRV91epS 2achW21S3YzGiIAjev7OOmL5FVpMejz1l49TijarVHGBesYVe2zHgY6lGYDBKFVER9IF0P ZE5vYe6VPrsJxGsUwXRI9xI0F5XLHfIN2UxvAeXZ3qXgdd2PtHd9gFvnkD3QYgCkBX4bTn byluE0bKH4Dl9/fupPDhbJvD1PH2aSSuqaZUrpNJpgtRTFVVSoG2Y70fr5o+cw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=TnIXFMNe; dmarc=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=1685267071; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: 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=5Xl1ezPXOHAiG3o+I7NjWj3Qx6GsjyUpDCS00OVHGp0=; b=tyGQ5VhIpef7OkI5/QHm7AiCNvmclNGoGvvTbwf74qFTAsAijbLPfHE/FAZaz5bTPxtzn2 QCw55zIgoIvKLb+M3hNmFVhUgD0G6vQDQgU33yrSfwZxSHedQUvG6Tb/Ap3SHLxJ2d263q ogE4eFAqbZRcVEVgLDGKbbRWmik7zqUv+b6z/WNCVZJN7iC2zGNgD4WWskTJ+z1F1NjBqe sZjftpRwEEQ3BafDUnrLWUPja4IhYs4Ybj8ABoOZQfOoY+7niYKgxn2IsWfShxqetTmVU3 k1lztt0y5sqvA9v/GcUkXsyQyjovmgSGiwBcN0Lr2icRiAnfXv4fJjmA329cQA== X-Migadu-Spam-Score: -0.61 X-Spam-Score: -0.61 X-Migadu-Queue-Id: 65F7E14B8C X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=TnIXFMNe; dmarc=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-TUID: kPw3W9JpjY2p * gnu/packages/base.scm (glibc-2.33)[source]: Add patch. * gnu/packages/patches/glibc-2.33-rawmemchr-miscompilation.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. --- gnu/local.mk | 1 + gnu/packages/base.scm | 16 ++++-- .../glibc-2.33-rawmemchr-miscompilation.patch | 57 +++++++++++++++++++ 3 files changed, 68 insertions(+), 6 deletions(-) create mode 100644 gnu/packages/patches/glibc-2.33-rawmemchr-miscompilation.patch diff --git a/gnu/local.mk b/gnu/local.mk index 50d65a3dba..e8770a3f2a 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1235,6 +1235,7 @@ dist_patch_DATA = \ %D%/packages/patches/glib-appinfo-watch.patch \ %D%/packages/patches/glib-networking-gnutls-binding.patch \ %D%/packages/patches/glib-skip-failing-test.patch \ + %D%/packages/patches/glibc-2.33-rawmemchr-miscompilation.patch \ %D%/packages/patches/glibc-CVE-2019-7309.patch \ %D%/packages/patches/glibc-CVE-2019-9169.patch \ %D%/packages/patches/glibc-CVE-2019-19126.patch \ diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index d2f276c447..dbf1b0edcb 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -1066,12 +1066,13 @@ (define-public glibc-2.33 (base32 "1zvp0qdfbdyqrzydz18d9zg3n5ygy8ps7cmny1bvsp8h1q05c99f")) (patches - ;; Remove a patch that's become irrelevant and that does not - ;; apply to this version. - (remove (lambda (patch) - (string=? (basename patch) - "glibc-hurd-clock_gettime_monotonic.patch")) - (origin-patches (package-source glibc)))))) + (cons* (search-patch "glibc-2.33-rawmemchr-miscompilation.patch") + ;; Remove a patch that's become irrelevant and that does not + ;; apply to this version. + (remove (lambda (patch) + (string=? (basename patch) + "glibc-hurd-clock_gettime_monotonic.patch")) + (origin-patches (package-source glibc))))))) (arguments (substitute-keyword-arguments (package-arguments glibc) ((#:configure-flags flags ''()) @@ -1379,6 +1380,9 @@ (define-public glibc-utf8-locales (make-glibc-utf8-locales glibc))) ;; Packages provided to ease use of binaries linked against the previous libc. +(define-public glibc-locales-2.33 + (package (inherit (make-glibc-locales glibc-2.33)) + (name "glibc-locales-2.33"))) (define-public glibc-locales-2.32 (package (inherit (make-glibc-locales glibc-2.32)) (name "glibc-locales-2.32"))) diff --git a/gnu/packages/patches/glibc-2.33-rawmemchr-miscompilation.patch b/gnu/packages/patches/glibc-2.33-rawmemchr-miscompilation.patch new file mode 100644 index 0000000000..bcf297be94 --- /dev/null +++ b/gnu/packages/patches/glibc-2.33-rawmemchr-miscompilation.patch @@ -0,0 +1,57 @@ +This patch is from upstream glibc after 2.33 and is needed in Guix to +fix glibc-2.33 compilation for riscv64-linux. + +From 044e603b698093cf48f6e6229e0b66acf05227e4 Mon Sep 17 00:00:00 2001 +From: Florian Weimer +Date: Fri, 19 Feb 2021 13:29:00 +0100 +Subject: [PATCH] string: Work around GCC PR 98512 in rawmemchr + +--- + string/rawmemchr.c | 26 +++++++++++++++----------- + 1 file changed, 15 insertions(+), 11 deletions(-) + +diff --git a/string/rawmemchr.c b/string/rawmemchr.c +index 59bbeeaa42..b8523118e5 100644 +--- a/string/rawmemchr.c ++++ b/string/rawmemchr.c +@@ -22,24 +22,28 @@ + # define RAWMEMCHR __rawmemchr + #endif + ++/* The pragmata should be nested inside RAWMEMCHR below, but that ++ triggers GCC PR 98512. */ ++DIAG_PUSH_NEEDS_COMMENT; ++#if __GNUC_PREREQ (7, 0) ++/* GCC 8 warns about the size passed to memchr being larger than ++ PTRDIFF_MAX; the use of SIZE_MAX is deliberate here. */ ++DIAG_IGNORE_NEEDS_COMMENT (8, "-Wstringop-overflow="); ++#endif ++#if __GNUC_PREREQ (11, 0) ++/* Likewise GCC 11, with a different warning option. */ ++DIAG_IGNORE_NEEDS_COMMENT (11, "-Wstringop-overread"); ++#endif ++ + /* Find the first occurrence of C in S. */ + void * + RAWMEMCHR (const void *s, int c) + { +- DIAG_PUSH_NEEDS_COMMENT; +-#if __GNUC_PREREQ (7, 0) +- /* GCC 8 warns about the size passed to memchr being larger than +- PTRDIFF_MAX; the use of SIZE_MAX is deliberate here. */ +- DIAG_IGNORE_NEEDS_COMMENT (8, "-Wstringop-overflow="); +-#endif +-#if __GNUC_PREREQ (11, 0) +- /* Likewise GCC 11, with a different warning option. */ +- DIAG_IGNORE_NEEDS_COMMENT (11, "-Wstringop-overread"); +-#endif + if (c != '\0') + return memchr (s, c, (size_t)-1); +- DIAG_POP_NEEDS_COMMENT; + return (char *)s + strlen (s); + } + libc_hidden_def (__rawmemchr) + weak_alias (__rawmemchr, rawmemchr) ++ ++DIAG_POP_NEEDS_COMMENT; +-- -- Efraim Flashner רנשלפ םירפא GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted