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]

Solaris cleanup patches


These four patches are minor cleanups to Solaris support from
csl-sol210-branch in preparation for merging the actual AMD64 Solaris
10 port.

1. When building multilibs with Solaris linker, put links to shared
   libraries within the multilib directory.

2. Move the definition of SUPPORTS_INIT_PRIORITY from a SPARC-specific
   file to the common Solaris configuration file.

3. Follow the specification of cmn_err formats, which says they accept
   %p.

4. Change ASM_OUTPUT_CALL to use print_operand rather than just the
   unadorned DECL_NAME to output function calls.

Bootstrapped (together) with no regressions on sparc-sun-solaris2.8.
OK to commit some or all of the patches?

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)

2004-11-14  Mark Mitchell <mark@codesourcery.com>

	* config/t-slibgcc-sld (SHLIB_LINK): Make symlinks entirely
	within the multilib directory.

diff -rupN -x CVS gcc-merge-HEAD-csl-sol210-1/gcc/config/t-slibgcc-sld gcc-sol210/gcc/config/t-slibgcc-sld
--- gcc-merge-HEAD-csl-sol210-1/gcc/config/t-slibgcc-sld	2004-02-07 15:45:22.000000000 -0800
+++ gcc-sol210/gcc/config/t-slibgcc-sld	2004-10-14 11:17:51.000000000 -0700
@@ -12,12 +12,12 @@
 	-Wl,-h,$(SHLIB_SONAME) -Wl,-z,text -Wl,-z,defs \
 	-Wl,-M,$(SHLIB_MAP) -o $(SHLIB_NAME).tmp \
 	@multilib_flags@ $(SHLIB_OBJS) -lc && \
-	rm -f $(SHLIB_SOLINK) && \
+	rm -f @shlib_dir@$(SHLIB_SOLINK) && \
 	if [ -f $(SHLIB_NAME) ]; then \
 	  mv -f $(SHLIB_NAME) $(SHLIB_NAME).`basename $(STAGE_PREFIX)`; \
 	else true; fi && \
 	mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
-	$(LN_S) $(SHLIB_NAME) $(SHLIB_SOLINK)
+	$(LN_S) $(SHLIB_SONAME) @shlib_dir@$(SHLIB_SOLINK)
 # $(slibdir) double quoted to protect it from expansion while building
 # libgcc.mk.  We want this delayed until actual install time.
 SHLIB_INSTALL = \

2004-11-14  Mark Mitchell <mark@codesourcery.com>

	* config/sparc/sol2.h (SUPPORTS_INIT_PRIORITY): Remove.
	* config/sol2.h (SUPPORTS_INIT_PRIORITY): Define here.

diff -rupN -x CVS gcc-merge-HEAD-csl-sol210-1/gcc/config/sol2.h gcc-sol210/gcc/config/sol2.h
--- gcc-merge-HEAD-csl-sol210-1/gcc/config/sol2.h	2004-07-25 11:10:02.000000000 -0700
+++ gcc-sol210/gcc/config/sol2.h	2004-09-27 08:44:58.000000000 -0700
@@ -148,6 +153,12 @@ Boston, MA 02111-1307, USA.  */
    %(link_arch) \
    %{Qy:} %{!Qn:-Qy}"
 
+/* The Solaris linker doesn't understand constructor priorities.  (The
+   GNU linker does support constructor priorities, so GNU ld
+   configuration files for Solaris override this setting.)  */
+#undef SUPPORTS_INIT_PRIORITY
+#define SUPPORTS_INIT_PRIORITY 0
+
 /* This defines which switch letters take arguments.
    It is as in svr4.h but with -R added.  */
 #undef SWITCH_TAKES_ARG
diff -rupN -x CVS gcc-merge-HEAD-csl-sol210-1/gcc/config/sparc/sol2.h gcc-sol210/gcc/config/sparc/sol2.h
--- gcc-merge-HEAD-csl-sol210-1/gcc/config/sparc/sol2.h	2004-09-23 23:17:07.000000000 -0700
+++ gcc-sol210/gcc/config/sparc/sol2.h	2004-11-07 23:30:15.000000000 -0800
@@ -129,9 +129,6 @@ Boston, MA 02111-1307, USA.  */
   ((flag_pic || GLOBAL) ? DW_EH_PE_aligned : DW_EH_PE_absptr)
 #endif
 
-/* The Solaris linker doesn't understand constructor priorities.  */
-#undef SUPPORTS_INIT_PRIORITY
-#define SUPPORTS_INIT_PRIORITY 0
 
 /* Define for support of TFmode long double.
    SPARC ABI says that long double is 4 words.  */

2004-11-14  Mark Mitchell <mark@codesourcery.com>

	* config/sol2-c.c (cmn_err_char_table): Add "p".

testsuite:
2004-11-14  Mark Mitchell <mark@codesourcery.com>

	* gcc.dg/format/cmn-err-1.c: Add tests for "%p".

diff -rupN -x CVS gcc-merge-HEAD-csl-sol210-1/gcc/config/sol2-c.c gcc-sol210/gcc/config/sol2-c.c
--- gcc-merge-HEAD-csl-sol210-1/gcc/config/sol2-c.c	2004-09-17 14:54:50.000000000 -0700
+++ gcc-sol210/gcc/config/sol2-c.c	2004-09-27 09:24:48.000000000 -0700
@@ -64,6 +64,7 @@ static const format_char_info cmn_err_ch
   { "oOxX",0, STD_C89, { T89_UI,  BADLEN,  BADLEN,  T89_UL,  T9L_ULL, BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "w",  "",   NULL },
   { "u",   0, STD_C89, { T89_UI,  BADLEN,  BADLEN,  T89_UL,  T9L_ULL, BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "w",  "",   NULL },
   { "c",   0, STD_C89, { T89_C,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "w",  "",   NULL },
+  { "p",   1, STD_C89, { T89_V,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "w", "c",  NULL },
   { "s",   1, STD_C89, { T89_C,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "w",  "cR", NULL },
   { "b",   0, STD_C89, { T89_I,   BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN,  BADLEN  }, "",   "",   &bitfield_string_type },
   { NULL,  0, 0, NOLENGTHS, NULL, NULL, NULL }
diff -rupN -x CVS gcc-merge-HEAD-csl-sol210-1/gcc/testsuite/gcc.dg/format/cmn-err-1.c gcc-sol210/gcc/testsuite/gcc.dg/format/cmn-err-1.c
--- gcc-merge-HEAD-csl-sol210-1/gcc/testsuite/gcc.dg/format/cmn-err-1.c	2004-07-19 07:48:09.000000000 -0700
+++ gcc-sol210/gcc/testsuite/gcc.dg/format/cmn-err-1.c	2004-09-27 09:24:48.000000000 -0700
@@ -24,6 +24,7 @@
   cmn_err_func (0, "%lld %llD %llo %llO %llx %llX %llu",
 		ll, ll, ll, ll, ll, ll, ll);
   cmn_err_func (0, "%b %s", i, "\01Foo", string);
+  cmn_err_func (0, "%p", string);
 
   cmn_err_func (0, "%i", i);		/* { dg-error "unknown|too many" } */
   cmn_err_func (0, "%d", l);		/* { dg-error "expects type" } */
@@ -31,6 +32,6 @@
   cmn_err_func (0, "%b", i);		/* { dg-error "too few" } */
   cmn_err_func (0, "%b", i, i);		/* { dg-error "expects type" } */
   cmn_err_func (0, "%b", string, i);	/* { dg-error "expects type" } */
-
+  cmn_err_func (0, "%p", 3);            /* { dg-error "expects type" } */
   return 0;
 }

2004-11-14  Mark Mitchell <mark@codesourcery.com>

	* config/i386/sol2.h (ASM_OUTPUT_CALL): Use print_operand.
	* config/sparc/sol2.h (ASM_OUTPUT_CALL): Likewise.
	* config/sol2.c (solaris_output_init_fini): Update calls to
	ASM_OUTPUT_CALL.  Include "rtl.h".

diff -rupN -x CVS gcc-merge-HEAD-csl-sol210-1/gcc/config/i386/sol2.h gcc-sol210/gcc/config/i386/sol2.h
--- gcc-merge-HEAD-csl-sol210-1/gcc/config/i386/sol2.h	2004-07-25 11:10:03.000000000 -0700
+++ gcc-sol210/gcc/config/i386/sol2.h	2004-10-26 10:56:37.000000000 -0700
@@ -86,5 +99,11 @@ Boston, MA 02111-1307, USA.  */
 #define SUBTARGET_ATTRIBUTE_TABLE SOLARIS_ATTRIBUTE_TABLE
 
 /* Output a simple call for .init/.fini.  */
-#define ASM_OUTPUT_CALL(FILE, NAME)			\
-  fprintf (FILE, "\tcall\t%s\n", NAME)
+#define ASM_OUTPUT_CALL(FILE, FN)				\
+  do								\
+    {								\
+      fprintf (FILE, "\tcall\t");				\
+      print_operand (FILE, XEXP (DECL_RTL (FN), 0), 'P');	\
+      fprintf (FILE, "\n");					\
+    }								\
+  while (0)
diff -rupN -x CVS gcc-merge-HEAD-csl-sol210-1/gcc/config/sol2.c gcc-sol210/gcc/config/sol2.c
--- gcc-merge-HEAD-csl-sol210-1/gcc/config/sol2.c	2004-07-25 11:10:02.000000000 -0700
+++ gcc-sol210/gcc/config/sol2.c	2004-09-27 08:44:58.000000000 -0700
@@ -24,6 +24,7 @@ Boston, MA 02111-1307, USA.  */
 #include "coretypes.h"
 #include "tree.h"
 #include "tm.h"
+#include "rtl.h"
 #include "tm_p.h"
 #include "toplev.h"
 #include "ggc.h"
@@ -105,14 +106,14 @@ solaris_output_init_fini (FILE *file, tr
   if (lookup_attribute ("init", DECL_ATTRIBUTES (decl)))
     {
       fprintf (file, "\t.pushsection\t\".init\"\n");
-      ASM_OUTPUT_CALL (file, IDENTIFIER_POINTER (DECL_NAME (decl)));
+      ASM_OUTPUT_CALL (file, decl);
       fprintf (file, "\t.popsection\n");
     }
 
   if (lookup_attribute ("fini", DECL_ATTRIBUTES (decl)))
     {
       fprintf (file, "\t.pushsection\t\".fini\"\n");
-      ASM_OUTPUT_CALL (file, IDENTIFIER_POINTER (DECL_NAME (decl)));
+      ASM_OUTPUT_CALL (file, decl);
       fprintf (file, "\t.popsection\n");
     }
 }
diff -rupN -x CVS gcc-merge-HEAD-csl-sol210-1/gcc/config/sparc/sol2.h gcc-sol210/gcc/config/sparc/sol2.h
--- gcc-merge-HEAD-csl-sol210-1/gcc/config/sparc/sol2.h	2004-09-23 23:17:07.000000000 -0700
+++ gcc-sol210/gcc/config/sparc/sol2.h	2004-11-07 23:30:15.000000000 -0800
@@ -166,5 +163,11 @@ Boston, MA 02111-1307, USA.  */
 #define SUBTARGET_ATTRIBUTE_TABLE SOLARIS_ATTRIBUTE_TABLE
 
 /* Output a simple call for .init/.fini.  */
-#define ASM_OUTPUT_CALL(FILE, NAME)			\
-  fprintf (FILE, "\tcall\t%s\n\t nop\n", NAME)
+#define ASM_OUTPUT_CALL(FILE, FN)			        \
+  do								\
+    {								\
+      fprintf (FILE, "\tcall\t");				\
+      print_operand (FILE, XEXP (DECL_RTL (FN), 0), 0);	\
+      fprintf (FILE, "\n\tnop\n");				\
+    }								\
+  while (0)


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