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

Re: 3.4/3.5 PATCH: Switch to DWARF-2 debugging on Solaris/x86 >= 7


Eric Botcazou writes:

> > Fri Apr 16 18:04:38 2004  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
> >
> > 	* config.gcc (i[34567]86-*-solaris2*): Default to DWARF-2
> > 	debugging on Solaris 7 and up.
> 
> Rainer, would you mind doing this for sparc-*-solaris2* too on mainline?

Sure.

> > As an aside, I think that the definition of ASM_DEBUG in
> > config/sparc/sol2-bi.h from the above patch can be removed completely
> > since this is identical to the gcc.c default.
> 
> Yes, as well as the definition of PREFERRED_DEBUGGING_TYPE if tm-dwarf2.h is 
> included.  Would you mind writing the patch too?  Thanks in advance.
> 
> Both patches are pre-approved for mainline.

I've bootstrapped the following patch without regressions on
sparc-sun-solaris2.8 with the native as.  Unfortunately, a bootstrap with
gas (either 2.14 or 2.14.91 20040419) fails linking the 32-bit
libgcc_s.so.1:

$ ./xgcc -B./ -B/vol/gcc/share/sparc-sun-solaris2.8/bin/ -isystem /vol/gcc/share/sparc-sun-solaris2.8/include -isystem /vol/gcc/share/sparc-sun-solaris2.8/sys-include -L/vol/gcc/obj/gcc-3.5.0-20040419/8-gcc-gas214-ada/gcc/../ld -O2  -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -shared -nodefaultlibs -Wl,-h,libgcc_s.so.1 -Wl,-z,text -Wl,-z,defs -Wl,-M,libgcc/./libgcc.map -o libgcc_s.so.1   libgcc/./_muldi3.o libgcc/./_negdi2.o libgcc/./_lshrdi3.o libgcc/./_ashldi3.o libgcc/./_ashrdi3.o libgcc/./_cmpdi2.o libgcc/./_ucmpdi2.o libgcc/./_floatdidf.o libgcc/./_floatdisf.o libgcc/./_fixunsdfsi.o libgcc/./_fixunssfsi.o libgcc/./_fixunsdfdi.o libgcc/./_fixdfdi.o libgcc/./_fixunssfdi.o libgcc/./_fixsfdi.o libgcc/./_fixxfdi.o libgcc/./_fixunsxfdi.o libgcc/./_floatdixf.o libgcc/./_fixunsxfsi.o libgcc/./_fixtfdi.o libgcc/./_fixunstfdi.o libgcc/.!
 /_floatditf.o libgcc/./_clear_cache.o libgcc/./_trampoline.o libgcc/./__main.o libgcc/./_absvsi2.o libgcc/./_absvdi2.o libgcc/./_addvsi3.o libgcc/./_addvdi3.o libgcc/./_subvsi3.o libgcc/./_subvdi3.o libgcc/./_mulvsi3.o libgcc/./_mulvdi3.o libgcc/./_negvsi2.o libgcc/./_negvdi2.o libgcc/./_ctors.o libgcc/./_ffssi2.o libgcc/./_ffsdi2.o libgcc/./_clz.o libgcc/./_clzsi2.o libgcc/./_clzdi2.o libgcc/./_ctzsi2.o libgcc/./_ctzdi2.o libgcc/./_popcount_tab.o libgcc/./_popcountsi2.o libgcc/./_popcountdi2.o libgcc/./_paritysi2.o libgcc/./_paritydi2.o libgcc/./_divdi3.o libgcc/./_moddi3.o libgcc/./_udivdi3.o libgcc/./_umoddi3.o libgcc/./_udiv_w_sdiv.o libgcc/./_udivmoddi4.o  libgcc/./unwind-dw2.o libgcc/./unwind-dw2-fde.o libgcc/./unwind-sjlj.o libgcc/./gthr-gnat.o libgcc/./unwind-c.o -lc && rm -f libgcc_s.so && ln -s libgcc_s.so.1 libgcc_s.so
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_muldi3.o: symbol <unknown>: offset 0xfeaf7262 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_negdi2.o: symbol <unknown>: offset 0xfeaf72cb is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_lshrdi3.o: symbol <unknown>: offset 0xfeaf732e is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_ashrdi3.o: symbol <unknown>: offset 0xfeaf7422 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_fixunsdfsi.o: symbol <unknown>: offset 0xfeaf7661 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_fixunssfsi.o: symbol <unknown>: offset 0xfeaf76c7 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_fixunsdfdi.o: symbol <unknown>: offset 0xfeaf772d is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_fixdfdi.o: symbol <unknown>: offset 0xfeaf779a is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_fixunssfdi.o: symbol <unknown>: offset 0xfeaf7802 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_fixsfdi.o: symbol <unknown>: offset 0xfeaf7876 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_fixtfdi.o: symbol <unknown>: offset 0xfeaf7946 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_fixunstfdi.o: symbol <unknown>: offset 0xfeaf79b2 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_floatditf.o: symbol <unknown>: offset 0xfeaf7a36 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_clear_cache.o: symbol <unknown>: offset 0xfeaf7a99 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_trampoline.o: symbol <unknown>: offset 0xfeaf7aee is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_absvsi2.o: symbol <unknown>: offset 0xfeaf7b6d is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_absvdi2.o: symbol <unknown>: offset 0xfeaf7bd2 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_addvdi3.o: symbol <unknown>: offset 0xfeaf7c9f is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_subvsi3.o: symbol <unknown>: offset 0xfeaf7d09 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_subvdi3.o: symbol <unknown>: offset 0xfeaf7d73 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_mulvsi3.o: symbol <unknown>: offset 0xfeaf7ddd is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_mulvdi3.o: symbol <unknown>: offset 0xfeaf7e45 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_negvsi2.o: symbol <unknown>: offset 0xfeaf7ef5 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_ffssi2.o: symbol <unknown>: offset 0xfeaf7fed is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_ffsdi2.o: symbol <unknown>: offset 0xfeaf8065 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_clzsi2.o: symbol <unknown>: offset 0xfeaf8132 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_clzdi2.o: symbol <unknown>: offset 0xfeaf81a6 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_ctzsi2.o: symbol <unknown>: offset 0xfeaf821b is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_ctzdi2.o: symbol <unknown>: offset 0xfeaf8291 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_popcountsi2.o: symbol <unknown>: offset 0xfeaf834a is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_popcountdi2.o: symbol <unknown>: offset 0xfeaf83b1 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_paritydi2.o: symbol <unknown>: offset 0xfeaf847e is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_divdi3.o: symbol <unknown>: offset 0xfeaf84f5 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_moddi3.o: symbol <unknown>: offset 0xfeaf85c5 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./_umoddi3.o: symbol <unknown>: offset 0xfeaf8762 is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./unwind-dw2.o: symbol <unknown>: offset 0xfeaf89df is non-aligned
ld: fatal: relocation error: R_SPARC_32: file libgcc/./unwind-c.o: symbol <unknown>: offset 0xfeaf964d is non-aligned
collect2: ld returned 1 exit status
make[3]: *** [libgcc_s.so] Error 1

