[llvm-bugs] [Bug 40257] New: Build failure using clang + libstdc++ from gcc 9

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jan 8 16:34:43 PST 2019


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

            Bug ID: 40257
           Summary: Build failure using clang + libstdc++ from gcc 9
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Core LLVM classes
          Assignee: unassignedbugs at nondot.org
          Reporter: romain.geissler at amadeus.com
                CC: llvm-bugs at lists.llvm.org

Hi,

Last October, libstdc++ from gcc 9 added the object relocation as move +
destroy. It seems that this lead to clang bootstrap failure when clang +
libstdc++v3 is used to build llvm. I have build failures like this:

FAILED: lib/Support/CMakeFiles/LLVMSupport.dir/JSON.cpp.o 

/workdir/build/final-system/llvm-build/./bin/clang++  -DGTEST_HAS_RTTI=0
-D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
-D__STDC_LIMIT_MACROS -Ilib/Support -I/workdir/src/llvm-8.0.0/llvm/lib/Support
-Iinclude -I/workdir/src/llvm-8.0.0/llvm/include -O2 -mmmx -msse -msse2 -msse3
-I/workdir/build/final-system/llvm-temporary-static-dependencies/install/include
-I/workdir/build/final-system/llvm-temporary-static-dependencies/install/include/ncursesw
-fPIC -fvisibility-inlines-hidden -Werror=date-time
-Werror=unguarded-availability-new -std=c++11 -Wall -Wextra
-Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers
-pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default
-Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor
-Wstring-conversion -fdiagnostics-color -ffunction-sections -fdata-sections
-fprofile-instr-generate='/workdir/build/final-system/llvm-build/tools/clang/stage2-instrumented-bins/profiles/%4m.profraw'
-flto -O3 -DNDEBUG -fPIC    -fno-exceptions -fno-rtti -MD -MT
lib/Support/CMakeFiles/LLVMSupport.dir/JSON.cpp.o -MF
lib/Support/CMakeFiles/LLVMSupport.dir/JSON.cpp.o.d -o
lib/Support/CMakeFiles/LLVMSupport.dir/JSON.cpp.o -c
/workdir/src/llvm-8.0.0/llvm/lib/Support/JSON.cpp

In file included from /workdir/src/llvm-8.0.0/llvm/lib/Support/JSON.cpp:10:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/Support/JSON.h:47:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/ADT/DenseMap.h:17:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/ADT/DenseMapInfo.h:17:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/ADT/ArrayRef.h:13:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/ADT/Hashing.h:49:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/Support/Host.h:17:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/ADT/StringMap.h:17:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/ADT/StringRef.h:13:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/ADT/STLExtras.h:20:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/ADT/Optional.h:20:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/Support/AlignOf.h:17:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/Support/Compiler.h:20:

In file included from
/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/new:40:

In file included from
/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/exception:144:

In file included from
/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/bits/nested_exception.h:40:

In file included from
/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/bits/move.h:55:

/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/type_traits:667:38:
error: incomplete type 'llvm::json::Value' used in type trait expression

    : public integral_constant<bool, __is_trivial(_Tp)>

                                     ^

/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/bits/stl_uninitialized.h:899:7:
note: in instantiation of template class 'std::is_trivial<llvm::json::Value>'
requested here

    : is_trivial<_Tp> { };

      ^

/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/bits/stl_uninitialized.h:902:31:
note: in instantiation of template class
'std::__is_trivially_relocatable<llvm::json::Value, void>' requested here

    inline __enable_if_t<std::__is_trivially_relocatable<_Tp>::value, _Tp*>

                              ^

