Message ID | 20250904130459.848794-14-sjg@u-boot.org |
---|---|
State | New |
Headers |
Return-Path: <concept-bounces+u-boot-concept=u-boot.org@u-boot.org> 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=1756991165; bh=4mim2/Rs67Mcp9MtYN4WBLAOeOYMbFOTrmdUEXj1xFA=; 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=ZwqAcbqsXT2cL0qd23u6ukx2liFrkKdMKyw19BIbWdoWanggSVUikfyJQlYiz8Lq2 38iVkSP+qpIU8WFn/OyfVveuNtWBrHXv+szuvCyuBEtM47879PKiyp2YCc23YTr7S8 AyN9UrxKE2SiVSFwt06taKpQx/S4PiKOpfaN97WADeukjm7F3Qk8keiyB/yVzN2Aak bwbtfqZY8TaPaL9Nk0F3EyLDE1kWXsL81AjVB/0h19SuZ23f3ymBAWC8gGKtY9MaaP TkGn3q4fpaux154zedt3uwTTSG47FGa4AyI/NMH+4CDs9+fFvhE2kXuiqXjVv1I2oe VaCYPh0uHqYLg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 335C667966 for <u-boot-concept@u-boot.org>; Thu, 4 Sep 2025 07:06:05 -0600 (MDT) 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 tf4qidJVwXHC for <u-boot-concept@u-boot.org>; Thu, 4 Sep 2025 07:06:05 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756991165; bh=4mim2/Rs67Mcp9MtYN4WBLAOeOYMbFOTrmdUEXj1xFA=; 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=ZwqAcbqsXT2cL0qd23u6ukx2liFrkKdMKyw19BIbWdoWanggSVUikfyJQlYiz8Lq2 38iVkSP+qpIU8WFn/OyfVveuNtWBrHXv+szuvCyuBEtM47879PKiyp2YCc23YTr7S8 AyN9UrxKE2SiVSFwt06taKpQx/S4PiKOpfaN97WADeukjm7F3Qk8keiyB/yVzN2Aak bwbtfqZY8TaPaL9Nk0F3EyLDE1kWXsL81AjVB/0h19SuZ23f3ymBAWC8gGKtY9MaaP TkGn3q4fpaux154zedt3uwTTSG47FGa4AyI/NMH+4CDs9+fFvhE2kXuiqXjVv1I2oe VaCYPh0uHqYLg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2218367961 for <u-boot-concept@u-boot.org>; Thu, 4 Sep 2025 07:06:05 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756991164; bh=WOpMCInsuSd2kR5S5B2I6i/Lj9+vG5hKwvx3Tf8dJJc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CaBOvAFESRjbitVTuHEiGrAIA3ugDfCKWfpEa2/CGXjHAYaExaeo7LCKD3fhFw1bu vfacY4HOhN21IdU5+42H48/KbzEj/povO0HKLYAJk3n7zEGt1cs2KfCpztu/GS/hB5 Dn7PG1rrK7nPwSWhdnChpcTzfoYtsoBvOjNbLrNUxcpevCFHTjzpWDNDwrcp3njdTS z91uCkq8pPMLS+iKren5DcDMDlKELRhdgH2uw/FUYJQvKz8MkId0l+amrf8KxSiuWT vc6xiI62AfVt7hS+tWOgoJtJXt3GbXDW1zQnNCf0fDaWXMpM/nV2AcWgpTCIqbrwMZ pdGwzLBeQrlEw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 21FB86795C; Thu, 4 Sep 2025 07:06:04 -0600 (MDT) 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 ea1UTg6I--O0; Thu, 4 Sep 2025 07:06:04 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756991159; bh=1E0Dh98lmwCjxH7DdnYO1RS53nXpBjRnJVTW9wUC7vY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wKfqte58lMb8hFL4l7ZMI34Y/zV+pV6NwgaEtwsJ4GEqQdMDdlIRan8IpoJUYeO/s 0p2HI68YhPQPRw9gN2RDXA6aR0nkSl54Ea7mqSW1iPKNtfNMPh+MQ1sc7LQgfsEV02 tRKLiX9JJGrVl68wx2fPpCOH3T2fn/dHgl4ZRO4XLy/Qzv/O7fY7FIVUkC28mdm6Bm 3Zs86WHh9o5JdCWsZp18D4Fs0WtoccHIf9pE58d3RrxIpv5VsWvu0etG717NWG1unz HhT2DHOTrXStIMWhdl1xmqqL3nHLHBR1yH9fg4Dz6QV23vwhY7vZtZk396G7y2gkOP BNR2v4aCQjYKw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id A5CDB67966; Thu, 4 Sep 2025 07:05:59 -0600 (MDT) From: Simon Glass <sjg@u-boot.org> To: U-Boot Concept <concept@u-boot.org> Date: Thu, 4 Sep 2025 07:04:46 -0600 Message-ID: <20250904130459.848794-14-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250904130459.848794-1-sjg@u-boot.org> References: <20250904130459.848794-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: LOOHVXCHJWUOLLB63YCKEBLMIVRAY6L4 X-Message-ID-Hash: LOOHVXCHJWUOLLB63YCKEBLMIVRAY6L4 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: Heinrich Schuchardt <xypron.glpk@gmx.de>, Simon Glass <sjg@chromium.org> X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 13/18] ulib: Enable building the ulib test program List-Id: Discussion and patches related to U-Boot Concept <concept.u-boot.org> Archived-At: <https://lists.u-boot.org/archives/list/concept@u-boot.org/message/LOOHVXCHJWUOLLB63YCKEBLMIVRAY6L4/> List-Archive: <https://lists.u-boot.org/archives/list/concept@u-boot.org/> List-Help: <mailto:concept-request@u-boot.org?subject=help> List-Owner: <mailto:concept-owner@u-boot.org> List-Post: <mailto:concept@u-boot.org> List-Subscribe: <mailto:concept-join@u-boot.org> List-Unsubscribe: <mailto:concept-leave@u-boot.org> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit |
Series |
ulib: Introduce building U-Boot as a shared library
|
|
Commit Message
Simon Glass
Sept. 4, 2025, 1:04 p.m. UTC
From: Simon Glass <sjg@chromium.org> Now that the required pieces are in place, add the test program into the build. Provide the linker script too. The library requires CONFIG_CMDLINE, at least initially, so don't attempt to build it when there is no command line. For clang, an error is produced, so disable it in that case too: test/ulib/ulib_test.o: file not recognized: file format not recognized For now the program just crashes on startup, due to mon_len being larger than available RAM. Signed-off-by: Simon Glass <sjg@chromium.org> --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile index a0a9ce3196b..b43e028a06e 100644 --- a/Makefile +++ b/Makefile @@ -1043,7 +1043,11 @@ INPUTS-$(CONFIG_X86) += u-boot-x86-start16.bin u-boot-x86-reset16.bin \ $(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \ $(if $(CONFIG_TPL_X86_16BIT_INIT),tpl/u-boot-tpl.bin) -INPUTS-$(CONFIG_ULIB) += libu-boot.so +ifdef CONFIG_CMDLINE +ifneq ($(cc-name),clang) +INPUTS-$(CONFIG_ULIB) += libu-boot.so test/ulib/ulib_test +endif +endif LDFLAGS_u-boot += $(LDFLAGS_FINAL) @@ -1852,6 +1856,7 @@ endif # Build U-Boot as a shared library quiet_cmd_libu-boot.so = LD $@ cmd_libu-boot.so = $(CC) -shared -o $@ -Wl,--build-id=none \ + -Wl,-T,$(srctree)/arch/sandbox/cpu/u-boot-lib.lds \ $(u-boot-init) \ $(KBUILD_LDFLAGS:%=-Wl,%) $(SANITIZERS) $(LTO_FINAL_LDFLAGS) \ -Wl,--whole-archive \