This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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 V2] wrap default_assemble_visibility() for targets w/out GAS.


On Thu, Apr 08, 2010 at 08:52:36AM +0100, IainS wrote:
> http://gcc.gnu.org/ml/gcc-patches/2010-04/msg00330.html
> 
> has a typo ...
> which this corrects ...  bootstraps OK on i686-darwin,
> bootstraps still  running on powerpc-darwin and ia32-linux.

I guess I'd prefer not to provide two fn definitions, instead
add ATTRIBUTE_UNUSED to the arguments unconditionally and
put #ifdef HAVE_GAS_HIDDEN right after opening {.

> Index: gcc/varasm.c
> ===================================================================
> --- gcc/varasm.c	(revision 158099)
> +++ gcc/varasm.c	(working copy)
> @@ -5802,6 +5802,7 @@
>  /* Emit an assembler directive to set symbol for DECL visibility to
>     the visibility type VIS, which must not be VISIBILITY_DEFAULT.  */
>  
> +#ifdef HAVE_GAS_HIDDEN
>  void
>  default_assemble_visibility (tree decl, int vis)
>  {
> @@ -5814,15 +5815,19 @@
>    name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
>    type = visibility_types[vis];
>  
> -#ifdef HAVE_GAS_HIDDEN
>    fprintf (asm_out_file, "\t.%s\t", type);
>    assemble_name (asm_out_file, name);
>    fprintf (asm_out_file, "\n");
> +}
>  #else
> -  warning (OPT_Wattributes, "visibility attribute not supported "
> +void
> +default_assemble_visibility (tree decl ATTRIBUTE_UNUSED, 
> +			     int vis ATTRIBUTE_UNUSED)
> +{
> +    warning (OPT_Wattributes, "visibility attribute not supported "
>  	   "in this configuration; ignored");
> +}
>  #endif
> -}
>  
>  /* A helper function to call assemble_visibility when needed for a decl.  */
>  

> 


	Jakub


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