From patchwork Mon Feb 16 01:34:48 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 124 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=1771205724; bh=1DM6w7f3n438Ix/h0K/Kamsv0324MTMcLPotq6eFsyI=; h=From:To:Date:CC:Subject:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=BtjaobYI7h/wM7ORBL1BUH1LWmf11JPfkyPNCPB6tvdjX7ww3u0PjtPLUO++T6dBI 5owQIh2HTxYDURQCeGQqy9vcyBPaVhc9zcSqQgV+jCd2twqL0c/ItGsmyhjRCNC49C jhDmY7ni1Xwk/FrNGfM3MCPSPFVTrCyj30SHsdluHouH1KDpVZXCblquGKmVdfW1wo ljc49xFbpxycb9g7IgOKJu02zfFwi1jDo6SIoiiwoJWnWlIBN+j97dToMgDgQJh7xF /ys8G15sSiBa3dVU0CV9XPae2/EG77M2gv8h3hbS+TsoAwJhYVAscqmxC5pnsgtREM sSUOK5be0xBWg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 89A0369BD1 for ; Sun, 15 Feb 2026 18:35:24 -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 ewuhfuBelLkj for ; Sun, 15 Feb 2026 18:35:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771205724; bh=1DM6w7f3n438Ix/h0K/Kamsv0324MTMcLPotq6eFsyI=; h=From:To:Date:CC:Subject:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=BtjaobYI7h/wM7ORBL1BUH1LWmf11JPfkyPNCPB6tvdjX7ww3u0PjtPLUO++T6dBI 5owQIh2HTxYDURQCeGQqy9vcyBPaVhc9zcSqQgV+jCd2twqL0c/ItGsmyhjRCNC49C jhDmY7ni1Xwk/FrNGfM3MCPSPFVTrCyj30SHsdluHouH1KDpVZXCblquGKmVdfW1wo ljc49xFbpxycb9g7IgOKJu02zfFwi1jDo6SIoiiwoJWnWlIBN+j97dToMgDgQJh7xF /ys8G15sSiBa3dVU0CV9XPae2/EG77M2gv8h3hbS+TsoAwJhYVAscqmxC5pnsgtREM sSUOK5be0xBWg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7094A69BCC for ; Sun, 15 Feb 2026 18:35:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771205722; bh=D9bpyLo/j5oUs0QWJunaoCg9HERJMxqZaAkC+U76fXI=; h=From:To:Cc:Subject:Date:From; b=slYSg4UpIvrkrP9y5gPjCGTlptZ4AJrEYAhw4u7prHXqHQSUbUKVr3xQEzdk9u6ar GgwdfhcjjbTEgu4NwX1V1u5w9/Vrx9A1dA4HO0Qn2mmCGqg+aqSp/WxsGNvzooc/wZ 5quHGAvGLeitrSo9Aafw990BhlKVkJ8YVD+YJ+BE7qI4D6WWd5I0mgthiAoyIkMNIE LAh8LwUPITrn6jU/N3rnZJOMiA5GDBBf6Q49ZAM1krulCytXnwidTj8PH2rF/uHpTB dRSWM7yEvlQjTkoTCle55X+SXekyUsg0J/Defz32TPL5Zq8XM7rd9DpMu6/bQ4IaXO 3079cf0rKR6Aw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6F86869BCC; Sun, 15 Feb 2026 18:35:22 -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 F7kbrHh2Ce8H; Sun, 15 Feb 2026 18:35:22 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771205718; bh=vf0Oq+xVsKuTx7EA0XEz/phx2I1U2/wBkZvcbA1vWx4=; h=From:To:Cc:Subject:Date:From; b=JV4wX0mJGaznyZ3oxbApavOmcZ9P2McxmcKbJWVMW103MHPudluietkLX2ePsl0H+ 6kANpLhQCbzhc0lQtr70dUT3wubqvtf1EqzOuo9TkEWGc6b8oRB4stTZvFHsqF0D6B HO51SL/JDPdUsZmQWP24dzOptMVNo76jx7C1t56oA0AUzpdheGwU10xzRBs2w9Mj5D 97ffM/xY9arzdYAeGRoey2Tu4No3PcpcB28X60Hit31BLhwDaGFlRsoBDCFh5c7uAz Dx/upz0xYa656SIVRwVNLr9OWA5lvmgRnYAhYpudWw4g9949yFf/HYTMootTvzxr3p w5SnkZtkXIMVw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 437A969AD9; Sun, 15 Feb 2026 18:35:18 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 15 Feb 2026 18:34:48 -0700 Message-ID: <20260216013511.4079770-1-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Message-ID-Hash: RTFMFO7CG2FWF6EQEGWC5ZG3PO5AVXGD X-Message-ID-Hash: RTFMFO7CG2FWF6EQEGWC5ZG3PO5AVXGD 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 X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 00/17] ulib: Add multi-arch demo and EFI app support 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 This series extends the ulib demo to ARM64 and RISC-V64, following the existing x86 pattern. Each architecture re-links U-Boot with the example objects so the demo's main() overrides the weak default. RISC-V requires an additional prelink-riscv step to resolve GOT entries in the static PIE binary. EFI app builds are also supported on all three architectures, producing a demo-app.efi binary that can boot under QEMU with UEFI firmware. A build_api.py fix handles empty archives that appear in cross-compiled EFI builds. All new demos have pytests that boot under QEMU and verify the expected output. A new 'localqemu' pytest marker skips these tests in lab mode, since they launch their own QEMU rather than using the lab's managed U-Boot instance. This also updates the build-qemu script to support RISC-V. Simon Glass (17): ulib: Skip empty archives in build_api.py objcopy step ulib: Build the static test binary by default ulib: test: Add localqemu marker to skip tests in lab ulib: test: Detect clang instead of checking binaries ulib: Extract common example build rules for demo ulib: x86: Add demo pytest for qemu-x86_64_nospl ulib: arm: Add demo binary and examples for qemu_arm64 ulib: riscv: Add demo binary and examples for qemu-riscv64 ulib: efi: Use ulib_has_main() in efi_main() ulib: x86: Add demo-app.efi target for EFI app builds ulib: x86: Enable examples for efi-x86_app64 ulib: test: Add a pytest for efi-x86_app64 demo ulib: arm: Enable demo EFI binary for efi-arm_app64 ulib: riscv: Enable demo EFI binary for efi-riscv_app64 ulib: test: Add EFI demo pytest for arm64 ulib: test: Add EFI demo pytest for riscv64 ulib: scripts: Add RISC-V support to build-qemu Makefile | 3 + arch/arm/Makefile | 6 + arch/riscv/Makefile | 7 + arch/x86/Makefile | 31 +--- configs/efi-arm_app64_defconfig | 2 + configs/efi-riscv_app64_defconfig | 2 + configs/efi-x86_app64_defconfig | 2 + configs/qemu-riscv64_defconfig | 2 + configs/qemu-x86_64_nospl_defconfig | 2 + configs/qemu_arm64_defconfig | 2 + doc/develop/pytest/usage.rst | 9 ++ examples/ulib/Kbuild | 2 +- lib/efi_client/efi_main.c | 3 +- scripts/Makefile.ulib-example | 63 ++++++++ scripts/build-qemu | 23 ++- scripts/build_api.py | 6 + test/py/conftest.py | 15 ++ test/py/pytest.ini | 1 + test/py/tests/test_ulib.py | 237 ++++++++++++++++++++++++---- 19 files changed, 351 insertions(+), 67 deletions(-) create mode 100644 scripts/Makefile.ulib-example