From patchwork Thu Sep 10 15:08:42 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trevor Gamblin X-Patchwork-Id: 97877 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2B33C79F9F for ; Thu, 10 Sep 2026 15:21:45 +0000 (UTC) Received: from mail-qk2-f12.google.com (mail-qk2-f12.google.com [74.125.230.204]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.16664.1789052928721746564 for ; Thu, 10 Sep 2026 08:08:49 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@baylibre.com header.s=google header.b=D+xHf44Y; spf=pass (domain: baylibre.com, ip: 74.125.230.204, mailfrom: tgamblin@baylibre.com) Received: by mail-qk2-f12.google.com with SMTP id d75a77b69052e-52fb766bfd3so15780871cf.0 for ; Thu, 10 Sep 2026 08:08:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1789052928; x=1789657728; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=BB6XTWiA7d0PRr2bH5p46rEh38GwksFRpnCdp7AsVMk=; b=D+xHf44Yb6sOoqb3OP+7wctZEHvDJkrau+Y3UBGHx3SJsfQins9xfy5y9ASs9/ynVZ xkBhDFfcMyN546jV04iDqzHt+oDhkDDMMloL2mZYxnJocokgjTs4wCajhKS0x/mE3hPU Ot6PqtOGC1asklEnfr50DFQd02Qw/Afm7H0HuKW9Q5hqd7G9ma/PO9wpVqmrqHPEu14l y2WcoHcc4FNdUNV3KYl0TiZjgNtN0K2MRNZBSh0HC50Wj/0l7Oj/qhXY7BN/RKT8V0zU oWzJz3FoLipnphQ5G4XWXL1SNoRm86HsA6/HdpiS6Ifs2ycXEQ+6DmgouRW/J78RMnJ7 vHzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789052928; x=1789657728; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=BB6XTWiA7d0PRr2bH5p46rEh38GwksFRpnCdp7AsVMk=; b=F5TvkZ4ETnW1kpnPZM33zen4DJFh/r8KZgrzqEomj3W+IIDdWxl8b2Bci8MQdgX7nX idjqs50F7pxX8O4MkcL7rdo9Qvk3NWCvSKezV8UAQDZ73Z34oFUKonMEk3H4zBhU3myI omxLyRjd3fTJIBDhETzq1mQD/SW1Nm+UEmNmkKcQN8+WUo3mnnvAhGJy1HAd/KCvD/8C sRiCuJvHINxGXXkWf0Jey+Dzj+shfFxSjNNRNpidz2hrjG7QThgRFRCHDoxYe1GXbOzK 2XF0ujL17Y01/Gjy5WYuECCdaENWYk25PGkS1gvriGzkvxJa8XOeiDlxIJ0s9xy3eiP2 JQRg== X-Gm-Message-State: AFuF++lVW6GMb5hMe4svvVjXpZ1pflfGqRLSxZbf/aIYnkzEdW0UsDY6 D5lG9LttGlxDFP6AEZTWq8QFDEZ+dp5mO1ua97O4ZE45m1T2o4Z2YkSuGfhgnS6S7Ju7Q9mKpRi B2WFZ X-Gm-Gg: AYBFou3T0+K7vgZPwwFr9GXXtWkkPN3SEwIxBJjIS6yGjvvs3zWvceGpI73bwqOghwM L7F9biuF+Fje9mL90Q8exf50RkCZMwSxmbq3s8SdSNEXSzf0wl1X62paUGdnFO+tKRLdV74UjBD bRKDPlisn3xOWnoPhOF8XDPE6hzKqmvpVdFj4XpdBQdnic5HrZENc2ODit1SAMyhkZDfsOM7Jyx Uz6NBPekw5QCM7JmmWUkpsXCcuhsDe/oTVdpJ41wSB46SlaHshgGlmM32cuKHN2niOpzP8xNeA4 Ahf7C8KrEekuEBKUSltjiK3rzsggybT3zA/60hKJvgG1v5SUDgz3reISpDqN5IUpMGbutW+20yW HZVaEeXfkoKhn6UyisMlpLcJ3Hct8lUFB+XJNWuv2GHw2ihh1B0w9hGOYw0wu+IZ7TPssLPR79X WJU3DYJj9BVN4QEyTpcOj2+5DsrfXJgpF0/02Ogq4ukaepKdZmIwUGlDI4rybCtuqI8PHOY3k7Z BDalItlx7gTrqFzcAKDhajUnw6xgSQPYg== X-Received: by 2002:a05:622a:646:b0:530:430e:8125 with SMTP id d75a77b69052e-530aefba436mr117691381cf.46.1789052927436; Thu, 10 Sep 2026 08:08:47 -0700 (PDT) Received: from localhost ([2001:1970:3847:e000:e8bd:ca0f:c232:9f10]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-910406af144sm172237426d6.40.2026.09.10.08.08.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2026 08:08:45 -0700 (PDT) From: "Trevor Gamblin" To: openembedded-core@lists.openembedded.org Cc: mark.hatle@kernel.crashing.org Subject: [OE-core][PATCH 1/2] opensbi: patch Makefile for zicsr, zifencei extension check Date: Thu, 10 Sep 2026 11:08:42 -0400 Message-ID: <20260910150843.1531415-1-tgamblin@baylibre.com> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 10 Sep 2026 15:21:45 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/245587 Backport a patch from upstream to fix the way OpenSBI's Makefile checks for zicsr and zifencei extension support. The use of grep incorrectly matches against build paths generated by Yocto, so the patch directly checks the exit status from the assignment instead. [YOCTO #15897] Signed-off-by: Trevor Gamblin --- ...rep-when-setting-CC_SUPPORT_ZICSR_ZI.patch | 33 +++++++++++++++++++ meta/recipes-bsp/opensbi/opensbi_1.9.bb | 5 ++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-bsp/opensbi/files/0001-Makefile-don-t-grep-when-setting-CC_SUPPORT_ZICSR_ZI.patch diff --git a/meta/recipes-bsp/opensbi/files/0001-Makefile-don-t-grep-when-setting-CC_SUPPORT_ZICSR_ZI.patch b/meta/recipes-bsp/opensbi/files/0001-Makefile-don-t-grep-when-setting-CC_SUPPORT_ZICSR_ZI.patch new file mode 100644 index 0000000000..db93d69e7c --- /dev/null +++ b/meta/recipes-bsp/opensbi/files/0001-Makefile-don-t-grep-when-setting-CC_SUPPORT_ZICSR_ZI.patch @@ -0,0 +1,33 @@ +From b4ea30a4e46fa6fe4293f86c601394052e5e2b43 Mon Sep 17 00:00:00 2001 +From: Trevor Gamblin +Date: Wed, 9 Sep 2026 14:33:24 -0400 +Subject: [PATCH 1/3] Makefile: don't grep when setting + CC_SUPPORT_ZICSR_ZIFENCEI + +Upstream-Status: Submitted [https://lists.infradead.org/pipermail/opensbi/2026-September/010606.html] + +Check exit status from the compiler/linker check directly (similar to +OPENSBI_LD_PIE), rather than using grep to search for a pattern. This +avoids potential unrelated matches in the command. + +Signed-off-by: Trevor Gamblin +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index aebaa98c..07ac7e30 100644 +--- a/Makefile ++++ b/Makefile +@@ -204,7 +204,7 @@ CC_SUPPORT_SAVE_RESTORE := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) -nostdlib + CC_SUPPORT_STRICT_ALIGN := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) -nostdlib -mstrict-align -x c /dev/null -o /dev/null 2>&1 | grep -e "-mstrict-align" -e "-mno-unaligned-access" >/dev/null && echo n || echo y) + + # Check whether the assembler and the compiler support the Zicsr and Zifencei extensions +-CC_SUPPORT_ZICSR_ZIFENCEI := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) -nostdlib -march=rv$(OPENSBI_CC_XLEN)imafd_zicsr_zifencei -x c /dev/null -o /dev/null 2>&1 | grep -e "zicsr" -e "zifencei" > /dev/null && echo n || echo y) ++CC_SUPPORT_ZICSR_ZIFENCEI := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) -nostdlib -march=rv$(OPENSBI_CC_XLEN)imafd_zicsr_zifencei -x c /dev/null -o /dev/null >/dev/null 2>&1 && echo y || echo n) + + # Check whether the assembler and the compiler support the Vector extension + CC_SUPPORT_VECTOR := $(shell $(CC) $(CLANG_TARGET) $(RELAX_FLAG) -nostdlib -march=rv$(OPENSBI_CC_XLEN)gv -dM -E -x c /dev/null 2>&1 | grep -q riscv.*vector && echo y || echo n) +-- +2.55.0 + diff --git a/meta/recipes-bsp/opensbi/opensbi_1.9.bb b/meta/recipes-bsp/opensbi/opensbi_1.9.bb index 0142ef6787..954753d97e 100644 --- a/meta/recipes-bsp/opensbi/opensbi_1.9.bb +++ b/meta/recipes-bsp/opensbi/opensbi_1.9.bb @@ -9,7 +9,10 @@ require opensbi-payloads.inc inherit deploy SRCREV = "cbf9f6734dd85a982c63e3cb5db7ffe09da839ca" -SRC_URI = "git://github.com/riscv/opensbi.git;branch=master;protocol=https;tag=v${PV}" +SRC_URI = " \ + git://github.com/riscv/opensbi.git;branch=master;protocol=https;tag=v${PV} \ + file://0001-Makefile-don-t-grep-when-setting-CC_SUPPORT_ZICSR_ZI.patch \ + " TARGET_DBGSRC_DIR = "/share/opensbi/*/generic/firmware/"