This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: gcj shouldn't use hidden visibility if unsupported (PR target/32462, libgcj/32465)
- From: Rainer Orth <ro at techfak dot uni-bielefeld dot de>
- To: gcc-patches at gcc dot gnu dot org
- Cc: java-patches at gcc dot gnu dot org
- Date: Thu, 12 Jul 2007 19:24:32 +0200 (MEST)
- Subject: PATCH: gcj shouldn't use hidden visibility if unsupported (PR target/32462, libgcj/32465)
As described in PR target/32462, gcj currently uses visibility(hidden)
unconditionally, even if the target doesn't support it. This breaks
linking both the 32 and 64 bit libgcj.so on Solaris 10/x86 with gas and
the Sun ld.
The following patch fixes this:
Thu Jul 12 14:48:07 2007 Andrew Haley <aph@redhat.com>
Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
PR target/32462
PR libgcj/32465
* class.c (hide): Wrap in HAVE_GAS_HIDDEN.
Index: gcc/java/class.c
===================================================================
--- gcc/java/class.c (revision 126588)
+++ gcc/java/class.c (working copy)
@@ -691,10 +691,12 @@ build_java_method_type (tree fntype, tre
}
static void
-hide (tree decl)
+hide (tree decl ATTRIBUTE_UNUSED)
{
+#ifdef HAVE_GAS_HIDDEN
DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN;
DECL_VISIBILITY_SPECIFIED (decl) = 1;
+#endif
}
tree
I've already successfully run a C, C++, Java bootstrap of rev. 123476 with
this patch added, where libgcj.so linked successfully. A full bootstrap on
i386-pc-solaris2.10 is in progress.
Ok if it passes?
As mentioned by Andrew Pinski in the PR, it may be necessary to somehow
test for Darwin as well; if so, I'd need someone to test a modified patch.
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University