Fix Solaris 8/9 bootstrap with Sun as

Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
Mon May 10 12:54:00 GMT 2010


A recent bootstrap on Solaris 9 with Sun as broke because the native
assembler doesn't support .hidden etc, so we got warnings/errors about
unused variables and arguments.

Fixed as below, and moved the comment about Sun ld visibility support to
configure.ac where it belongs.

Installed mainline and 4.5 branch.

	Rainer

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


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

	* config/sol2.c (solaris_assemble_visibility): Declare decl, vis
	unused.
	Define visibility_types, name, type inside HAVE_GAS_HIDDEN.
	* configure.ac (gcc_cv_ld_hidden): Explain stages of visibility
	support in Sun ld.
	* configure: Regenerate.

diff -r 263e7d3a84dc gcc/config/sol2.c
--- a/gcc/config/sol2.c	Sat May 08 18:23:36 2010 +0200
+++ b/gcc/config/sol2.c	Sat May 08 18:26:23 2010 +0200
@@ -122,8 +122,10 @@
    the visibility type VIS, which must not be VISIBILITY_DEFAULT.  */
 
 void
-solaris_assemble_visibility (tree decl, int vis)
+solaris_assemble_visibility (tree decl ATTRIBUTE_UNUSED,
+			     int vis ATTRIBUTE_UNUSED)
 {
+#ifdef HAVE_GAS_HIDDEN
   /* Sun as uses .symbolic for STV_PROTECTED.  STV_INTERNAL is marked as
      `currently reserved', but the linker treats it like STV_HIDDEN.  Sun
      Studio 12.1 cc emits .hidden instead.
@@ -146,9 +148,6 @@
   name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
   type = visibility_types[vis];
 
-  /* .hidden dates back before Solaris 2.5, but .symbolic was only added in
-     Solaris 9 12/02.  */
-#ifdef HAVE_GAS_HIDDEN
   fprintf (asm_out_file, "\t.%s\t", type);
   assemble_name (asm_out_file, name);
   fprintf (asm_out_file, "\n");
diff -r 263e7d3a84dc gcc/configure
--- a/gcc/configure	Sat May 08 18:23:36 2010 +0200
+++ b/gcc/configure	Sat May 08 18:26:23 2010 +0200
@@ -21343,6 +21343,8 @@
 	gcc_cv_ld_hidden=yes
 	;;
       *-*-solaris2.9* | *-*-solaris2.1[0-9]*)
+	# Support for .hidden in Sun ld appeared in Solaris 9 FCS, but
+	# .symbolic was only added in Solaris 9 12/02.
         gcc_cv_ld_hidden=yes
 	;;
       *)
diff -r 263e7d3a84dc gcc/configure.ac
--- a/gcc/configure.ac	Sat May 08 18:23:36 2010 +0200
+++ b/gcc/configure.ac	Sat May 08 18:26:23 2010 +0200
@@ -2225,6 +2225,8 @@
 	gcc_cv_ld_hidden=yes
 	;;
       *-*-solaris2.9* | *-*-solaris2.1[0-9]*)
+	# Support for .hidden in Sun ld appeared in Solaris 9 FCS, but
+	# .symbolic was only added in Solaris 9 12/02.
         gcc_cv_ld_hidden=yes
 	;;
       *)



More information about the Gcc-patches mailing list