This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Almost got glibc working with no-vtable-thunks, but ....
- To: "Martin v. Loewis" <martin AT mira.isdn.cs.tu-berlin.de>
- Subject: Almost got glibc working with no-vtable-thunks, but ....
- From: Fredrik Öhrström <d92-foh AT nada.kth.se>
- Date: Wed, 15 Sep 1999 18:06:08 +0200 (MET DST)
- cc: gcc AT gcc.gnu dot org
> This, in turn, could result from an incorrect contents of _G_config.h,
> which explains the C++ vtable mechanism to C applications. You'll
Found it. Everything seems to build correctly now. The generated
files contains _vt. prefixes for the virtual tables instead of _vt_
I examined what the glibc "make check" command did to compile
testprograms with the new library. With that information I managed
to compile a single HelloWorld C program and link with the new
library! :-)
But when I try the following C++ program I get several link
errors of this kind:
/usr/local/gcc/lib/libstdc++.a.2.10.0(iostream.o): In function
`_IO_ostream_with assign type_info function':
/home/foh/Code/gccobjdir/i686-pc-linux-gnu/libio/../../../gcc-2.95.1/libio/iostr
eam.h(.gnu.linkonce.t._._8iostream+0xc9): undefined reference to
`__builtin_vec_delete'
The program looks like this:
#include<stdio.h>
#include<iostream.h>
struct Alfa
{
virtual int a() = 0;
};
struct Beta : public Alfa
{
int a ()
{
return 47;
}
};
int main()
{
printf ("Hello World!\n");
cout << "Hello World!" << endl;
Beta b;
return b.a();
}
And the makefile looks like this:
all: compile link
compile: test.cc
g++ test.cc -c -g
-DNLSPATH='"/usr/local/glibc/share/locale/%L/%N:/usr/local/glibc/share/locale/%L/LC_MESSAGES/%N:/usr/local/glibc/share/locale/%l/%N:/usr/local/glibc/share/locale/%l/LC_MESSAGES/%N:"'
-DHAVE_CONFIG_H -D_LIBC_REENTRANT -o test.o
link: test.o
gcc -nostdlib -nostartfiles -o test
-Wl,-dynamic-linker=/usr/local/glibc/lib/ld-linux.so.2
/usr/local/glibc/lib/crt1.o /usr/local/glibc/lib/crti.o `gcc
--print-file-name=crtbegin.o` test.o
-Wl,-rpath-link=/usr/local/glibc/lib /usr/local/glibc/lib/libc.so.6
/usr/local/glibc/lib/libc_nonshared.a -lgcc `gcc
--print-file-name=crtend.o` /usr/local/glibc/lib/crtn.o
/usr/local/gcc/lib/libstdc++.a.2.10.0
(Sorry for the linebreaks...)
What do I link in to find these rather important methods?
I thought that earlier you had to explicitly link in -lg++
but now I can't find any library with that name.
Thanks!
Fredrik Ohrstrom