This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Bug java/37068] [4.4 Regression] libgcj linkage failure: Incorrect library ABI version detected
- From: Andrew Haley <aph at redhat dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>, Java Patch List <java-patches at gcc dot gnu dot org>
- Date: Wed, 05 Nov 2008 10:04:39 +0000
- Subject: [Bug java/37068] [4.4 Regression] libgcj linkage failure: Incorrect library ABI version detected
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37068
Fixed thusly.
Andrew.
2008-11-04 Andrew Haley <aph@redhat.com>
PR java/37068
* jcf-parse.c (java_emit_static_constructor): Don't call
cgraph_build_static_cdtor. Rewrite.
Index: jcf-parse.c
===================================================================
--- jcf-parse.c (revision 141575)
+++ jcf-parse.c (working copy)
@@ -1699,7 +1699,33 @@
write_resource_constructor (&body);
if (body)
- cgraph_build_static_cdtor ('I', body, DEFAULT_INIT_PRIORITY);
+ {
+ tree name = get_identifier ("_Jv_global_static_constructor");
+
+ tree decl
+ = build_decl (FUNCTION_DECL, name,
+ build_function_type (void_type_node, void_list_node));
+
+ tree resdecl = build_decl (RESULT_DECL, NULL_TREE, void_type_node);
+ DECL_ARTIFICIAL (resdecl) = 1;
+ DECL_RESULT (decl) = resdecl;
+ current_function_decl = decl;
+ allocate_struct_function (decl, false);
+
+ TREE_STATIC (decl) = 1;
+ TREE_USED (decl) = 1;
+ DECL_ARTIFICIAL (decl) = 1;
+ DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (decl) = 1;
+ DECL_SAVED_TREE (decl) = body;
+ DECL_UNINLINABLE (decl) = 1;
+
+ DECL_INITIAL (decl) = make_node (BLOCK);
+ TREE_USED (DECL_INITIAL (decl)) = 1;
+
+ DECL_STATIC_CONSTRUCTOR (decl) = 1;
+ java_genericize (decl);
+ cgraph_finalize_function (decl, false);
+ }
}