Relationship between kernel and glibc.

Christopher Stone <[email protected]> 11 Jun 2002 14:33:17 -0400
Newsgroups gmane.linux.ports.mips.devel
Message-ID <[email protected]>
First, some background (there is a linux kernel question at the end, but
I want to provide some good background first):

I have a linux mips kernel (version 2.4.18) up and running on a custom
board that uses a NEC VR4131 (mips architecture) processor. My kernel
was based on source code from kernel.org and from Mips technologies. The
processor has no FPU, but, the kernel provides FPU emulation. My root
file system uses glibc 2.2.5 which was compiled from the source
downloaded from ftp.gnu.org. Glibc was configured as follows:

configure \
    --prefix=/opt/sombrio/confrere/usr/mipsel-linux \
    --enable-add-ons \
    --build=i686-pc-linux-gnu \
    --host=mipsel-linux

Some of the binaries and libraries in the root file system were compiled
from source by myself and others have been downloaded from the redhat
distribution on SGI's web site. I am using a cross compiler that runs on
an x86 PC to produce mips little endian code. I am using GCC 3.0.4. The
cross compiler was built from source downloaded from gcc.gnu.org, and
was configured as follows:

configure --target=mipsel-linux \
   --prefix=/opt/sombrio/confrere/usr \
   --exec-prefix=/opt/sombrio/confrere/usr \
   --enable-threads=posix --enable-languages=c,c++,java \
   --disable-libgcj --with-stabs --enable-shared \
   --with-gnu-ld --with-gnu-as --enable-version-specific-runtime-libs
   -v

I am also using binutils version 2.12 compiled from source downloaded
from gnu.org.

All of this works perfectly and has passed extensive QA product testing.
There is, however, one problem with the compiler. For some C++ code, we
get the following error during linking:
/opt/sombrio/confrere/usr/lib/gcc-lib/mipsel-linux/3.0.4/../../../../mipsel-linux/bin/ld: BFD 2.12 assertion fail ../../binutils-2.12/bfd/elf32-mips.c:6374

This error is fixed by by GCC 3.1, but, when glibc is compiled with GCC
3.1 it does not work.

So, we have tried running a kernel compiled with GCC 3.1 with a root
file system that uses a glibc compiled with GCC 3.0.4. The kernel
crashes within 10 minutes on a page fault, which is a red herring, i.e.,
the address that is referenced is not valid ( the address can be
00000000, or 00000004, etc.). So, I take a working and QA'd system and
replace the kernel with one compiled with GCC 3.1 and the system breaks.


Finally, my question is:

Someone has told me that it is a no-no to use a kernel and glibc that
are not compiled with the same compiler, or at least, the same compiler
version. Is there a relationship between the kernel and glibc that
requires you to use the same compiler for the kernel and glibc?


Cheers, 
   Chris Stone.


-- 
---------------------------------------------------------
Christopher Stone               Voice: 613-831-1892
Principal                       Fax:   613-831-6095
Sombrio Systems Inc.            email: [email protected]
18 Moss Hill Trail              Web:   www.sombrio.com
Stittsville, ON, Canada
K2S 1E2

-
To unsubscribe from this list: send the line "unsubscribe linux-mips" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html