0

While trying to create an x86-64 appliance, I naturally wanted to compile glibc 2.23. I managed to do so through

mkdir build
cd build
../configure --enable-kernel=2.6.32 
--with-headers=/path/to/appliance/kernel/headers
--prefix=/usr

and

make -j4 install_root=/path/to/appliance/root && make install install_root=/path/to/appliance/root

The result comes out to over 100 MB, and I look at the Debain libc package and wonder how they got it to be only a few megabytes in comparison. It seems much of the space comes from locales and charsets that I will likely never need.

Is it possible to cut stuff out?

2
  • 4
    What takes 100MB? Analyze the output a bit further, at the very least run du to see what's taking space. In Debian the locales are shipped separately and compiled on demand, the locales-all package is ~110MB. If you want to run in limited space, maybe you should use an alternate libc designed for embedded systems. Why are you building your own anyway rather than use a distribution? Apr 16, 2016 at 23:53
  • Use newlib instead? Apr 17, 2016 at 0:07

2 Answers 2

1

Not exactly an answer to your question but since size matters you should consider using musl instead of glibc. This also makes all the binaries statically or dynamically linked against that libc way smaller.

https://www.musl-libc.org/

http://elinux.org/images/e/eb/Transitioning_From_uclibc_to_musl_for_Embedded_Development.pdf

http://wiki.musl-libc.org/wiki/Projects_using_musl

1
  • musl is great +1. Sep 15, 2016 at 20:07
0

Don't build locales that You don't need, remove all static libraries that You won't need, and strip debug symbols from shared ones. That should cut it down to size nicely.

1
  • That's actually a pretty good answer, but it would much better if you gave more specific instructions to do it. Sep 15, 2016 at 20:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .