[PATCH] Fix libgcj{,_bc}.so exports (PR libgcj/38872)
Andrew Haley
aph@redhat.com
Tue Jan 27 09:47:00 GMT 2009
Jakub Jelinek wrote:
> Hi!
>
> libgcj_bc.so exports _Jv_CreateJavaVM, but libgcj.so.10 exports it
> as extern "C++" name, i.e. mangled. The following patch changes
> it to extern "C" to match libgcj_bc.so and also removes one export
> from libgcj_bc.so for an extern inline cni.h function which shouldn't
> be ever undefined and libgcj.so.* never exported it.
>
> Bootstrapped/regtested on x86_64-linux, ok for trunk?
No, this breaks the ABI. We need to keep the old version of _Jv_CreateJavaVM
as an alias.
Removing _Jv_GetStringChars is OK, though.
Andrew.
> 2009-01-26 Jakub Jelinek <jakub@redhat.com>
>
> PR libgcj/38872
> * gcj/javaprims.h (_Jv_CreateJavaVM): Change to extern "C" symbol.
> * libjgc_bc.c (_Jv_GetStringChars): Remove.
>
> --- libjava/gcj/javaprims.h.jj 2008-10-23 13:22:46.000000000 +0200
> +++ libjava/gcj/javaprims.h 2009-01-26 18:51:31.000000000 +0100
> @@ -1,8 +1,8 @@
> // javaprims.h - Main external header file for libgcj. -*- c++ -*-
>
>
> -/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
> - Free Software Foundation
> +/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
> + 2008, 2009 Free Software Foundation
>
> This file is part of libgcj.
>
> @@ -919,7 +919,7 @@ struct _Jv_VMInitArgs
> jboolean ignoreUnrecognized;
> };
>
> -extern jint _Jv_CreateJavaVM (struct _Jv_VMInitArgs*);
> +extern "C" jint _Jv_CreateJavaVM (struct _Jv_VMInitArgs*);
>
> void
> _Jv_ThreadRun (java::lang::Thread* thread);
> --- libjava/libgcj_bc.c.jj 2008-09-05 12:59:47.000000000 +0200
> +++ libjava/libgcj_bc.c 2009-01-26 19:16:10.000000000 +0100
> @@ -1,6 +1,6 @@
> /* libgcj_bc.c */
>
> -/* Copyright (C) 2006 Free Software Foundation
> +/* Copyright (C) 2006, 2009 Free Software Foundation
>
> This file is part of libgcj.
>
> @@ -89,7 +89,6 @@ void _Jv_AttachCurrentThreadAsDaemon ()
> void _Jv_CreateJavaVM () {}
> void _Jv_DetachCurrentThread () {}
> void _Jv_Free () {}
> -void _Jv_GetStringChars () {}
> void _Jv_GetStringUTFLength () {}
> void _Jv_GetStringUTFRegion () {}
> void _Jv_Malloc () {}
>
> Jakub
More information about the Gcc-patches
mailing list