Seeking Help with GCC for SunOS 2.8

LLeweLLyn Reese llewelly@lifesupport.shutdown.com
Mon Dec 23 22:49:00 GMT 2002


"Steven Teeter" <steeter@symyx.com> writes:

> Hello GCC Help.  I'm hoping you can advise me on a problem resulting from the upgrade of a Sun E450 from SunOS 2.6 to SunOS 2.8.  
> 
> I have a C application that compiled and executed successfully on SunOS 2.6 using gcc 2.95.3 and make 3.79.1.  The machine was recently upgraded to SunOS 2.8, obliterating all traces of the former system and GNU libraries.
> 
> In the new SunOS 2.8 environment, I installed gcc 2.95.3 and make 3.80.  The application compiles without complaint (see output below), but the resulting executable is much smaller than the SunOS 2.6 version.  The SunOS 2.8 executable ssod.so7 is 117556 bytes, while the SunOS 2.6 executable was 781396 bytes.  This suggests something is missing.
> 
> When I attempt to execute the SunOS 2.8 executable ssod.so7, it terminates instantly:
> 
> # ./bin/ssod.so7
> ld.so.1: ./bin/ssod.so7: fatal: libstdc++.so.2.10.0: open failed: No such file or directory
> Killed

Ah. This is what is missing. The gcc you had under 2.6 was probably
configured to link staticly (this including everything used from
libstdc++) while the gcc you installed under 2.8 was probably
configured to link dynamicly. Add -v to your CFLAGS and gcc will dump
some extra info that should help you verify this assumption.

> 
> However, the stdc++ library seems to be where it belongs:
> 
> # ls -l /usr/local/lib/libstd*
> -rw-r--r--   1 bin      bin      2222756 Mar 16  2001 /usr/local/lib/libstdc++.a.2.10.0
> -r-xr-xr-x   1 bin      bin      2232464 Mar 16  2001 /usr/local/lib/libstdc++.so.2.10.0
> # ls -l /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/libstd*
> lrwxrwxrwx   1 root     other         27 Dec 20 13:13 /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/libstdc++.a -> ../../../libstdc++.a.2.10.0
> lrwxrwxrwx   1 root     other         28 Dec 20 13:13 /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/libstdc++.so -> ../../../libstdc++.so.2.10.0
> 
> Any suggestions will be appreciated.  I can provide source code or
> other information if it is needed.  Many thanks.

It's been a while since I used solaris, but ISTR that /usr/local/lib
is not searched for dynamic libs by default. That is, your solaris
install probably isn't configured to look there for libstdc++.

One fix is to set LD_LBRIARY_PATH to include /usr/local/lib :

$export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib

or in csh:

>set LD_LIBRARY_PATH = ${LD_LIBRARY_PATH}:/usr/local/lib

before running the program.

An alternative is recompile the program with -static.

Finally, read 'man ld.so.1' . It likely contains something I've forgotten.

[snip]



More information about the Gcc-help mailing list