/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/bits/stl_uninitialized.h:938:23:
note: while substituting deduced template arguments into function template
'__relocate_a_1' [with _Tp = llvm::json::Value, _Up = llvm::json::Value]

    noexcept(noexcept(__relocate_a_1(std::__niter_base(__first),

                      ^

/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/bits/stl_vector.h:428:11:
note: in instantiation of exception specification for
'__relocate_a<llvm::json::Value *, llvm::json::Value *,
std::allocator<llvm::json::Value> >' requested here

        noexcept(std::__relocate_a(std::declval<pointer>(),

                 ^

/workdir/src/llvm-8.0.0/llvm/include/llvm/Support/JSON.h:153:22: note: in
instantiation of template class 'std::vector<llvm::json::Value,
std::allocator<llvm::json::Value> >' requested here

  std::vector<Value> V;

                     ^

/workdir/src/llvm-8.0.0/llvm/include/llvm/Support/JSON.h:83:7: note: forward
declaration of 'llvm::json::Value'

class Value;

      ^

In file included from /workdir/src/llvm-8.0.0/llvm/lib/Support/JSON.cpp:10:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/Support/JSON.h:47:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/ADT/DenseMap.h:17:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/ADT/DenseMapInfo.h:17:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/ADT/ArrayRef.h:13:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/ADT/Hashing.h:49:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/Support/Host.h:17:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/ADT/StringMap.h:17:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/ADT/StringRef.h:13:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/ADT/STLExtras.h:21:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/ADT/SmallVector.h:17:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/ADT/iterator_range.h:22:

In file included from
/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/iterator:64:

In file included from
/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/ostream:38:

In file included from
/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/ios:42:

In file included from
/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/bits/ios_base.h:41:

In file included from
/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/bits/locale_classes.h:40:

In file included from
/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/string:41:

In file included from
/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/bits/allocator.h:46:

In file included from
/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/x86_64-1a-linux-gnu/bits/c++allocator.h:33:

/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/ext/new_allocator.h:146:8:
error: allocation of incomplete type 'llvm::json::Value'

                            _Up(std::forward<_Args>(__args)...)))

                            ^~~

/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/bits/alloc_traits.h:483:24:
note: in instantiation of exception specification for
'construct<llvm::json::Value, llvm::json::Value>' requested here

        noexcept(noexcept(__a.construct(__p, std::forward<_Args>(__args)...)))

                              ^

/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/bits/stl_uninitialized.h:886:23:
note: in instantiation of exception specification for
'construct<llvm::json::Value, llvm::json::Value>' requested here

    noexcept(noexcept(std::allocator_traits<_Allocator>::construct(__alloc,

                      ^

/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/bits/stl_uninitialized.h:917:23:
note: in instantiation of exception specification for
'__relocate_object_a<llvm::json::Value, llvm::json::Value,
std::allocator<llvm::json::Value> >' requested here

    noexcept(noexcept(std::__relocate_object_a(std::addressof(*__result),

                      ^

/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/bits/stl_uninitialized.h:938:23:
note: in instantiation of exception specification for
'__relocate_a_1<llvm::json::Value *, llvm::json::Value *,
std::allocator<llvm::json::Value> >' requested here

    noexcept(noexcept(__relocate_a_1(std::__niter_base(__first),

                      ^

/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/bits/stl_vector.h:428:11:
note: in instantiation of exception specification for
'__relocate_a<llvm::json::Value *, llvm::json::Value *,
std::allocator<llvm::json::Value> >' requested here

        noexcept(std::__relocate_a(std::declval<pointer>(),

                 ^

/workdir/src/llvm-8.0.0/llvm/include/llvm/Support/JSON.h:153:22: note: in
instantiation of template class 'std::vector<llvm::json::Value,
std::allocator<llvm::json::Value> >' requested here

  std::vector<Value> V;

                     ^

/workdir/src/llvm-8.0.0/llvm/include/llvm/Support/JSON.h:83:7: note: forward
declaration of 'llvm::json::Value'

class Value;

      ^

In file included from /workdir/src/llvm-8.0.0/llvm/lib/Support/JSON.cpp:10:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/Support/JSON.h:47:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/ADT/DenseMap.h:17:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/ADT/DenseMapInfo.h:17:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/ADT/ArrayRef.h:13:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/ADT/Hashing.h:49:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/Support/Host.h:17:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/ADT/StringMap.h:17:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/ADT/StringRef.h:13:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/ADT/STLExtras.h:21:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/ADT/SmallVector.h:17:

In file included from
/workdir/src/llvm-8.0.0/llvm/include/llvm/ADT/iterator_range.h:22:

In file included from
/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/iterator:64:

In file included from
/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/ostream:38:

In file included from
/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/ios:42:

In file included from
/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/bits/ios_base.h:41:

In file included from
/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/bits/locale_classes.h:40:

In file included from
/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/string:41:

In file included from
/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/bits/allocator.h:46:

In file included from
/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/x86_64-1a-linux-gnu/bits/c++allocator.h:33:

/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/ext/new_allocator.h:152:24:
error: member access into incomplete type 'llvm::json::Value'

        noexcept(noexcept( __p->~_Up()))

                              ^

/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/bits/alloc_traits.h:496:24:
note: in instantiation of exception specification for
'destroy<llvm::json::Value>' requested here

        noexcept(noexcept(__a.destroy(__p)))

                              ^

/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/bits/stl_uninitialized.h:888:19:
note: in instantiation of exception specification for
'destroy<llvm::json::Value>' requested here

             && noexcept(std::allocator_traits<_Allocator>::destroy(

                         ^

/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/bits/stl_uninitialized.h:917:23:
note: in instantiation of exception specification for
'__relocate_object_a<llvm::json::Value, llvm::json::Value,
std::allocator<llvm::json::Value> >' requested here

    noexcept(noexcept(std::__relocate_object_a(std::addressof(*__result),

                      ^

/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/bits/stl_uninitialized.h:938:23:
note: in instantiation of exception specification for
'__relocate_a_1<llvm::json::Value *, llvm::json::Value *,
std::allocator<llvm::json::Value> >' requested here

    noexcept(noexcept(__relocate_a_1(std::__niter_base(__first),

                      ^

/opt/1A/toolchain/x86_64-v20.0.0/lib64/gcc/x86_64-1a-linux-gnu/9.0.0/../../../../include/c++/9.0.0/bits/stl_vector.h:428:11:
note: in instantiation of exception specification for
'__relocate_a<llvm::json::Value *, llvm::json::Value *,
std::allocator<llvm::json::Value> >' requested here

        noexcept(std::__relocate_a(std::declval<pointer>(),

                 ^

/workdir/src/llvm-8.0.0/llvm/include/llvm/Support/JSON.h:153:22: note: in
instantiation of template class 'std::vector<llvm::json::Value,
std::allocator<llvm::json::Value> >' requested here

  std::vector<Value> V;

                     ^

/workdir/src/llvm-8.0.0/llvm/include/llvm/Support/JSON.h:83:7: note: forward
declaration of 'llvm::json::Value'

class Value;

      ^

3 errors generated.


I am not sure clang is actually too eager at instantiating templates, or if we
should simply define the class Value before the cass Array in LLVM's JSON.h

Note: when building the same JSON.cpp with gcc trunk, there is no error.

Cheers,
Romain

-- 
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/20190109/0fa13868/attachment-0001.html>


More information about the llvm-bugs mailing list