This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
gcc 3.0 missing __dso_handle in libstdc++
- To: gcc-bugs at gcc dot gnu dot org
- Subject: gcc 3.0 missing __dso_handle in libstdc++
- From: Andi Kleen <ak at muc dot de>
- Date: Sun, 27 May 2001 12:09:25 +0200
I built a gcc 3.0 branch of two days ago on i386/SuSE 6.4 (that's glibc
2.1 based)
The gcc was built using configure --prefix=/pkg/gcc-3.0-date
--enable-languages=c,c++
and installed using make bootstrap ; make install. That configure seems
to imply --enable-shared on the system. C works fine, but trying simple
C++ programs shows a problem:
fred:~/wsrc% cat hello.cc
#include <iostream>
int main()
{
std::cout << "Hello world\n";
}
fred:~/wsrc% /pkg/gcc-3.0-010526/bin/g++ hello.cc -o hello
fred:~/wsrc% LD_LIBRARY_PATH=/pkg/gcc-3.0-010526/lib ./hello
./hello: error in loading shared libraries: /pkg/gcc-3.0-010526/lib/libstdc++.so.3: undefined symbol: __dso_handle
fred:~/wsrc%
The linker runs like this:
/pkg/gcc-3.0-010526/lib/gcc-lib/i586-pc-linux-gnu/3.0/collect2 -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o hello /usr/lib/crt1.o /usr/lib/crti.o /pkg/gcc-3.0-010526/lib/gcc-lib/i586-pc-linux-gnu/3.0/crtbegin.o -L/pkg/gcc-3.0-010526/lib/gcc-lib/i586-pc-linux-gnu/3.0 -L/pkg/gcc-3.0-010526/lib/gcc-lib/i586-pc-linux-gnu/3.0/../../.. /tmp/ccWAiceA.o -lstdc++ -lm -lgcc_s -lc -lgcc_s /pkg/gcc-3.0-010526/lib/gcc-lib/i586-pc-linux-gnu/3.0/crtend.o /usr/lib/crtn.o
__dso_handle seems to declared in crtstuff.c. It seems to forget to link
that in (?)
-Andi
--
Life would be so much easier if we could just look at the source code.