This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: 4.1/4.2 PATCH: PR middle-end/20218: Can't use __attribute__ ((visibility ("hidden"))) to hide a symbol
"H. J. Lu" <hjl@lucon.org> writes:
> On Sun, Jan 14, 2007 at 06:35:15PM -0800, H. J. Lu wrote:
>> On Mon, Jan 15, 2007 at 01:19:40AM +0000, Richard Sandiford wrote:
>> > "H. J. Lu" <hjl@lucon.org> writes:
>> > > I am enclosing backported 4.1/4.2 patches for PR middle-end/20218.
>> >
>> > If you're backporting a patch for elfos.h to a release branch, I think
>> > you need to explain why you think it's safe for all elfos ports.
>> > I realise you can't test them all, but you can at least (for example)
>> > grep for definitions of ASM_OUTPUT_EXTERNAL.
>> >
>> > Your original mainline patch broke bootstrap on mips-linux-gnu (which
>> > I know you know, because you commented on it). I think it would be
>> > reasonable under the circumstances to expect you to include that fix
>> > in your backport too. From a quick grep, I'm also dubious about pa/elf.h.
>> > Does anything undefine your new elfos definition before pa/elf.h defines
>> > the new one? What about config/score/score.h?
>>
>> I don't like to blindly undef ASM_OUTPUT_EXTERNAL to make an ELF
>> backend to compile. It doesn't belong to my bug fix. I can provide
>> a separate patch to undef ASM_OUTPUT_EXTERNAL for those ports which
>> are affected. I only got one report on MIPS.
However, blindly undefining them preserves the current behaviour for
those ports, and avoids the redefinition warning. It would make your
patch a strict improvement over pre-patch sources. I would certainly
be happy with that from a MIPS point of view if the rest is considered
OK for a release branch.
In other words, I don't see that you need to fix the bug for all targets.
You just need to make a reasonable effort to ensure you don't change the
behaviour for the targets that you're not fixing. And from a release
branch point of view, that certainly seems to be less risky than trying
to rewrite the MIPS, pa and score hooks. E.g.
> +#ifndef USING_ELFOS_H
> static void mips_file_end (void);
> +#endif
....
> -/* Implement TARGET_ASM_FILE_END. When using assembler macros, emit
> - .externs for any small-data variables that turned out to be external. */
> -
> -static void
> -mips_file_end (void)
... I don't see how this can be right.
Richard