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] Use vague linkage for Java methods


Julian Brown wrote:
Ranjit Mathew wrote:
Lastly, please do verify Java patches against the Jacks
testsuite as well:

http://gcc.gnu.org/install/test.html#TOC2

OK, I'll do that.

I've now tested the patch with Jacks too, with no regressions (again on i686-pc-linux-gnu). A cleaned-up patch & ChangeLog are included.


OK to apply on mainline?

ChangeLog:

* decl.c (finish_method): Give methods once-only linkage.
Index: gcc/java/decl.c
===================================================================
RCS file: /home/gcc/repos/gcc/gcc/gcc/java/decl.c,v
retrieving revision 1.209
diff -c -p -r1.209 decl.c
*** gcc/java/decl.c	14 Feb 2005 14:58:22 -0000	1.209
--- gcc/java/decl.c	8 Mar 2005 15:05:49 -0000
*************** finish_method (tree fndecl)
*** 2036,2041 ****
--- 2036,2048 ----
  		    build2 (TRY_FINALLY_EXPR, void_type_node, *tp, exit));
      }
  
+   /* Ensure non-abstract non-static non-private members are defined only once
+      when linking. This is an issue when using CNI to interface with C++ object
+      files.  */
+   if (! METHOD_STATIC (fndecl) && ! METHOD_PRIVATE (fndecl)
+       && ! METHOD_ABSTRACT (fndecl))
+     make_decl_one_only (fndecl);
+ 
    /* Prepend class initialization for static methods reachable from
       other classes.  */
    if (METHOD_STATIC (fndecl) && ! METHOD_PRIVATE (fndecl)

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