This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Another weird sparc solaris 2.8 compiler error
- To: Gerald Pfeifer <pfeifer at dbai dot tuwien dot ac dot at>
- Subject: Re: Another weird sparc solaris 2.8 compiler error
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Thu, 01 Feb 2001 19:36:17 +1300
- CC: Edgar Villanueva <EVillanueva at dynamicsoft dot com>, java at gcc dot gnu dot org
- References: <Pine.BSF.4.32.0102010157480.96364-100000@deneb.dbai.tuwien.ac.at>
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 ]