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

Re: Does -fjni work with recent builds?

Tom Tromey writes:

> Nope.  We need a different such symbol for each native method.  `meth'
> is a per-stub cache of the underlying JNI method.


> I don't understand why this doesn't work.  `meth' should be local to
> the stub (but static).  That is why TREE_STATIC is 1 but TREE_PUBLIC
> and DECL_EXTERNAL are 0.  I must be missing something.

It seems to be related to the changes in make_decl_rtl. This patch
corrects the situation. If it works for you Barnet, I'll check it in
(it's important to have a -fjni in order for 3.0, unless library
hackers think otherwise -- not a big deal of a patch anways.)


2001-01-19  Alexandre Petit-Bianco  <>

	* expr.c (build_jni_stub): Set DECL_CONTEXT on `meth_var' so it
	gets a unique asm name.

Index: expr.c
RCS file: /cvs/gcc/egcs/gcc/java/expr.c,v
retrieving revision 1.96
diff -u -p -r1.96 expr.c
--- expr.c      2001/01/17 00:39:09     1.96
+++ expr.c      2001/01/20 02:26:45
@@ -2024,6 +2024,7 @@ build_jni_stub (method)
   TREE_STATIC (meth_var) = 1;
   TREE_PUBLIC (meth_var) = 0;
   DECL_EXTERNAL (meth_var) = 0;
+  DECL_CONTEXT (meth_var) = method;
   make_decl_rtl (meth_var, NULL);
   meth_var = pushdecl_top_level (meth_var);

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