[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [microblaze-uclinux] Shared vs Static libraries?
Hi John,
John McGrath wrote:
> I just sucessfully compiled the kernel / image for the current uClinux
> distribution. I wanted to have a pertty minimal setup, but after
> compilation I discovered the image.bin was 8.8 Mb!! I looked and saw the
> kernel was about 1.2Mb, while the user applications took up the rest. On
> looking in the romfs/bin directory I saw all the executable files there
> were about 200-500K! for example cat was 159K while the cat on my linux
> machine is 19K !! so clearly there is something going wrong.
A few comments here. You will see that many of the utilities in the
romfs/bin directory are exactly the same size - these are links to the
busybox executable, which is intended to combat exactly the issue you
are raising. In the actual romgfs image, there is (or should be) only a
single instance of busybox, with a bunch of links to it to represents
that various applets that it implements.
That said, if your final image.bin file is over 8mb in size, you must
have a pretty serious collection of applications installed, or else some
large data in the home/httpd directory or something. This shouldn't
happen in a "minimal setup" - my typical baseline build is normally
around 2-2.5MB kernel included. It seems likely that you've enabled
something that yuo've forgotten, or there's something else going on.
Feel free to post the full directory listing of the romfs/bin directory
on your host, it might tell us something.
> My guess it
> is is statically linking the programs. I did not do anything (to my
> knowledfge) to turn this on - but I assume it would not be the default,
> as space is a premium! Anyone got any ideas on what this could be?
Yep - it's all statically linked. Dynamic linking is possible on
uClinux, but needs some software hackery and also support from the
compiler for position independent code (I think). As far as I know,
m68k-nommu is the only arch to support dynamic libraries on uClinux.
Regards,
John
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@itee.uq.edu.au
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/