Skip to content

Update FreeBSD toolchain on dist images #72390

Closed
@nikic

Description

@nikic

During the LLVM 10 update in #67759 we ran into an LLVM build failure on FreeBSD:

In file included from /checkout/src/llvm-project/llvm/tools/llvm-profdata/llvm-profdata.cpp:13:
In file included from /checkout/src/llvm-project/llvm/include/llvm/ADT/SmallSet.h:17:
In file included from /checkout/src/llvm-project/llvm/include/llvm/ADT/SmallPtrSet.h:20:
In file included from /checkout/src/llvm-project/llvm/include/llvm/Support/type_traits.h:18:
/usr/local/x86_64-unknown-freebsd10/usr/include/c++/v1/utility:283:11: error: call to deleted constructor of 'llvm::Error'
        : first(__p.first),
          ^     ~~~~~~~~~
/usr/local/x86_64-unknown-freebsd10/usr/include/c++/v1/memory:1645:31: note: in instantiation of member function 'std::__1::pair<llvm::Error, std::__1::basic_string<char> >::pair' requested here
            ::new((void*)__p) _Up(_VSTD::forward<_Args>(__args)...);
                              ^
/usr/local/x86_64-unknown-freebsd10/usr/include/c++/v1/memory:1572:18: note: in instantiation of function template specialization 'std::__1::allocator<std::__1::pair<llvm::Error, std::__1::basic_string<char> > >::construct<std::__1::pair<llvm::Error, std::__1::basic_string<char> >, const std::__1::pair<llvm::Error, std::__1::basic_string<char> > &>' requested here
            {__a.construct(__p, _VSTD::forward<_Args>(__args)...);}
                 ^
/usr/local/x86_64-unknown-freebsd10/usr/include/c++/v1/memory:1453:14: note: in instantiation of function template specialization 'std::__1::allocator_traits<std::__1::allocator<std::__1::pair<llvm::Error, std::__1::basic_string<char> > > >::__construct<std::__1::pair<llvm::Error, std::__1::basic_string<char> >, const std::__1::pair<llvm::Error, std::__1::basic_string<char> > &>' requested here
            {__construct(__has_construct<allocator_type, _Tp*, _Args...>(),
             ^
/usr/local/x86_64-unknown-freebsd10/usr/include/c++/v1/memory:1535:17: note: in instantiation of function template specialization 'std::__1::allocator_traits<std::__1::allocator<std::__1::pair<llvm::Error, std::__1::basic_string<char> > > >::construct<std::__1::pair<llvm::Error, std::__1::basic_string<char> >, const std::__1::pair<llvm::Error, std::__1::basic_string<char> > &>' requested here
                construct(__a, _VSTD::__to_raw_pointer(__end2-1), _VSTD::move_if_noexcept(*--__end1));
                ^
/usr/local/x86_64-unknown-freebsd10/usr/include/c++/v1/vector:897:21: note: in instantiation of function template specialization 'std::__1::allocator_traits<std::__1::allocator<std::__1::pair<llvm::Error, std::__1::basic_string<char> > > >::__construct_backward<std::__1::pair<llvm::Error, std::__1::basic_string<char> > *>' requested here
    __alloc_traits::__construct_backward(this->__alloc(), this->__begin_, this->__end_, __v.__begin_);
                    ^
/usr/local/x86_64-unknown-freebsd10/usr/include/c++/v1/vector:1635:5: note: in instantiation of member function 'std::__1::vector<std::__1::pair<llvm::Error, std::__1::basic_string<char> >, std::__1::allocator<std::__1::pair<llvm::Error, std::__1::basic_string<char> > > >::__swap_out_circular_buffer' requested here
    __swap_out_circular_buffer(__v);
    ^
/usr/local/x86_64-unknown-freebsd10/usr/include/c++/v1/vector:1654:9: note: in instantiation of function template specialization 'std::__1::vector<std::__1::pair<llvm::Error, std::__1::basic_string<char> >, std::__1::allocator<std::__1::pair<llvm::Error, std::__1::basic_string<char> > > >::__emplace_back_slow_path<llvm::Error, const std::__1::basic_string<char> &>' requested here
        __emplace_back_slow_path(_VSTD::forward<_Args>(__args)...);
        ^
/checkout/src/llvm-project/llvm/tools/llvm-profdata/llvm-profdata.cpp:209:18: note: in instantiation of function template specialization 'std::__1::vector<std::__1::pair<llvm::Error, std::__1::basic_string<char> >, std::__1::allocator<std::__1::pair<llvm::Error, std::__1::basic_string<char> > > >::emplace_back<llvm::Error, const std::__1::basic_string<char> &>' requested here
      WC->Errors.emplace_back(make_error<InstrProfError>(IPE), TestFilename);
                 ^
/checkout/src/llvm-project/llvm/include/llvm/Support/Error.h:186:3: note: 'Error' has been explicitly marked deleted here
  Error(const Error &Other) = delete;
  ^
1 error generated.
make[2]: *** [tools/llvm-profdata/CMakeFiles/llvm-profdata.dir/llvm-profdata.cpp.o] Error 1
make[1]: *** [tools/llvm-profdata/CMakeFiles/llvm-profdata.dir/all] Error 2

This seems to be related to a too old version of libc++.

We work around this with a patch to our LLVM fork in rust-lang/llvm-project@943dbdd.

While we have avoided this particular issue, we still need to update the used FreeBSD version (or possibly just libc++?) to avoid additional problems in the future. The relevant code seems to be: https://github.com/rust-lang/rust/blob/master/src/ci/docker/scripts/freebsd-toolchain.sh.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.O-freebsdOperating system: FreeBSDT-infraRelevant to the infrastructure team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions