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]

[patch] Re: Another weird sparc solaris 2.8 compiler error


Gerald Pfeifer wrote:

> On Wed, 31 Jan 2001, Bryce McKinlay wrote:
> > Nope, Gerald reported this recently too.Gerald, did you find a solution for
> > this problem?
>
> No, not a solution, but I tracked down the problem a bit:
>
>    nunki[71]:~% cat x.s
>          .global class
>          class = dummy
>    nunki[72]:~% as x.s
>    as: "x.s", line 2: error: symbol "dummy" is used but not defined
>
> > Maybe Sun's as doesn't like the class$ symbol for some reason. Can you
> > try it with GNU as?
>
> It is not a problem with the specific name as I originally thought, it's
> just that this syntax per se seems to be a GNUism.
>
> Which would be bug. Who exactly does generate this "class =" thingie?  Do
> we really need it? And why had that worked before?

Can you guys try this patch?

cheers

  [ bryce ]


2001-02-01  Bryce McKinlay  <bryce@albatross.co.nz>

	* jvgenmain.c (class_mangling_suffix): Remove unused string.
	(error): Remove unused function.
	(main): Don't use "__attribute__ alias" on generated class symbol.

Index: jvgenmain.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/jvgenmain.c,v
retrieving revision 1.19
diff -u -r1.19 jvgenmain.c
--- jvgenmain.c	2001/01/15 08:01:22	1.19
+++ jvgenmain.c	2001/02/01 06:58:55
@@ -34,31 +34,8 @@
 
 static char * do_mangle_classname PARAMS ((const char *string));
 
-const char class_mangling_suffix[] = "class$";
-
 struct obstack name_obstack;
 
-extern void error			PARAMS ((const char *, ...))
-  ATTRIBUTE_PRINTF_1;
-
-void
-error VPARAMS ((const char *msgid, ...))
-{
-#ifndef ANSI_PROTOTYPES
-  const char *msgid;
-#endif
-  va_list ap;
- 
-  VA_START (ap, msgid);
- 
-#ifndef ANSI_PROTOTYPES
-  msgid = va_arg (ap, const char *);
-#endif
- 
-  vfprintf (stderr, msgid, ap);
-  va_end (ap);
-}
-
 void
 gcc_obstack_init (obstack)
      struct obstack *obstack;
@@ -153,12 +130,11 @@
     }
   fprintf (stream, "  0\n};\n\n");
 
-  fprintf (stream, "extern int class __attribute__ ((alias (\"%s\")));\n",
-	   mangled_classname);
+  fprintf (stream, "extern int %s;\n", mangled_classname);
   fprintf (stream, "int main (int argc, const char **argv)\n");
   fprintf (stream, "{\n");
   fprintf (stream, "   _Jv_Compiler_Properties = props;\n");
-  fprintf (stream, "   JvRunMain (&class, argc, argv);\n");
+  fprintf (stream, "   JvRunMain (&%s, argc, argv);\n", mangled_classname);
   fprintf (stream, "}\n");
   if (stream != stdout && fclose (stream) != 0)
     {

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