Compiling libstdc++-2.90.7 on Solaris 7

Matthew Brown mbrown@mediadb.net
Sat Apr 1 00:00:00 GMT 2000


I had success with casting rather than actually changing the data type. This only needed to be done in ctype.cc.

-- Matthew Brown

----- Original Message ----- 
From: "Viraj Alankar" <valankar@cse.fau.edu>
To: <libstdc++@sourceware.cygnus.com>
Sent: Wednesday, February 02, 2000 9:12 AM
Subject: Compiling libstdc++-2.90.7 on Solaris 7


> 
> Hello,
> 
> We are having a problem compiling libstc++-2.90.7 on Solaris 7
> with gcc 2.95.2:
> 
> c++ -DHAVE_CONFIG_H -I. -I../../libstdc++-2.90.7/src -I.. -nostdinc++
> -I../../libstdc++-2.90.7/config/solaris -I../../libstdc++-2.90.7
> -I../../libstdc++-2.90.7/stl -I../../libstdc++-2.90.7/libio -D_GNU_SOURCE
> -fno-implicit-templates -Wall -Wno-format -W -Wwrite-strings -Winline
> -Werror -g -fno-honor-std -c  -fPIC -DPIC
> ../../libstdc++-2.90.7/src/locale.cc -o .libs/locale.lo
> In file included from ../../libstdc++-2.90.7/src/locale.cc:446:
> ../../libstdc++-2.90.7/config/solaris/ctype.cc:36: converting to `long int
> *' from `int *'
> ../../libstdc++-2.90.7/config/solaris/ctype.cc:37: converting to `long int
> *' from `int *'
> ../../libstdc++-2.90.7/config/solaris/ctype.cc:41: converting to `long int
> *' from `int *'
> ../../libstdc++-2.90.7/config/solaris/ctype.cc:42: converting to `long int
> *' from `int *'
> gmake[2]: *** [locale.lo] Error 1
> gmake[2]: Leaving directory `/home/home4/valankar/gcc/bld-libstdc++/src'
> gmake[1]: *** [all-recursive] Error 1
> gmake[1]: Leaving directory `/home/home4/valankar/gcc/bld-libstdc++'
> gmake: *** [all-recursive-am] Error 2
> 
> I noticed mention of this on the mailing list, and tried the patch
> to config/solaris/bits/ctype_base.h changing:
> 
> typedef long*               __to_type;
> 
> to
> 
> typedef int*               __to_type;
> 
> After this change I was able to compile the library successfully.
> However, when I tried using the lib my executables would core dump:
> 
> uname -a
> SunOS trout 5.7 Generic_106541-05 sun4u sparc SUNW,Ultra-250
> 
> g++ --version
> 2.95.2
> 
> env |grep STDC
> STDC3LIB=/usr/local/libstdc++-v3/lib
> STDC3INC=/usr/local/libstdc++-v3/include/g++-v3
> 
> g++ -Wall -I$STDC3INC -L$STDC3LIB cool.cc -o cool
> cool.cc: In function `int main()':
> cool.cc:14: warning: unused variable `int count'
> 
> ./cool
> Segmentation Fault
> 
> ldd cool
>         libstdc++.so.3 =>        /usr/local/libstdc++-v3/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
> 
> gdb cool
> GDB is free software and you are welcome to distribute copies of it
>  under certain conditions; type "show copying" to see the conditions.
> There is absolutely no warranty for GDB; type "show warranty" for details.
> GDB 4.16 (sparc-sun-solaris2.5.1), 
> Copyright 1996 Free Software Foundation, Inc...
> (gdb) run
> Starting program: /home/home3/sysadm/valankar/cool 
> warning: Unable to find dynamic linker breakpoint function.
> warning: GDB will be unable to debug shared library initializers
> warning: and track explicitly loaded dynamic code.
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0xff294d98 in ctype<char>::ctype (this=0x36310, __table=0x0, __del=false, 
>     __refs=0) at ../../libstdc++-2.90.7/bits/locale_facets.h:320
> 320           : _Ctype_nois<char>(__refs), _M_table(__table == 0 ? _S_table: __table), 
> Current language:  auto; currently c++
> (gdb) 
> 
> Anyone know what may be wrong? Thanks for any help.
> 
> Viraj.
> 
> 



More information about the Libstdc++ mailing list