<div dir="ltr">Does the command that performs the check:<div>  </div><div>  <span style="font-family:arial,sans-serif;font-size:13px">echo '#include <iostream>' | ./build/bin/clang -E -x c++ -</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">fail on that system?</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Kuba</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 11, 2014 at 8:52 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">OSX 10.9. Yes, this is a buildbot failure on our internal bot.<br>
<div class="HOEnZb"><div class="h5"><br>
On Thu, Sep 11, 2014 at 7:49 PM, Kuba Brecka <<a href="mailto:kuba.brecka@gmail.com">kuba.brecka@gmail.com</a>> 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 revert.<br>
> Thanks.<br>
><br>
> Kuba<br>
><br>
><br>
> On Thu, Sep 11, 2014 at 2:18 AM, Alexander Potapenko <<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 otherwise.<br>
>><br>
>> On Wed, Sep 10, 2014 at 9:23 PM, Kuba Brecka <<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>
>> >     compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt<br>
>> ><br>
>> > Modified: compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake<br>
>> > URL:<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>
>> > --- compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake (original)<br>
>> > +++ compiler-rt/trunk/cmake/Modules/CompilerRTCompile.cmake Wed Sep 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 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 tests. Let's<br>
>> > detect<br>
>> > +# this before we try to build the tests and print out a suggestion 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>' | ${COMPILER_RT_TEST_COMPILER} -E -x<br>
>> > c++ - > /dev/null"<br>
>> > +      "if [ $? != 0 ] "<br>
>> > +      "  then echo"<br>
>> > +      "  echo 'Your just-built clang cannot find C++ headers, which are<br>
>> > needed to build and run compiler-rt tests.'"<br>
>> > +      "  echo 'You should copy or symlink your system C++ headers into<br>
>> > ${LLVM_BINARY_DIR}/include/c++'"<br>
>> > +      "  if [ -d $(dirname $(dirname $(xcrun -f clang)))/include/c++ ]"<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 clang)))/lib/c++ ]"<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 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++ headers..."<br>
>> > +      DEPENDS clang<br>
>> > +      VERBATIM)<br>
>> > +  endif()<br>
>> > +endmacro()<br>
>> ><br>
>> > Modified: compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt<br>
>> > URL:<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>
>> > --- compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt<br>
>> > (original)<br>
>> > +++ compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt Wed 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>
</div></div></blockquote></div><br></div>