------- Comment #10 from ro at techfak dot uni-bielefeld dot de  2007-07-12 
14:15 -------
Subject: Re:  [4.3 regression] Linking libgcj.so fails on Solaris 10/x86

aph at gcc dot gnu dot org writes:

> ------- Comment #9 from aph at gcc dot gnu dot org  2007-07-12 10:49 -------
> This is somewhat bewildering: if the visibility attribute is not supported, 
> who
> does setting the visibility make any difference to the build?

I have no idea (and haven't really checked).

> Nonetheless, I have no objection to something like
> 
> static void
> hide (tree decl)
> {
> #ifdef __linux__
>   DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN;
>   DECL_VISIBILITY_SPECIFIED (decl) = 1;
> #endif
> }
> 
> or whatever macro seems appropriate to you, in order to restrict this to
> GNU/Linux systems.

I think the following variant should be ok.  I added it to the previously
failing revision (with only c, c++, and java), and now both 32 and 64 bit
libgcj.so build.

2007-07-12  Andrew Haley  <[EMAIL PROTECTED]>
            Rainer Orth  <[EMAIL PROTECTED]>

        PR target/32462
        PR libgcj/32465
        * class.c (hide): Wrap in HAVE_GAS_HIDDEN.

diff -r e4a0b686f36f gcc/java/class.c
--- a/gcc/java/class.c  Tue Apr 03 15:28:16 2007 +0000
+++ b/gcc/java/class.c  Thu Jul 12 15:04:11 2007 +0200
@@ -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

Is this enough for checkin or should I run a full mainline bootstrap?  At
least it fixes two bootstrap failures.

        Rainer


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32462

Reply via email to