This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: [bug report] gcc-2.95.1 on Solaris x86 2.5 [patch for 2.95.2]
On Sep 17, 1999, I Lee Hetherington <ilh@sls.lcs.mit.edu> wrote:
> Also, debugging, even with gdb, seems to work better with dwarf2 for me
> on Solaris 2.5 x86. gdb doesn't find the source files if I use -gstabs,
> but does with -gdwarf-2, when I run in a directory different from
> compilation.
Well, we should probably default to -gstabs, as we do on
Solaris/sparc, so that dbx works. People can always --enable-dwarf2
or compile -gdwarf-2 if they wish (unlike --with-stabs, that relied
upon sol2dbg.h that was plain broken with GNU as, despite the comment
in the beginning of the header file!)
Here's a patch that enables stabs by default on Solaris/x86, and works
around the lack of support for `-s' in gas. Ok to install?
I strongly advise to put it in for 2.95.2. We've been getting several
reports of crashes in dwarfout_finish, when compiling with `g++ -g' or
`gcj' without `-g0' (it defaults to -g1). This patch obviously won't
fixing the -gdwarf bug, as it would be desirable, but that is
currently beyond my (avail)abilities. Moreover, using stabs by
default on Solaris/x86 is consistent with Solaris/sparc behavior.
for gcc/ChangeLog:
from Alexandre Oliva <oliva@lsd.ic.unicamp.br>
* config/i386/sol2.h (PREFERRED_DEBUGGING_TYPE): Use stabs.
(ASM_SPEC): Moved from sol2dbg.h. Added work-around for gas.
* config/i386/sol2dbg.h: Removed.
* config/i386/sol2gas.h: New file, to enable gas work-around.
* configure.in: Use i386/sol2gas.h on Solaris/x86 --with-gas.
Don't use sol2dbg.h.
* configure: Rebuilt.
Index: gcc/config/i386/sol2.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/i386/sol2.h,v
retrieving revision 1.4
diff -u -r1.4 sol2.h
--- gcc/config/i386/sol2.h 1998/12/20 13:24:16 1.4
+++ gcc/config/i386/sol2.h 1999/09/18 07:02:53
@@ -21,6 +21,33 @@
#include "i386/sysv4.h"
+/* We use stabs-in-elf for debugging, because that is what the native
+ toolchain uses. */
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
+
+#if ! GAS_REJECTS_MINUS_S
+
+/*
+ Changed from config/svr4.h in the following ways:
+
+ - Removed -Yd (neither the sun bundled assembler nor gas accept it).
+ - Added "-s" so that stabs are not discarded.
+*/
+
+#undef ASM_SPEC
+#define ASM_SPEC \
+ "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Wa,*:%*} -s"
+
+#else /* GAS_REJECTS_MINUS_S */
+
+/* Same as above, except for -s, unsupported by GNU as. */
+#undef ASM_SPEC
+#define ASM_SPEC \
+ "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Wa,*:%*}"
+
+#endif /* GAS_REJECTS_MINUS_S */
+
/* The Solaris 2.0 x86 linker botches alignment of code sections.
It tries to align to a 16 byte boundary by padding with 0x00000090
ints, rather than 0x90 bytes (nop). This generates trash in the
Index: gcc/config/i386/sol2dbg.h
===================================================================
RCS file: sol2dbg.h
diff -N sol2dbg.h
--- gcc/config/i386/sol2dbg.h Fri Sep 17 23:26:39 1999
+++ gcc/config/i386/sol2dbg.h Sat Dec 5 20:30:03 1998
@@ -1,27 +0,0 @@
-/* Target definitions for GNU compiler for Intel 80386 running Solaris
- with gas and gdb.
- This file is added into the directory .../gcc-2.../config/i386
- Workability without "#undef DWARF_DEBUGGING_INFO" is not tested. */
-
-/* Use stabs instead of DWARF debug format. */
-#ifdef PREFERRED_DEBUGGING_TYPE
-#undef PREFERRED_DEBUGGING_TYPE
-#endif
-#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
-
-#include "i386/sol2.h"
-
-#ifdef DWARF_DEBUGGING_INFO
-#undef DWARF_DEBUGGING_INFO
-#endif
-
-/*
- Changed from config/svr4.h in the following ways:
-
- - Added "%{V}".
- - Modified "{%v:-V}" to take into account "%{V}".
- - Added "-s" so that stabs are saved in the final executable. */
-
-#undef ASM_SPEC
-#define ASM_SPEC \
- "%{V} %{v:%{!V:-V}} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} -s"
Index: gcc/config/i386/sol2gas.h
===================================================================
RCS file: sol2gas.h
diff -N sol2gas.h
--- gcc/config/i386/sol2gas.h Sat Dec 5 20:30:03 1998
+++ gcc/config/i386/sol2gas.h Fri Sep 17 23:26:39 1999
@@ -0,0 +1,11 @@
+/* Definitions of target machine for GNU compiler, for SPARC running
+ Solaris 2 with GNU as up to 2.9.5.0.12.
+
+ Copyright (C) 1999 Free Software Foundation, Inc.
+*/
+
+#ifndef GAS_DOES_NOT_SUPPORT_MINUS_S
+#define GAS_DOES_NOT_SUPPORT_MINUS_S 1
+#endif
+
+#include "i386/sol2.h"
Index: gcc/configure.in
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/configure.in,v
retrieving revision 1.288
diff -u -r1.288 configure.in
--- gcc/configure.in 1999/09/15 13:53:45 1.288
+++ gcc/configure.in 1999/09/18 05:27:56
@@ -1539,9 +1539,9 @@
changequote([,])dnl
xm_file="xm-siglist.h xm-alloca.h ${xm_file}"
xm_defines="USG POSIX SMALL_ARG_MAX"
- if test x$stabs = xyes
- then
- tm_file=i386/sol2dbg.h
+ if test x$gas = xyes; then
+ # Only needed if gas does not support -s
+ tm_file=i386/sol2gas.h
else
tm_file=i386/sol2.h
fi
--
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
oliva@{lsd.ic.unicamp.br,guarana.{org,com}} aoliva@{acm,computer}.org
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
** I may forward mail about projects to mailing lists; please use them