Skip to contentSkip to conversation

lib: disable hashtable and display options code in SPL

PATCH In review Anatolij Gustschin 2 participants 2 messages Aug 28, 2017 – Sep 14, 2017 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib: disable hashtable and display options code in SPL

We do not need hashtable code in SPL when building without environment support. Also display options code is not used in current SPL configuration and can be disabled.

---
 lib/Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
lib/Makefile +6 -1
index 2eef1eb..1ffa455 100644
@@ -43,6 +43,7 @@ obj-$(CONFIG_TPM) += tpm.o
 obj-$(CONFIG_RBTREE)	+= rbtree.o
 obj-$(CONFIG_BITREVERSE) += bitrev.o
 obj-y += list_sort.o
+obj-y += hashtable.o
 endif
 
 obj-$(CONFIG_RSA) += rsa/
@@ -61,10 +62,14 @@ obj-$(CONFIG_SPL_YMODEM_SUPPORT) += crc16.o
 obj-$(CONFIG_SPL_NET_SUPPORT) += net_utils.o
 endif
 obj-$(CONFIG_ADDR_MAP) += addr_map.o
-obj-y += hashtable.o
 obj-y += errno.o
+ifdef CONFIG_SPL_BUILD
+obj-$(CONFIG_SPL_ENV_SUPPORT) += hashtable.o
+endif
+ifndef CONFIG_SPL_BUILD
 obj-y += display_options.o
 CFLAGS_display_options.o := $(if $(BUILD_TAG),-DBUILD_TAG='"$(BUILD_TAG)"')
+endif
 obj-$(CONFIG_BCH) += bch.o
 obj-y += crc32.o
 obj-y += ctype.o
Signature · 1 line
2.7.4
#1 lore raw
Quoted 9 lines · Anatolij Gustschin

We do not need hashtable code in SPL when building without environment support. Also display options code is not used in current SPL configuration and can be disabled.

---
 lib/Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

This and https://patchwork.ozlabs.org/patch/806646/ don't give you what you want I think. First, take a look at
https://gist.github.com/trini/fb85b11f6337ea9d5d65736762c678ac as these patches break a number of platforms (there are SPL cases where we do need these). And with gcc-6.x and later (which is being required with v2018.01, which is really soon now), we finally have strings discarded along with functions, so there's no size savings being seen in almost every case (it would be interesting to see what the savings is in Cyprus* and those few arm cases where we do save a tiny bit of text).

In sum, I don't think we want either of these patches, even with the link errors fixed unless you can show some size savings with gcc-6 or later. But those cases in the above gist were size is reduced could hint at places to look for a different set of changes to make here, perhaps. Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170914/12bacbd9/attachment.sig>