[llvm-bugs] [Bug 32361] New: `ninja check-asan` fails when using LLVM_ENABLE_LIBCXX

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Mar 21 08:45:48 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=32361

            Bug ID: 32361
           Summary: `ninja check-asan` fails when using LLVM_ENABLE_LIBCXX
           Product: compiler-rt
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: compiler-rt
          Assignee: unassignedbugs at nondot.org
          Reporter: chandlerc at gmail.com
                CC: llvm-bugs at lists.llvm.org

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.
----

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170321/dd551a74/attachment-0001.html>


More information about the llvm-bugs mailing list