<div dir="ltr">It's strange. I have got the below build error messages when I tried to merge r268662 into Ubuntu 14.04 x64 (Trusty) distribution. <div>It seems that this build error is generated by test/FileCheck/check-empty.txt. <br>Did you have similar experience like me? Is this related to the version of the LLVM? <br><div><br><div><div>> /work/dotnet/llvm-3.6.2.fixed.packaging/llvm-toolchain-3.6-3.6/build-llvm/Release/bin/llc: <br>> /work/dotnet/llvm-3.6.2.fixed.packaging/llvm-toolchain-3.6-3.6/test/CodeGen/ARM/litpool-licm.ll:29:18: error: expected value token</div><div>>   %val = load i32, i32* @var</div><div>>                  ^</div><div>> FileCheck error: '-' is empty.</div></div><div><br></div><div><br></div><div><br></div><div>--------- Detail error messages ---------------------------------------------------------------------------------------------------<br></div><div>            . . . . Omission . . . . </div><div><br></div><div><div>make[1]: Entering directory `/work/dotnet/llvm-3.6.2.fixed.packaging/llvm-toolchain-3.6-3.6'</div><div>NJOBS="-j 8" LD_LIBRARY_PATH=/work/dotnet/llvm-3.6.2.fixed.packaging/llvm-toolchain-3.6-3.6/build-llvm/Release/lib/ /usr/bin/make -C build-llvm check</div><div>make[2]: Entering directory `/work/dotnet/llvm-3.6.2.fixed.packaging/llvm-toolchain-3.6-3.6/build-llvm'</div><div>llvm[2]: Running test suite</div><div>make[3]: Entering directory `/work/dotnet/llvm-3.6.2.fixed.packaging/llvm-toolchain-3.6-3.6/build-llvm/test'</div><div>Making LLVM 'lit.site.cfg' file...</div><div>Making LLVM unittest 'lit.site.cfg' file...</div><div>( ulimit -t 600 ; ulimit -d 512000 ; ulimit -m 512000 ; ulimit -s 8192 ; \</div><div><span class="" style="white-space:pre">     </span>  /usr/bin/python /work/dotnet/llvm-3.6.2.fixed.packaging/llvm-toolchain-3.6-3.6/utils/lit/lit.py -s -v -j 8 . )</div><div>lit.py: lit.cfg:271: note: Did not find llvm-go in /work/dotnet/llvm-3.6.2.fixed.packaging/llvm-toolchain-3.6-3.6/build-llvm/Release/bin</div><div>FAIL: LLVM :: CodeGen/ARM/litpool-licm.ll (1638 of 12267)</div><div>******************** TEST 'LLVM :: CodeGen/ARM/litpool-licm.ll' FAILED ********************</div><div>Script:</div><div>--</div><div>/work/dotnet/llvm-3.6.2.fixed.packaging/llvm-toolchain-3.6-3.6/build-llvm/Release/bin/llc -mtriple=thumbv7-linux-gnueabihf -relocation-model=pic /work/dotnet/llvm-3.6.2.fixed.packaging/llvm-toolchain-3.6-3.6/test/CodeGen/ARM/litpool-licm.ll -o - | /work/dotnet/llvm-3.6.2.fixed.packaging/llvm-toolchain-3.6-3.6/build-llvm/Release/bin/FileCheck /work/dotnet/llvm-3.6.2.fixed.packaging/llvm-toolchain-3.6-3.6/test/CodeGen/ARM/litpool-licm.ll</div><div>--</div><div>Exit Code: 2</div><div><br></div><div>Command Output (stderr):</div><div>--</div><div>/work/dotnet/llvm-3.6.2.fixed.packaging/llvm-toolchain-3.6-3.6/build-llvm/Release/bin/llc: /work/dotnet/llvm-3.6.2.fixed.packaging/llvm-toolchain-3.6-3.6/test/CodeGen/ARM/litpool-licm.ll:29:18: error: expected value token</div><div>  %val = load i32, i32* @var</div><div>                 ^</div><div>FileCheck error: '-' is empty.</div><div><br></div><div>--</div><div><br></div><div>********************</div><div>Testing Time: 39.24s</div><div>********************</div><div>Unexpected Passing Tests (12):</div><div>    LLVM :: BugPoint/crash-narrowfunctiontest.ll</div><div>    LLVM :: BugPoint/metadata.ll</div><div>    LLVM :: BugPoint/remove_arguments_test.ll</div><div>    LLVM :: ExecutionEngine/MCJIT/cross-module-sm-pic-a.ll</div><div>    LLVM :: ExecutionEngine/MCJIT/eh-lg-pic.ll</div><div>    LLVM :: ExecutionEngine/MCJIT/eh-sm-pic.ll</div><div>    LLVM :: ExecutionEngine/MCJIT/hello-sm-pic.ll</div><div>    LLVM :: ExecutionEngine/MCJIT/multi-module-sm-pic-a.ll</div><div>    LLVM :: ExecutionEngine/MCJIT/stubs-sm-pic.ll</div><div>    LLVM :: ExecutionEngine/MCJIT/test-global-init-nonzero-sm-pic.ll</div><div>    LLVM :: ExecutionEngine/MCJIT/test-ptr-reloc-sm-pic.ll</div><div>    LLVM :: Feature/load_module.ll</div><div><br></div><div>********************</div><div>Failing Tests (1):</div><div>    LLVM :: CodeGen/ARM/litpool-licm.ll</div><div><br></div><div>  Expected Passes    : 11998</div><div>  Expected Failures  : 75</div><div>  Unsupported Tests  : 181</div><div>  Unexpected Passes  : 12</div><div>  Unexpected Failures: 1</div><div>make[3]: *** [check-local] Error 1</div><div>make[3]: Leaving directory `/work/dotnet/llvm-3.6.2.fixed.packaging/llvm-toolchain-3.6-3.6/build-llvm/test'</div><div>make[2]: *** [check] Error 2</div><div>make[2]: Leaving directory `/work/dotnet/llvm-3.6.2.fixed.packaging/llvm-toolchain-3.6-3.6/build-llvm'</div><div>make[1]: *** [override_dh_auto_test] Error 2</div><div>make[1]: Leaving directory `/work/dotnet/llvm-3.6.2.fixed.packaging/llvm-toolchain-3.6-3.6'</div><div>make: *** [binary] Error 2</div><div>Command exited with non-zero status 2</div><div>100.38user 45.56system 0:40.75elapsed 358%CPU (0avgtext+0avgdata 538244maxresident)k</div><div>0inputs+180240outputs (6major+32138062minor)pagefaults 0swaps</div><div>invain@db400:/work/dotnet/llvm-3.6.2.fixed.packaging/llvm-toolchain-3.6-3.6$ </div></div><div><br></div><div><br></div><div>------------------------------------------------------------------------------------------------------------</div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 20, 2016 at 11:58 PM, Geunsik Lim <span dir="ltr"><<a href="mailto:leemgs@gmail.com" target="_blank">leemgs@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span class=""><span style="font-size:12.8px">> BTW, I am afraid that I can merge the patch to Ubuntu 14.04 and Ubuntu 16.04  LTS repository to support</span></span><div><span style="font-size:12.8px"><span class="">> the easy update (e.g. apt-get install llvm-3.6).<br><br></span>I have posted this issue to Ubuntu's launchpad bug system (e.g. llvm-defaults package) as following:  </span></div>* <a href="https://bugs.launchpad.net/ubuntu/+source/llvm-defaults/+bug/1584089" target="_blank">https://bugs.launchpad.net/ubuntu/+source/llvm-defaults/+bug/1584089</a><br><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 20, 2016 at 11:20 PM, Geunsik Lim <span dir="ltr"><<a href="mailto:leemgs@gmail.com" target="_blank">leemgs@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span>> <span style="font-size:12.8px">I'd be happy to look at the various clsload.cpp.o files produced</span><br style="font-size:12.8px"><span style="font-size:12.8px">> (there is more than 1 and I can't actually remember which had the</span><br style="font-size:12.8px"></span><span style="font-size:12.8px"><span>> problem I'm afraid) and tell you if the TLS accesses are sane.<br><br></span>I have verified that r268662 can resolve the __thread variable issue that I reported to LLVM community.<br>Thank you for your technical support to fix ARM code generation of LLVM back-end.<br><br>BTW, I am afraid that I can merge the patch to Ubuntu 14.04 and Ubuntu 16.04  LTS repository to support</span><div><span style="font-size:12.8px">the easy update (e.g. apt-get install llvm-3.6).</span></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 20, 2016 at 7:49 AM, Geunsik Lim <span dir="ltr"><<a href="mailto:leemgs@gmail.com" target="_blank">leemgs@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><p dir="ltr"><span>><span style="font-size:12.8px">So, I am analyzing the build process of CoreCLR  to know why we can not see the 'std::cout' message while compiling</span><span style="font-size:12.8px"> <br></span><br></span>I have verified that the modified ARMConstantPoolValue.cpp.o is related to the below files form the our build system. As you can see,  there are two libraries (e.g. and ) at the linking procedure; libLLVMARMCodeGen.a(static library)  and libLTO.so (shared library). </p><p dir="ltr">* LLVM-3.6 - Building to support Linux/ARM:<br>Building CXX object lib/Target/ARM/CMakeFiles/LLVMARMCodeGen.dir/ARMConstantPoolValue.cpp.o<br><br></p><p dir="ltr">* LLVM-3.6 - Linking files: </p><p dir="ltr">Linking CXX static library ../../libLLVMARMCodeGen.a<br>Linking CXX executable ../../bin/llc<br>Linking CXX executable ../../bin/llvm-ar<br>Linking CXX executable ../../bin/llvm-nm<br>Linking CXX executable ../../bin/llvm-objdump<br>Linking CXX executable ../../bin/opt<br>Linking CXX executable ../../bin/llvm-mc<br>Linking CXX executable ../../bin/llvm-readobj<br>Linking CXX executable ../../bin/llvm-rtdyld<br>Linking CXX executable ../../bin/llvm-c-test<br>Linking CXX shared library ../../lib/libLTO.so<br>Linking CXX executable ../../bin/llvm-lto<br><br></p><p dir="ltr">Actually, I have simply overwritten the all generated files into the existing LLVM folder (.e.g. /usr/lib/llvm-3.6 and /usr/include/llvm-* ) in the build system.  However, existing clang has been operating with single shared library (LLVM_BUILD_LLVM_DYLIB:BOOL). It was why I could not see the 'std::cout" message at build time of CoreCLR. So, I have tried to make self-made clang/llvm in my home folder ($HOME/llvm-3.6/) after uninstalling temporarily all clang/llvm packages that are installed in build system. Then, I could see the stdout message normally. I expect that the doing not merging multiple 'ldr' instructions will be executed  for using __thread variable in Linux/ARM environment. I will shortly tell you the experimental result of the additional comparisons such as 'Modifier' and 'AddCurrentAddress'.<br></p><span><pre style="font-size:smaller;color:rgb(0,0,0);background-color:rgb(204,204,204)">-      ACPV->Modifier == Modifier) {
-    if (ACPV->LabelId == LabelId)
-      return true;
+      ACPV->Modifier == Modifier &&
+      ACPV->LabelId == LabelId &&
+      ACPV->AddCurrentAddress == AddCurrentAddress) {

</pre>
<p dir="ltr"><br></p></span><p dir="ltr">On the other hands, It seems that Android developers have tried to append emulated-TLS instead of the direct TLS usage to avoid architecture-dependent operation situation. In this case, is problem is just speed?   <br>* Clang/driver: emulated TLS mode - <a href="http://reviews.llvm.org/D10524" target="_blank">http://reviews.llvm.org/D10524</a><br><br></p>
<p dir="ltr">BRs, <br>
Geunsik Lim.</p><div><div>
<div 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"><div dir="ltr">> <span style="font-size:12.8px">Maybe the build system is suppressing </span><span style="font-size:12.8px">stdout for some reason?<br>I think that the build system does not suppress stdout at build-time if I append "verbose" option.<br>So, I am analyzing the build process of CoreCLR  to know why we can not see the 'std::cout' message while compiling <br>CoreCLR with clang/llvm(including your patch)<br><br><br></span></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 18, 2016 at 12:09 PM, Tim Northover <span dir="ltr"><<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a>></span> wrote:<br><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"><span>On 17 May 2016 at 19:22, Geunsik Lim <<a href="mailto:leemgs@gmail.com" target="_blank">leemgs@gmail.com</a>> wrote:<br>
> It's strange. I could not see the "[DEBUG] ****" message while compiling<br>
> CoreCLR  with Clang/LLVM for Linux/ARM. Is it right? Can you give me an<br>
> opinion?<br>
<br>
</span>That strongly suggests something is wrong. That function ought to be<br>
called hundreds of times while building the source, regardless of the<br>
changed outcome after my patch. Maybe the build system is suppressing<br>
stdout for some reason?<br>
<br>
I'd be happy to look at the various clsload.cpp.o files produced<br>
(there is more than 1 and I can't actually remember which had the<br>
problem I'm afraid) and tell you if the TLS accesses are sane.<br>
<br>
Cheers.<br>
<span><font color="#888888"><br>
Tim.<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><a href="http://leemgs.fedorapeople.org" style="font-family:Tahoma" target="_blank">http://leemgs.fedorapeople.org</a><span style="font-family:Tahoma"> </span></div><div>Don't try to avoid pain if you fail.<br>If you decided to face the challenges in life, <br>you can gain a lot by giving your best.<br>Cheolsang Jeong's Book & life<br>--<br></div></div></div>
</div>
</div>
</div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><a href="http://leemgs.fedorapeople.org" style="font-family:Tahoma" target="_blank">http://leemgs.fedorapeople.org</a><span style="font-family:Tahoma"> </span></div><div>Don't try to avoid pain if you fail.<br>If you decided to face the challenges in life, <br>you can gain a lot by giving your best.<br>Cheolsang Jeong's Book & life<br>--<br></div></div></div>
</div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><a href="http://leemgs.fedorapeople.org" style="font-family:Tahoma" target="_blank">http://leemgs.fedorapeople.org</a><span style="font-family:Tahoma"> </span></div><div>Don't try to avoid pain if you fail.<br>If you decided to face the challenges in life, <br>you can gain a lot by giving your best.<br>Cheolsang Jeong's Book & life<br>--<br></div></div></div>
</div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><a href="http://leemgs.fedorapeople.org" style="font-family:Tahoma" target="_blank">http://leemgs.fedorapeople.org</a><span style="font-family:Tahoma"> </span></div><div>Don't try to avoid pain if you fail.<br>If you decided to face the challenges in life, <br>you can gain a lot by giving your best.<br>Cheolsang Jeong's Book & life<br>--<br></div></div></div>
</div>