This is certainly not related to my patch, but this way I couldn't verify
the ASM_DEBUG_SPEC part, so I'm somewhat relucatant to check this in.

	Rainer

-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University


Mon Apr 19 18:00:51 2004  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>

	* config.gcc (sparc64-*-solaris2*, sparcv9-*-solaris2*): Add
	tm-dwarf2.h for Solaris 7 and up.
	(sparc-*-solaris2*): Likewise.
	* config/sparc/sol2-bi.h (PREFERRED_DEBUGGING_TYPE): Remove.
	(ASM_DEBUG_SPEC): Remove.

Index: gcc/config.gcc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.449
diff -u -p -r1.449 config.gcc
--- gcc/config.gcc	17 Apr 2004 02:32:23 -0000	1.449
+++ gcc/config.gcc	20 Apr 2004 11:34:06 -0000
@@ -1823,6 +1823,11 @@ sparc64-*-solaris2* | sparcv9-*-solaris2
 	if test x$gas = xyes; then
 		tm_file="${tm_file} sparc/sol2-gas-bi.h"
 	fi
+	case ${target} in
+	*-*-solaris2.[789] | *-*-solaris2.1[0-9])
+		tm_file="$tm_file tm-dwarf2.h"
+		;;
+	esac
 	tmake_file="sparc/t-sol2 sparc/t-sol2-64 sparc/t-crtfm"
 	if test x$gnu_ld = xyes; then
 		tmake_file="$tmake_file t-slibgcc-elf-ver"
@@ -1862,6 +1867,7 @@ sparc-*-solaris2*)
 		if test x$gas = xyes; then
 			tm_file="${tm_file} sparc/sol2-gas-bi.h"
 		fi
+		tm_file="$tm_file tm-dwarf2.h"
 		tmake_file="$tmake_file sparc/t-sol2-64"
 		need_64bit_hwint=yes
 		;;
Index: gcc/config/sparc/sol2-bi.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sol2-bi.h,v
retrieving revision 1.16
diff -u -p -r1.16 sol2-bi.h
--- gcc/config/sparc/sol2-bi.h	5 Apr 2004 04:22:57 -0000	1.16
+++ gcc/config/sparc/sol2-bi.h	20 Apr 2004 11:34:06 -0000
@@ -215,10 +215,3 @@
 #else
 #define MULTILIB_DEFAULTS { "m64" }
 #endif
-
-#undef PREFERRED_DEBUGGING_TYPE
-#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
-
-#if defined(HAVE_AS_GDWARF2_DEBUG_FLAG) && defined(HAVE_AS_GSTABS_DEBUG_FLAG)
-# define ASM_DEBUG_SPEC "%{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}}"
-#endif


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