This is GCC Bugzilla
This is GCC Bugzilla Version 2.20+
View Bug Activity | Format For Printing | Clone This Bug
JNI_CreateJavaVM fails to recognise -X options such as -Xmx and friends. It says: libgcj: unknown option: -Xmx128M I tracked it to this code in libjava/prims.cc: else if (vm_args->ignoreUnrecognized) { if (option_string[0] == '_') parse_x_arg (option_string + 1); else if (! strncmp (option_string, "-X", 2)) parse_x_arg (option_string + 2); else { unknown_option: fprintf (stderr, "libgcj: unknown option: %s\n", option_string); return -1; } } else goto unknown_option; Notice how the -X options are only accepted if vm_args->ignoreUnrecognized is true. This is contrary to the specification [1] which seems to say that supported -X options should be recognized in all cases, whereas unknown -X options should be ignored iff vm_args->ignoreUnrecognized. [1] http://java.sun.com/j2se/1.4.2/docs/guide/jni/jni-12.html
Yeah, this logic looks bogus.
Created an attachment (id=13452) [edit] proposed patch Could you try this patch? If it works for you I will check it in. Thanks.
Subject: Re: [JNI] -X options not recognised by JNI_CreateJavaVM > Could you try this patch? I'm trying, but my brand new Thinkpad insists on rebooting every time I build gcc. Will have to investigate... Marcus
this patch is applied on the current trunk; the bug should be closed. Matthias
Fix checked in a while ago.