Another weird sparc solaris 2.8 compiler error

Bryce McKinlay bryce@albatross.co.nz
Wed Jan 31 22:31:00 GMT 2001


Gerald Pfeifer wrote:

> 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?

It comes from the small C program generated by jvgenmain when the --main option is
used to create a Java executable.

The C looks something like this:

extern const char **_Jv_Compiler_Properties;
static const char *props[] =
{
  0
};

extern int class __attribute__ ((alias ("_ZN5Hello6class$E")));
int main (int argc, const char **argv)
{
   _Jv_Compiler_Properties = props;
   JvRunMain (&class, argc, argv);
}

I'll bet the weird syntax you're seeing is caused by the use of
__attribute__ (alias). In my case (i686), I get asm output that looks like

.globl class
 .set class,_ZN5Hello6class$E

I have no idea why the alias is needed, though. It appears to work fine for me to
simply replace that line with "extern int _ZN5Hello6class$E;". Does anyone know
why it was done this way?

regards

  [ bryce ]




More information about the Java mailing list