<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Apr 19, 2016, at 9:36 PM, Teresa Johnson <<a href="mailto:tejohnson@google.com" class="">tejohnson@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><br class="Apple-interchange-newline"><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Tue, Apr 19, 2016 at 9:18 PM, Mehdi Amini via llvm-commits<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">Author: mehdi_amini<br class="">Date: Tue Apr 19 23:18:11 2016<br class="">New Revision: 266856<br class=""><br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=266856&view=rev" rel="noreferrer" class="">http://llvm.org/viewvc/llvm-project?rev=266856&view=rev</a><br class="">Log:<br class="">ThinLTO: never promote as external weak<br class=""><br class="">This linkage is *not* intended to express that a declaration refers<br class="">to a weak symbol, but that the symbol might not be present at link<br class="">time. I don't believe it was the intent.<br class=""></blockquote><br class="">In fact, this was the intent. WeakAny linkage is used for defined symbols with __attribute__((weak)), which may not have a definition. The corresponding declaration should be ExternalWeak.</div></div></blockquote><div><br class=""></div><div>It is not clear to me: how can you during the link be in a situation where you have a weak definition that will not be present?</div><div>I don't see a case where we *introduce* an external_weak that is not present in the original program.</div><div><br class=""></div><div>CC Rafael.</div><div><br class=""></div><div><br class=""></div><div>-- </div><div>Mehdi</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><br class="">From: Mehdi Amini <<a href="mailto:mehdi.amini@apple.com" class="">mehdi.amini@apple.com</a>><br class=""><br class="">Modified:<br class=""> <span class="Apple-converted-space"> </span>llvm/trunk/lib/Transforms/Utils/FunctionImportUtils.cpp<br class=""> <span class="Apple-converted-space"> </span>llvm/trunk/test/Linker/funcimport.ll<br class=""><br class="">Modified: llvm/trunk/lib/Transforms/Utils/FunctionImportUtils.cpp<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/FunctionImportUtils.cpp?rev=266856&r1=266855&r2=266856&view=diff" rel="noreferrer" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/FunctionImportUtils.cpp?rev=266856&r1=266855&r2=266856&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/Transforms/Utils/FunctionImportUtils.cpp (original)<br class="">+++ llvm/trunk/lib/Transforms/Utils/FunctionImportUtils.cpp Tue Apr 19 23:18:11 2016<br class="">@@ -132,7 +132,7 @@ FunctionImportGlobalProcessing::getLinka<br class=""> // linker. The module linking caller needs to enforce this.<br class=""> assert(!doImportAsDefinition(SGV));<br class=""> // If imported as a declaration, it becomes external_weak.<br class="">- return GlobalValue::ExternalWeakLinkage;<br class="">+ return SGV->getLinkage();<br class=""><br class=""> case GlobalValue::WeakODRLinkage:<br class=""> // For weak_odr linkage, there is a guarantee that all copies will be<br class=""><br class="">Modified: llvm/trunk/test/Linker/funcimport.ll<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/funcimport.ll?rev=266856&r1=266855&r2=266856&view=diff" rel="noreferrer" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/funcimport.ll?rev=266856&r1=266855&r2=266856&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/test/Linker/funcimport.ll (original)<br class="">+++ llvm/trunk/test/Linker/funcimport.ll Tue Apr 19 23:18:11 2016<br class="">@@ -98,7 +98,7 @@<br class=""> ; reference should turned into an external_weak declaration.<br class=""> ; RUN: llvm-link %t2.bc -summary-index=%t3.thinlto.bc -import=callweakfunc:%t.bc -import=weakfunc:%t.bc -S 2>&1 | FileCheck %s --check-prefix=IMPORTWEAKFUNC<br class=""> ; IMPORTWEAKFUNC-DAG: Ignoring import request for weak-any function weakfunc<br class="">-; IMPORTWEAKFUNC-DAG: declare extern_weak void @weakfunc<br class="">+; IMPORTWEAKFUNC-DAG: declare void @weakfunc<br class=""> ; IMPORTWEAKFUNC-DAG: define available_externally void @callweakfunc<br class=""> ; IMPORTWEAKFUNC-NOT: @weakvar = extern_weak global i32, align 4<br class=""><br class=""><br class=""><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class=""></blockquote></div><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br clear="all" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">--<span class="Apple-converted-space"> </span></span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_signature" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: times; font-size: inherit;" class=""><table cellspacing="0" cellpadding="0" class=""><tbody class=""><tr style="color: rgb(85, 85, 85); font-family: sans-serif; font-size: small;" class=""><td nowrap="" style="border-top-style: solid; border-top-color: rgb(213, 15, 37); border-top-width: 2px;" class="">Teresa Johnson |</td><td nowrap="" style="border-top-style: solid; border-top-color: rgb(51, 105, 232); border-top-width: 2px;" class=""> Software Engineer |</td><td nowrap="" style="border-top-style: solid; border-top-color: rgb(0, 153, 57); border-top-width: 2px;" class=""> <a href="mailto:tejohnson@google.com" class="">tejohnson@google.com</a> |</td><td nowrap="" style="border-top-style: solid; border-top-color: rgb(238, 178, 17); border-top-width: 2px;" class=""> 408-460-2413</td></tr></tbody></table></span></div></div></blockquote></div><br class=""></body></html>