This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/7978: gcc 3.2 dynamic link path problem on Solaris 8 with g++


>Number:         7978
>Category:       c++
>Synopsis:       gcc 3.2 dynamic link path problem on Solaris 8 with g++
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 19 13:26:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Paul Eggert
>Release:        3.2
>Organization:
Twin Sun, Inc.
>Environment:
Solaris 8 (sparc).
System: SunOS sic.twinsun.com 5.8 Generic_108528-16 sun4u sparc SUNW,UltraSPARC-IIi-Engine
Architecture: sun4

	
host: sparc-sun-solaris2.8
build: sparc-sun-solaris2.8
target: sparc-sun-solaris2.8
configured with: ../gcc-3.2/configure --disable-nls --enable-languages=c,c++ --prefix=/tmp/prefix --with-system-zlib
>Description:
	The "g++" command creates an executable that does not run due to
	a run-time link path problem.
>How-To-Repeat:
	$ echo 'int main (void) { return 0; }' >test.cc
	$ g++ test.cc
	$ ./a.out
	ld.so.1: ./a.out: fatal: libstdc++.so.5: open failed: No such file or directory
	Killed
	$ ldd a.out
		libstdc++.so.5 =>	 (file not found)
		libm.so.1 =>	 /usr/lib/libm.so.1
		libgcc_s.so.1 =>	 /usr/lib/libgcc_s.so.1
		libc.so.1 =>	 /usr/lib/libc.so.1
		libdl.so.1 =>	 /usr/lib/libdl.so.1
		/usr/platform/SUNW,UltraSPARC-IIi-Engine/lib/libc_psr.so.1
	$ g++ -v test.cc
	Reading specs from /tmp/prefix/lib/gcc-lib/sparc-sun-solaris2.8/3.2/specs
	Configured with: ../gcc-3.2/configure --disable-nls --enable-languages=c,c++ --prefix=/tmp/prefix --with-system-zlib
	Thread model: posix
	gcc version 3.2
	 /tmp/prefix/lib/gcc-lib/sparc-sun-solaris2.8/3.2/cc1plus -v -D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=0 -D__GXX_ABI_VERSION=102 -Dsparc -Dsun -Dunix -D__svr4__ -D__SVR4 -D__PRAGMA_REDEFINE_EXTNAME -D__sparc__ -D__sun__ -D__unix__ -D__svr4__ -D__SVR4 -D__PRAGMA_REDEFINE_EXTNAME -D__sparc -D__sun -D__unix -Asystem=unix -Asystem=svr4 -D__NO_INLINE__ -D__STDC_HOSTED__=1 -D_XOPEN_SOURCE=500 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -D__EXTENSIONS__ -D__SIZE_TYPE__=unsigned int -D__PTRDIFF_TYPE__=int -D__WCHAR_TYPE__=long int -D__WINT_TYPE__=long int -D__GCC_NEW_VARARGS__ -Acpu=sparc -Amachine=sparc test.cc -D__GNUG__=3 -D__DEPRECATED -D__EXCEPTIONS -quiet -dumpbase test.cc -version -o /tmp/ccGvtOqb.s
	GNU CPP version 3.2 (cpplib) (sparc ELF)
	GNU C++ version 3.2 (sparc-sun-solaris2.8)
		compiled by GNU C version 3.2.
	ignoring nonexistent directory "/usr/local/include"
	ignoring nonexistent directory "/tmp/prefix/sparc-sun-solaris2.8/include"
	#include "..." search starts here:
	#include <...> search starts here:
	 /tmp/prefix/include/c++/3.2
	 /tmp/prefix/include/c++/3.2/sparc-sun-solaris2.8
	 /tmp/prefix/include/c++/3.2/backward
	 /tmp/prefix/include
	 /tmp/prefix/lib/gcc-lib/sparc-sun-solaris2.8/3.2/include
	 /usr/include
	End of search list.
	 /usr/ccs/bin/as -V -Qy -s -o /tmp/ccZQywic.o /tmp/ccGvtOqb.s
	/usr/ccs/bin/as: Sun WorkShop 6 99/08/18
	 /tmp/prefix/lib/gcc-lib/sparc-sun-solaris2.8/3.2/collect2 -V -Y P,/usr/ccs/lib:/usr/lib -Qy /tmp/prefix/lib/gcc-lib/sparc-sun-solaris2.8/3.2/crt1.o /tmp/prefix/lib/gcc-lib/sparc-sun-solaris2.8/3.2/crti.o /usr/ccs/lib/values-Xa.o /tmp/prefix/lib/gcc-lib/sparc-sun-solaris2.8/3.2/crtbegin.o -L/tmp/prefix/lib/gcc-lib/sparc-sun-solaris2.8/3.2 -L/usr/ccs/bin -L/usr/ccs/lib -L/tmp/prefix/lib/gcc-lib/sparc-sun-solaris2.8/3.2/../../.. /tmp/ccZQywic.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc -lc /tmp/prefix/lib/gcc-lib/sparc-sun-solaris2.8/3.2/crtend.o /tmp/prefix/lib/gcc-lib/sparc-sun-solaris2.8/3.2/crtn.o
	ld: Software Generation Utilities - Solaris Link Editors: 5.8-1.275

>Fix:
	g++ automatically appends -L options to the collect2 command, to
	help the linker find libstdc++.so.5 at link-time.  It should also
	append -R options, so that the dynamic linker can find it too.

	A workaround is to use "g++ -static".
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]