On Thursday 21 June 2007 18:55, Martinb_ARM_NOMMU_KISSDVD wrote:
> I can only tell about my personal experience (as a user)
> 
> if I compile 1 busybox with telnetd,crond,httpd,lash,hush,free and I will
> type free I will get less mem then if I create  separated
> httpd,lash,telnetd,inetd etc etc
> the difference is so big that i split (almost) all the busybox applets in
> small parts
> so if mem is really important (and since I only have 4MB free it is) I
> advise to split them
> 
> I advise to make the same test yourself so you will know for sure what the
> best option is

Building each applet separately is beneficial for NOMMU arches,
because on those arches entire text segment is loaded into RAM,
so when you run one applet, you still load code for all applets
because it exist in this executable file.
And on NOMMU, if you run two copies of busybox, you load it twice.

However, building each applet separately is not optimal too,
because each libbb function used by applets will be duplicated
in each separate executable!

If your arch supports dynamic linking (there are NOMMU arches
which support this), there is a solution: enable
CONFIG_BUILD_LIBBUSYBOX, CONFIG_FEATURE_INDIVIDUAL and
CONFIG_FEATURE_SHARED_BUSYBOX.

It works with glibc on x86 for me, may need testing/fixing
on other arches.

With these options on, build says:

...
  CC      util-linux/umount.o
  AR      util-linux/lib.a
  LINK    busybox_unstripped
Trying libraries: crypt m
 Library crypt is needed
 Library m is needed
Final link with: crypt m
libbusybox: 0_lib/libbusybox.so.1.10.0.svn
busybox linked against libbusybox: 0_lib/busybox
Linking individual applets against libbusybox (see 0_lib/*)

You still end up with "monolithic" busybox in the root of build tree,
but in 0_lib/* you will find these:

-rwxr-xr-x    1 root     root       900329 Feb  9 13:04 
libbusybox.so.1.10.0.svn_unstripped
-rwxr-xr-x    1 root     root       760800 Feb  9 13:04 libbusybox.so.1.10.0.svn
-rw-r--r--    1 root     root       581163 Feb  9 13:04 
libbusybox.so.1.10.0.svn_unstripped.map
-rw-r--r--    1 root     root        28161 Feb  9 13:04 
libbusybox.so.1.10.0.svn_unstripped.out
-rw-r--r--    1 root     root        15452 Feb  9 13:04 busybox_unstripped.map
-rw-r--r--    1 root     root        11898 Feb  9 13:04 busybox_unstripped.out
-rwxr-xr-x    1 root     root         6126 Feb  9 13:04 busybox_unstripped
-rwxr-xr-x    1 root     root         2692 Feb  9 13:05 start-stop-daemon
-rwxr-xr-x    1 root     root         2684 Feb  9 13:05 pipe_progress
-rwxr-xr-x    1 root     root         2676 Feb  9 13:05 deallocvt
-rwxr-xr-x    1 root     root         2676 Feb  9 13:05 dhcprelay
-rwxr-xr-x    1 root     root         2676 Feb  9 13:05 dumpleases
....
-rwxr-xr-x    1 root     root         2660 Feb  9 13:05 vi
-rwxr-xr-x    1 root     root         2660 Feb  9 13:05 wc
-rwxr-xr-x    1 root     root         2660 Feb  9 13:05 who
-rwxr-xr-x    1 root     root         2660 Feb  9 13:05 yes
-rwxr-xr-x    1 root     root         2560 Feb  9 13:04 busybox

The bulk of busybox is in libbusybox.so.1.N.M, and applets
are just separate tiny stub executables which use it.
--
vda
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to