This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: stabs in x86-sol2
On Sep 19, 1999, Richard Henderson <rth@cygnus.com> wrote:
> You've used both GAS_REJECTS_MINUS_S and GAS_DOES_NOT_SUPPORT_MINUS_S.
Yup, that's one takes for splitting a couple of unrelated
modifications into separate patch files, making further changes, then
editing the separate patch files :-)
> Don't chain include files with #include; use multiple tm_files.
I didn't know it would work. Thanks for the tip.
> I don't really like having the variable at all.
Nor do I, but I think it's essential for 2.95.2, if we go in the
dwarf1->stabs route, and dwarf1 is unusable. For 2.96, we'll probably
be able to get rid of the additional configuration file and #define,
since Ian has just installed a patch for gas to ignore -s. But it
will take a while until it makes it to a stable binutils release, so
I'd rather put the patch in till then.
> You really have to give a special flag to _not_ strip stabs?
Yup, the man-page says:
-s Places all stabs in the .stabs section. By
default, stabs are placed in stabs.excl sections,
which are stripped out by the static linker,
ld(1), during final execution. When the -s option
is used, stabs remain in the final executable
because .stab sections are not stripped by the
static linker.
I have verified that it indeed does as it says :-(
> Why were we configuring dwarf1 instead of dwarf2 anyway?
Dunno. Since there was no explicit definition, it was picking the
svr4 default, that is DWARF-1.
Here's a revised patch, that I'm testing at this very moment. Ok to
install (assuming it succeeds the tests :-)?
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.5
diff -u -p -r1.5 sol2.h
--- gcc/config/i386/sol2.h 1999/09/18 19:09:32 1.5
+++ gcc/config/i386/sol2.h 1999/09/20 10:21:01
@@ -21,6 +21,33 @@ Boston, MA 02111-1307, USA. */
#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 Mon Sep 20 03:21:03 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 Mon Sep 20 03:21:01 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_REJECTS_MINUS_S
+#define GAS_REJECTS_MINUS_S 1
+#endif
+
+/* Assume sol2.h will be included afterwards. */
Index: gcc/configure.in
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/configure.in,v
retrieving revision 1.290
diff -u -p -r1.290 configure.in
--- gcc/configure.in 1999/09/20 09:59:33 1.290
+++ gcc/configure.in 1999/09/20 10:23:08
@@ -1543,11 +1543,10 @@ changequote(,)dnl
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
- else
- tm_file=i386/sol2.h
+ tm_file=i386/sol2.h
+ if test x$gas = xyes; then
+ # Only needed if gas does not support -s
+ tm_file="i386/sol2gas.h ${tm_file}"
fi
tmake_file=i386/t-sol2
extra_parts="crt1.o crti.o crtn.o gcrt1.o gmon.o crtbegin.o crtend.o"
--
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