Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linking external/v8/bytecode_builtins_list_generator failed: (Exit 1): clang-18 failed #2395

Closed
kpcyrd opened this issue Jul 14, 2024 · 2 comments
Assignees

Comments

@kpcyrd
Copy link

kpcyrd commented Jul 14, 2024

Hello, I noticed the build is currently failing for me with this error message:

[2,451 / 6,330] Compiling src/kj/compat/http.c++; 9s processwrapper-sandbox ... (96 actions, 95 running)
[2,486 / 6,330] Compiling src/kj/compat/http.c++; 10s processwrapper-sandbox ... (96 actions, 95 running)
[2,501 / 6,330] Compiling src/kj/compat/http.c++; 11s processwrapper-sandbox ... (96 actions, 95 running)
[2,544 / 6,330] Compiling src/kj/compat/http.c++; 12s processwrapper-sandbox ... (96 actions, 95 running)
ERROR: /build/.cache/bazel/_bazel_builduser/077e79d00c4526e94c6261bd1a5a8f6e/external/v8/BUILD.bazel:4288:10: Linking external/v8/bytecode_builtins_list_generator failed: (Exit 1): clang-18 failed: error executing CppLink command (from target @@v8//:bytecode_builtins_list_generator) 
  (cd /build/.cache/bazel/_bazel_builduser/077e79d00c4526e94c6261bd1a5a8f6e/sandbox/processwrapper-sandbox/1486/execroot/workerd && \
  exec env - \
    BAZEL_COMPILER=clang \
    BAZEL_LINKLIBS='-l%:libc++.a -l%:libc++abi.a -lm -static-libgcc' \
    CC=clang \
    CXX=clang++ \
    PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/lib/jvm/default/bin \
    PWD=/proc/self/cwd \
    ZERO_AR_DATE=1 \
  /usr/bin/clang-18 @bazel-out/k8-opt/bin/external/v8/bytecode_builtins_list_generator-2.params)
# Configuration: 9ccbeb3a6e14169d95af461e1c01c3712aca0dcc4a9bbc6e08a305a7dbe9dbbf
# Execution platform: @@internal_platforms_do_not_use//host:host

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(hash.cpp.o):DW.ref.__gxx_personality_v0:(.data.DW.ref.__gxx_personality_v0+0x0): error: undefined reference to '__gxx_personality_v0'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(stdexcept.cpp.o):function std::logic_error::logic_error(char const*):(.text._ZNSt11logic_errorC2EPKc+0x1b): error: undefined reference to 'vtable for std::logic_error'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(stdexcept.cpp.o):function std::logic_error::logic_error(char const*):(.text._ZNSt11logic_errorC2EPKc+0x3b): error: undefined reference to 'operator new(unsigned long)'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(stdexcept.cpp.o):function std::logic_error::logic_error(char const*):(.text._ZNSt11logic_errorC2EPKc+0x8f): error: undefined reference to 'std::exception::~exception()'
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(stdexcept.cpp.o):function std::runtime_error::runtime_error(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&):(.text._ZNSt13runtime_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE+0x1b): error: undefined reference to 'vtable for std::runtime_error'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(stdexcept.cpp.o):function std::runtime_error::runtime_error(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&):(.text._ZNSt13runtime_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE+0x49): error: undefined reference to 'operator new(unsigned long)'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(stdexcept.cpp.o):function std::runtime_error::runtime_error(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&):(.text._ZNSt13runtime_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE+0x9d): error: undefined reference to 'std::exception::~exception()'
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(stdexcept.cpp.o):function std::runtime_error::runtime_error(char const*):(.text._ZNSt13runtime_errorC2EPKc+0x1b): error: undefined reference to 'vtable for std::runtime_error'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(stdexcept.cpp.o):function std::runtime_error::runtime_error(char const*):(.text._ZNSt13runtime_errorC2EPKc+0x3b): error: undefined reference to 'operator new(unsigned long)'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(stdexcept.cpp.o):function std::runtime_error::runtime_error(char const*):(.text._ZNSt13runtime_errorC2EPKc+0x8f): error: undefined reference to 'std::exception::~exception()'
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(stdexcept.cpp.o):function std::__1::__throw_runtime_error(char const*):(.text._ZNSt3__121__throw_runtime_errorEPKc+0x14): error: undefined reference to '__cxa_allocate_exception'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(stdexcept.cpp.o):function std::__1::__throw_runtime_error(char const*):(.text._ZNSt3__121__throw_runtime_errorEPKc+0x2a): error: undefined reference to 'typeinfo for std::runtime_error'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(stdexcept.cpp.o):function std::__1::__throw_runtime_error(char const*):(.text._ZNSt3__121__throw_runtime_errorEPKc+0x31): error: undefined reference to 'std::runtime_error::~runtime_error()'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(stdexcept.cpp.o):function std::__1::__throw_runtime_error(char const*):(.text._ZNSt3__121__throw_runtime_errorEPKc+0x39): error: undefined reference to '__cxa_throw'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(stdexcept.cpp.o):function std::__1::__throw_runtime_error(char const*):(.text._ZNSt3__121__throw_runtime_errorEPKc+0x48): error: undefined reference to '__cxa_free_exception'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(string.cpp.o):function std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string():(.text._ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev+0x16): error: undefined reference to 'operator delete(void*)'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(string.cpp.o):function std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__assign_external(char const*, unsigned long):(.text._ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17__assign_externalEPKcm+0xf2): error: undefined reference to 'operator new(unsigned long)'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(string.cpp.o):function std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__assign_external(char const*, unsigned long):(.text._ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE17__assign_externalEPKcm+0x115): error: undefined reference to 'operator delete(void*)'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(string.cpp.o):function std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::append(char const*, unsigned long):(.text._ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcm+0x13f): error: undefined reference to 'operator delete(void*)'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(string.cpp.o):function std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::push_back(char):(.text._ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc+0x107): error: undefined reference to 'operator delete(void*)'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.cpp.o):function std::__1::__throw_failure[abi:ne180100](char const*):(.text._ZNSt3__115__throw_failureB8ne180100EPKc+0x25): error: undefined reference to '__cxa_allocate_exception'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.cpp.o):function std::__1::__throw_failure[abi:ne180100](char const*):(.text._ZNSt3__115__throw_failureB8ne180100EPKc+0x7a): error: undefined reference to '__cxa_throw'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.cpp.o):function std::__1::__throw_failure[abi:ne180100](char const*):(.text._ZNSt3__115__throw_failureB8ne180100EPKc+0x87): error: undefined reference to '__cxa_guard_acquire'
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.cpp.o):function std::__1::__throw_failure[abi:ne180100](char const*):(.text._ZNSt3__115__throw_failureB8ne180100EPKc+0x98): error: undefined reference to '__cxa_guard_release'
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.cpp.o):function std::__1::__throw_failure[abi:ne180100](char const*):(.text._ZNSt3__115__throw_failureB8ne180100EPKc+0xa9): error: undefined reference to '__cxa_free_exception'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.cpp.o):function std::__1::ios_base::__set_badbit_and_consider_rethrow():(.text._ZNSt3__18ios_base33__set_badbit_and_consider_rethrowEv+0x14): error: undefined reference to '__cxa_rethrow'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.cpp.o):vtable for std::__1::ios_base::failure:(.data.rel.ro._ZTVNSt3__18ios_base7failureE+0x20): error: undefined reference to 'std::runtime_error::what() const'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.cpp.o):typeinfo for std::__1::ios_base:(.data.rel.ro._ZTINSt3__18ios_baseE+0x0): error: undefined reference to 'vtable for __cxxabiv1::__class_type_info'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.cpp.o):typeinfo for std::__1::ios_base::failure:(.data.rel.ro._ZTINSt3__18ios_base7failureE+0x0): error: undefined reference to 'vtable for __cxxabiv1::__si_class_type_info'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.cpp.o):typeinfo for std::__1::__iostream_category:(.data.rel.ro._ZTINSt3__119__iostream_categoryE+0x0): error: undefined reference to 'vtable for __cxxabiv1::__si_class_type_info'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):function std::__1::basic_ostream<char, std::__1::char_traits<char> >::flush():(.text._ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5flushEv+0xb3): error: undefined reference to '__cxa_begin_catch'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):function std::__1::basic_ostream<char, std::__1::char_traits<char> >::flush():(.text._ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5flushEv+0xc8): error: undefined reference to '__cxa_end_catch'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):function std::__1::basic_ostream<char, std::__1::char_traits<char> >::flush():(.text._ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE5flushEv+0xe8): error: undefined reference to '__cxa_end_catch'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):function std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::~sentry():(.text._ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD2Ev+0x7e): error: undefined reference to '__cxa_begin_catch'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):function std::__1::basic_ostream<char, std::__1::char_traits<char> >::sentry::~sentry():(.text._ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEE6sentryD2Ev+0x83): error: undefined reference to '__cxa_end_catch'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):function std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(int):(.text._ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEi+0x198): error: undefined reference to '__cxa_begin_catch'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):function std::__1::basic_ostream<char, std::__1::char_traits<char> >::operator<<(int):(.text._ZNSt3__113basic_ostreamIcNS_11char_traitsIcEEElsEi+0x1ad): error: undefined reference to '__cxa_end_catch'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):function std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >::flush():(.text._ZNSt3__113basic_ostreamIwNS_11char_traitsIwEEE5flushEv+0xb3): error: undefined reference to '__cxa_begin_catch'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):function std::__1::basic_filebuf<char, std::__1::char_traits<char> >::~basic_filebuf():(.text._ZNSt3__113basic_filebufIcNS_11char_traitsIcEEED2Ev+0x62): error: undefined reference to 'operator delete[](void*)'
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):function std::__1::basic_filebuf<char, std::__1::char_traits<char> >::~basic_filebuf():(.text._ZNSt3__113basic_filebufIcNS_11char_traitsIcEEED2Ev+0x7a): error: undefined reference to 'operator delete[](void*)'
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):function std::__1::__throw_bad_cast[abi:ne180100]():(.text._ZNSt3__116__throw_bad_castB8ne180100Ev+0x10): error: undefined reference to '__cxa_allocate_exception'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):function std::__1::__throw_bad_cast[abi:ne180100]():(.text._ZNSt3__116__throw_bad_castB8ne180100Ev+0x1c): error: undefined reference to 'std::bad_cast::bad_cast()'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):function std::__1::__throw_bad_cast[abi:ne180100]():(.text._ZNSt3__116__throw_bad_castB8ne180100Ev+0x23): error: undefined reference to 'typeinfo for std::bad_cast'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):function std::__1::__throw_bad_cast[abi:ne180100]():(.text._ZNSt3__116__throw_bad_castB8ne180100Ev+0x2a): error: undefined reference to 'std::bad_cast::~bad_cast()'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):function std::__1::__throw_bad_cast[abi:ne180100]():(.text._ZNSt3__116__throw_bad_castB8ne180100Ev+0x32): error: undefined reference to '__cxa_throw'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):function std::__1::basic_filebuf<char, std::__1::char_traits<char> >::setbuf(char*, long):(.text._ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE6setbufEPcl+0x3b): error: undefined reference to 'operator delete[](void*)'
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):function std::__1::basic_filebuf<char, std::__1::char_traits<char> >::setbuf(char*, long):(.text._ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE6setbufEPcl+0x53): error: undefined reference to 'operator delete[](void*)'
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):function std::__1::basic_filebuf<char, std::__1::char_traits<char> >::setbuf(char*, long):(.text._ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE6setbufEPcl+0xc3): error: undefined reference to 'operator new[](unsigned long)'
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):function std::__1::basic_filebuf<char, std::__1::char_traits<char> >::setbuf(char*, long):(.text._ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE6setbufEPcl+0x102): error: undefined reference to 'operator new[](unsigned long)'
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):function std::__1::basic_filebuf<char, std::__1::char_traits<char> >::imbue(std::__1::locale const&):(.text._ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE5imbueERKNS_6localeE+0xb5): error: undefined reference to 'operator new[](unsigned long)'
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):function std::__1::basic_filebuf<char, std::__1::char_traits<char> >::imbue(std::__1::locale const&):(.text._ZNSt3__113basic_filebufIcNS_11char_traitsIcEEE5imbueERKNS_6localeE+0xeb): error: undefined reference to 'operator new[](unsigned long)'
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):typeinfo for std::__1::basic_ios<char, std::__1::char_traits<char> >:(.data.rel.ro._ZTINSt3__19basic_iosIcNS_11char_traitsIcEEEE+0x0): error: undefined reference to 'vtable for __cxxabiv1::__si_class_type_info'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):typeinfo for std::__1::basic_streambuf<char, std::__1::char_traits<char> >:(.data.rel.ro._ZTINSt3__115basic_streambufIcNS_11char_traitsIcEEEE+0x0): error: undefined reference to 'vtable for __cxxabiv1::__class_type_info'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):typeinfo for std::__1::basic_istream<char, std::__1::char_traits<char> >:(.data.rel.ro._ZTINSt3__113basic_istreamIcNS_11char_traitsIcEEEE+0x0): error: undefined reference to 'vtable for __cxxabiv1::__vmi_class_type_info'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):typeinfo for std::__1::basic_ostream<char, std::__1::char_traits<char> >:(.data.rel.ro._ZTINSt3__113basic_ostreamIcNS_11char_traitsIcEEEE+0x0): error: undefined reference to 'vtable for __cxxabiv1::__vmi_class_type_info'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):typeinfo for std::__1::basic_ios<wchar_t, std::__1::char_traits<wchar_t> >:(.data.rel.ro._ZTINSt3__19basic_iosIwNS_11char_traitsIwEEEE+0x0): error: undefined reference to 'vtable for __cxxabiv1::__si_class_type_info'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):typeinfo for std::__1::basic_streambuf<wchar_t, std::__1::char_traits<wchar_t> >:(.data.rel.ro._ZTINSt3__115basic_streambufIwNS_11char_traitsIwEEEE+0x0): error: undefined reference to 'vtable for __cxxabiv1::__class_type_info'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):typeinfo for std::__1::basic_istream<wchar_t, std::__1::char_traits<wchar_t> >:(.data.rel.ro._ZTINSt3__113basic_istreamIwNS_11char_traitsIwEEEE+0x0): error: undefined reference to 'vtable for __cxxabiv1::__vmi_class_type_info'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(ios.instantiations.cpp.o):typeinfo for std::__1::basic_ostream<wchar_t, std::__1::char_traits<wchar_t> >:(.data.rel.ro._ZTINSt3__113basic_ostreamIwNS_11char_traitsIwEEEE+0x0): error: undefined reference to 'vtable for __cxxabiv1::__vmi_class_type_info'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(iostream.cpp.o):function std::__1::ios_base::Init::Init():(.text._ZNSt3__18ios_base4InitC2Ev+0x25): error: undefined reference to '__cxa_guard_acquire'
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(iostream.cpp.o):function std::__1::ios_base::Init::Init():(.text._ZNSt3__18ios_base4InitC2Ev+0x5c): error: undefined reference to '__cxa_guard_release'
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(iostream.cpp.o):function std::__1::ios_base::Init::Init():(.text._ZNSt3__18ios_base4InitC2Ev+0x70): error: undefined reference to '__cxa_guard_abort'
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(locale.cpp.o):function std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::do_get(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, void*&) const:(.text._ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv+0x4ff): error: undefined reference to '__cxa_guard_acquire'
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(locale.cpp.o):function std::__1::num_get<char, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> > >::do_get(std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::istreambuf_iterator<char, std::__1::char_traits<char> >, std::__1::ios_base&, unsigned int&, void*&) const:(.text._ZNKSt3__17num_getIcNS_19istreambuf_iteratorIcNS_11char_traitsIcEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv+0x52f): error: undefined reference to '__cxa_guard_release'
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(locale.cpp.o):function std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_get(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, void*&) const:(.text._ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv+0x578): error: undefined reference to '__cxa_guard_acquire'
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(locale.cpp.o):function std::__1::num_get<wchar_t, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> > >::do_get(std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::istreambuf_iterator<wchar_t, std::__1::char_traits<wchar_t> >, std::__1::ios_base&, unsigned int&, void*&) const:(.text._ZNKSt3__17num_getIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEE6do_getES4_S4_RNS_8ios_baseERjRPv+0x5a8): error: undefined reference to '__cxa_guard_release'
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(locale.cpp.o):function std::__1::locale::classic():(.text._ZNSt3__16locale7classicEv+0x6e): error: undefined reference to '__cxa_guard_abort'
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(locale.cpp.o):function std::__1::locale::locale():(.text._ZNSt3__16localeC2Ev+0x7f): error: undefined reference to '__cxa_guard_abort'
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(locale.cpp.o):function std::__1::__time_get_c_storage<wchar_t>::__weeks() const:(.text._ZNKSt3__120__time_get_c_storageIwE7__weeksEv+0x66): error: undefined reference to '__cxa_guard_abort'
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(locale.cpp.o):typeinfo for std::__1::ctype_base:(.data.rel.ro._ZTINSt3__110ctype_baseE+0x0): error: undefined reference to 'vtable for __cxxabiv1::__class_type_info'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
/usr/bin/ld.gold: the symbol should have been defined by a plugin
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(exception.cpp.o):function std::uncaught_exception():(.text._ZSt18uncaught_exceptionv+0xa): error: undefined reference to '__cxa_uncaught_exceptions'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(new_helpers.cpp.o):function std::__throw_bad_alloc():(.text._ZSt17__throw_bad_allocv+0x10): error: undefined reference to '__cxa_allocate_exception'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(new_helpers.cpp.o):function std::__throw_bad_alloc():(.text._ZSt17__throw_bad_allocv+0x1c): error: undefined reference to 'std::bad_alloc::bad_alloc()'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(new_helpers.cpp.o):function std::__throw_bad_alloc():(.text._ZSt17__throw_bad_allocv+0x23): error: undefined reference to 'typeinfo for std::bad_alloc'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(new_helpers.cpp.o):function std::__throw_bad_alloc():(.text._ZSt17__throw_bad_allocv+0x2a): error: undefined reference to 'std::bad_alloc::~bad_alloc()'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(new_helpers.cpp.o):function std::__throw_bad_alloc():(.text._ZSt17__throw_bad_allocv+0x32): error: undefined reference to '__cxa_throw'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(system_error.cpp.o):function std::__1::system_error::~system_error():(.text._ZNSt3__112system_errorD2Ev+0xb): error: undefined reference to 'std::runtime_error::~runtime_error()'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(system_error.cpp.o):vtable for std::__1::system_error:(.data.rel.ro._ZTVNSt3__112system_errorE+0x20): error: undefined reference to 'std::runtime_error::what() const'
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../lib64/libc++.a(system_error.cpp.o):typeinfo for std::__1::system_error:(.data.rel.ro._ZTINSt3__112system_errorE+0x10): error: undefined reference to 'typeinfo for std::runtime_error'
/tmp/lto-llvm-9e3311.o:generate-bytecodes-builtins-list.cc:function __clang_call_terminate:(.text.__clang_call_terminate+0xa): error: undefined reference to 'std::terminate()'
/tmp/lto-llvm-e2fabe.o:bytecodes.cc:function std::__1::__throw_length_error[abi:ne180100](char const*):(.text._ZNSt3__120__throw_length_errorB8ne180100EPKc+0x25): error: undefined reference to 'typeinfo for std::length_error'
/tmp/lto-llvm-e2fabe.o:bytecodes.cc:function std::__1::__throw_length_error[abi:ne180100](char const*):(.text._ZNSt3__120__throw_length_errorB8ne180100EPKc+0x2c): error: undefined reference to 'std::length_error::~length_error()'
/tmp/lto-llvm-e2fabe.o:bytecodes.cc:function std::__1::__throw_length_error[abi:ne180100](char const*):(.text._ZNSt3__120__throw_length_errorB8ne180100EPKc+0x3f): error: undefined reference to '__cxa_free_exception'
/tmp/lto-llvm-e2fabe.o:bytecodes.cc:function std::length_error::length_error[abi:ne180100](char const*):(.text._ZNSt12length_errorC2B8ne180100EPKc+0x11): error: undefined reference to 'vtable for std::length_error'
/usr/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
/tmp/lto-llvm-7eb919.o:random-number-generator.cc:function std::__throw_bad_array_new_length[abi:ne180100]():(.text._ZSt28__throw_bad_array_new_lengthB8ne180100v+0x17): error: undefined reference to 'std::bad_array_new_length::bad_array_new_length()'
/tmp/lto-llvm-7eb919.o:random-number-generator.cc:function std::__throw_bad_array_new_length[abi:ne180100]():(.text._ZSt28__throw_bad_array_new_lengthB8ne180100v+0x1e): error: undefined reference to 'typeinfo for std::bad_array_new_length'
/tmp/lto-llvm-7eb919.o:random-number-generator.cc:function std::__throw_bad_array_new_length[abi:ne180100]():(.text._ZSt28__throw_bad_array_new_lengthB8ne180100v+0x25): error: undefined reference to 'std::bad_array_new_length::~bad_array_new_length()'
clang-18: error: linker command failed with exit code 1 (use -v to see invocation)
Target //src/workerd/server:workerd failed to build
INFO: Elapsed time: 76.822s, Critical Path: 13.72s
INFO: 2658 processes: 1247 internal, 98 local, 1313 processwrapper-sandbox.
ERROR: Build did NOT complete successfully

