Who understands this code?

Ronald Hummelink ronald at hummelink.xs4all.nl
Fri Mar 14 06:20:42 PST 2003


Did a few tests that may help you out.

on the host:

#gcc -o ct-mmap ct-mmap.c -O2 -pipe as root or user lfs
#./ct-mmap
#echo $?
0

In the shell building lfs as user lfs (PATH is starting with /stage1/bin
here):

#gcc -o ct-mmap ct-mmap.c -O2 -pipe
#ldd ./ct-mmap
libc.so.6 => /stage1/lib/libc.so.6 (0x4001500)
/stage1/lib/ld-linux.so.2 => /stage1/lib/ld-linux.so.2 (0x40000000)
#./ct-mmap
test 3 nonconsecutive pages - 40014000, 40149000
#echo $?
16

#/lib/ld-linux.so.2 ./ct-mmap
#echo $?
0

#/stage1/lib/ld-linux.so.2 --list ./ct-mmap
libc.so.6 => /stage1/lib/libc.so.6 (0x40001000)
/stage1/lib/ld-linux.so.2 => /stage1/lib/ld-linux.so.2 (0x80000000)
#/lib/ld-linux.so.2 --list ./ct-mmap
libc.so.6 => /lib/tls/libc.so.6 (0x42000000)
/stage1/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

Running:
LD_DEBUG=all /lib/ld-linux.so.2 ./ct-mmap
shows no sign of anything in stage1 being used.

Now .. lets have some fun (this is a bit beyond me to what exactly is
done) -L/stage1/lib else it won't link with undefined references in libc
to make matters more difficult.

#/usr/bin/gcc ./ct-mmap.c -o ct-mmap -L/stage1/lib
#ldd ./ct-mmap
libc.so.6 => /lib/tls/libc.so.6 (0x42000000)
/stage1/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
#./ct-mmap
#echo $?
0
#/lib/ld-linux.so.2 ./ct-mmap
#echo $?
0
#/stage1/lib/ld-linux.so.2 ./ct-mmap
test 3 nonconsecutive pages - 40000000, 40136000
#echo $?
16

I can also confirm that without ld.so.cache in place the test always
succeeds where above they failed.

Not all that suprising, without ld.so.cache the glibc-configure script
detects things 'properly'

My ideas:

Using the red hat compiler or pass1-ch5 seems to make no difference.
Does this mean our gcc is fine on this?

Forcing on redhats glibc or our own new glibc by calling things via
ld-linux.so.2 seems to tell the problem is our newly build libc? 

Right now, i'm going to step back to before glibc-ch5 and build it
without --enable-kernel=2.4.0 to see if it makes a difference.
Will let know about wether it does or not.

Ronald

-- 
Linux is like a small snowball rolling downhill. Microsoft is just
waiting down the mountain...

-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-dev' in the subject header of the message



More information about the lfs-dev mailing list