This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Troubles with -fno-vtable-thunks recompilation.... Was: Strange C++ behaviour



Sorry to bother you all about this again.....
Since I could not make the compiler work with Martins old patch I 
decided to go for the -fno-vtable-thunks approach.
Unfortunately I am having severe troubles with recompiling glibc and
gcc.

The goal is to recompile my C++ programs with -fno-vtable-thunks,
however because of the binary incompatibility I have to recompile
both the stdc++ library and glibc. (If I understood correctly)

-- Compiler ---------------
I have recompiled gcc 2.95.1 with -fno-vtable-thunks (made the change
in config/mt-linux.h, configured and make bootstrap) and installed it
in /usr/local/gcc. I believe that this created a compiler that
compiles everything with no-vtable-thunks and a newly compiled stdc++
library  that is compiled with -fno-vtable-thunks.

-- Glibc ------------------
Then I compiled glibc with this new compiler. Had to change in
the configure script to allow the 2.95.1 compiler and to add
the link crypt/sysdeps/unix/libc-lock.h to 
glibc-2.1.1/sysdeps/generic/bits/libc-lock.h

After that compilation went ok and make check was ok.

-- Compiling problems with old libraries -------------------
I can compile and run a testprogram with the old glibc libraries
(libc-2.1.1.so with thunks):
int main(){return 42;}

When I compile a test program containing c++ like:
#include<iostream.h> int main(){cout<<"Hello"<<endl;}
I get three:

/usr/local/gcc/lib/gcc-lib/i686-pc-linux-gnu/2.95.1/libstdc++.a(stdstrbufs.o)(.data+0xb4):
undefined reference to `filebuf virtual table'

-- Running problems with new libraries ----------------
If set LD_LIBRARY_PATH to /usr/local/glib/lib whatever I run I get:
./a.out: /lib/ld-linux.so.2: version `GLIBC_2.1.1' not found
(required by /usr/local/glibc/lib/libc.so.6)

-- My guesses ---------------
I assume that I in some way must tell gcc to use the new glibc
library when compiling new stuff but I am completely lost here.....

Am I on the right track? Any help would be greatly appreciated!

Thanks
Fredrik Ohrstrom



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]