From patchwork Tue Sep 9 15:18:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 273 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=1757431170; bh=zuKEpga45rSvPVQ6qDFtMoAxAju/vwo4dkQD4aiWTbg=; 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=RRv7802dtGhR6SuKJtkaiWuVCYjgmWHnnesr3j64h+qXquuqD2nFmnLJXTxw+6pIA kZyXj8MbDLK2ad0lBErE7ep2r9Mkn3DuSn8uDJrJe1fACwxmW8YzMmieCPc91v6cq0 mKs64VeGG5c6sd2uufxa8EoJYNnp0XGhL+NkGW+iRrTgR0e5BNPoBLQlIWV9uTYH9F Dz2BXCqa3SlxKJwzrYAmyLmpukEhNkQMwrYgq9GkD7w5EikcvpT1pAs6uQGp4BtL2f zn4dfGBLUn9N/veYQDSDA1btQ8FFiuyjNSo81Dv9QEfxnVWogAqDcBpV16Nnof24iQ JEJEF8/1sk+JA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DEFB367A7F for ; Tue, 9 Sep 2025 09:19:30 -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 bdv9AU48lYGI for ; Tue, 9 Sep 2025 09:19:30 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757431170; bh=zuKEpga45rSvPVQ6qDFtMoAxAju/vwo4dkQD4aiWTbg=; 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=RRv7802dtGhR6SuKJtkaiWuVCYjgmWHnnesr3j64h+qXquuqD2nFmnLJXTxw+6pIA kZyXj8MbDLK2ad0lBErE7ep2r9Mkn3DuSn8uDJrJe1fACwxmW8YzMmieCPc91v6cq0 mKs64VeGG5c6sd2uufxa8EoJYNnp0XGhL+NkGW+iRrTgR0e5BNPoBLQlIWV9uTYH9F Dz2BXCqa3SlxKJwzrYAmyLmpukEhNkQMwrYgq9GkD7w5EikcvpT1pAs6uQGp4BtL2f zn4dfGBLUn9N/veYQDSDA1btQ8FFiuyjNSo81Dv9QEfxnVWogAqDcBpV16Nnof24iQ JEJEF8/1sk+JA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CE6D5679E6 for ; Tue, 9 Sep 2025 09:19:30 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757431168; bh=4Zw9+MjgZVDzcG+BQvjEi4FotL92IW3cfeyKLB8J6Y4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gaktJ8G5802H2qlb0strnd0lcHnamknIMkreXHp8+fajqMb/hF5OWx5Swf1zAGn6t MrhMIFDYKiklU5yyzB1SnCG9i6r8mLpvdAYJL5eJn9lKAZPfG7Mecr7GNKZshC2lVy ckd+SBsXWzNQMqRxD3nFFD7mNwDziAVV1XUikSGvVB9FD8QdAuLJFVkn0u1iYu7OVt HZX7xNNQyysa2WrZ9M1VIi5aKYxIoVP6mWS1zt4RpksoR2yaafJUZRAb4PahMWBhUE JYFFyAjPeAgjiMl15tG2lcqgazACZ37trtgdjn6qaN8cTNDBqgIrb9CzDdMArbN8rl qi2qXfhcQKRew== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E5DFD60026; Tue, 9 Sep 2025 09:19:28 -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 zOuozCmzAklM; Tue, 9 Sep 2025 09:19:28 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757431164; bh=MTlE+cy5qQyW+4+N8rNq3PoIPdyweCzZmlZ90bCkFMU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u0RPefZpXLkkc73FWv50EvHlCNM6ExPdglZB08cwd+RAsJrjmrlrRmVbg1Km4HjOk +LSrzHYWiZYnnKQRIYW+g4S55dwOuPE62QlummQdfzn4m/jVn7gQ1/FIabnK7FPnjo kXQogqAxWCPO1aOdU/WfE7WoWO3Bh5DxJdJ9+HChFhH4/gexCDhTzVrWNdczCAjqmk eTxZrUQY+ViKD417N7kn71/cAEZG6vuUYNOMnY+CW0PrYWCPAmoM4ZoHmWLt/4Tsx6 0aiuQYlbelkXFwu7V9eYxOeGZy5GAR9wI7MXb+Tt9So9S+GIqoBrydHecS+17XBcji 5z8hvgnoCEmSA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 4BC44679D6; Tue, 9 Sep 2025 09:19:24 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Tue, 9 Sep 2025 09:18:10 -0600 Message-ID: <20250909151824.2327219-14-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250909151824.2327219-1-sjg@u-boot.org> References: <20250909151824.2327219-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: NV3QPZFA5VJCXRWWCP2RWTN53GAATSYC X-Message-ID-Hash: NV3QPZFA5VJCXRWWCP2RWTN53GAATSYC 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 13/18] ulib: Makefile: Plumb in renaming symbols for ulib 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 Plumb this feature in, so that symbols are renamed as expected. Signed-off-by: Simon Glass --- Makefile | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index f6527cca136..f157de21008 100644 --- a/Makefile +++ b/Makefile @@ -1880,32 +1880,26 @@ quiet_cmd_ulib-objs = OBJS $@ # Build U-Boot as a shared library quiet_cmd_libu-boot.so = LD $@ - cmd_libu-boot.so = $(CC) -shared -o $@ -Wl,--build-id=none \ + cmd_libu-boot.so = \ + $(CC) -shared -o $@ -Wl,--build-id=none \ -Wl,-T,$(LIB_LDS) \ - $(u-boot-init) \ $(KBUILD_LDFLAGS:%=-Wl,%) $(SANITIZERS) $(LTO_FINAL_LDFLAGS) \ -Wl,--whole-archive \ - $(filter-out %/main.o,$(u-boot-main)) \ - $(u-boot-keep-syms-lto) \ + $$(cat .ulib-objs) \ -Wl,--no-whole-archive \ $(PLATFORM_LIBS) -Wl,-Map -Wl,libu-boot.map -libu-boot.so: $(u-boot-init) $(u-boot-main) $(u-boot-keep-syms-lto) \ - $(LIB_LDS) FORCE +libu-boot.so: .ulib-objs $(LIB_LDS) include/u-boot-api.h FORCE $(call if_changed,libu-boot.so) # Build U-Boot as a static library # Create a fat archive with all object files (except arch/sandbox/cpu/main.o) # Avoid partial linking so as to preserve the linker-list sections quiet_cmd_libu-boot.a = AR $@ - cmd_libu-boot.a = rm -f $@ $@.tmp $@.objlist; \ - $(AR) rcT $@.tmp $(u-boot-init) $(u-boot-main) \ - $(u-boot-keep-syms-lto); \ - $(AR) t $@.tmp | grep -v "arch/sandbox/cpu/main\.o$$" > $@.objlist; \ - cat $@.objlist | xargs $(AR) rcs $@; \ - rm -f $@.tmp $@.objlist + cmd_libu-boot.a = rm -f $@; \ + cat .ulib-objs | xargs $(AR) rcs $@ -libu-boot.a: $(u-boot-init) $(u-boot-main) $(u-boot-keep-syms-lto) FORCE +libu-boot.a: .ulib-objs include/u-boot-api.h FORCE $(call if_changed,libu-boot.a) # Build ulib_test that links with shared library @@ -2347,7 +2341,9 @@ CLEAN_FILES += include/autoconf.mk* include/bmp_logo.h include/bmp_logo_data.h \ mkimage.rom.mkimage mkimage-in-simple-bin* rom.map simple-bin* \ idbloader-spi.img lib/efi_loader/helloworld_efi.S *.itb \ Test* capsule*.*.efi-capsule capsule*.map \ - test/ulib/ulib_test test/ulib/ulib_test_static + test/ulib/ulib_test test/ulib/ulib_test_static \ + libu-boot.so.tmp libu-boot.so.objlist \ + libu-boot.a.tmp libu-boot.a.objlist # Directories & files removed with 'make mrproper' MRPROPER_DIRS += include/config include/generated spl tpl vpl \