Re: [OpenWrt-Devel] [RFC] mklibs.py integration

2009-08-07 Thread Felix Fietkau
Hi all,

I reworked and fixed the mklibs.py integration and it actually works
now. The reported 4KB space saving in the linker binary that florian
reported was just simple stripping, not actual relinking.
Here are the results with a slightly-bigger-than-standard configuration
on a mips target:

libuClibc-0.9.30.1.so - before: 401380, after: 253512
libm-0.9.30.1.so - before: 102128, after: 46900

There is no significant space saving on the other libraries yet.

- Felix
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [RFC] mklibs.py integration

2009-08-01 Thread Daniel Dickinson
On Sat, 1 Aug 2009 05:03:22 -0400
Daniel Dickinson  wrote:

> 
> Doesn't mklibs.py remove portions of a library that are unused?
> Wouldn't that mean that fewer programs would result in more removal
> (due to more unused bits).   Or do you strip all libraries and not
> just uClibc?
> 

Never mind.  I see that you are stripping all libraries.  So yes, good
idea.  I was confused by your specifically mentioning the uClibc loader.
Can you give comparative squashfs sizes instead?

Also, this may takes signficantly long periods of time for large
numbers of packages.  Have you tested with more than the base setup?

Regards,

Daniel

-- 
And that's my crabbing done for the day.  Got it out of the way early, 
now I have the rest of the afternoon to sniff fragrant tea-roses or 
strangle cute bunnies or something.   -- Michael Devore
GnuPG Key Fingerprint 86 F5 81 A5 D4 2E 1F 1C  http://gnupg.org
The C Shore (Daniel Dickinson's Website) http://www.bmts.com/~cshore


signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [RFC] mklibs.py integration

2009-08-01 Thread Florian Fainelli
Hi Daniel,

Le Saturday 01 August 2009 11:03:22 Daniel Dickinson, vous avez écrit :
> On Sat, 25 Jul 2009 12:25:20 +0200
>
> Florian Fainelli  wrote:
> > Hi all,
> >
> > Please find below a proof-of-concept of the mklibs.py reduction
> > integration in OpenWrt. I have not been able to strip the uClibc
> > loader more than 4KB out of 28KB (original size) but it might
> > significantly better results with more softare installed in the
> > rootfs. --- Index: Config.in
>
> Doesn't mklibs.py remove portions of a library that are unused?

It does indeed.

> Wouldn't that mean that fewer programs would result in more removal
> (due to more unused bits).   Or do you strip all libraries and not just
> uClibc?

I think I did not ask it to strip down all shared libraries, thus it only 
stripped down the linker. I will try to look at it later in the weekend.
-- 
Best regards, Florian Fainelli
Email: flor...@openwrt.org
Web: http://openwrt.org
IRC: [florian] on irc.freenode.net
---


signature.asc
Description: This is a digitally signed message part.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [RFC] mklibs.py integration

2009-08-01 Thread Daniel Dickinson
On Sat, 25 Jul 2009 12:25:20 +0200
Florian Fainelli  wrote:

> Hi all,
> 
> Please find below a proof-of-concept of the mklibs.py reduction
> integration in OpenWrt. I have not been able to strip the uClibc
> loader more than 4KB out of 28KB (original size) but it might
> significantly better results with more softare installed in the
> rootfs. --- Index: Config.in

Doesn't mklibs.py remove portions of a library that are unused?
Wouldn't that mean that fewer programs would result in more removal
(due to more unused bits).   Or do you strip all libraries and not just
uClibc?

Regards,

Daniel
-- 
And that's my crabbing done for the day.  Got it out of the way early, 
now I have the rest of the afternoon to sniff fragrant tea-roses or 
strangle cute bunnies or something.   -- Michael Devore
GnuPG Key Fingerprint 86 F5 81 A5 D4 2E 1F 1C  http://gnupg.org
The C Shore (Daniel Dickinson's Website) http://www.bmts.com/~cshore


signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [RFC] mklibs.py integration

2009-07-25 Thread Florian Fainelli
Hi all,

Please find below a proof-of-concept of the mklibs.py reduction integration in 
OpenWrt. I have not been able to strip the uClibc loader more than 4KB out of 
28KB (original size) but it might significantly 
better results with more softare installed in the rootfs.
---
Index: Config.in
===
--- Config.in   (revision 16963)
+++ Config.in   (working copy)
@@ -142,6 +142,13 @@
This will install all compiled package binaries into 
build_dir/target-*/debug-*/,
useful for cross-debugging via gdb/gdbserver

+config USE_MKLIBS
+   bool "Run mklibs.py on the final root filesystem to strip down even 
more libraries"
+   default n
+   help
+   This will run mklibs.py on the root filesystem and recompile 
the libraries to remove
+   unused symbols.
+
 comment "Kernel build options"

 config KERNEL_KALLSYMS
Index: tools/mklibs/Makefile
===
--- tools/mklibs/Makefile   (revision 0)
+++ tools/mklibs/Makefile   (revision 0)
@@ -0,0 +1,30 @@
+#
+# Copyright (C) 2009 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=mklibs
+PKG_VERSION:=0.1.26
+
+PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://ftp.de.debian.org/debian/pool/main/m/mklibs/
+PKG_MD5SUM:=708f284975f1b567b817d27f7677a95f
+
+include $(INCLUDE_DIR)/host-build.mk
+
+define Host/Install
+   $(INSTALL_BIN) \
+   $(HOST_BUILD_DIR)/src/mklibs.py \
+   $(HOST_BUILD_DIR)/src/mklibs-copy.py \
+   $(HOST_BUILD_DIR)/src/mklibs-readelf/mklibs-readelf \
+   $(STAGING_DIR_HOST)/bin/
+endef
+
+define Host/Clean
+   rm -f $(STAGING_DIR_HOST)/bin/mklibs*
+endef
+
+$(eval $(call HostBuild))
Index: tools/Makefile
===
--- tools/Makefile  (revision 16963)
+++ tools/Makefile  (working copy)
@@ -11,7 +11,7 @@
 # subdirectories to descend into
 tools-y :=
 tools-$(CONFIG_GCC_VERSION_4_3)$(CONFIG_GCC_VERSION_4_4) += gmp mpfr
-tools-y += m4 autoconf automake bison pkg-config sed
+tools-y += m4 autoconf automake bison pkg-config sed mklibs
 tools-y += sstrip ipkg-utils genext2fs squashfs squashfs4 mtd-utils lzma-old 
mkimage
 tools-y += firmware-utils patch-cmdline quilt yaffs2

Index: include/image.mk
===
--- include/image.mk(revision 16963)
+++ include/image.mk(working copy)
@@ -125,6 +125,20 @@
$(call Image/mkfs/prepare/default)
 endef

+ifeq ($(CONFIG_USE_MKLIBS),y)
+  define Image/mklibs
+   # Generate the list of programs
+   - rm $(KDIR)/mklibs-progs
+   find $(TARGET_DIR) -type f -perm +100 -exec \
+   file -r -N -F '' {} + | \
+   awk ' /executable.*dynamically/ { print 1 }' > 
$(KDIR)/mklibs-progs
+   ifeq ($(CONFIG_USE_UCLIBC),y)
+   $(STAGING_DIR_HOST)/bin/mklibs.py -D -L $(STAGING_DIR)/lib -L 
$(TOOLCHAIN_DIR)/lib --ldlib=$(TOOLCHAIN_DIR)/lib/ld-uClibc.so.0 \
+   --target=$(GNU_TARGET_NAME) -d $(TARGET_DIR) `cat 
$(KDIR)/mklibs-progs`
+   endif
+  endef
+endif
+
 define BuildImage
 download:
 prepare:
@@ -137,6 +151,7 @@

 ifneq ($(IB),1)
   install: compile install-targets FORCE
+   $(call Image/mklibs)
$(call Image/Prepare)
$(call Image/mkfs/prepare)
$(call Image/BuildKernel)

-- 
Best regards, Florian Fainelli
Email: flor...@openwrt.org
Web: http://openwrt.org
IRC: [florian] on irc.freenode.net
---
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel