If you don't know what I mean by build-gcc, read this first: Automated scripts for building gcc 4.4.x and 4.5.x for using with OpenFOAM 1.7 series
Sometime ago, a problem was detected when using one of my build-gcc scripts (see OpenFoam 1.7.0 on RHEL 4.6 post #3
) about no valid libc.so
being found during the build procedure. This was later fixed by adding the proper lib folder path to LD_LIBRARY_PATH
(read post #9 on that thread).