[PATCH] store --help messages in compressed form. saves 35k

Denis Vlasenko vda at ilport.com.ua
Thu Apr 27 05:53:54 UTC 2006


On Wednesday 26 April 2006 15:49, Denis Vlasenko wrote:
> It's rather mysterious, and I feel I need to present the evidence.
> See attached preprocessed (gcc -E) files. They are different only in:
> 
> # diff -u vi_org.c vi.c
> --- vi_org.c    Wed Apr 26 15:40:10 2006
> +++ vi.c        Wed Apr 26 15:40:05 2006
> @@ -7303,9 +7303,7 @@
>  extern const struct BB_applet applets[];
>  # 62 "include/busybox.h"
>  # 1 "include/applets.h" 1
> -# 22 "include/applets.h"
> -  extern const char usage_messages[];
> -# 50 "include/applets.h"
> +# 49 "include/applets.h"
>  extern int test_main(int argc, char **argv);
>  extern int test_main(int argc, char **argv);
>  extern int addgroup_main(int argc, char **argv);
> @@ -8497,7 +8495,7 @@
>    }
> 
>   } else if (strncasecmp((char *) cmd, "version", i) == 0) {
> -  psb("%s", "1.2.0-pre0" " " "2006.04.26-12:19+0000");
> +  psb("%s", "1.2.0-pre0" " " "2006.04.26-12:18+0000");
>   } else if (strncasecmp((char *) cmd, "write", i) == 0
>     || strncasecmp((char *) cmd, "wq", i) == 0
>     || strncasecmp((char *) cmd, "wn", i) == 0
> 
> But still on my system resulting .o modules are different!
> 
> size vi_org.o vi.o
>    text    data     bss     dec     hex filename
>   19823       4     896   20723    50f3 vi_org.o
>   19835       4     896   20735    50ff vi.o
> 
> My gcc is:
> 
> # gcc -v
> Reading specs from /.share/usr/app/gcc-3.4.3/bin/../lib/gcc/i386-pc-linux-gnu/3.4.3/specs
> Configured with: ../gcc-3.4.3/configure --prefix=/usr/app/gcc-3.4.3 --exec-prefix=/usr/app/gcc-3.4.3 --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/app/gcc-3.4.3/libexec --datadir=/usr/app/gcc-3.4.3/share --sysconfdir=/etc --sharedstatedir=/usr/app/gcc-3.4.3/var/com --localstatedir=/usr/app/gcc-3.4.3/var --libdir=/usr/lib --includedir=/usr/include --infodir=/usr/info --mandir=/usr/man --with-slibdir=/usr/app/gcc-3.4.3/lib --with-local-prefix=/usr/local --with-gxx-include-dir=/usr/app/gcc-3.4.3/include/g++-v3 --enable-languages=c,c++ --with-system-zlib --disable-nls --enable-threads=posix i386-pc-linux-gnu
> Thread model: posix
> gcc version 3.4.3

gcc 4.0.0 doesn't show such erratic behavior,
so this is a compiler glitch.

Updated patch is attached.

If you will do a size comparison with it, be sure
to disable CONFIG_BBCONFIG option.
--
vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compressed_usage_bz_4.patch
Type: text/x-diff
Size: 5768 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20060427/b4a16387/attachment.bin 


More information about the busybox mailing list