[cfe-dev] Is there a way to get linkonce / selectany in C programs?

Talin viridia at gmail.com
Tue Jul 1 23:16:31 PDT 2014


OK that makes sense. So forget selectany for a moment - what I really want
to know is, is there any way, from C, to give a symbol linkonce linkage? Or
is this capability only available via the IR?


On Tue, Jul 1, 2014 at 11:13 PM, Nikola Smiljanic <popizdeh at gmail.com>
wrote:

> Grepping the source code tells me that selectany is only implemented as
> microsoft extension. Test files use it in combination with __declspec and
> they enable this functionality with -fsm-compatibility. Note that I have no
> idea what this attribute actually does, I just did a search for you :)
>
>
> On Wed, Jul 2, 2014 at 2:31 PM, Talin <viridia at gmail.com> wrote:
>
>> I'm working with a code generator that produces C code and I need
>> linkonce to eliminate duplicate definitions - but the clang compiler
>> complains that the 'selectany' attribute is not recognized (even though I
>> see looking through the clang source code that there's code to handle it.)
>> So I'm wondering why the attribute isn't recognized, I'm guessing it could
>> be any number of things (platform [OS X], source language (.c), and so
>> on...)
>>
>> --
>> -- Talin
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>>
>


-- 
-- Talin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140701/45044db6/attachment.html>


More information about the cfe-dev mailing list