<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 - 'check-cxx' fails with undefined reference errors when assertions are enabled"
   href="https://bugs.llvm.org/show_bug.cgi?id=50534">50534</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>'check-cxx' fails with undefined reference errors when assertions are enabled
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++
          </td>
        </tr>

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

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

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

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

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

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Starting with commit 31e820378b8ae4d81e9d206a7dae64ccf4b4c97f, building libc++
with `-DLIBCXX_ENABLE_ASSERTIONS=on` no longer works. `ninja check-cxx` fails
with 1000+ errors:

Failed Tests (1207):
  libc++ :: libcxx/containers/sequences/vector/asan_throw.pass.cpp
  libc++ :: libcxx/containers/sequences/vector/const_value_type.pass.cpp
  libc++ ::
libcxx/containers/sequences/vector/exception_safety_exceptions_disabled.pass.cpp
  libc++ :: libcxx/containers/sequences/vector/robust_against_adl.pass.cpp
  libc++ ::
libcxx/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
  libc++ ::
libcxx/containers/sequences/vector/vector.cons/construct_iter_iter_alloc.pass.cpp
  libc++ :: libcxx/fuzzing/make_heap.pass.cpp
  libc++ :: libcxx/fuzzing/nth_element.pass.cpp
  libc++ :: libcxx/fuzzing/partial_sort.pass.cpp
  libc++ :: libcxx/fuzzing/partial_sort_copy.pass.cpp
  libc++ :: libcxx/fuzzing/partition.pass.cpp
  libc++ :: libcxx/fuzzing/partition_copy.pass.cpp
  .
  .
  libc++ :: std/utilities/template.bitset/bitset.members/test.pass.cpp
  libc++ :: std/utilities/template.bitset/bitset.members/to_string.pass.cpp
  libc++ :: std/utilities/template.bitset/bitset.operators/op_and.pass.cpp
  libc++ :: std/utilities/template.bitset/bitset.operators/op_not.pass.cpp
  libc++ :: std/utilities/template.bitset/bitset.operators/op_or.pass.cpp
  libc++ :: std/utilities/template.bitset/bitset.operators/stream_in.pass.cpp
  libc++ :: std/utilities/template.bitset/bitset.operators/stream_out.pass.cpp
  libc++ :: std/utilities/tuple/tuple.tuple/tuple.assign/copy.pass.cpp
  libc++ :: std/utilities/tuple/tuple.tuple/tuple.creation/tie.pass.cpp
  libc++ :: std/utilities/tuple/tuple.tuple/tuple.elem/get_non_const.pass.cpp
  libc++ :: std/utilities/utility/exchange/exchange.pass.cpp
  libc++ :: std/utilities/variant/variant.variant/variant.assign/T.pass.cpp
  libc++ :: std/utilities/variant/variant.variant/variant.assign/copy.pass.cpp
  libc++ :: support/test.support/make_string_header.pass.cpp


Testing Time: 225.48s
  Unsupported      :  214
  Passed           : 5175
  Expectedly Failed:   49
  Failed           : 1207
FAILED: projects/libcxx/test/CMakeFiles/check-cxx

The failures are caused by link-time `undefined reference` errors like this
one:

 "/usr/bin/ld" -z relro --hash-style=gnu --eh-frame-hdr -m elf_x86_64
-dynamic-linker /lib64/ld-linux-x86-64.so.2 -o
/home/bryanpkc/llvm/main/build/projects/libcxx/projects/libcxx/test/std/utilities/variant/variant.variant/variant.assign/Output/copy.pass.cpp.dir/t.tmp.exe
/usr/lib/x86_64-linux-gnu/crt1.o /usr/lib/x86_64-linux-gnu/crti.o
/usr/lib/gcc/x86_64-linux-gnu/9/crtbegin.o
-L/home/bryanpkc/llvm/main/build/projects/libcxx/./lib
-L/home/bryanpkc/llvm/main/build/projects/libcxx/./lib
-L/usr/lib/gcc/x86_64-linux-gnu/9 -L/lib/x86_64-linux-gnu -L/lib/../lib64
-L/usr/lib/x86_64-linux-gnu -L/home/bryanpkc/llvm/main/install/bin/../lib
-L/lib -L/usr/lib /tmp/copy-35c74a.o -lc++experimental -rpath
/home/bryanpkc/llvm/main/build/projects/libcxx/./lib -rpath
/home/bryanpkc/llvm/main/build/projects/libcxx/./lib -lc++ -lm -lgcc_s -lgcc
-lpthread -lc -lgcc_s -lgcc -latomic /usr/lib/gcc/x86_64-linux-gnu/9/crtend.o
/usr/lib/x86_64-linux-gnu/crtn.o
/tmp/copy-35c74a.o: In function `void
std::__1::__variant_detail::__assignment<std::__1::__variant_detail::__traits<int,
MakeEmptyT, std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > > >::__assign_alt<2ul, std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> >,
std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&>(std::__1::__variant_detail::__alt<2ul,
std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > >&, std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&)':
copy.pass.cpp:(.text._ZNSt3__116__variant_detail12__assignmentINS0_8__traitsIJi10MakeEmptyTNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEEEE12__assign_altILm2ES9_RKS9_EEvRNS0_5__altIXT_ET0_EEOT1_[_ZNSt3__116__variant_detail12__assignmentINS0_8__traitsIJi10MakeEmptyTNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEEEEE12__assign_altILm2ES9_RKS9_EEvRNS0_5__altIXT_ET0_EEOT1_]+0x3c):
undefined reference to `std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char>
<span class="quote">>::operator=(std::__1::basic_string<char, std::__1::char_traits<char>,</span >
std::__1::allocator<char> > const&)'

I can reproduce this on x86_64 Ubuntu 18.04 as well as aarch64 CentOS 7.7.</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>