[llvm-bugs] [Bug 50534] New: 'check-cxx' fails with undefined reference errors when assertions are enabled

via llvm-bugs llvm-bugs at lists.llvm.org
Sun May 30 12:01:29 PDT 2021


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

            Bug ID: 50534
           Summary: 'check-cxx' fails with undefined reference errors when
                    assertions are enabled
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: bryanpkc at gmail.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

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>
>::operator=(std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&)'

I can reproduce this on x86_64 Ubuntu 18.04 as well as aarch64 CentOS 7.7.

-- 
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/20210530/db285048/attachment.html>


More information about the llvm-bugs mailing list