<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Thu, Mar 9, 2017 at 3:00 PM Chris Bieneman <<a href="mailto:beanz@apple.com">beanz@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="gmail_msg">I'll try and reproduce later today. Is this Linux? Can you give me your CMake command line?</div></blockquote><div><br>Excuse the delay, been busy setting up a new machine - also an opportunity to try clean cmake setups rather than my aging configurations that have a bunch of old stuff baked in and manual variables changed, etc. (& I do so wish that CMakeCache.txt had a comment at teh top describing the command that produced it like the config.log - that way I'd probably be more likely to copy/paste and modify the command line than hand editing the cache file)<br><br>Anyway, so I don't have the compounding issue (local libstdc++ install with ABI incompatibility to my system libstdc++) so I can build/test compiler-rt when it's in projects at the moment (though I will soon locally install GCC 6.3 and have the problems with xray again).<br><br>But when I place compiler-rt in runtimes I do have problems.<br><br>Here's my cmake command:<br><br>cmake -G Ninja -DCMAKE_INSTALL_PREFIX=$HOME/dev/llvm/install -DCMAKE_BUILD_TYPE=Debug ../../src/ -DCMAKE_C_COMPILER=$HOME/install/bin/clang -DCMAKE_CXX_COMPILER=$HOME/install/bin/clang++ -DLLVM_USE_SPLIT_DWARF=ON -DLLVM_ENABLE_WERROR=ON -DLLVM_BUILD_EXAMPLES=ON -DLLVM_INCLUDE_GO_TESTS=OFF<br> <br>& here's the result of "ninja check-all":<br><br><div>[3671/3683] cd /usr/local/google/home/blaikie/dev/llvm/build/default...fault/runtimes/runtimes-bins/ --target check-runtimes --config Debug</div><div>[318/409] Generating tsan_mman_test.cc.x86_64.o</div><div>FAILED: compiler-rt/lib/tsan/tests/unit/tsan_mman_test.cc.x86_64.o </div><div>cd /usr/local/google/home/blaikie/dev/llvm/build/default/runtimes/runtimes-bins/compiler-rt/lib/tsan/tests/unit && /usr/local/google/home/blaikie/dev/llvm/build/default/./bin/clang -fPIC -fvisibility-inlines-hidden -Werror -Werror=date-time -std=c++11 -fcolor-diagnostics -Wall -Werror -std=c++11 -Wno-unused-parameter -Wno-unknown-warning-option -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -fvisibility-inlines-hidden -fno-lto -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -Wno-non-virtual-dtor -fPIE -fno-rtti -Wno-covered-switch-default -DGTEST_NO_LLVM_RAW_OSTREAM=1 -DGTEST_HAS_RTTI=0 -I/usr/local/google/home/blaikie/dev/llvm/src/utils/unittest/googletest/include -I/usr/local/google/home/blaikie/dev/llvm/src/utils/unittest/googletest -I/usr/local/google/home/blaikie/dev/llvm/src/runtimes/compiler-rt/lib -I/usr/local/google/home/blaikie/dev/llvm/src/runtimes/compiler-rt/lib/tsan/rtl -DGTEST_HAS_RTTI=0 -m64 -c -o tsan_mman_test.cc.x86_64.o /usr/local/google/home/blaikie/dev/llvm/src/runtimes/compiler-rt/lib/tsan/tests/unit/tsan_mman_test.cc</div><div>/usr/local/google/home/blaikie/dev/llvm/src/runtimes/compiler-rt/lib/tsan/tests/unit/tsan_mman_test.cc:14:10: fatal error: 'sanitizer/allocator_interface.h' file not found</div><div>#include <sanitizer/allocator_interface.h></div><div>         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</div><div>1 error generated.</div><div>[370/409] Generating ASAN_INST_TEST_OBJECTS.asan_test.cc.x86_64-inline.o</div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">-Chris</div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">On Mar 9, 2017, at 11:45 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="gmail_msg" target="_blank">dblaikie@gmail.com</a>> wrote:</div><br class="m_-8791573680410378486Apple-interchange-newline gmail_msg"><div class="gmail_msg"><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><br class="m_-8791573680410378486Apple-interchange-newline gmail_msg">On Thu, Mar 9, 2017 at 11:25 AM Chris Bieneman <<a href="mailto:beanz@apple.com" class="gmail_msg" target="_blank">beanz@apple.com</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;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 class="gmail_msg" style="word-wrap:break-word"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">On Mar 8, 2017, at 4:42 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="gmail_msg" target="_blank">dblaikie@gmail.com</a>> wrote:</div><br class="m_-8791573680410378486m_5259437214943620448Apple-interchange-newline gmail_msg"><div class="gmail_msg"><div dir="ltr" class="gmail_msg" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br class="gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Wed, Mar 8, 2017 at 3:23 PM Chris Bieneman <<a href="mailto:beanz@apple.com" class="gmail_msg" target="_blank">beanz@apple.com</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" 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 class="gmail_msg" style="word-wrap:break-word"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">On Mar 8, 2017, at 3:16 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="gmail_msg" target="_blank">dblaikie@gmail.com</a>> wrote:</div><br class="m_-8791573680410378486m_5259437214943620448m_-9062683264771332218Apple-interchange-newline gmail_msg"><div class="gmail_msg"><div dir="ltr" class="gmail_msg"><br class="gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Wed, Mar 8, 2017 at 2:55 PM Chris Bieneman <<a href="mailto:beanz@apple.com" class="gmail_msg" target="_blank">beanz@apple.com</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" 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 class="gmail_msg" style="word-wrap:break-word">David,<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">This is an area that has had a lot of development over the last two years.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">There are two supported ways in the LLVM build system to build compiler-rt with the just-built compiler.<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">1) The legacy way is for if compiler-rt is under LLVM/projects. You can specify -DLLVM_BUILD_EXTERNAL_COMPILER_RT=On, which will configure compiler-rt using the just-built clang after clang is built.</div></div></div></blockquote><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I thought the BUILD_EXTERNAL variables were for use when projects were not embedded within the llvm source tree (mostly in use by Takumi's flat buildbots that checout the top-level project without embedding, say, clang or compiler-rt within the llvm source tree)?</div></div></div></div></blockquote><div class="gmail_msg"><br class="gmail_msg"></div></div></div><div class="gmail_msg" style="word-wrap:break-word"><div class="gmail_msg"><div class="gmail_msg">You are confusing this with the similarly named LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR variables.</div></div></div></blockquote><div class="gmail_msg"><br class="gmail_msg">Ah, right - indeed.<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" 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 class="gmail_msg" style="word-wrap:break-word"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><div dir="ltr" class="gmail_msg"><div class="gmail_quote gmail_msg"><blockquote class="gmail_quote gmail_msg" 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 class="gmail_msg" style="word-wrap:break-word"><div class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">2) The new way, is to place compiler-rt under LLVM/runtimes. In this path the build system will automatically build with the just-built compiler. This path also splits compiler-rt into two separate build steps, one that configures and builds the builtins with the just-built compiler, and a second that configures and builds the sanitizer libraries.</div></div></div></blockquote><div class="gmail_msg"><br class="gmail_msg">Huh, OK - could someone remove the legacy format, then? If it's a trap.<br class="gmail_msg"></div></div></div></div></blockquote><div class="gmail_msg"><br class="gmail_msg"></div></div></div><div class="gmail_msg" style="word-wrap:break-word"><div class="gmail_msg"><div class="gmail_msg">I'm not sure the new path is fully supported in every workflow, so removing it seems like a not great idea at the moment.</div></div></div><div class="gmail_msg" style="word-wrap:break-word"><div class="gmail_msg"><br class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><div dir="ltr" class="gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg"><br class="gmail_msg">That said, I tried putting compiler-rt in runtimes instead of projects and I got a bunch of cmake errors starting with:<br class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg">CMake Error at /usr/local/google/home/blaikie/dev/llvm/build/clang/debug/split/notypes/nostandalone/lib/cmake/llvm/AddLLVM.cmake:1174 (add_dependencies):</div><div class="gmail_msg"> <span class="gmail_msg m_-8791573680410378486m_5259437214943620448Apple-converted-space"> </span>The dependency target "GotsanRuntimeCheck" of target "check-runtimes" does</div><div class="gmail_msg"> <span class="gmail_msg m_-8791573680410378486m_5259437214943620448Apple-converted-space"> </span>not exist.</div><div class="gmail_msg">Call Stack (most recent call first):</div><div class="gmail_msg"> <span class="gmail_msg m_-8791573680410378486m_5259437214943620448Apple-converted-space"> </span>CMakeLists.txt:110 (add_lit_target)<br class="gmail_msg"><br class="gmail_msg">Any ideas?</div></div></div></div></div></blockquote><div class="gmail_msg"><br class="gmail_msg"></div></div></div><div class="gmail_msg" style="word-wrap:break-word"><div class="gmail_msg"><div class="gmail_msg">I have never encountered that issue. It looks like the tsan test code is out of sync. If you go into tsan/test/CMakeLists.txt and on Line 2 add this to the if statement "AND TARGET GotsanRuntimeCheck" that should fix the issue.</div></div></div></blockquote><div class="gmail_msg"><br class="gmail_msg">Hrm - not sure which CMakeLists.txt you're referring to? In my runtimes/compiler-rt/lib/tsan/tests/CMakeLists.txt the first few lines are:<br class="gmail_msg"></div></div></div></div></blockquote><div class="gmail_msg"><br class="gmail_msg"></div></div></div><div class="gmail_msg" style="word-wrap:break-word"><div class="gmail_msg"><div class="gmail_msg">Sorry, I meant <compiler-rt>/test/tsan/CMakeLists.txt, not tsan/test.</div></div></div></blockquote><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><br class="gmail_msg">Think that got me past that error, but (sorry I wasn't clear) it was only one of many errors. Here are the next... 5, say...<br class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg">CMake Error at /usr/local/google/home/blaikie/dev/llvm/build/clang/debug/split/notypes/nostandalone/lib/cmake/llvm/AddLLVM.cmake:1174 (add_dependencies):</div><div class="gmail_msg">  The dependency target "TsanUnitTests" of target "check-runtimes" does not</div><div class="gmail_msg">  exist.</div><div class="gmail_msg">Call Stack (most recent call first):</div><div class="gmail_msg">  CMakeLists.txt:110 (add_lit_target)</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">CMake Error at /usr/local/google/home/blaikie/dev/llvm/build/clang/debug/split/notypes/nostandalone/lib/cmake/llvm/AddLLVM.cmake:1174 (add_dependencies):</div><div class="gmail_msg">  The dependency target "cfi" of target "check-runtimes" does not exist.</div><div class="gmail_msg">Call Stack (most recent call first):</div><div class="gmail_msg">  CMakeLists.txt:110 (add_lit_target)</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">CMake Error at /usr/local/google/home/blaikie/dev/llvm/build/clang/debug/split/notypes/nostandalone/lib/cmake/llvm/AddLLVM.cmake:1174 (add_dependencies):</div><div class="gmail_msg">  The dependency target "TsanUnitTests" of target "check-compiler-rt" does</div><div class="gmail_msg">  not exist.</div><div class="gmail_msg">Call Stack (most recent call first):</div><div class="gmail_msg">  compiler-rt/test/CMakeLists.txt:94 (add_lit_target)</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">CMake Error at /usr/local/google/home/blaikie/dev/llvm/build/clang/debug/split/notypes/nostandalone/lib/cmake/llvm/AddLLVM.cmake:1174 (add_dependencies):</div><div class="gmail_msg">  The dependency target "cfi" of target "check-compiler-rt" does not exist.</div><div class="gmail_msg">Call Stack (most recent call first):</div><div class="gmail_msg">  compiler-rt/test/CMakeLists.txt:94 (add_lit_target)</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">CMake Error at /usr/local/google/home/blaikie/dev/llvm/build/clang/debug/split/notypes/nostandalone/lib/cmake/llvm/AddLLVM.cmake:1174 (add_dependencies):</div><div class="gmail_msg">  The dependency target "TsanUnitTests" of target "check-tsan" does not</div><div class="gmail_msg">  exist.</div><div class="gmail_msg">Call Stack (most recent call first):</div><div class="gmail_msg">  /usr/local/google/home/blaikie/dev/llvm/build/clang/debug/split/notypes/nostandalone/lib/cmake/llvm/AddLLVM.cmake:1195 (add_lit_target)</div><div class="gmail_msg">  compiler-rt/test/tsan/CMakeLists.txt:46 (add_lit_testsuite)</div><div class="gmail_msg"><br class="gmail_msg"><br class="gmail_msg">I'm assuming there's some systemic problem with the way I'm holding this (if it's working for other people)?<br class="gmail_msg"><br class="gmail_msg">- Dave</div> </div><blockquote class="gmail_quote gmail_msg" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;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 class="gmail_msg" style="word-wrap:break-word"><div class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">-Chris</div></div></div><div class="gmail_msg" style="word-wrap:break-word"><div class="gmail_msg"><br class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><div dir="ltr" class="gmail_msg" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class="gmail_quote gmail_msg"><div class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg">include_directories(../rtl)</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">add_custom_target(TsanUnitTests)</div><div class="gmail_msg">set_target_properties(TsanUnitTests PROPERTIES</div><div class="gmail_msg"> <span class="m_-8791573680410378486Apple-converted-space gmail_msg"> </span>FOLDER "TSan unittests")</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">no if condition I could modify?</div> </div><blockquote class="gmail_quote gmail_msg" 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 class="gmail_msg" style="word-wrap:break-word"><div class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">-Chris</div></div></div><div class="gmail_msg" style="word-wrap:break-word"><div class="gmail_msg"><br class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><div dir="ltr" class="gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg"> </div><blockquote class="gmail_quote gmail_msg" 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 class="gmail_msg" style="word-wrap:break-word"><div class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">The second path also works for many (but not all) of our other runtime library projects. I know it works for libcxx, libcxxabi, and libunwind. Petr Hosek (CC'd) has also been working on support for multi-arch builtin and runtime library builds so that you can generate full cross-compilers from a single cmake invocation.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">-Chris</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"></blockquote></div></div></div></div><div class="gmail_msg" style="word-wrap:break-word"><div class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">On Mar 8, 2017, at 2:35 PM, David Blaikie via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="gmail_msg" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="gmail_msg m_-8791573680410378486m_5259437214943620448m_-9062683264771332218m_4522516111472582671Apple-interchange-newline"></blockquote></div></div></div></div><div class="gmail_msg" style="word-wrap:break-word"><div class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg"><div dir="ltr" class="gmail_msg"><br class="gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Wed, Mar 8, 2017 at 2:03 PM Sterling Augustine <<a href="mailto:saugustine@google.com" class="gmail_msg" target="_blank">saugustine@google.com</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" 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" class="gmail_msg">Yes, this is a aspect of the larger problem that clang bootstrap doesn't work for a cross-compiler. The build (mostly?) assumes that host==target during the build of clang itself, and then if you want another architecture also, you run a second build of the target libraries, and manually merge the trees.</div></blockquote><div class="gmail_msg"><br class="gmail_msg">I kind of roughly follow that, but not too well.<br class="gmail_msg"> </div><blockquote class="gmail_quote gmail_msg" 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" class="gmail_msg"><div class="gmail_msg">If you think about compiler-rt as being compiled for the target rather than the host, the problem you describe here is exactly the same one, and we have been getting lucky.<br class="gmail_msg"></div></div></blockquote><div class="gmail_msg"><br class="gmail_msg">Sure - if a PPC clang is being built from an x86 host, how would compiler-rt be built (OK, it could be built with the just-built clang, which it isn't at the moment) and tested (can't really be tested because the host can't run PPC binaries).<br class="gmail_msg"> </div><blockquote class="gmail_quote gmail_msg" 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" class="gmail_msg"><div class="gmail_msg"></div><div class="gmail_msg"><div class="gmail_msg">At the moment, the blaze builds of clang do exactly the procedure described above, so this hasn't been a terrible problem for Google, but I do think it is something that should be fixed (I'm working on another aspect of compiler-rt bringup at the moment, so won't solve this in the immediate future.)<br class="gmail_msg"></div></div></div></blockquote><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Rightio</div><div class="gmail_msg"> </div><blockquote class="gmail_quote gmail_msg" 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" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">gnu systems have a make variable, "CC_FOR_TARGET" that addresses this problem. I imagine llvm should adopt a similar mechanism inside cmake.</div></div></div></blockquote><div class="gmail_msg"><br class="gmail_msg">Not sure I follow on the need/use of CC_FOR_TARGET compared to using the just-built clang as the CC_FOR_TARGET (which it seems we have some plumbing for already - the just-built clang is used for building the compiler-rt tests, but not for building the library. I /think/ it should be used for both)<br class="gmail_msg"><br class="gmail_msg">- Dave<br class="gmail_msg"> </div><blockquote class="gmail_quote gmail_msg" 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 class="gmail_extra gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg">On Wed, Mar 8, 2017 at 1:54 PM, David Blaikie<span class="gmail_msg m_-8791573680410378486m_5259437214943620448Apple-converted-space"> </span><span dir="ltr" class="gmail_msg"><<a href="mailto:dblaikie@gmail.com" class="gmail_msg" target="_blank">dblaikie@gmail.com</a>></span><span class="gmail_msg m_-8791573680410378486m_5259437214943620448Apple-converted-space"> </span>wrote:<br class="gmail_msg"><blockquote class="gmail_quote gmail_msg" 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" class="gmail_msg">I stumbled across what seems to be a bug (to me) in the compiler-rt build:<br class="gmail_msg"><br class="gmail_msg">The compiler-rt libraries themselves are built with the host compiler while the tests are built and then linked with the just-built clang.<br class="gmail_msg"><br class="gmail_msg">It was my understanding that the goal/intent/need was to have the compiler-rt library build with the just-built clang? Did I misunderstand that?*<br class="gmail_msg"><br class="gmail_msg">Sterling: Chandler seemed to think you might be interested in this issue & possibly addressing it given you're working on compiler-rt bring-up? It'd probably be useful to have compiler-rt built with the just-built clang for performance reasons.<br class="gmail_msg"><br class="gmail_msg">Evgeniy - not sure if you're interested in this or have much context? Know if this is right/wrong/neutral, etc?<br class="gmail_msg"><br class="gmail_msg">* reasons include performance, ABI compatibility, etc (I thought this was necessary for correctness in some way) - also, otherwise it seems excessive to hold up the whole build on waiting for just-built clang to finish, then use that to compile some tests. (well, I realize some of the tests are end-to-end, so they do need the just-built compiler)</div></blockquote></div><br class="gmail_msg"></div></blockquote></div></div></div></blockquote></div></div></div></div><div class="gmail_msg" style="word-wrap:break-word"><div class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">_______________________________________________<br class="gmail_msg">LLVM Developers mailing list<br class="gmail_msg"><a href="mailto:llvm-dev@lists.llvm.org" class="gmail_msg" target="_blank">llvm-dev@lists.llvm.org</a><br class="gmail_msg"><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a></div></blockquote></div></div></div></div></blockquote></div></div></div></blockquote></div></div></blockquote></div></div></div></blockquote></div></div></blockquote></div></blockquote></div><br class="gmail_msg"></div></div></blockquote></div></div>