<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=koi8-r">
<style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; } .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: 2px solid rgb(128, 0, 0); }--></style>
</head>
<body dir="ltr" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>I couldn't reproduce this on Linux, now trying Mac OS X (will take the whole night as it is slow)<br>
</p>
<p>Stewen, can you please send me CMake configuration string from your buildbot. It would be helpful <br>
</p>
<p>if pending OS X build also succeed.<br>
</p>
<p><br>
</p>
<p>What I'm doing is:<br>
</p>
<p>- build LLVM/clang with thin LTO cache<br>
</p>
<p>- When finished remove cache from disk, then remove and rebuild libclang.so(dylib)<br>
</p>
<p>- Remove and rebuild clang-func-mapping<br>
</p>
<p><br>
</p>
<p>Are those steps correct?<br>
</p>
<div style="color: rgb(33, 33, 33);">
<div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>От:</b> Teresa Johnson via Phabricator <reviews@reviews.llvm.org><br>
<b>Отправлено:</b> 14 ноября 2018 г. 19:00<br>
<b>Кому:</b> Evgeny Leviant; tejohnson@google.com; joker.eph@gmail.com<br>
<b>Копия:</b> trent.xin.tong@gmail.com; arphaman@gmail.com; dany.grumberg@gmail.com; jfbastien@apple.com; anton@korobeynikov.info; llvm@inglorion.net; eraman@google.com; stevenwu@apple.com; dexonsmith@apple.com; llvm-commits@lists.llvm.org; George Rimar; Igor
 Kudrin; jun.l@samsung.com<br>
<b>Тема:</b> [PATCH] D49362: [ThinLTO] Internalize read only globals</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.<br>
<br>
tejohnson added a comment.<br>
<br>
In <a href="https://reviews.llvm.org/D49362#1297188">https://reviews.llvm.org/D49362#1297188</a>, @steven_wu wrote:<br>
<br>
> I reverted this in r346768.<br>
><br>
> I think this is indeed a caching problem. There are some dylib/binary in clang projects that toggles whether to enable the recovery context but some does not. I can reproduce the issue by thin link libclang.dylib first, then link clang-func-mapping on Darwin.<br>
>  libclang.dylib thinks the file scope variable gCrashRecoveryEnabled not read-only, so it promotes it.<br>
>  clang-func-mapping thinks gCrashRecoveryEnabled read-only, so it internalize and constant propagate the variable but ParseAST.o in the cache is still expecting gCrashRecoveryEnabled to be available.<br>
><br>
> Let me know if you need more information.<br>
<br>
<br>
Thinking through this example, I'm not sure what is going on. This patch did change the cache key computation to include the read only bit from the global var summary of anything defined or imported. Since gCrashRecoveryEnabled is a static in CrashRecoveryContext.cpp,
 it must have been imported into ParseAST.o, which means that the read only bit on the associated gvar summary should have been hashed into ParseAST.o's cache key. So presumably we shouldn't have had a cache hit for ParseAST.o (built when the read only bit
 is not set on gCrashRecoveryEnabled) when thin linking clang-func-mapping which has this bit set for that variable.<br>
<br>
Even if the variable was originally externally visible, in order for it to be marked read only by the thin link it would have had to have been imported at all use sites. Which means that any referencing module had to have it in the import set (and therefore
 would have hashed the read only bit) in the thin link where it was marked read only. So I am not sure offhand why we could ever share a referencing object between a link where it was read only and another link where it is not...   Hopefully Eugene can figure
 out what is going wrong here.<br>
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D49362">https://reviews.llvm.org/D49362</a><br>
<br>
<br>
<br>
</div>
</span></font></div>
</body>
</html>