This is the mail archive of the gcc@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]

G++ 3.2, Sol 7/sparc, dynamic linking problem?


Recently build of GCC 3.2 on/for Solaris 7 (sparc).  

I have been using this to build C apps successfully (from GNU tarballs).
Not seen any problems running them.

C++ app with dynamic linkage suffer SegFault.  Static linkage OK (limited
testing).

For example, trying to build a C++ app (eg, minimal "Hello World"):

(1)
	tmp$ g++ cc.cc
	/usr/gnu/bin/ld: cannot find -lgcc_s
	collect2: ld returned 1 exit status

OK, libgcc_s.so is under /usr/gnu/lib/sparcv9, so add
-L/usr/gnu/lib/sparcv9.
But, shouldnt this be found by g++/ld?

(2)	Build with explicit -L.  Set LD_LIBRARY_PATH to include /usr/gnu/lib

and /usr/gnu/lib/sparcv9:

	tmp$ ldd a.out
	libstdc++.so.5 =>        /usr/gnu/lib/libstdc++.so.5
	libm.so.1 =>     /usr/lib/libm.so.1
	libgcc_s.so.1 =>         /usr/gnu/lib/sparcv9/libgcc_s.so.1
	libc.so.1 =>     /usr/lib/libc.so.1
	libdl.so.1 =>    /usr/lib/libdl.so.1
	/usr/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1
	
Running results in a SegFault.  GDB shows:

	Program received signal SIGSEGV, Segmentation fault.
	__register_frame_info_bases (begin=0xff2b0000, ob=0xff2b0000,
tbase=0x0, 
	    dbase=0x0) at ../../gcc-3.2/gcc/unwind-dw2-fde.c:83
	83      ../../gcc-3.2/gcc/unwind-dw2-fde.c: No such file or
directory.
	        in ../../gcc-3.2/gcc/unwind-dw2-fde.c

(3)	Built with -static, result runs OK.


Can anybody shed light on this?


GCC Build info (all with prefix=/usr/gnu)

Previous compiler is gcc 2.8.1 (prefix=/usr/local)

Built binutils-2.13
Configured gcc with
	--with-as=/usr/gnu/bin/as
	--with-ld=/usr/gnu/bin/ld
	--disable-multilib  (32bit mode solaris kernel)
	--enable-__cxa_atexit
make bootstrap on GCC

binutils-2.13 have since been rebuilt (using GCC 3.2) due to accidental
deletion
of strip.  (Had not tried any C++ apps at that point).



Simon.



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