[uClibc]Re: [BusyBox] tar and getopt (again)
Erik Andersen
andersen at lineo.com
Mon Jan 22 21:54:37 UTC 2001
On Mon Jan 22, 2001 at 03:08:21PM -0600, Manuel Novoa III wrote:
> Erik,
>
> > k. Ckeck it in as is. uClibc already has a getopt_long -- the main reason I
> > was looking at it is that since so few busybox apps use it, I was hoping to
> > save space by not using it. It saves space on a static compile, since the
> > getopt_long code wouldn't get linked in, and it saves a (admittedly tiny) bit
> > of space on a dynamic build, since the ELF vector code to fixup the external
> > symbol isn't needed. Not that big a deal. Just a thought.
>
> This brings up an issue similar to the "long long" stuff that came up this
> weekend wrt libgcc.a. { On that issue, I'm thinking now that "long long" support
> in uClibc _should_ be a build-time option, and if it is included then pull the
> support routines from libgcc.a and add them to the shared lib. }
Completely agreed. We will need per-platform long long support routines (that will
live in sysdeps/linux/<arch>) but that is simple enough.
> It would be nice to have a kind of pseudo-linker which you could pass a list of
> the symbols you programs needed and build a customized shared uClibc.
> Something like:
>
> ld -r -o myapp1.ldr myapp1_*.o
> ld -r -o myapp2.ldr myapp2_*.o
> nm -s myapp[12].ldr | grep " U " | build-custom-shared-uClibc -o mylib.so
>
> I remember doing something similar a few years ago in awk in order to debug a
> problem in ncurses. I needed to see where to break up some of the source files
> to eliminate a number of unnecessary symbols being pulled in.
>
> I think something like this is a good candidate application for the uClibc/extra
> dir. What do you think?
This is essentially what mklibs.sh does for the debian boot floppies. 1) Given
a set of files in a certain directory, find those that are executables and
create a list of required external symbols. 2) Given a set of static
libraries, create a list of all exported symbols. 3) Given the two lists,
rebuild a new library that only includes the symbols from list #1.
http://cvs.debian.org/boot-floppies/scripts/rootdisk/mklibs.sh
-Erik
--
Erik B. Andersen email: andersen at lineo.com
--This message was written using 73% post-consumer electrons--
More information about the uClibc
mailing list