This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Strange issues with gcc 2.95.3, libstdc++ 2.90.8, and Solaris nm
- From: Timothy Demarest <demarest at arraycomm dot com>
- To: libstdc++ at gcc dot gnu dot org
- Cc: Timothy Demarest <demarest at arraycomm dot com>
- Date: Fri, 24 May 2002 15:29:19 -0700
- Subject: Strange issues with gcc 2.95.3, libstdc++ 2.90.8, and Solaris nm
Hey there.
I'm not sure if this is a GCC issue or a libstdc++ issue, or both. We've
recently compiled and installed gcc 2.95.3 with libstdc++-2.90.8 under
Solaris 8 02/02 with the latest patch cluster. We've built and rebuilt gcc
along with libstdc++ v3 with both gcc (2.95.2) and the Sun Workshop
compiler (Workshop 6 update with patches). I followed the instructions to
the letter for using the v3 library as the default along with the GCC
sources. The libstdc++ patch was applied, per the instructions, and I've
had to comment out WERROR in the Makefile in
buildir/sparc-sun-solaris2.8/libstdc++/src to get around libstdc++ not
compiling due to warnings. I've used both GNU as and ld, as well as Sun's
as and ld. These are the most recent configure lines:
Using gcc as the compiler (GNU utils except ranlib in path first)
env CC="gcc" ../gcc-2.95.3/configure --prefix=/opt/local/gnu
--enable-threads=posix --enable-shared --enable-haifa
--with-as=/opt/local/gnu/bin/gas --with-ld=/opt/local/gnu/bin/gld
--enable-languages=c,c++ --with-gnu-as --with-gnu-ld --disable-nls
Sun compiler (Sun utils in path first):
env CC="cc -xildoff" ../gcc-2.95.3/configure --prefix=/opt/local/gnu
--enable-languages=c,c++ --enable-threads=posix --verbose
--enable-long-long --enable-shared --with-as=/usr/ccs/bin/as
--with-ld=/usr/ccs/bin/ld --disable-nls
I can get the compiler to build and install, but there are several strange
problems with g++ and libstdc++:
1. iostream.h doesn't seem to get installed into
/opt/local/gnu/include/g++-v3/backward. Is it supposed to?
2. All C++ code compiled with the new g++ fails with a seg fault.
3. Solaris nm seg faults when trying to demangle libstdc++ (nm -C), but GNU
nm works fine. Solaris nm works with -C.
Question #1 is fairly straight forward. Why doesn't iostream.h get
installed into the backward directory? Here is what did get installed:
agnes<.../home/demarest>ls /opt/local/gnu/include/g++-v3/backward/
algo.h alloc.h defalloc.h function.h hash_set.h heap.h
list.h multimap.h pair.h set.h stack.h tree.h
algobase.h bvector.h deque.h hash_map.h hashtable.h iterator.h
map.h multiset.h rope.h slist.h tempbuf.h vector.h
Question #2
Simple C++ code -- any C++ code compiled with the new g++ fails with a seg
fault. Take the following code:
#include <iostream>
int main()
{
std::cout << "Hello world, C++ Standard Style!\n";
}
agnes<...tmp/test>g++ -v -fhonor-std foo.cpp
Reading specs from
/opt/local/gnu/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/specs
gcc version 2.95.3 20010315 (release)
/opt/local/gnu/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/cpp0 -lang-c++ -v
-D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -Dsparc -Dsun
-Dunix -D__svr4__ -D__SVR4 -D__sparc__ -D__sun__ -D__unix__ -D__svr4__
-D__SVR4 -D__sparc -D__sun -D__unix -Asystem(unix) -Asystem(svr4)
-D__EXCEPTIONS -D__GCC_NEW_VARARGS__ -Acpu(sparc) -Amachine(sparc) foo.cpp
/home/demarest/tmp/ccbMCTqc.ii
GNU CPP version 2.95.3 20010315 (release) (sparc)
#include "..." search starts here:
#include <...> search starts here:
/opt/local/gnu/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/../../../../include
/g++-v3
/usr/local/include
/opt/local/gnu/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/../../../../sparc-s
un-solaris2.8/include
/opt/local/gnu/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/include
/usr/include
End of search list.
The following default directories have been omitted from the search path:
End of omitted list.
/opt/local/gnu/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/cc1plus
/home/demarest/tmp/ccbMCTqc.ii -quiet -dumpbase foo.cc -version -fhonor-std
-o /home/demarest/tmp/ccpk0cSa.s
GNU C++ version 2.95.3 20010315 (release) (sparc-sun-solaris2.8) compiled
by GNU C version 2.95.3 20010315 (release).
/usr/ccs/bin/as -V -Qy -s -o /home/demarest/tmp/cc5U32Pb.o
/home/demarest/tmp/ccpk0cSa.s
/usr/ccs/bin/as: Sun WorkShop 6 99/08/18
/opt/local/gnu/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/collect2 -V -Y
P,/usr/ccs/lib:/usr/lib -Qy
/opt/local/gnu/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/crt1.o
/opt/local/gnu/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/crti.o
/usr/ccs/lib/values-Xa.o
/opt/local/gnu/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/crtbegin.o
-L/opt/local/gnu/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3
-L/opt/local/gnu/sparc-sun-solaris2.8/lib -L/usr/ccs/bin -L/usr/ccs/lib
-L/opt/local/gnu/lib /home/demarest/tmp/cc5U32Pb.o -lstdc++ -lm -lgcc -lc
-lgcc /opt/local/gnu/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/crtend.o
/opt/local/gnu/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/crtn.o
ld: Software Generation Utilities - Solaris Link Editors: 5.8-1.273
agnes<...tmp/test>./a.out
Segmentation fault
agnes<...tmp/test>./a.out
Segmentation fault
agnes<...tmp/ddd-3.3.1>file a.out
a.out: ELF 32-bit MSB executable, SPARC, version 1, dynamically linked
(uses shared libs), not stripped
agnes<...tmp/ddd-3.3.1>ldd a.out
libstdc++.so.3 => /opt/local/gnu/lib/libstdc++.so.3
libm.so.1 => /usr/lib/libm.so.1
libc.so.1 => /usr/lib/libc.so.1
libdl.so.1 => /usr/lib/libdl.so.1
/usr/platform/SUNW,Sun-Fire-880/lib/libc_psr.so.1
Question #3: Solaris 'nm -C' fails to demangle:
agnes<.../home/demarest>/usr/ccs/bin/nm -C
/opt/local/gnu/lib/libstdc++.so.3.0.0
/opt/local/gnu/lib/libstdc++.so.3.0.0:
[Index] Value Size Type Bind Other Shndx Name
Segmentation fault
But GNU's nm works:
agnes<.../home/demarest>/opt/local/gnu/bin/nm -C
/opt/local/gnu/lib/libstdc++.so.3.0.0
000fd928 r .LLC0
000fd8f8 r .LLC0
000fd910 r .LLC0
...
0007e630 T std::__basic_file::xsputn(char const *, int)
000b5814 W std::basic_streambuf<char, std::char_traits<char> >::xsputn(char
const *, int)
000b5cc8 W std::basic_streambuf<wchar_t, std::char_traits<wchar_t>
>::xsputn(wchar_t const *, int)
Any ideas?
--
Timothy Demarest ArrayComm, Inc.
demarest@arraycomm.com 2480 North 1st Street, Suite 200
http://www.arraycomm.com San Jose, CA 95131