Sanity Checkpoints

Greg Schafer gschafer at zip.com.au
Mon May 12 19:00:03 PDT 2003


Hi

It might not be a bad idea to implement a few sanity checks along the way.
We do more more compiling in Ch 5 now so it would seem logical to catch
errors earlier by running a small sanity check or 2 just after critical
points in the build process.

Maybe something as simple as a hello world program.

Compile it
Run it
readelf it (not ldd as that can be misleading)
strings it

I s'pose the critical points would be just after:-

 - the Ch 5 lock in glibc step
 - the Ch 5 pass 2 build of binutils
 - immediately entering the Ch 6 chroot
 - the Ch 6 adjust toolchain step

Could be as simple as:-

gws at tigers-lfs:~$ echo 'main(){printf("Hello World\n");}' > check.c
gws at tigers-lfs:~$ /stage1/bin/gcc check.c
gws at tigers-lfs:~$ ./a.out
Hello World
gws at tigers-lfs:~$ readelf -e a.out | grep stage1
      [Requesting program interpreter: /stage1/lib/ld-linux.so.2]

and maybe even:-

gws at tigers-lfs:~$ strings -a a.out | grep GCC
GCC: (GNU) 3.2.3
GCC: (GNU) 3.2.3
GCC: (GNU) 3.2.3
GCC: (GNU) 3.2.3
GCC: (GNU) 3.2.3
GCC: (GNU) 3.2.3
GCC: (GNU) 3.2.3

to confirm the right gcc was used.

Might even be educational as well. What do we think? Silly idea? Not for the
book but the FAQ? Put a script in lfs-utils? Wasn't someone woring on a
check script at some point? Dunno.

Greg
-- 
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