This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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]

Re: Patch: PR 16923


Thomas Fitzsimmons wrote:

Index: gij.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gij.cc,v
retrieving revision 1.25
diff -u -r1.25 gij.cc
--- gij.cc	18 Feb 2005 20:52:14 -0000	1.25
+++ gij.cc	22 Feb 2005 05:51:45 -0000
@@ -57,7 +57,6 @@
{
  /* We rearrange ARGV so that all the -D options appear near the
     beginning.  */
-  int last_D_option = 0;
  bool jar_mode = false;

  int i;
@@ -77,7 +76,12 @@

if (! strncmp (arg, "-D", 2))
{
- argv[last_D_option++] = arg + 2;
+ _Jv_Compiler_Properties = (const char**) realloc
+ (_Jv_Compiler_Properties,
+ (_Jv_Properties_Count + 1) * sizeof (char*));
+
+ _Jv_Compiler_Properties[_Jv_Properties_Count++] = strdup (arg + 2);



See tromey's comment here. Perhaps we need a test case to ensure that -D is working for compiled binaries?


Index: prims.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/prims.cc,v
retrieving revision 1.103
diff -u -r1.103 prims.cc
--- prims.cc	16 Feb 2005 04:16:06 -0000	1.103
+++ prims.cc	22 Feb 2005 05:51:46 -0000
@@ -80,10 +80,9 @@
// functions are changed to take a size_t argument instead of jint.
#define MAX_OBJECT_SIZE ((1<<31) - 1)

-static const char *no_properties[] = { NULL };
-
// Properties set at compile time.
-const char **_Jv_Compiler_Properties = no_properties;
+const char **_Jv_Compiler_Properties = NULL;
+int _Jv_Properties_Count = 0;

// The JAR file to add to the beginning of java.class.path.
const char *_Jv_Jar_Class_Path;
@@ -909,16 +908,167 @@
  bool runtimeInitialized = false;
}

jint
-_Jv_CreateJavaVM (void* /*vm_args*/)
+_Jv_CreateJavaVM (void* vm_args)
{


Can we make the arguments to _Jv_CreateJavaVM and JvCreateJavaVM be JvVMInitArgs*, instead of void*?

Index: gcj/cni.h
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gcj/cni.h,v
retrieving revision 1.14
diff -u -r1.14 cni.h
--- gcj/cni.h 12 Aug 2004 06:53:38 -0000 1.14
+++ gcj/cni.h 22 Feb 2005 05:51:46 -0000
@@ -136,4 +136,25 @@
{
return _Jv_DetachCurrentThread ();
}
+
+typedef struct JvVMOption
+{
+ char* optionString;
+ void* extraInfo;
+} JvVMOption;
+
+typedef struct JvVMInitArgs
+{
+ /* For compatibility with JavaVMInitArgs */
+ jint version;
+
+ /* Number of options. */
+ jint nOptions;
+
+ /* Options to the VM. */
+ JvVMOption* options;
+
+ /* Whether we should ignore unrecognized options. */
+ jboolean ignoreUnrecognized;
+} JvVMInitArgs;



... and update the "invocation" section of gcj.texi with the definition of these structs, and some brief documentation.


Regards

Bryce


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