From patchwork Sun May 28 09:44:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Efraim Flashner X-Patchwork-Id: 50377 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 879DB27BBEA; Sun, 28 May 2023 10:44:32 +0100 (BST) 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=ham 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 718A827BBE2 for ; Sun, 28 May 2023 10:44:31 +0100 (BST) 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 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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; +--