[patch][pr14974] Change what #pragma weak matches

John McCall rjmccall at apple.com
Mon Feb 25 17:29:32 PST 2013


On Feb 25, 2013, at 4:49 PM, Rafael EspĂ­ndola <rafael.espindola at gmail.com> wrote:
> On 25 February 2013 19:23, John McCall <rjmccall at apple.com> wrote:
>> On Feb 22, 2013, at 7:52 PM, Rafael EspĂ­ndola <rafael.espindola at gmail.com> wrote:
>>> Gcc applies a pragma weak to a decl if it matches the mangled name. So
>>> far clang applies it if matches the "plain" name. This patches tries
>>> to be a compromise. We don't expose the mangling itself, but we only
>>> check for matches in decls that are not mangled.
>> 
>> Is the decision whether to mangle a symbol actually ABI-dependent?
> 
> Looks like it is. At least given
> 
> int foo;
> static int bar;
> 
> On Itanium we mangle bar, on MS we mangle foo.

Oh, right.

I wonder if we can justify only ever matching C-linkage declarations?
That would be stricter than Itanium forces us to be, but, well, it's not an
unreasonable restriction, it's likely to always apply in system headers,
and it draws a very clear line in the sand.  And we really don't want to
have to match mangled names.

John.



More information about the cfe-commits mailing list