From patchwork Sun May 28 09:44:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Efraim Flashner X-Patchwork-Id: 50379 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 B8C1627BBEA; Sun, 28 May 2023 10:44:41 +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 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 C69BC27BBE2 for ; Sun, 28 May 2023 10:44:40 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q3Cwa-0008ES-8J; 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 1q3CwU-0008DQ-4j for guix-patches@gnu.org; Sun, 28 May 2023 05:44:02 -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 1q3CwT-0003JQ-T1 for guix-patches@gnu.org; Sun, 28 May 2023 05:44:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q3CwT-0001bG-Po for guix-patches@gnu.org; Sun, 28 May 2023 05:44:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63766] [PATCH 1/4] gnu: bootloader: Add u-boot-sifive-unmatched-bootloader. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: , guix-patches@gnu.org Resent-Date: Sun, 28 May 2023 09:44:01 +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.16852670246083 (code B ref 63766); Sun, 28 May 2023 09:44:01 +0000 Received: (at 63766) by debbugs.gnu.org; 28 May 2023 09:43:44 +0000 Received: from localhost ([127.0.0.1]:53291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3CwC-0001a3-01 for submit@debbugs.gnu.org; Sun, 28 May 2023 05:43:44 -0400 Received: from mail-wm1-f50.google.com ([209.85.128.50]:57840) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3Cw8-0001Ze-Mo for 63766@debbugs.gnu.org; Sun, 28 May 2023 05:43:42 -0400 Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-3f606912ebaso23476915e9.3 for <63766@debbugs.gnu.org>; Sun, 28 May 2023 02:43:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685267015; x=1687859015; 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=c+lyzZ2AdRbMQ3b+dXX9tNzaGHWDBbfyjxYAOOFNGn0=; b=NdmNDqfWw26f3ITytbxnYuD8xwDeE/2OzGzTvkqmSuYV0+GkvFG5IT/acqppj87K8L S4TlH9bGkVaGVzUaDOFdCy4ZBjAjwFtS2Lr/Tw7ZKBaeXClvoit3hzjT1kYe+f8OuXxi sMKHr2Hto5GgfEejpRQ7/LwubU8bjGIwTqTwTf/ub/BQI32sbR/NubjsgoVi2DDimlTj gJTL8HHhhyZ0zTzhUPKlux2R9iDriG4tZxbXPNrogYVmAfSBXBm9DiAc87+tc1CW2Rvd 5rXGnFZsT1Rr33P6TeOn6r0atY1jD0QkEjh8TxUtuvCc9eoaHUkhOPKPMEr1vLGY32Y/ SIVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685267015; x=1687859015; 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=c+lyzZ2AdRbMQ3b+dXX9tNzaGHWDBbfyjxYAOOFNGn0=; b=Od+YOWqDwVCfHUhw7cJnjb4Uc1HZqXxuLsRMBqRgYJbB4N6BighkDjDTGjHltESfhw yX2Kj/5id3ZVdioFl1f/pr+IWOJ1FR2unQ/T6zqg3Ty/cCIT1okOoOcOXaUgch5UCvdi p5vesP84evkpJ9JFPuDpKGRtfvRxEStn43mfpHqRR0Nq9uWqzFKPz7cRC1xfURc/Gb+J DGOqscvTIdcMWCcJcQcmSgMYC7d+Y2nJqagmDcSeal8b0qlg2SP367wc9XXRGAlAyBwc Pr8s8Kkhuo1LUOUMeypuHbH8YC3qKYsbxKxMsYHtNRSRRnCI1jq6zlohTS1rEqq0RyXZ 3gjw== X-Gm-Message-State: AC+VfDza39MBmdqegJfm7SnqL4OQVDYC8O1oWdlNRRtGeyhOdUXntpr4 TgLbyQmBDLtRdh5iUSbDjtImEke4Px9cZA== X-Google-Smtp-Source: ACHHUZ5h6pFl8lX4Bn29mBSS7wrGOSE9xfa27HE7Ebo7IP41luC0hDBweSy4xJYQJ7PY8XLM7vWofg== X-Received: by 2002:a1c:7718:0:b0:3f4:2452:9667 with SMTP id t24-20020a1c7718000000b003f424529667mr6319487wmi.30.1685267014669; Sun, 28 May 2023 02:43:34 -0700 (PDT) Received: from localhost ([37.46.46.3]) by smtp.gmail.com with ESMTPSA id l21-20020a1c7915000000b003f603b8eb5asm10758191wme.7.2023.05.28.02.43.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 May 2023 02:43:34 -0700 (PDT) From: Efraim Flashner Date: Sun, 28 May 2023 12:44:18 +0300 Message-Id: <5085b2db36a14af32131e5024a0952d9f3e700ed.1685266344.git.efraim@flashner.co.il> 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/bootloader/u-boot.scm (install-sifive-unmatched-u-boot, u-boot-sifive-unmatched-bootloader): New variables. --- gnu/bootloader/u-boot.scm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gnu/bootloader/u-boot.scm b/gnu/bootloader/u-boot.scm index 65d7923465..712db15b02 100644 --- a/gnu/bootloader/u-boot.scm +++ b/gnu/bootloader/u-boot.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2020 Julien Lepiller ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2022 Maxim Cournoyer +;;; Copyright © 2023 Efraim Flashner ;;; ;;; This file is part of GNU Guix. ;;; @@ -43,6 +44,7 @@ (define-module (gnu bootloader u-boot) u-boot-puma-rk3399-bootloader u-boot-rock64-rk3328-bootloader u-boot-rockpro64-rk3399-bootloader + u-boot-sifive-unmatched-bootloader u-boot-ts7970-q-2g-1000mhz-c-bootloader u-boot-wandboard-bootloader)) @@ -135,6 +137,15 @@ (define install-u-boot-ts7970-q-2g-1000mhz-c-u-boot (install-dir (string-append mount-point "/boot"))) (install-file u-boot.imx install-dir)))) +(define install-sifive-unmatched-u-boot + #~(lambda (bootloader root-index image) + (let ((spl (string-append bootloader "/libexec/spl/u-boot-spl.bin")) + (u-boot (string-append bootloader "/libexec/u-boot.itb"))) + (write-file-on-device spl (stat:size (stat spl)) + image (* 34 512)) + (write-file-on-device u-boot (stat:size (stat u-boot)) + image (* 2082 512))))) + ;;; @@ -273,3 +284,9 @@ (define u-boot-ts7970-q-2g-1000mhz-c-bootloader (package u-boot-ts7970-q-2g-1000mhz-c) (installer install-u-boot-ts7970-q-2g-1000mhz-c-u-boot) (disk-image-installer #f))) + +(define u-boot-sifive-unmatched-bootloader + (bootloader + (inherit u-boot-bootloader) + (package u-boot-sifive-unmatched) + (disk-image-installer install-sifive-unmatched-u-boot))) From patchwork Sun May 28 09:44:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Efraim Flashner X-Patchwork-Id: 50376 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 C181E27BBE9; Sun, 28 May 2023 10:44:17 +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 autolearn=unavailable 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 3A39E27BBE2 for ; Sun, 28 May 2023 10:44:16 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q3CwX-0008Dx-CD; Sun, 28 May 2023 05:44:05 -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 1q3CwU-0008Da-GP for guix-patches@gnu.org; Sun, 28 May 2023 05:44:02 -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 1q3CwU-0003JZ-8j for guix-patches@gnu.org; Sun, 28 May 2023 05:44:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q3CwU-0001bN-4v for guix-patches@gnu.org; Sun, 28 May 2023 05:44:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63766] [PATCH 2/4] gnu: image: Add support for unformatted partitions. 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.16852670286105 (code B ref 63766); Sun, 28 May 2023 09:44:02 +0000 Received: (at 63766) by debbugs.gnu.org; 28 May 2023 09:43:48 +0000 Received: from localhost ([127.0.0.1]:53295 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3CwG-0001aO-Ay for submit@debbugs.gnu.org; Sun, 28 May 2023 05:43:48 -0400 Received: from mail-wm1-f52.google.com ([209.85.128.52]:45308) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3CwA-0001Zg-9M for 63766@debbugs.gnu.org; Sun, 28 May 2023 05:43:43 -0400 Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-3f6cbdf16d2so14473805e9.2 for <63766@debbugs.gnu.org>; Sun, 28 May 2023 02:43:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685267016; x=1687859016; 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=iQg9ql3ZIuaP1nOqFaG3LeLoMOfUqmLDaS+XeSF4iWI=; b=JDCcC+1A9qXR6h4ZaE8QL4cdjyg5U4R0FbDxKFTSdznHxVqZ1uBXYewZ7Ne7zEtj48 +rpzwgUhduqnr5jBoKDgXOLysIA8MCWlWw6l5A8B6yaOdtDIMYcOGW7eKnj5heD6fVGt IRKoYAeuha9Q6cFp88PHMsxk3+RinhNkgpxqTsshMaiR9IGv1JmNOUWPDNXjWm7jBaMS wvx+etRI7/y2ZSQ2qt5ULh9HBliXBySLEKWih8J50zaMfWLz8N+RC7VXRCt+VhQIGK46 lf/rnClne3ZCCjZa8Zl26Z0q5t5LuwUo0287yyw6rW9Z0HYQFfc26pKxwdhs+tHbnK4b AOSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685267016; x=1687859016; 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=iQg9ql3ZIuaP1nOqFaG3LeLoMOfUqmLDaS+XeSF4iWI=; b=ATOIXrbndNf4ccMF1TKeWjMmsVIqwGTpAvRgcVfwAkb71HVAFCQGyLayH16yWwn++g qj52jy2GmFcbC1B3OWj6ymzOoxCQwUCTTg3IV64h7etQwzHEEyrls8vLGQAHyxiORg20 N4dw6zVyA+sPeFDYmES89Z17J/BWNY0vSzxVzW2Mf50SStItrz0ZMYW0luv7nv1AIfes 2UgSMuaBJR3hxnT58Uuq2/8VOBfhwggB7uNmqrg1mcOv4eoZszZmb3WJ7AcOK7ZcIOUe 0TWK5PHtFc4gocx/eQfgLRgkFhqkHAgNkQSUwAE6rlw+FMdXuWTy7Ol3l10b70O8pMWB 7hpg== X-Gm-Message-State: AC+VfDywFeaE5PTyLjuBTtzZxx6SYd4znmEOsahZpqFPKNm4ZE/wlQDB GOifWnxrEJOSVWRROt/bHuDDECPErIAfnw== X-Google-Smtp-Source: ACHHUZ5rxZkVmOmu3IPMBHsoMs+V5QVgNtrQfToRim6a5Zt1DoCr88EgwyXOAEE89AGzFvfxu/hlzA== X-Received: by 2002:a1c:7319:0:b0:3f7:5d:4a08 with SMTP id d25-20020a1c7319000000b003f7005d4a08mr1215262wmb.1.1685267016451; Sun, 28 May 2023 02:43:36 -0700 (PDT) Received: from localhost ([37.46.46.3]) by smtp.gmail.com with ESMTPSA id q21-20020a1ce915000000b003f421979398sm14196469wmc.26.2023.05.28.02.43.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 May 2023 02:43:36 -0700 (PDT) From: Efraim Flashner Date: Sun, 28 May 2023 12:44:19 +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/build/image.scm (make-unformatted-image): New procedure. (make-partition-image): Add support for unformatted partition. * gnu/system/image.scm (system-disk-image)[partition->gpt-type]: Add case for using unformatted partition uuid. [partition-image]: Add coreutils to image-builder closure. --- gnu/build/image.scm | 8 ++++++++ gnu/system/image.scm | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/gnu/build/image.scm b/gnu/build/image.scm index 65a0373980..d47cb31aa0 100644 --- a/gnu/build/image.scm +++ b/gnu/build/image.scm @@ -7,6 +7,7 @@ ;;; Copyright © 2020 Mathieu Othacehe ;;; Copyright © 2022 Pavel Shlyak ;;; Copyright © 2022 Denis 'GNUtoo' Carikli +;;; Copyright © 2023 Efraim Flashner ;;; ;;; This file is part of GNU Guix. ;;; @@ -122,6 +123,11 @@ (define* (make-vfat-image partition target root fs-bits) (string-append "::" file)))) (scandir root)))) +(define* (make-unformatted-image partition target) + "Make an unformatted partition of a certain size." + (let ((size (partition-size partition))) + (invoke "truncate" "--size" (number->string size) target))) + (define* (make-partition-image partition-sexp target root) "Create and return the image of PARTITION-SEXP as TARGET. Use the given ROOT directory to populate the image." @@ -134,6 +140,8 @@ (define* (make-partition-image partition-sexp target root) (make-vfat-image partition target root 16)) ((string=? type "fat32") (make-vfat-image partition target root 32)) + ((string=? type "unformatted") + (make-unformatted-image partition target)) (else (raise (condition (&message diff --git a/gnu/system/image.scm b/gnu/system/image.scm index afef79185f..3fe813f096 100644 --- a/gnu/system/image.scm +++ b/gnu/system/image.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2022 Pavel Shlyak ;;; Copyright © 2022 Denis 'GNUtoo' Carikli ;;; Copyright © 2022 Alex Griffin +;;; Copyright © 2023 Efraim Flashner ;;; ;;; This file is part of GNU Guix. ;;; @@ -390,6 +391,9 @@ (define* (system-disk-image image ((or (string=? file-system "vfat") (string=? file-system "fat16") (string=? file-system "fat32")) "F") + ((and (string=? file-system "unformatted") + (partition-uuid partition)) + (uuid->string (partition-uuid partition))) (else (raise (condition (&message @@ -414,7 +418,11 @@ (define* (system-disk-image image (with-imported-modules* (let ((initializer (or #$(partition-initializer partition) initialize-root-partition)) - (inputs '#+(list e2fsprogs fakeroot dosfstools mtools)) + (inputs '#+(list e2fsprogs ; ext2/3/4 + fakeroot + dosfstools ; vfat + mtools ; vfat + coreutils)) ; truncate (image-root "tmp-root")) (sql-schema #$schema) From patchwork Sun May 28 09:44:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Efraim Flashner X-Patchwork-Id: 50378 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 B4AE227BBE9; Sun, 28 May 2023 10:44:37 +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=unavailable 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 1F4E427BBE2 for ; Sun, 28 May 2023 10:44:36 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q3Cwa-0008EH-0k; 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 1q3CwU-0008Dn-RQ for guix-patches@gnu.org; Sun, 28 May 2023 05:44:02 -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 1q3CwU-0003Jh-Jj for guix-patches@gnu.org; Sun, 28 May 2023 05:44:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q3CwU-0001bU-GD for guix-patches@gnu.org; Sun, 28 May 2023 05:44:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63766] [PATCH 3/4] system: images: Add unmatched module. 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.16852670296113 (code B ref 63766); Sun, 28 May 2023 09:44:02 +0000 Received: (at 63766) by debbugs.gnu.org; 28 May 2023 09:43:49 +0000 Received: from localhost ([127.0.0.1]:53297 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3CwG-0001aQ-QP for submit@debbugs.gnu.org; Sun, 28 May 2023 05:43:49 -0400 Received: from mail-wr1-f54.google.com ([209.85.221.54]:53353) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3CwC-0001Zk-29 for 63766@debbugs.gnu.org; Sun, 28 May 2023 05:43:44 -0400 Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-30ae95c4e75so182271f8f.2 for <63766@debbugs.gnu.org>; Sun, 28 May 2023 02:43:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685267018; x=1687859018; 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=NAbOzbzqxJ6lYEiJzrVXpSrrHjtNe8N8kxIXaw8gDl4=; b=c+oCEYRq0o6argMR2qsMjJJ9CLrhIc2JAc8Zw9JMp7RiemoLxionedAfyV53RFotFo PAS2h2JMvPtGQbXsQjqcL2ktYichQGZuW4TalpBZW4rnYlUO7K2Icaq4whv8Jz9J47n6 gqf3fVVUezRlBW2YvIfFnEB6bKqpoNG/4Kti55Hd0vSq3+oWlW7j8Z2P/CFQzrosWAHP 3zF4H74XmPb9mpoKg/4zfHh40qh/XRLBW93TR+XHlk2CQ5L6cNlOxGzKJDdUIf2HfDxD 0gCw2yVUv3HGtlY2h91/3z7P08OOB2QK69USNnkqTTkP/AsozuzHD0P1vbJldeTppGSZ T69Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685267018; x=1687859018; 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=NAbOzbzqxJ6lYEiJzrVXpSrrHjtNe8N8kxIXaw8gDl4=; b=P0XUU66MHi6cE5Lw9jgTyXXBtW2KQBU80CGvCNZHcXt2vY0do+j6DlBio1BKu1KmFP U3fzD9izV72JDHKGuPz35VQb/ENuHROSMGJ60NaF0yQbzOafxu0GPDbkQiTqkrtubreP c/ITVodq5kHwggRYyJDAgRLRZZQcqg1bRHXKnV6NfoJbP35d7BpszU6Ab4bCNhi/GoGq /t9wTjHrS1UL9VuE6vgtuJKT15hVn30EHomKM1NsSo882Q40syHID5TQOLCC089PWYdr Ontm/UiQ7yL27PwjwBHctafDhSDm55tjWG6aQRPtsn7FgS1DZU8cONOBDGUamBsJpYS0 sX0Q== X-Gm-Message-State: AC+VfDwmQ0UkF7Tf0QVOJ2WCVEGXCQbGWtGcPPnn1W5IfKFmChhhIXcs 2Wt6lfxIXkglZpEFXT18r1fm7lI4EP9BiQ== X-Google-Smtp-Source: ACHHUZ5TCSGAfkj7SbpPhlXb8YBY90Gjwzr4x+BQJqI+VKHgZky09LVQ0zXgp6pCAvkPS9toh1JFsA== X-Received: by 2002:a5d:4e09:0:b0:309:3c19:a127 with SMTP id p9-20020a5d4e09000000b003093c19a127mr6247375wrt.36.1685267018207; Sun, 28 May 2023 02:43:38 -0700 (PDT) Received: from localhost ([37.46.46.3]) by smtp.gmail.com with ESMTPSA id q18-20020adffed2000000b003047dc162f7sm10245515wrs.67.2023.05.28.02.43.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 May 2023 02:43:37 -0700 (PDT) From: Efraim Flashner Date: Sun, 28 May 2023 12:44:20 +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/system/images/unmatched.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. --- gnu/local.mk | 1 + gnu/system/images/unmatched.scm | 94 +++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 gnu/system/images/unmatched.scm diff --git a/gnu/local.mk b/gnu/local.mk index 18e8235140..50d65a3dba 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -741,6 +741,7 @@ GNU_SYSTEM_MODULES = \ %D%/system/images/pine64.scm \ %D%/system/images/pinebook-pro.scm \ %D%/system/images/rock64.scm \ + %D%/system/images/unmatched.scm \ %D%/system/images/wsl2.scm \ \ %D%/machine.scm \ diff --git a/gnu/system/images/unmatched.scm b/gnu/system/images/unmatched.scm new file mode 100644 index 0000000000..06d8d876d1 --- /dev/null +++ b/gnu/system/images/unmatched.scm @@ -0,0 +1,94 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2023 Efraim Flashner +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu system images unmatched) + #:use-module (gnu bootloader) + #:use-module (gnu bootloader u-boot) + #:use-module (gnu image) + #:use-module (gnu packages linux) + #:use-module (gnu services) + #:use-module (gnu services base) + #:use-module (gnu services networking) + #:use-module (gnu system) + #:use-module (gnu system file-systems) + #:use-module (gnu system image) + #:use-module (guix platforms riscv) + #:use-module (srfi srfi-26) + #:export (unmatched-barebones-os + unmatched-image-type + unmatched-barebones-raw-image)) + +(define unmatched-barebones-os + (operating-system + (host-name "unmatched") + (timezone "Asia/Jerusalem") + (locale "en_US.utf8") + (bootloader (bootloader-configuration + (bootloader u-boot-sifive-unmatched-bootloader) + (targets '("/dev/vda")))) + (initrd-modules '()) + (kernel linux-libre-riscv64-generic) + (file-systems (cons (file-system + (device (file-system-label "my-root")) + (mount-point "/") + (type "ext4")) + %base-file-systems)) + (services + (append (list (service agetty-service-type + (agetty-configuration + (extra-options '("-L")) ; no carrier detect + (baud-rate "115200") + (term "vt100") + (tty "ttySIF0"))) + (service dhcp-client-service-type)) + %base-services)))) + +(define unmatched-disk-image + (image-without-os + (format 'disk-image) + (partition-table-type 'gpt) + ;; https://source.denx.de/u-boot/u-boot/-/blob/master/doc/board/sifive/unmatched.rst + (partitions (list + (partition + (size (* 1 (expt 2 20))) + (label "spl") + (offset (* 34 512)) + (file-system "unformatted") + (uuid (uuid "5b193300-fc78-40cd-8002-e86c45580b47"))) ; HiFive FSBL + (partition + (size (* 4 (expt 2 20))) + (label "uboot") + (offset (* 2082 512)) + (file-system "unformatted") + (uuid (uuid "2e54b353-1271-4842-806f-e436d6af6985"))) ; HiFive BBL + root-partition)))) + +(define unmatched-image-type + (image-type + (name 'unmatched-raw) + (constructor (cut image-with-os unmatched-disk-image <>)))) + +(define unmatched-barebones-raw-image + (image + (inherit + (os+platform->image unmatched-barebones-os riscv64-linux + #:type unmatched-image-type)) + (name 'unmatched-barebones-raw-image))) + +;; Return the default image. +unmatched-barebones-raw-image 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; +--