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]

PATCH: Don't use .stabd with Sun as on Solaris 2/x86


When bootstrapping mainline on Solaris 11/x86 with Sun as, I noticed
many different testsuite failures, e.g.

FAIL: gcc.dg/debug/20020220-1.c (test for excess errors)
Excess errors:
Assembler: 20020220-1.c
	"/var/tmp//cc6vaOeA.s", line 29 : Illegal mnemonic
	Near line: "	.stabd	46,0,0"
	"/var/tmp//cc6vaOeA.s", line 29 : Syntax error
	Near line: "	.stabd	46,0,0"
	"/var/tmp//cc6vaOeA.s", line 42 : Illegal mnemonic
	Near line: "	.stabd	78,0,0"
	"/var/tmp//cc6vaOeA.s", line 42 : Syntax error
	Near line: "	.stabd	78,0,0"
[...]

As on Solaris 2/SPARC, Sun as doesn't understand the .stabd directive,
and, given their move to DWARF-2, isn't ever likely to.  After several
false starts, I discovered how the problem is fixed on SPARC: simply
defined NO_DBX_BNSYM_ENSYM and be done with it.

The following fix does so and fixes all those failures.  As this is a
common Solaris 2 issue, I'll move the define to a new common
config/sol2-gas.h header, but only for 4.6.

Installed.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2010-02-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* config/i386/sol2.h (NO_DBX_BNSYM_ENSYM): Define.
	* config/i386/sol2-gas.h: New file.
	* config.gcc (i[34567]86-*-solaris2*): Use it.

diff -r 2db82b177868 -r a5a9a49aa068 gcc/config.gcc
--- a/gcc/config.gcc	Thu Feb 11 23:19:26 2010 +0100
+++ b/gcc/config.gcc	Thu Feb 11 23:19:26 2010 +0100
@@ -1239,6 +1239,9 @@
 		;;
 	esac
 	tm_file="${tm_file} i386/sol2.h"
+	if test x$gas = xyes; then
+		tm_file="${tm_file} i386/sol2-gas.h"
+	fi
 	tmake_file="${tmake_file} t-sol2 t-svr4"
 	c_target_objs="${c_target_objs} sol2-c.o"
 	cxx_target_objs="${cxx_target_objs} sol2-c.o"
diff -r 2db82b177868 -r a5a9a49aa068 gcc/config/i386/sol2-gas.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gcc/config/i386/sol2-gas.h	Thu Feb 11 23:19:26 2010 +0100
@@ -0,0 +1,28 @@
+/* Definitions of target machine for GCC, for x86 running Solaris 2
+   using the GNU assembler.
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+/* Undefine this so that BNSYM/ENSYM pairs are emitted by STABS+.  */
+#undef NO_DBX_BNSYM_ENSYM
diff -r 2db82b177868 -r a5a9a49aa068 gcc/config/i386/sol2.h
--- a/gcc/config/i386/sol2.h	Thu Feb 11 23:19:26 2010 +0100
+++ b/gcc/config/i386/sol2.h	Thu Feb 11 23:19:26 2010 +0100
@@ -1,6 +1,6 @@
 /* Target definitions for GCC for Intel 80386 running Solaris 2
    Copyright (C) 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-   2004, 2007, 2008, 2009 Free Software Foundation, Inc.
+   2004, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Fred Fish (fnf@cygnus.com).
 
 This file is part of GCC.
@@ -91,6 +91,10 @@
       }							\
   } while (0)
 
+/* The Solaris assembler cannot grok .stabd directives.  */
+#undef NO_DBX_BNSYM_ENSYM
+#define NO_DBX_BNSYM_ENSYM 1
+
 /* Solaris-specific #pragmas are implemented on top of attributes.  Hook in
    the bits from config/sol2.c.  */
 #define SUBTARGET_INSERT_ATTRIBUTES solaris_insert_attributes


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