[OE-core] Very large size of libraries in core-image-minimal rootfs

Khem Raj raj.khem at gmail.com
Tue Nov 26 18:30:12 UTC 2019


On Wed, 2019-11-27 at 07:27 +1300, Ankur Tyagi wrote:
> Hi Khem,
> 
> I have no experience with musl but keen to understand does musl
> improves/impacts DRAM performance as compared to glibc? 
> 

it really depends on load it runs, so I would not say its better or
worse but for many loads it makes better use of memory.

I would recommend to do some benchmarking on your platform and
application

> regards
> Ankur
> 
> On Wed, 27 Nov 2019, 7:17 a.m. Khem Raj, <raj.khem at gmail.com> wrote:
> > On Mon, 2019-11-25 at 23:10 +0200, Adrian Bunk wrote:
> > > On Mon, Nov 25, 2019 at 07:26:58PM +0000, Ross Burton wrote:
> > > > On 25/11/2019 18:37, Ankur Tyagi wrote:
> > > > > Hi,
> > > > > 
> > > > > Based upon "thud" branch, I created core-image-minimal for
> > > > > am335x-evm
> > > > > board and resulting image size is very big(71M)
> > > > 
> > > > If disk size is important then a good first step is to use musl
> > > > instead of
> > > > glibc:
> > > > 
> > > > TCLIBC = "musl"
> > > > ...
> > > 
> > > musl is mainly useful for tiny systems, a 40 MB partition is such
> > a
> > > huge
> > > amount of space that the size of the C library no longer matters
> > > much.
> > > 
> > > The size benefit of replacing glibc with musl is around 2 MB.
> > 
> > I would refrain from labeling as useful for tiny systems. since
> > static size is one thing, there is DRAM behaviour which is equally
> > important, how malloc and other resource oriented algorithms behave
> > is
> > important as well.
> > 
> > secondly, if I have 40MB partition, one might rather want to use
> > extra
> > space for implementing features in their product than spend it for
> > enabling the system if they can.
> > 
> > there are many other design considerations where musl might make
> > more
> > sense
> > 
> > > 
> > > A partition with an -Os build of Yocto with glibc+systemd (sic)
> > > is around 9 MB, together with bootloader and kernel this all
> > > fits in a 16 MB flash. Use compression for kernel and root
> > > filesystem and everything fits in a 8 MB flash.
> > > 
> > 
> > -Os is not as well tested option as -O2 is. So we should always
> > recommend it with grain of salt, speaking from experience there are
> > bugs that will show up with Os which you wont see with O2 and leave
> > a
> > bad taste for user
> > 
> > > > Ross
> > > 
> > > cu
> > > Adrian
> > 



More information about the Openembedded-core mailing list