From patchwork Mon Nov 30 00:52:25 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Murray X-Patchwork-Id: 106324 Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.23419.1795999968047520144 for ; Sun, 29 Nov 2026 16:52:48 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@konsulko.com header.s=google header.b=Jt0GW3cQ; spf=pass (domain: konsulko.com, ip: 209.85.160.170, mailfrom: scott.murray@konsulko.com) Received: by mail-qt1-f170.google.com with SMTP id d75a77b69052e-5569551d19dso113080051cf.0 for ; Sun, 29 Nov 2026 16:52:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1795999967; x=1796604767; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=yIlXuHHQCRSHgJr+43F30KbvdyePymq7sk3wOreJGD4=; b=Jt0GW3cQSYVRQuAbFJhI8J1QV0xIOUUTOW0c+/XFkyjnHSodANgbn246cQwT5yksPd H5PJY68z+ml8WCqmtQWwegqKRhy3mxNBJe2pef9LpIpZuQ6EmNEMjRol6aHnGih19OBh aE3jNfer+/5Edcrk6qX8zkgolnfrc3HM/kZaA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795999967; x=1796604767; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=yIlXuHHQCRSHgJr+43F30KbvdyePymq7sk3wOreJGD4=; b=jeABXZBKFgEWZ2SV8CL9T0FEMf+61j+fyIYAfYpGDEH6vXVGfc+NbSaSJhIRzloPMw liqipth2A7RMFbGbN5zTTiA6Rq5GoNh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xFicUONiL26W0vqKxQC91GClNoZBzbsADlnbBUpVIttyOWY7Zww== X-Received: by 2002:a05:6214:328a:b0:921:22b1:f419 with SMTP id 6a1803df08f44-9212e125f67mr607600916d6.33.1795999966834; Sun, 29 Nov 2026 16:52:46 -0800 (PST) Return-Path: Received: from ghidorah.spiteful.org (107-179-213-3.cpe.teksavvy.com. [107.179.213.3]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-921787fd72asm141946796d6.12.2026.11.29.16.52.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2026 16:52:46 -0800 (PST) From: Scott Murray To: yocto-patches@lists.yoctoproject.org Subject: [meta-lts-mixins][wrynose/rust][PATCH 07/10] rust-target-config.bbclass: pass on all RISC-V extensions to LLVM Date: Sun, 29 Nov 2026 19:52:25 -0500 Message-ID: <442604caedc3e100243dfc203b25d0c8e24f7dc4.1795997683.git.scott.murray@konsulko.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Mon, 30 Nov 2026 00:52:51 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto-patches/message/5594 From: Trevor Gamblin llvm_features_from_tune() doesn't pass on all RISC-V extensions listed in TUNE_FEATURES, but rather has a fixed subset listed, and ignores others. This means that with new profiles and custom tunes, Rust code still gets compiled for riscv64gc plus a handful of extras. LLVM's RISC-V extension names match those we use for TUNE_FEATURES, so we can instead pass on each extension in the same order. Signed-off-by: Trevor Gamblin Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie (adapted from oe-core commit 3b78f64f23d9ad1e0c94943f4a180189a57474eb) Signed-off-by: Scott Murray --- classes-recipe/rust-target-config.bbclass | 34 ++++++----------------- 1 file changed, 8 insertions(+), 26 deletions(-) diff --git a/classes-recipe/rust-target-config.bbclass b/classes-recipe/rust-target-config.bbclass index 2faecd5..89fbd19 100644 --- a/classes-recipe/rust-target-config.bbclass +++ b/classes-recipe/rust-target-config.bbclass @@ -83,32 +83,14 @@ def llvm_features_from_tune(d): if 'cortexa57' in feat: f.append("+v8a") if 'rv' in feat: - if 'm' in feat: - f.append("+m") - if 'a' in feat: - f.append("+a") - if 'f' in feat: - f.append("+f") - if 'd' in feat: - f.append("+d") - if 'c' in feat: - f.append("+c") - if 'v' in feat: - f.append("+v") - if 'zicbom' in feat: - f.append("+zicbom") - if 'zicsr' in feat: - f.append("+zicsr") - if 'zifencei' in feat: - f.append("+zifencei") - if 'zba' in feat: - f.append("+zba") - if 'zbb' in feat: - f.append("+zbb") - if 'zbc' in feat: - f.append("+zbc") - if 'zbs' in feat: - f.append("+zbs") + # LLVM uses the same names as TUNE_FEATURES for RISC-V extensions, so + # pass on every single-letter (except the base i) and z, s or x + # extension, in TUNE_FEATURES order to keep the result stable. Other + # tune flags (e.g. "rv", "64" or core names) aren't extensions. + for e in dict.fromkeys(d.getVar('TUNE_FEATURES').split()): + if (len(e) == 1 and e.isalpha() and e != 'i') or \ + (len(e) > 1 and e[0] in 'zsx' and e.isalnum()): + f.append("+" + e) return f llvm_features_from_tune[vardepvalue] = "${@llvm_features_from_tune(d)}"