This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch V2] wrap default_assemble_visibility() for targets w/out GAS.
- From: Jakub Jelinek <jakub at redhat dot com>
- To: IainS <developer at sandoe-acoustics dot co dot uk>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 8 Apr 2010 21:29:01 +0200
- Subject: Re: [Patch V2] wrap default_assemble_visibility() for targets w/out GAS.
- References: <C55A6298-4B5B-454E-9887-746FBB1A270C@sandoe-acoustics.co.uk>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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