<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - `ninja check-asan` fails when using LLVM_ENABLE_LIBCXX"
   href="https://bugs.llvm.org/show_bug.cgi?id=32361">32361</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>`ninja check-asan` fails when using LLVM_ENABLE_LIBCXX
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>compiler-rt
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>compiler-rt
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>chandlerc@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The failure mode differs depending on if I have LLVM_ENABLE_LLD turned on or
off, but it fails either way for me:

With LLVM_ENABLE_LLD=OFF I get:
----
% ninja -C dev check-asan check-asan-dynamic                                   
                                                                               
                                            ninja: Entering directory `dev'    
                                                                               
                                                                               
        [397/405] cd
/home/chandlerc/src/llvm.git/build/dev/projects/compiler-rt/lib/asan/tests &&
/home/cha...chandlerc/lib -stdlib=libc++ -Wl,-allow-shlib-undefined -g
--driver-mode=g++ -ldl -lrt -pthread -m64 FAILED:
projects/compiler-rt/lib/asan/tests/CMakeFiles/Asan-x86_64-inline-Noinst-Test  
                                                                               
                                    cd
/home/chandlerc/src/llvm.git/build/dev/projects/compiler-rt/lib/asan/tests &&
/home/chandlerc/src/llvm.git/build/dev/./bin/clang
ASAN_NOINST_TEST_OBJECTS.gtest-all.cc.x86_64-inline.o
ASAN_NOINST_TEST_OBJECTS.asan_fake_stack_test.cc.x86_64-inline.o
ASAN_NOINST_TEST_OBJECTS.asan_noinst_test.cc.x86_64-inline.o
ASAN_NOINST_TEST_OBJECTS.asan_test_main.cc.x86_64-inline.o
libRTAsanTest.x86_64-inline.a -o
/home/chandlerc/src/llvm.git/build/dev/projects/compiler-rt/lib/asan/tests/default/Asan-x86_64-inline-Noinst-Test
-Wl,-rpath=/home/chandlerc/lib64 -Wl,-rpath=/home/chandlerc/lib -stdlib=libc++
-Wl,-allow-shlib-undefined -g --driver-mode=g++ -ldl -lrt -pthread -m64        
                                                                               
                                                          
/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/bin/ld:
error: cannot find -lc++                                                       
                                            
/home/chandlerc/src/llvm.git/build/dev/bin/../include/c++/v1/string:3837:
error: undefined reference to 'std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> >::append(char const*)' 
                                                                               
                                                                               
                                 
/home/chandlerc/src/llvm.git/build/dev/bin/../include/c++/v1/string:1552:
error: undefined reference to
'std::__1::__basic_string_common<true>::__throw_length_error() const'          
                   
/home/chandlerc/src/llvm.git/build/dev/bin/../include/c++/v1/string:1552:
error: undefined reference to
'std::__1::__basic_string_common<true>::__throw_length_error() const'          
                   
/home/chandlerc/src/llvm.git/utils/unittest/googletest/include/gtest/gtest-message.h:162:
error: undefined reference to 'std::__1::basic_ostream<char,
std::__1::char_traits<char> >::operator<<(int)'     
/home/chandlerc/src/llvm.git/build/dev/bin/../include/c++/v1/ostream:866:
error: undefined reference to 'std::__1::cerr'                                 
                                                 
/home/chandlerc/src/llvm.git/utils/unittest/googletest/src/gtest.cc:318: error:
undefined reference to 'std::__1::basic_ostream<char,
std::__1::char_traits<char> >::operator<<(unsigned int)'             
/home/chandlerc/src/llvm.git/utils/unittest/googletest/src/gtest.cc:319: error:
undefined reference to 'std::__1::basic_ostream<char,
std::__1::char_traits<char> >::operator<<(unsigned int)'             
/home/chandlerc/src/llvm.git/build/dev/bin/../include/c++/v1/ostream:866:
error: undefined reference to 'std::__1::cerr'                                 
                                                 
/home/chandlerc/src/llvm.git/build/dev/bin/../include/c++/v1/string:1552:
error: undefined reference to
'std::__1::__basic_string_common<true>::__throw_length_error() const'
/home/chandlerc/src/llvm.git/utils/unittest/googletest/src/gtest.cc:3988:
error: undefined reference to '__cxa_guard_acquire'
/home/chandlerc/src/llvm.git/utils/unittest/googletest/src/gtest.cc:3988:
error: undefined reference to '__cxa_guard_release'
/home/chandlerc/src/llvm.git/utils/unittest/googletest/src/gtest.cc:3988:
error: undefined reference to '__cxa_guard_abort'
/home/chandlerc/src/llvm.git/utils/unittest/googletest/src/gtest.cc:4160:
error: undefined reference to '__cxa_allocate_exception'
....
----

With LLVM_ENABLE_LLD=ON I get:
----
[2702/2713] cd
/home/chandlerc/src/llvm.git/build/dev/projects/compiler-rt/lib/asan/tests &&
/home/c... -stdlib=libc++ -fuse-ld=lld -Wl,-allow-shlib-undefined -g
--driver-mode=g++ -ldl -lrt -pthread -m64 FAILED:
projects/compiler-rt/lib/asan/tests/CMakeFiles/Asan-x86_64-inline-Noinst-Test  
                                                                               
                                    cd
/home/chandlerc/src/llvm.git/build/dev/projects/compiler-rt/lib/asan/tests &&
/home/chandlerc/src/llvm.git/build/dev/./bin/clang
ASAN_NOINST_TEST_OBJECTS.gtest-all.cc.x86_64-inline.o
ASAN_NOINST_TEST_OBJECTS.asan_fake_stack_test.cc.x86_64-inline.o
ASAN_NOINST_TEST_OBJECTS.asan_noinst_test.cc.x86_64-inline.o
ASAN_NOINST_TEST_OBJECTS.asan_test_main.cc.x86_64-inline.o
libRTAsanTest.x86_64-inline.a -o
/home/chandlerc/src/llvm.git/build/dev/projects/compiler-rt/lib/asan/tests/default/Asan-x86_64-inline-Noinst-Test
-Wl,-rpath=/home/chandlerc/lib64 -Wl,-rpath=/home/chandlerc/lib -stdlib=libc++
-fuse-ld=lld -Wl,-allow-shlib-undefined -g --driver-mode=g++ -ldl -lrt -pthread
-m64                                                                           
                                                          
/home/chandlerc/src/llvm.git/build/dev/./bin/ld.lld: error: unable to find
library -lc++                                                                  
                                                 clang-5.0: error: linker
command failed with exit code 1 (use -v to see invocation)                     
                                                                               
                   [2706/2713] Generating
ASAN_INST_TEST_OBJECTS.gtest-all.cc.x86_64-inline.o                            
                                                                               
                     ninja: build stopped: subcommand failed.
----</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>