From patchwork Thu Sep 4 13:04:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 222 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=1756991145; bh=XPFUyYOz2HWIEms+ii2uqgcVaYQTiF5HJsXYswT1TqQ=; 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=n8RllTeTk6hRgAONuhhmyLSSyfu9+OSfmx6kbQ87+Cfq4lG0A1TjHKdSNbH3s3bt5 Hu6VLV3kJ0y7UoMy0zfLds4CSxIe5LhEyvycVojw34R4vywiJK+PU9UpLdY/nIs9o4 luAXy4l+W0YqMM13nWDYbkwCE1NGAD8PIpIoD7XrqxjLlXOs5bR0l9hgAz9B5exIs1 x3V+w94E33I08aYteO1kf8A9xkdcftJmSkTero4bA/xj/Q+FGTZBlqKDxEAuE9+BQX c3WM5Wzyb9Gqu9KzYiUl0365VFPc1hjEzS9gBm7/osGJQGAfcYPtOYcjZJc85yVXvl aZxyhMl1T7I7g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9CD1467964 for ; Thu, 4 Sep 2025 07:05:45 -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 KWSvuNDShpSC for ; Thu, 4 Sep 2025 07:05:45 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756991145; bh=XPFUyYOz2HWIEms+ii2uqgcVaYQTiF5HJsXYswT1TqQ=; 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=n8RllTeTk6hRgAONuhhmyLSSyfu9+OSfmx6kbQ87+Cfq4lG0A1TjHKdSNbH3s3bt5 Hu6VLV3kJ0y7UoMy0zfLds4CSxIe5LhEyvycVojw34R4vywiJK+PU9UpLdY/nIs9o4 luAXy4l+W0YqMM13nWDYbkwCE1NGAD8PIpIoD7XrqxjLlXOs5bR0l9hgAz9B5exIs1 x3V+w94E33I08aYteO1kf8A9xkdcftJmSkTero4bA/xj/Q+FGTZBlqKDxEAuE9+BQX c3WM5Wzyb9Gqu9KzYiUl0365VFPc1hjEzS9gBm7/osGJQGAfcYPtOYcjZJc85yVXvl aZxyhMl1T7I7g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8D52F6795D for ; Thu, 4 Sep 2025 07:05:45 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756991144; bh=r5do5Wpmqa4FfIJZp8dk141Gz1Mw0KTSIc1dIjvIIM0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YXPFFIwVIHk/4jnsDx76adzERMs/j3+E8WCwslVFZoH/hEhpi/sql0lFyzuPue0da Db00T1ayODU2vhac82jSVI8Z4sy0I95/qkEwtSG8M5uAgi2uYTru4Ns0HxR5lZ5bd6 vLPslKy2nimt9yxhrnloLIKTzrPwnMyVjGm98jzQpnIMZN7CXfZoK6Ink4+4AnOiwd PROW3LmUQNE5sU7jIvRaYt6ErAjW79HF4jQsUfc7G+gGS2w3Vbu2yWdirWPo1T+W73 /gEsm2bRAXWt51pz7M/86PYgnrePUY+wD1A2cuWeR4gGQqXPVgbcdysvrPqVEKI2Ie ax0wMsWEnEjXg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 931FA678AB; Thu, 4 Sep 2025 07:05:44 -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 0_-z-qZCrqAX; Thu, 4 Sep 2025 07:05:44 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1756991139; bh=8OIVkM3FTRkLnkma0IevrXS7voMt6h3GhUAdpqUE+eY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ip6TJF86YmGQ3jCmTxPS/AeL3reEU+pwbnDotQ0K7VH1+twPWi5mw5gg2kZEKvRm0 vYD2PoRKzdRtgUbOcIb1b0sJZbnTJHZsfMU8/A5RlLi+MLGiHMFW3Bx6fp4CZSrsXC zfC5M89NsYqUj5FbhFps8C2N+PNTBHPc5vm7FVjLR/Pvp0NYTtvYElwm3ZuoPvwOLx b68fzfg0hxV70UAhXNVwrfSP5HvoGqJpqMLFDni73dXlGpMpLlg9zAQ/KoLTC/cCC9 V8xIhb5i8OJubMFWR5iX1t+ABoASlLnAHceslM6OzMFoGB5n8fnfM8kQ5T0NFblmVc ZTP8dilIvRFUw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id F0B0867959; Thu, 4 Sep 2025 07:05:38 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 4 Sep 2025 07:04:41 -0600 Message-ID: <20250904130459.848794-9-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: N7BPXQDRL4PXRE3LAAH2JYV23PAXKXQL X-Message-ID-Hash: N7BPXQDRL4PXRE3LAAH2JYV23PAXKXQL 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 , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 08/18] ulib: Add an option to build U-Boot as a library 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 It is sometimes useful to create a different main program for U-Boot, or even to use some parts of U-Boot in an entirely different project. Add a new option to allow building a .so from parts of U-Boot. For now this does nothing. Enable it by default for sandbox, excluding the tools-only build, where it has no meaning. Signed-off-by: Simon Glass --- Kconfig | 9 +++++++++ configs/tools-only_defconfig | 1 + 2 files changed, 10 insertions(+) diff --git a/Kconfig b/Kconfig index de9d9ad5653..3b136a5f897 100644 --- a/Kconfig +++ b/Kconfig @@ -98,6 +98,15 @@ config CC_OPTIMIZE_FOR_DEBUG endchoice +config ULIB + bool "Build U-Boot as a library" + default y if SANDBOX + help + Enable this to build a library which can be linked to other programs, + to extend U-Boot's functionality. + + The library is called libu-boot.so + config OPTIMIZE_INLINING bool "Allow compiler to uninline functions marked 'inline' in full U-Boot" help diff --git a/configs/tools-only_defconfig b/configs/tools-only_defconfig index 20ac1e63f09..9e4866b494c 100644 --- a/configs/tools-only_defconfig +++ b/configs/tools-only_defconfig @@ -5,6 +5,7 @@ CONFIG_DEFAULT_DEVICE_TREE="sandbox" CONFIG_SYS_LOAD_ADDR=0x0 CONFIG_PCI=y # CONFIG_SANDBOX_SDL is not set +# CONFIG_ULIB is not set # CONFIG_EFI_LOADER is not set CONFIG_ANDROID_BOOT_IMAGE=y CONFIG_TIMESTAMP=y