[Concept,11/13] ulib: arm64: Enable Rust demo for efi-arm_app64

Message ID 20260220001926.2366140-12-sjg@u-boot.org
State New
Headers
Series ulib: Enable the Rust demo on more architectures |

Commit Message

Simon Glass Feb. 20, 2026, 12:19 a.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

The EFI ARM64 board sets EXAMPLE_ARCH to arm but no RUST_TARGET_arm is
defined, so the Rust demo cannot build. Since only 64-bit ARM has ULIB
support, define RUST_TARGET_arm as aarch64-unknown-none (the same
approach used for RISC-V where only 64-bit is supported).

Enable CONFIG_RUST_EXAMPLES in efi-arm_app64_defconfig and add a QEMU
boot test that launches rust-demo-app.efi under QEMU_EFI.fd.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 configs/efi-arm_app64_defconfig | 1 +
 scripts/Makefile.ulib-example   | 2 ++
 test/py/tests/test_ulib.py      | 9 +++++++++
 3 files changed, 12 insertions(+)
  

Patch

diff --git a/configs/efi-arm_app64_defconfig b/configs/efi-arm_app64_defconfig
index a9c4686a106..4d43a5bc754 100644
--- a/configs/efi-arm_app64_defconfig
+++ b/configs/efi-arm_app64_defconfig
@@ -55,4 +55,5 @@  CONFIG_CONSOLE_SCROLL_LINES=5
 CONFIG_FAT_WRITE=y
 CONFIG_ULIB=y
 CONFIG_EXAMPLES=y
+CONFIG_RUST_EXAMPLES=y
 CONFIG_CMD_DHRYSTONE=y
diff --git a/scripts/Makefile.ulib-example b/scripts/Makefile.ulib-example
index ae3f75b33fb..fdb5a27fa1d 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_arm := aarch64-unknown-none
+RUST_FLAGS_arm :=
 RUST_TARGET_riscv := riscv64gc-unknown-none-elf
 RUST_FLAGS_riscv :=
 
diff --git a/test/py/tests/test_ulib.py b/test/py/tests/test_ulib.py
index 8ec5e985b52..851732fa1da 100644
--- a/test/py/tests/test_ulib.py
+++ b/test/py/tests/test_ulib.py
@@ -527,6 +527,15 @@  def test_ulib_demo_efi_arm64(ubman):
                  '/usr/share/qemu-efi-aarch64/QEMU_EFI.fd', None,
                  ['--machine', 'virt', '-cpu', 'max'])
 
+@pytest.mark.localqemu
+@pytest.mark.boardspec('efi-arm_app64')
+@pytest.mark.buildconfigspec("rust_examples")
+def test_ulib_rust_demo_efi_arm64(ubman):
+    """Test the Rust ulib demo EFI app under QEMU aarch64 with UEFI."""
+    run_efi_rust_demo(ubman, 'qemu-system-aarch64',
+                      '/usr/share/qemu-efi-aarch64/QEMU_EFI.fd', None,
+                      ['--machine', 'virt', '-cpu', 'max'])
+
 @pytest.mark.localqemu
 @pytest.mark.boardspec('efi-riscv_app64')
 @pytest.mark.buildconfigspec("examples")