The build command I use is this:

  bazel build \
    --config=thin-lto \
    --action_env=BAZEL_LINKLIBS='-l%:libc++.a -l%:libc++abi.a -lm -static-libgcc' \
    //src/workerd/server:workerd

Input very welcome :)

@fhanau
Copy link
Collaborator

fhanau commented Jul 14, 2024

Several ideas:

  • This will not have caused the issues here but it is highly recommended to link using lld (e.g. package lld-18 on Ubuntu). Linking with the gold linker should also be supported but is slower, you may need to use bazel clean --expunge for bazel to reconfigure the toolchain afterwards.
  • Clearly something is going wrong here with libc++ – we recently changed how static linkage of libc++ is being managed. Note that BAZEL_LINKLIBS may be ignored at present as we pass --features=-default_link_libs to facilitate statically linking libc++, which bazel does not support well otherwise.
  • I'm not entirely sure what the underlying issue is, might be using clang instead of clang++ or an issue with linking libc++abi. First I would recommend installing libunwind-18 libc++abi1-18 libc++1-18 libc++-18-dev to ensure there's no missing packages.
  • The most promising thing to try is linking with libc++ dynamically as a workaround. Assuming that dynamic libc++ is installed, try commenting out the build:linux --linkopt='-l:libc++.a' --linkopt='-lm' --linkopt='-static-libgcc'
    build:linux --host_linkopt='-l:libc++.a' --host_linkopt='-lm' lines in .bazelrc to avoid static linkage and replace them with the simpler build:linux --linkopt='-lc++' --linkopt='-lm' --host_linkopt='-lc++' --host_linkopt='-lm'.

@fhanau fhanau self-assigned this Jul 14, 2024
@kpcyrd
Copy link
Author

kpcyrd commented Jul 19, 2024

Thanks, I got it to work with this command:

  bazel build \
    --config=thin-lto \
    --linkopt='-lc++' --linkopt='-lm' --host_linkopt='-lc++' --host_linkopt='-lm' \
    //src/workerd/server:workerd

https://gitlab.archlinux.org/archlinux/packaging/packages/workerd/-/commit/f535d641d59539596b45ec92e96995c9e2624011

@kpcyrd kpcyrd closed this as completed Jul 19, 2024
@cloudflare cloudflare deleted a comment from AungThuSoe24 Jul 20, 2024
@cloudflare cloudflare deleted a comment from AungThuSoe24 Jul 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@kpcyrd @fhanau and others