"Difference beetween uClibc and Glibc?"

Aurelien Jacobs aurel at gnuage.org
Sun Apr 9 00:59:27 UTC 2006


On Sat, 8 Apr 2006 19:04:06 -0400
Rich Felker <dalias at aerifal.cx> wrote:

> On Sun, Apr 09, 2006 at 12:04:58AM +0200, Aurelien Jacobs wrote:
> > On Sat, 8 Apr 2006 16:26:09 -0400
> > Rich Felker <dalias at aerifal.cx> wrote:
> > 
> > > On Sat, Apr 08, 2006 at 02:49:22PM -0500, Rob Landley wrote:
> > > > On Friday 07 April 2006 4:02 am, vipul_it413 wrote:
> > > > > Hi all,
> > > > > I am new to this mailing list.....
> > > > > Can anybody know the difference between the uClibc and Glibc?
> > > > > I want to know the technical difference and the reason why the size of the
> > > > > executable compiled with the uClibc is smaller than that of Glibc????????
> > > > 
> > > > The fact that the classic "hello world" program bloats to over 400k when 
> > > > statically linked against glibc should be a hint that glibc is simply 
> > > > defective.
> > > 
> > > Not just that. Look what happens when it's dynamic linked:
> > > 
> > > brightrain:~$ cat > hello.c
> > > int main() { printf("hello, world\n"); sleep(10); return 0; }
> > > brightrain:~$ gcc hello.c
> > > brightrain:~$ ./a.out
> > > hello, world
> > > 
> > > and meanwhile:
> > > 
> > > brightrain:~$ cat /proc/32590/statm
> > > 84 84 71 2 0 82 13
> > > 
> > > THIRTEEN dirty pages! That's 52k of nonsharable memory that's good for
> > > absolutely nothing.
> > > 
> > > And for completeness, static linking:
> > > 
> > > brightrain:~$ cat /proc/32650/statm
> > > 24 24 18 21 0 3 6
> > > 
> > > Note that all of these numbers are with my extremely old glibc, which
> > > I refuse to upgrade because I know they'll all double if I do...
> > 
> > Well, if dirty pages really scares you, maybe you should try to
> > upgrade...
> > Here are the results with glibc-2.3.6 gcc-4.0.3:
> > 
> > dynamic
> > $ cat /proc/24370/statm
> > 364 78 62 1 0 28 0
> > 
> > static
> > $ cat /proc/24391/statm
> > 165 32 25 107 0 57 0
> > 
> > By the way, on my system, the following commands returns
> > only zeros :
> > cat /proc/*/statm | cut -d' ' -f7
> 
> Right. Your system is broken...

Could you elaborate please ?
I tried it on 8 different hosts (various kernel versions, arch, distro)
and get the same result on all of them ! (ie. no dirty page at all)

Aurel



More information about the uClibc mailing list