[cfe-commits] r66270 - in /cfe/trunk: lib/CodeGen/CodeGenModule.cpp test/CodeGen/attributes.c

Chris Lattner clattner at apple.com
Sun Mar 8 17:28:50 PDT 2009


On Mar 6, 2009, at 9:59 AM, Daniel Dunbar wrote:

> On Fri, Mar 6, 2009 at 9:28 AM, Chris Lattner <clattner at apple.com>  
> wrote:
>> On Mar 6, 2009, at 8:20 AM, Daniel Dunbar wrote:
>>> +    } else if (D->getAttr<WeakAttr>() ||
>>> +               D->getAttr<WeakImportAttr>()) {
>>> +      // "extern_weak" is overloaded in LLVM; we probably should  
>>> have
>>> +      // separate linkage types for this.
>>
>> What is the issue here?
>
> Assuming I understand reality correctly, which is unlikely:
>
> weak (for extern declarations) and weak_import have slightly different
> semantics. This relates to Darwin using a two level namespace.
> weak_import means resolve this symbol at link time but allow it to be
> absent at runtime. weak (for extern declarations, on Linux) means
> resolve this symbol at runtime (and allow it to be absent).

Ok.

> Nick has some good suggestions about how LLVM linkage types could be
> improved here:
> <rdar://problem/5684011> llvm should not generate 'weak global' for  
> commons
> Seems like we should get that information out publicly?

I thought that was fixed through the introduction of an explicit  
'common' linkage type?

-Chris



More information about the cfe-commits mailing list