Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 31700
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Marcus Better <marcus@better.se>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
P proposed patch patch 2007-04-26 23:13 657 bytes Edit | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 31700 depends on: Show dependency tree
Show dependency graph
Bug 31700 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2007-04-25 18:38 Opened: 2007-04-25 13:58
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

------- Comment #1 From Tom Tromey 2007-04-25 18:38 -------
Yeah, this logic looks bogus.

------- Comment #2 From Tom Tromey 2007-04-26 23:13 -------
Created an attachment (id=13452) [edit]
proposed patch

Could you try this patch?
If it works for you I will check it in.
Thanks.

------- Comment #3 From Marcus Better 2007-05-14 15:24 -------
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

------- Comment #4 From Debian GCC Maintainers 2008-01-23 11:07 -------
this patch is applied on the current trunk; the bug should be closed.

  Matthias

------- Comment #5 From Tom Tromey 2008-01-23 17:59 -------
Fix checked in a while ago.

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug