This is the mail archive of the gcc-bugs@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]

[Bug libgcj/31700] New: [JNI] -X options not recognised by JNI_CreateJavaVM


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


-- 
           Summary: [JNI] -X options not recognised by JNI_CreateJavaVM
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcj
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: marcus at better dot se
  GCC host triplet: i486-linux-gnu
GCC target triplet: i486-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31700


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