From patchwork Fri Feb 20 00:19:16 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1910 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771546818; bh=vwsFB1C1cCME4F11eQulWAMY3HyJAaGyXnli2do4LJo=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=GRfMOAHZW9nwm86zN6/OK+zI7C17XZ5wWrXg1jwSaa3g0WT3lgBwJfDUaNJCFDswv rRbLISt7MQuaAwlN3+KUigs2UowKGFpQGN2baHMm+noHALjC0LeQlzYglijP9ebWrK p7lfj8OjIM1qiin3y3IVcbKKtErpXfCKOSXS/+AMnDCyAms5cP3lspgP69rnLK6tkJ 2vBVlOjYL2tE/7/g1OR24kHrYOMo0/wbrFAVYtd4PLZn9zakSU5REz0BeBTUE6KqI7 v0pCzTeeabCbQNO/WgwBg6SHd8+6M54dytbemoogS7Av8FZrfMpGzkrrswHNH+Z3O/ DLlNODMpyEmfw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id ADDD369C89 for ; Thu, 19 Feb 2026 17:20:18 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id uvWvbZWTuhv8 for ; Thu, 19 Feb 2026 17:20:18 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771546816; bh=vwsFB1C1cCME4F11eQulWAMY3HyJAaGyXnli2do4LJo=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=kKVcLzN6j5NKn/Ug+UMqBjAiuJggjH/8OayWebjkgIv60u6cuRu+oUByUfMoNFJEM RAWy2QzlgNrfuFvm+L42V8sbytH7GIeJIpP406UbVyX8gAththYrOeW+mP3hxeik5e oO8q60t2aU+wGLkie0fqLUDj2mWshUJjI3D1P0p3d5oSrLkJA5REN6hSuihMvUR6+o Dt8QuSNm18x/INu0F0vmjL75faqQvpsf+6NcC1ks0/INVOtcc5NIXFnjaAYUtypgp7 YT2XwvmpqAwvL8aiaVubTszPY+UpGCidj1CVAgPjL4Yrha2QDy7I9xeTp1eQ/90G+c TSxe/xASurbsg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A62CE69C87 for ; Thu, 19 Feb 2026 17:20:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771546814; bh=YlZIFKkUpqUNI/YYAJYeSPCZAgFvrfuh85QY7izA2ks=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P62ycUL0GifcJHxb7mQkCWNnlqvAy0gb6hM5ya8gE4MaIAErrcmfqHb7WYCe6iAw2 9YKzKGVhpgHGW/RzO5oEL0lEIsgRHUoLi6v3vbm13A5tqGJkTYIcRzTXaCPWLih6Lv Ve9Qsh53dyNyeE+pgAf79qpOpwk5vrbhYzpq3+ouT+SwdGO90czMn7aG6ewsHx8K9B PLqZpyi48DkivRIj0o9RZpkY1OjpSTfhgGmOyAxdNTfjrjyL1xtJ2+BUuk+VSkWvCP CpNTAAiSW1XNljPFeiPWvqByVPtiHLyDmM+jJaEyq9RPEig0jrTDumEromvOZT63vv lsJJhYIUItnbQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DC0F769C87; Thu, 19 Feb 2026 17:20:14 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 4daeLZemXdPd; Thu, 19 Feb 2026 17:20:14 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771546814; bh=qRkBkxJI/NBRZVwM3sOQo0eiQ0Abh5ISJ6cVU7Kas4s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UBCsvnu/GKtj0iUQc9SKVvsNQJIPBNxhy/qA8nFzXot3wMjdXtB48vnsN+YcuA58V 5/MrcceE23uPeHUWN0uN77j9vbNMorZGbZK8YHP3sZWNPFPukTbNhsu0QA0Cd4hmhJ CvZW3w7SPjNSrMEWAERc/Twg88g8K603gkrJsFTLSfsJd540MU6L9EnUmGFHOeDKE8 HSa5uI/K+6TEjDpGURTTr/iRjTMfB8ce28SmEBx02KjgabYqHfVE5Ea8Yx+0Y9T1cm ssbaI0mlla4QLToVoipiRlVHpKUB4gu27Ez0HI9NOjBxqq4Pqw4WCSh7hKjQiJuVam Nx4T2zKJMMUBw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 5E6CA69C7C; Thu, 19 Feb 2026 17:20:14 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Thu, 19 Feb 2026 17:19:16 -0700 Message-ID: <20260220001926.2366140-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260220001926.2366140-1-sjg@u-boot.org> References: <20260220001926.2366140-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: LJJUPBR4XOSAPT7VQLTMIBF4TLFBHXME X-Message-ID-Hash: LJJUPBR4XOSAPT7VQLTMIBF4TLFBHXME X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 6" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 08/13] ulib: riscv: Enable Rust demo for qemu-riscv64 List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The Rust ulib demo currently works on x86 (32-bit and 64-bit) but not on RISC-V. Unlike x86, RISC-V has no calling-convention mismatch, so Rust's extern "C" naturally matches the standard ABI with no extra flags. Add the riscv64gc-unknown-none-elf built-in Rust target (which already has panic-strategy: abort) and enable CONFIG_RUST_EXAMPLES in the qemu-riscv64 defconfig so that rust-demo.bin is produced alongside demo.bin Co-developed-by: Claude Opus 4.6 Signed-off-by: Simon Glass --- configs/qemu-riscv64_defconfig | 1 + scripts/Makefile.ulib-example | 2 ++ 2 files changed, 3 insertions(+) diff --git a/configs/qemu-riscv64_defconfig b/configs/qemu-riscv64_defconfig index 4423d36b782..d30b017169e 100644 --- a/configs/qemu-riscv64_defconfig +++ b/configs/qemu-riscv64_defconfig @@ -24,3 +24,4 @@ CONFIG_UTHREAD=y CONFIG_UNIT_TEST=y CONFIG_ULIB=y CONFIG_EXAMPLES=y +CONFIG_RUST_EXAMPLES=y diff --git a/scripts/Makefile.ulib-example b/scripts/Makefile.ulib-example index a398f3e9621..ae3f75b33fb 100644 --- a/scripts/Makefile.ulib-example +++ b/scripts/Makefile.ulib-example @@ -25,6 +25,8 @@ RUST_TARGET_x86 := i686-unknown-linux-gnu RUST_TARGET_x86_64 := x86_64-unknown-none RUST_FLAGS_x86 := -C panic=abort -C relocation-model=static RUST_FLAGS_x86_64 := +RUST_TARGET_riscv := riscv64gc-unknown-none-elf +RUST_FLAGS_riscv := ifdef CONFIG_X86_64 RUST_TARGET := $(RUST_TARGET_$(EXAMPLE_ARCH)_64)