<div dir="ltr">How can a "weak" definition be a "strong" one!? ;)<div class="gmail_extra"><br></div><div class="gmail_extra">I think the reason for "weak" was to not duplicate it. A static would be duplicated in every translation unit that includes the header right? I don't know what it means in terms of extra number of relocation, etc.</div><div class="gmail_extra">Also the attribute used will prevent the linker from dead-stripping the symbol in case of static linking and/or when using LTO.</div><div class="gmail_extra"><br></div><div class="gmail_extra">-- </div><div class="gmail_extra">Mehdi</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-11-28 14:35 GMT-08:00 David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The abi-breaking.h seems to be incompatible with modules, owing to it having strong definitions in the header.<br><br>I'm wondering if I can make it compatible by changing the:<br><br>__attribute__((weak, visibility("hidden"))) variables to __attribute__((used)) static variables instead? It still seems to produce the desired link errors in my basic tests. Does that seem plausible to you?<br><br>(modules have a special case for static variables in headers to support things like the iostreams initializer)<br><br>Not sure why the modules buildbots don't see this but google's internal build system building with modules does... <br><br>- Dave</div>
</blockquote></div><br></div></div>