On Thu, Oct 27, 2005 at 10:22:08PM -0700, H. Peter Anvin wrote:> > >So it looks like as long as dash can link with klibc then:OK, I've got it to build with klibc using klcc: $ size src/dash text data bss dec hex filename 63333 356 5940 69629 10ffd src/dash Unfortunately there seems to be something fishy in parameter expansion as it fails three regression tests. I need to look into it. However, the good news is that it's smaller than I thought. The above result was actually obtained with klcc -static. So the corresponding size in klibc's ash is $ size ash/sh text data bss dec hex filename 77394 488 70936 148818 24552 ash/sh In fact it could go even smaller since I only used -Os and not the terribly long list of options that klibc uses :) I haven't built a shared version of dash with klibc because klcc -shared doesn't work very well with autoconf. You can get the latest version at http://gondor.apana.org.au/~herbert/dash/dash.git/ Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
On Sat, Oct 29, 2005 at 10:29:53PM +1000, herbert wrote:> > Unfortunately there seems to be something fishy in parameter expansion > as it fails three regression tests. I need to look into it.OK, I've found the problem. First two failures were harmless as klibc doesn't have getpwnam so tilde expansion always fails. The other one was an off-by-one bug in my stpcpy code. However, now I'm seeing bogus signal values being passed to my signal handler. I'm getting a signal value that's actually my PID. I suspect this is somehow related to the sa_restorer code in klibc's sigaction. What's the i386 breakage that requires this sa_restorer code? Does glibc do it as well? Thanks, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
H. Peter Anvin
2005-Oct-29 10:14 UTC
[klibc] Re: [PATCH] Avoid using dc in git-count-objects
Herbert Xu wrote:> On Thu, Oct 27, 2005 at 10:22:08PM -0700, H. Peter Anvin wrote: > >>>So it looks like as long as dash can link with klibc then: > > > OK, I've got it to build with klibc using klcc: > > $ size src/dash > text data bss dec hex filename > 63333 356 5940 69629 10ffd src/dash > > Unfortunately there seems to be something fishy in parameter expansion > as it fails three regression tests. I need to look into it. > > However, the good news is that it's smaller than I thought. The above > result was actually obtained with klcc -static. So the corresponding > size in klibc's ash is > > $ size ash/sh > text data bss dec hex filename > 77394 488 70936 148818 24552 ash/sh > > In fact it could go even smaller since I only used -Os and not the > terribly long list of options that klibc uses :) >klcc will happily provide that terribly long list for you (including -Os), so you probably couldn't. -hpa
Hi Peter: I've finally got around to putting dash into klibc and replacing ash with it. The result can be downloaded from master.kernel.org:/pub/scm/linux/kernel/git/herbert/klibc.git It passes all my regression tests apart from the exceptions that I've noted previously due to klibc limitations (tilde expansion and ulimit). Here are the sizes when built with gcc 4.0 on i386: $ size dash/sh dash/sh.shared text data bss dec hex filename 61553 324 5936 67813 108e5 dash/sh 51500 256 5920 57676 e14c dash/sh.shared $ There is still room for reduction as you can remove printf from either utils/ or dash/. IMHO it should be removed from utils/ since dash's echo is simply a wrapper around printf. I also haven't removed things like mail.c yet. I will do another round of removals soon. Please let me know if you have any problems with it. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt