<div dir="ltr"><div>Ok, I can reproduce this. This should fix it:</div><div><br></div><div>Index: cmake/Modules/CompilerRTCompile.cmake</div><div>===================================================================</div><div>--- cmake/Modules/CompilerRTCompile.cmake<span class="" style="white-space:pre">  </span>(revision 218404)</div><div>+++ cmake/Modules/CompilerRTCompile.cmake<span class="" style="white-space:pre"> </span>(working copy)</div><div>@@ -73,7 +73,9 @@</div><div>     add_custom_target(CompilerRTUnitTestCheckCxx</div><div>       COMMAND bash -c "${CMD}"</div><div>       COMMENT "Checking that just-built clang can find C++ headers..."</div><div>-      DEPENDS clang</div><div>       VERBATIM)</div><div>+    if (TARGET clang)</div><div>+      ADD_DEPENDENCIES(CompilerRTUnitTestCheckCxx clang)</div><div>+    endif()</div><div>   endif()</div><div> endmacro()</div><div><br></div><div><br></div><div>Kuba</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 22, 2014 at 5:42 AM, Alexander Potapenko <span dir="ltr"><<a href="mailto:glider@google.com" target="_blank">glider@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Yeah, see below:<br>
<br>
+ cd compiler_rt_build<br>
+ cmake -DCMAKE_BUILD_TYPE=Release<br>
-DCMAKE_C_COMPILER=/Users/buildbot/src/llvm-buildbot/slave/mac10.9-cmake/build/llvm_build64/bin/clang<br>
-DCMAKE_CXX_COMPILER=/Users/buildbot/src/llvm-buildbot/slave/mac10.9-cmake/build/llvm_build64/bin/clang++<br>
-DCOMPILER_RT_INCLUDE_TESTS=ON -DCOMPILER_RT_ENABLE_WERROR=ON<br>
-DLLVM_CONFIG_PATH=/Users/buildbot/src/llvm-buildbot/slave/mac10.9-cmake/build/llvm_build64/bin/llvm-config<br>
/Users/buildbot/src/llvm-buildbot/slave/mac10.9-cmake/build/llvm/projects/compiler-rt<br>
+ cd compiler_rt_build<br>
+ make -j8 check-all<br>
<br>
llvm_build64 is the newly built Clang.<br>
<div class="HOEnZb"><div class="h5"><br>
On Fri, Sep 19, 2014 at 10:27 PM, Kuba Brecka <<a href="mailto:kuba.brecka@gmail.com">kuba.brecka@gmail.com</a>> wrote:<br>
> I'll try it. What way do you run the compiler-rt build? "cmake<br>
> /path/to/compiler-rt -DLLVM_CONFIG_PATH=/path/to/llvm-config" then "make"?<br>
><br>
> Kuba<br>
><br>
><br>
> On Fri, Sep 19, 2014 at 11:17 AM, Alexander Potapenko <<a href="mailto:glider@google.com">glider@google.com</a>><br>
> wrote:<br>
>><br>
>> This looks sane, but I'll need to test when I'm back to the office.<br>
>><br>
>> On Sep 19, 2014 10:09 PM, "Kuba Brecka" <<a href="mailto:kuba.brecka@gmail.com">kuba.brecka@gmail.com</a>> wrote:<br>
>>><br>
>>> Ok, then changing the<br>
>>><br>
>>>     add_custom_target(CompilerRTUnitTestCheckCxx<br>
>>>           COMMAND bash -c "${CMD}"<br>
>>>           COMMENT "Checking that just-built clang can find C++<br>
>>> headers..."<br>
>>>           DEPENDS clang<br>
>>>           VERBATIM)<br>
>>><br>
>>> into something like<br>
>>><br>
>>>     add_custom_target(CompilerRTUnitTestCheckCxx<br>
>>>           COMMAND bash -c "${CMD}"<br>
>>>           COMMENT "Checking that just-built clang can find C++<br>
>>> headers..."<br>
>>>           VERBATIM)<br>
>>>     if(NOT COMPILER_RT_STANDALONE_BUILD)<br>
>>>       ADD_DEPENDENCIES(CompilerRTUnitTestCheckCxx clang)<br>
>>>     endif()<br>
>>><br>
>>> should help, what do you think?<br>
>>><br>
>>> Kuba<br>
>>><br>
>>><br>
>>> On Fri, Sep 19, 2014 at 10:55 AM, Alexander Potapenko <<a href="mailto:glider@google.com">glider@google.com</a>><br>
>>> wrote:<br>
>>>><br>
>>>> Yes, using the freshly built Clang.<br>
>>>><br>
>>>> On Sep 19, 2014 9:42 PM, "Kuba Brecka" <<a href="mailto:kuba.brecka@gmail.com">kuba.brecka@gmail.com</a>> wrote:<br>
>>>>><br>
>>>>> Are you building the compiler-rt project separately?<br>
>>>>><br>
>>>>> Kuba<br>
>>>>><br>
>>>>><br>
>>>>> On Fri, Sep 19, 2014 at 9:10 AM, Alexander Potapenko<br>
>>>>> <<a href="mailto:glider@google.com">glider@google.com</a>> wrote:<br>
>>>>>><br>
>>>>>> Here's the error message from that system:<br>
>>>>>><br>
>>>>>> [100%] Built target compiler-rt-build<br>
>>>>>> make[7]: *** No rule to make target<br>
>>>>>><br>
>>>>>> `/Users/buildbot/src/llvm-buildbot/slave/mac10.9-cmake/build/llvm/projects/compiler-rt/lib/sanitizer_common/tests/clang',<br>
>>>>>> needed by<br>
>>>>>> `lib/sanitizer_common/tests/CMakeFiles/CompilerRTUnitTestCheckCxx'.<br>
>>>>>> Stop.<br>
>>>>>> make[6]: ***<br>
>>>>>> [lib/sanitizer_common/tests/CMakeFiles/CompilerRTUnitTestCheckCxx.dir/all]<br>
>>>>>> Error 2<br>
>>>>>> make[6]: *** Waiting for unfinished jobs....<br>
>>>>>><br>
>>>>>><br>
>>>>>><br>
>>>>>> On Thu, Sep 11, 2014 at 8:00 PM, Kuba Brecka <<a href="mailto:kuba.brecka@gmail.com">kuba.brecka@gmail.com</a>><br>
>>>>>> wrote:<br>
>>>>>> > Does the command that performs the check:<br>
>>>>>> ><br>
>>>>>> >   echo '#include <iostream>' | ./build/bin/clang -E -x c++ -<br>
>>>>>> ><br>
>>>>>> > fail on that system?<br>
>>>>>> ><br>
>>>>>> > Kuba<br>
>>>>>> ><br>
>>>>>> ><br>
>>>>>> > On Thu, Sep 11, 2014 at 8:52 AM, Alexander Potapenko<br>
>>>>>> > <<a href="mailto:glider@google.com">glider@google.com</a>><br>
>>>>>> > wrote:<br>
>>>>>> >><br>
>>>>>> >> OSX 10.9. Yes, this is a buildbot failure on our internal bot.<br>
>>>>>> >><br>
>>>>>> >> On Thu, Sep 11, 2014 at 7:49 PM, Kuba Brecka<br>
>>>>>> >> <<a href="mailto:kuba.brecka@gmail.com">kuba.brecka@gmail.com</a>><br>
>>>>>> >> wrote:<br>
>>>>>> >> > Which version of Darwin? Is it a buildbot failure?<br>
>>>>>> >> ><br>
>>>>>> >> > If check-asan worked before and this patch broke it, then please<br>
>>>>>> >> > revert.<br>
>>>>>> >> > Thanks.<br>
>>>>>> >> ><br>
>>>>>> >> > Kuba<br>
>>>>>> >> ><br>
>>>>>> >> ><br>
>>>>>> >> > On Thu, Sep 11, 2014 at 2:18 AM, Alexander Potapenko<br>
>>>>>> >> > <<a href="mailto:glider@google.com">glider@google.com</a>><br>
>>>>>> >> > wrote:<br>
>>>>>> >> >><br>
>>>>>> >> >> Apparently this broke `make check-asan` on Darwin.<br>
>>>>>> >> >> I'll check whether the problem can be fixed easily or revert<br>
>>>>>> >> >> otherwise.<br>
>>>>>> >> >><br>
>>>>>> >> >> On Wed, Sep 10, 2014 at 9:23 PM, Kuba Brecka<br>
>>>>>> >> >> <<a href="mailto:kuba.brecka@gmail.com">kuba.brecka@gmail.com</a>><br>
>>>>>> >> >> wrote:<br>
>>>>>> >> >> > Author: kuba.brecka<br>
>>>>>> >> >> > Date: Wed Sep 10 12:23:58 2014<br>
>>>>>> >> >> > New Revision: 217523<br>
>>>>>> >> >> ><br>
>>>>>> >> >> > URL: <a href="http://llvm.org/viewvc/llvm-project?rev=217523&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=217523&view=rev</a><br>
>>>>>> >> >> > Log:<br>
>>>>>> >> >> > Make compiler-rt tests work with relocatable SDKs on OS X<br>
>>>>>> >> >> ><br>
>>>>>> >> >> > Reviewed at <a href="http://reviews.llvm.org/D4047" target="_blank">http://reviews.llvm.org/D4047</a><br>
>>>>>> >> >> ><br>
>>>>>> >> >> ><br>
>>>>>> >> >> > Modified:<br>
>>>>>> >> >> >     compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake<br>
>>>>>> >> >> ><br>
>>>>>> >> >> > compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt<br>
>>>>>> >> >> ><br>
>>>>>> >> >> > Modified:<br>
>>>>>> >> >> > compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake<br>
>>>>>> >> >> > URL:<br>
>>>>>> >> >> ><br>
>>>>>> >> >> ><br>
>>>>>> >> >> > <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake?rev=217523&r1=217522&r2=217523&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake?rev=217523&r1=217522&r2=217523&view=diff</a><br>
>>>>>> >> >> ><br>
>>>>>> >> >> ><br>
>>>>>> >> >> ><br>
>>>>>> >> >> > ==============================================================================<br>
>>>>>> >> >> > --- compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake<br>
>>>>>> >> >> > (original)<br>
>>>>>> >> >> > +++ compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake<br>
>>>>>> >> >> > Wed Sep<br>
>>>>>> >> >> > 10<br>
>>>>>> >> >> > 12:23:58 2014<br>
>>>>>> >> >> > @@ -11,6 +11,9 @@ macro(clang_compile object_file source)<br>
>>>>>> >> >> >    if(NOT COMPILER_RT_STANDALONE_BUILD)<br>
>>>>>> >> >> >      list(APPEND SOURCE_DEPS clang)<br>
>>>>>> >> >> >    endif()<br>
>>>>>> >> >> > +  if (TARGET CompilerRTUnitTestCheckCxx)<br>
>>>>>> >> >> > +    list(APPEND SOURCE_DEPS CompilerRTUnitTestCheckCxx)<br>
>>>>>> >> >> > +  endif()<br>
>>>>>> >> >> >    string(REGEX MATCH "[.](cc|cpp)$" is_cxx ${source_rpath})<br>
>>>>>> >> >> >    if(is_cxx)<br>
>>>>>> >> >> >      string(REPLACE " " ";" global_flags "${CMAKE_CXX_FLAGS}")<br>
>>>>>> >> >> > @@ -36,3 +39,41 @@ macro(clang_compile object_file source)<br>
>>>>>> >> >> >      MAIN_DEPENDENCY ${source}<br>
>>>>>> >> >> >      DEPENDS ${SOURCE_DEPS})<br>
>>>>>> >> >> >  endmacro()<br>
>>>>>> >> >> > +<br>
>>>>>> >> >> > +# On Darwin, there are no system-wide C++ headers and the<br>
>>>>>> >> >> > just-built<br>
>>>>>> >> >> > clang is<br>
>>>>>> >> >> > +# therefore not able to compile C++ files unless they are<br>
>>>>>> >> >> > copied/symlinked into<br>
>>>>>> >> >> > +# ${LLVM_BINARY_DIR}/include/c++<br>
>>>>>> >> >> > +# The just-built clang is used to build compiler-rt unit<br>
>>>>>> >> >> > tests.<br>
>>>>>> >> >> > Let's<br>
>>>>>> >> >> > detect<br>
>>>>>> >> >> > +# this before we try to build the tests and print out a<br>
>>>>>> >> >> > suggestion<br>
>>>>>> >> >> > how<br>
>>>>>> >> >> > to fix<br>
>>>>>> >> >> > +# it.<br>
>>>>>> >> >> > +# On other platforms, this is currently not an issue.<br>
>>>>>> >> >> > +macro(clang_compiler_add_cxx_check)<br>
>>>>>> >> >> > +  if (APPLE)<br>
>>>>>> >> >> > +    set(CMD<br>
>>>>>> >> >> > +      "echo '#include <iostream>' |<br>
>>>>>> >> >> > ${COMPILER_RT_TEST_COMPILER} -E<br>
>>>>>> >> >> > -x<br>
>>>>>> >> >> > c++ - > /dev/null"<br>
>>>>>> >> >> > +      "if [ $? != 0 ] "<br>
>>>>>> >> >> > +      "  then echo"<br>
>>>>>> >> >> > +      "  echo 'Your just-built clang cannot find C++ headers,<br>
>>>>>> >> >> > which<br>
>>>>>> >> >> > are<br>
>>>>>> >> >> > needed to build and run compiler-rt tests.'"<br>
>>>>>> >> >> > +      "  echo 'You should copy or symlink your system C++<br>
>>>>>> >> >> > headers<br>
>>>>>> >> >> > into<br>
>>>>>> >> >> > ${LLVM_BINARY_DIR}/include/c++'"<br>
>>>>>> >> >> > +      "  if [ -d $(dirname $(dirname $(xcrun -f<br>
>>>>>> >> >> > clang)))/include/c++<br>
>>>>>> >> >> > ]"<br>
>>>>>> >> >> > +      "    then echo 'e.g. with:'"<br>
>>>>>> >> >> > +      "    echo '  cp -r' $(dirname $(dirname $(xcrun -f<br>
>>>>>> >> >> > clang)))/include/c++ '${LLVM_BINARY_DIR}/include/'"<br>
>>>>>> >> >> > +      "  elif [ -d $(dirname $(dirname $(xcrun -f<br>
>>>>>> >> >> > clang)))/lib/c++<br>
>>>>>> >> >> > ]"<br>
>>>>>> >> >> > +      "    then echo 'e.g. with:'"<br>
>>>>>> >> >> > +      "    echo '  cp -r' $(dirname $(dirname $(xcrun -f<br>
>>>>>> >> >> > clang)))/lib/c++ '${LLVM_BINARY_DIR}/include/'"<br>
>>>>>> >> >> > +      "  fi"<br>
>>>>>> >> >> > +      "  echo 'This can also be fixed by checking out the<br>
>>>>>> >> >> > libcxx<br>
>>>>>> >> >> > project from <a href="http://llvm.org" target="_blank">llvm.org</a> and installing the headers'"<br>
>>>>>> >> >> > +      "  echo 'into your build directory:'"<br>
>>>>>> >> >> > +      "  echo '  cd ${LLVM_SOURCE_DIR}/projects && svn co<br>
>>>>>> >> >> > <a href="http://llvm.org/svn/llvm-project/libcxx/trunk" target="_blank">http://llvm.org/svn/llvm-project/libcxx/trunk</a> libcxx'"<br>
>>>>>> >> >> > +      "  echo '  cd ${LLVM_BINARY_DIR} && make -C<br>
>>>>>> >> >> > ${LLVM_SOURCE_DIR}/projects/libcxx installheaders<br>
>>>>>> >> >> > HEADER_DIR=${LLVM_BINARY_DIR}/include'"<br>
>>>>>> >> >> > +      "  echo"<br>
>>>>>> >> >> > +      "  false"<br>
>>>>>> >> >> > +      "fi"<br>
>>>>>> >> >> > +      )<br>
>>>>>> >> >> > +    add_custom_target(CompilerRTUnitTestCheckCxx<br>
>>>>>> >> >> > +      COMMAND bash -c "${CMD}"<br>
>>>>>> >> >> > +      COMMENT "Checking that just-built clang can find C++<br>
>>>>>> >> >> > headers..."<br>
>>>>>> >> >> > +      DEPENDS clang<br>
>>>>>> >> >> > +      VERBATIM)<br>
>>>>>> >> >> > +  endif()<br>
>>>>>> >> >> > +endmacro()<br>
>>>>>> >> >> ><br>
>>>>>> >> >> > Modified:<br>
>>>>>> >> >> > compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt<br>
>>>>>> >> >> > URL:<br>
>>>>>> >> >> ><br>
>>>>>> >> >> ><br>
>>>>>> >> >> > <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt?rev=217523&r1=217522&r2=217523&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt?rev=217523&r1=217522&r2=217523&view=diff</a><br>
>>>>>> >> >> ><br>
>>>>>> >> >> ><br>
>>>>>> >> >> ><br>
>>>>>> >> >> > ==============================================================================<br>
>>>>>> >> >> > ---<br>
>>>>>> >> >> > compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt<br>
>>>>>> >> >> > (original)<br>
>>>>>> >> >> > +++<br>
>>>>>> >> >> > compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt Wed<br>
>>>>>> >> >> > Sep<br>
>>>>>> >> >> > 10 12:23:58 2014<br>
>>>>>> >> >> > @@ -1,5 +1,7 @@<br>
>>>>>> >> >> >  include(CompilerRTCompile)<br>
>>>>>> >> >> ><br>
>>>>>> >> >> > +clang_compiler_add_cxx_check()<br>
>>>>>> >> >> > +<br>
>>>>>> >> >> >  set(SANITIZER_UNITTESTS<br>
>>>>>> >> >> >    sanitizer_allocator_test.cc<br>
>>>>>> >> >> >    sanitizer_atomic_test.cc<br>
>>>>>> >> >> ><br>
>>>>>> >> >> ><br>
>>>>>> >> >> > _______________________________________________<br>
>>>>>> >> >> > llvm-commits mailing list<br>
>>>>>> >> >> > <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
>>>>>> >> >> > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
>>>>>> >> >><br>
>>>>>> >> >><br>
>>>>>> >> >><br>
>>>>>> >> >> --<br>
>>>>>> >> >> Alexander Potapenko<br>
>>>>>> >> >> Software Engineer<br>
>>>>>> >> >> Google Moscow<br>
>>>>>> >> ><br>
>>>>>> >> ><br>
>>>>>> >><br>
>>>>>> >><br>
>>>>>> >><br>
>>>>>> >> --<br>
>>>>>> >> Alexander Potapenko<br>
>>>>>> >> Software Engineer<br>
>>>>>> >> Google Moscow<br>
>>>>>> ><br>
>>>>>> ><br>
>>>>>><br>
>>>>>><br>
>>>>>><br>
>>>>>> --<br>
>>>>>> Alexander Potapenko<br>
>>>>>> Software Engineer<br>
>>>>>> Google Moscow<br>
>>>>><br>
>>>>><br>
>>><br>
><br>
<br>
<br>
<br>
--<br>
Alexander Potapenko<br>
Software Engineer<br>
Google Moscow<br>
</div></div></blockquote></div><br></div>