From patchwork Sat Feb 14 02:12:59 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1865 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=1771035239; bh=1ufaQd7mfv2gz+SO9ATaRoFGtLNGtrikwZi2M0g6t/I=; 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=s+15yHSbdi0ELKcHm6tOT1xKAM6EHhEcGA9Q+i5tesOFIVZOdTc7/yXomDaoAN4YZ kux45L0bCH68ydSCC0fzdhmYdowq8cVgnYQgvZjaxoJsME5KXUtQa345ffGqfVBtbU xIMoNaadURslQx9FFtIOFdh6DTDFW18n2fWVYdtmsth/fAC/O8+cfOYXWEJF3SCtNX 42jMPI98ST5J4IgRXEDySZIaCMT49XWFIC3Piuwhujsv+XIZ7LOQknefd05RCy+lVf 8ClBiRY/QgZb5PsyAGYR2zI9SFijflchxse252PxTBKpR8iHPB5a8XAYLWX7Tr17kK MiO3Apr+zqkLQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EE7D769B5B for ; Fri, 13 Feb 2026 19:13:59 -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 hTxcsZl-Lu_I for ; Fri, 13 Feb 2026 19:13:59 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771035239; bh=1ufaQd7mfv2gz+SO9ATaRoFGtLNGtrikwZi2M0g6t/I=; 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=s+15yHSbdi0ELKcHm6tOT1xKAM6EHhEcGA9Q+i5tesOFIVZOdTc7/yXomDaoAN4YZ kux45L0bCH68ydSCC0fzdhmYdowq8cVgnYQgvZjaxoJsME5KXUtQa345ffGqfVBtbU xIMoNaadURslQx9FFtIOFdh6DTDFW18n2fWVYdtmsth/fAC/O8+cfOYXWEJF3SCtNX 42jMPI98ST5J4IgRXEDySZIaCMT49XWFIC3Piuwhujsv+XIZ7LOQknefd05RCy+lVf 8ClBiRY/QgZb5PsyAGYR2zI9SFijflchxse252PxTBKpR8iHPB5a8XAYLWX7Tr17kK MiO3Apr+zqkLQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DE22169B58 for ; Fri, 13 Feb 2026 19:13:59 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771035237; bh=6TCybWoGhrJsTk43GdpyuO35pqPB2Pm+m8rMnGALDsc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Asjf3j4VF41gBx9WlRbIQ+TBJkKng0yjLosz+mlAeFzycnnZlWHJnFrOSOJPtffSq wbc9ZMpcO21sXFr8h0pbYw9eEp4QYFuVIVGj8YnmZK8PFEEcNi53p5iowyaTwRlo+D YvHRwOTGxOmi0eKAs5B5FgegXwdhvrmEBtvBt78W3qGerlvQ0b3xkVoxpe/5GV1eLb zvYfPacjpvC1jBI3T40VEAjH8PMgsyV5kQXSoLCrAfYXvzASnEkteskOXblODD0Z1z b9zjrwcBh3enCDhuPS05hHPW0+rGVcObMQVuwvqwXypAxHGrFoMEhElgKXAJ5uyBx/ pG9uY/AmlnLHw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E26D469B58; Fri, 13 Feb 2026 19:13:57 -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 d6VOHaHZJJFA; Fri, 13 Feb 2026 19:13:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1771035232; bh=g1YyfDFnh8mjddvU9uXmZt7vWbMIr+xbQBqwraQYBJ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D9yaamkOSRtQDRYlBkuhbnGOQLwvRRKyfaUvQR5BGgQztU55PWFV0FAYDLfqQzN02 vBp93BXtVPUtEmsKmUx4oSwztg3ZwcU54r/8qfEUYP8HQYtYexrB4LPlf2i5R2hIPK d9qxHNYe5MGiMYYDQgetJE5OOdSZdCThBfsUJh7BSio0C8fUu0W8SySFmyy46BVY7T L0azvCOq63Qyqzn2QXwmNPTpBpnut8OH5+SGbsKBmYunj7XHj8NNFpn8QpYY9H5Zu6 lLjrEPsxtsRpW34DOIwhx+doSzBFhgvc5E7R+b5EPvJADrT4yRVy15kQZOV4k+REtl hAUAqxUilRk3Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 1E62B69B56; Fri, 13 Feb 2026 19:13:52 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Fri, 13 Feb 2026 19:12:59 -0700 Message-ID: <20260214021317.816170-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260214021317.816170-1-sjg@u-boot.org> References: <20260214021317.816170-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: MBLRCUB6QQ2URZST4X3NQKWTFB6AQPVP X-Message-ID-Hash: MBLRCUB6QQ2URZST4X3NQKWTFB6AQPVP 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 05/13] examples: ulib: Build shared-linked binaries only when .so is available 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 shared-linked example binaries (demo, boot) are only useful when libu-boot.so exists. Use $(wildcard) to conditionally include them, so standalone builds also adapt correctly. Co-developed-by: Claude Opus 4.6 Signed-off-by: Simon Glass --- examples/ulib/rules.mk | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/examples/ulib/rules.mk b/examples/ulib/rules.mk index c4b0bdb3668..bc677488649 100644 --- a/examples/ulib/rules.mk +++ b/examples/ulib/rules.mk @@ -5,9 +5,12 @@ # Copyright 2025 Canonical Ltd. # Written by Simon Glass -# Generate normal and statically linked binary names from progs variable -all_bins := $(foreach prog,$(progs),$(OUTDIR)/$(prog) \ - $(OUTDIR)/$(prog)_static) +# Generate binary names from progs variable +# Shared-linked versions are only built when libu-boot.so is available +static_bins := $(foreach prog,$(progs),$(OUTDIR)/$(prog)_static) +shared_bins := $(if $(wildcard $(UBOOT_BUILD)/libu-boot.so),\ + $(foreach prog,$(progs),$(OUTDIR)/$(prog))) +all_bins := $(shared_bins) $(static_bins) # Default target builds both programs all: $(all_bins)