bblanchon / pdfium-binaries

📰 Binary distribution of PDFium
908 stars 195 forks source link

Musl build issue #129

Closed jerbob92 closed 1 year ago

jerbob92 commented 1 year ago

Hi,

I'm trying to use the musl build in a Docker image, but when I want to compile against the musl binary, I get the following errors:

#14 8.180 /usr/lib/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::ostream::tellp()@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::chrono::_V2::steady_clock::now()@GLIBCXX_3.4.19'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `__dynamic_cast@CXXABI_1.3'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__once_call@GLIBCXX_3.4.11'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__throw_logic_error(char const*)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::reserve(unsigned long)@GLIBCXX_3.4.21'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::locale::~locale()@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__throw_bad_array_new_length()@GLIBCXX_3.4.29'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::swap(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)@GLIBCXX_3.4.21'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::basic_streambuf<char, std::char_traits<char> >::seekoff(long, std::_Ios_Seekdir, std::_Ios_Openmode)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `vtable for __cxxabiv1::__si_class_type_info@CXXABI_1.3'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::basic_ios<char, std::char_traits<char> >::_M_cache_locale(std::locale const&)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `__once_proxy@GLIBCXX_3.4.11'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `operator new[](unsigned long)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `vtable for std::basic_ifstream<char, std::char_traits<char> >@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `vtable for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::basic_streambuf<char, std::char_traits<char> >::underflow()@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::ctype<char>::_M_widen_init() const@GLIBCXX_3.4.11'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::locale::operator=(std::locale const&)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::_Rb_tree_decrement(std::_Rb_tree_node_base const*)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::condition_variable::notify_one()@GLIBCXX_3.4.11'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::ios_base::Init::~Init()@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::ostream::flush()@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `vtable for __cxxabiv1::__class_type_info@CXXABI_1.3'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::locale::locale()@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::chrono::_V2::system_clock::now()@GLIBCXX_3.4.19'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `VTT for std::basic_ifstream<char, std::char_traits<char> >@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::_Hash_bytes(void const*, unsigned long, unsigned long)@CXXABI_1.3.5'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::resize(unsigned long, char)@GLIBCXX_3.4.21'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::ostream& std::ostream::_M_insert<long long>(long long)@GLIBCXX_3.4.9'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `vtable for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::ostream::write(char const*, long)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__detail::_Prime_rehash_policy::_M_need_rehash(unsigned long, unsigned long, unsigned long) const@GLIBCXX_3.4.18'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::basic_ios<char, std::char_traits<char> >::rdbuf(std::basic_streambuf<char, std::char_traits<char> >*)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::ostream& std::ostream::_M_insert<unsigned long>(unsigned long)@GLIBCXX_3.4.9'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base const*)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::ios_base::~ios_base()@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::basic_streambuf<char, std::char_traits<char> >::setbuf(char*, long)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::condition_variable::notify_all()@GLIBCXX_3.4.11'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::ostream::operator<<(short)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__once_callable@GLIBCXX_3.4.11'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `VTT for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__basic_file<char>::~__basic_file()@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `__cxa_guard_acquire@CXXABI_1.3'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::ostream& std::ostream::_M_insert<bool>(bool)@GLIBCXX_3.4.9'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `vtable for std::basic_ios<char, std::char_traits<char> >@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `vtable for std::basic_filebuf<char, std::char_traits<char> >@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `operator delete[](void*)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::ios_base::_M_swap(std::ios_base&)@GLIBCXX_3.4.21'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(char const*) const@GLIBCXX_3.4.21'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::basic_filebuf<char, std::char_traits<char> >::close()@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `operator new(unsigned long)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::basic_streambuf<char, std::char_traits<char> >::showmanyc()@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::ostream::put(char)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__throw_bad_alloc()@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::basic_streambuf<char, std::char_traits<char> >::imbue(std::locale const&)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base*)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_erase(unsigned long, unsigned long)@GLIBCXX_3.4.21'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::ios_base::Init::Init()@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::condition_variable::condition_variable()@GLIBCXX_3.4.11'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::basic_filebuf<char, std::char_traits<char> >::basic_filebuf()@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::nothrow@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(unsigned long, unsigned long, char const*) const@GLIBCXX_3.4.21'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::cerr@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::basic_streambuf<char, std::char_traits<char> >::sync()@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::basic_streambuf<char, std::char_traits<char> >::pbackfail(int)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_mutate(unsigned long, unsigned long, char const*, unsigned long)@GLIBCXX_3.4.21'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)@GLIBCXX_3.4.15'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__detail::_List_node_base::_M_unhook()@GLIBCXX_3.4.15'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::locale::locale(std::locale const&)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::basic_ostream<wchar_t, std::char_traits<wchar_t> >::write(wchar_t const*, long)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::thread::hardware_concurrency()@GLIBCXX_3.4.17'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::exception::~exception()@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__basic_file<char>::is_open() const@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `operator new(unsigned long, std::nothrow_t const&)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::terminate()@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_append(char const*, unsigned long)@GLIBCXX_3.4.21'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::basic_streambuf<char, std::char_traits<char> >::overflow(int)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `vtable for std::ostream@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::basic_ios<char, std::char_traits<char> >::init(std::basic_streambuf<char, std::char_traits<char> >*)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_dispose()@GLIBCXX_3.4.21'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__throw_bad_cast()@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::basic_ios<char, std::char_traits<char> >::clear(std::_Ios_Iostate)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::ostream::operator<<(int)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `operator delete(void*, unsigned long)@CXXABI_1.3.9'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `VTT for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)@GLIBCXX_3.4.20'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::ostream& std::ostream::_M_insert<long>(long)@GLIBCXX_3.4.9'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::basic_streambuf<char, std::char_traits<char> >::uflow()@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long)@GLIBCXX_3.4.9'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::basic_streambuf<char, std::char_traits<char> >::seekpos(std::fpos<__mbstate_t>, std::_Ios_Openmode)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::ostream& std::ostream::_M_insert<unsigned long long>(unsigned long long)@GLIBCXX_3.4.9'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::basic_streambuf<char, std::char_traits<char> >::xsputn(char const*, long)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::condition_variable::wait(std::unique_lock<std::mutex>&)@GLIBCXX_3.4.11'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::push_back(char)@GLIBCXX_3.4.21'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__throw_bad_function_call()@GLIBCXX_3.4.14'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::basic_istream<char, std::char_traits<char> >& std::getline<char, std::char_traits<char>, std::allocator<char> >(std::basic_istream<char, std::char_traits<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, char)@GLIBCXX_3.4.21'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::ostream& std::ostream::_M_insert<void const*>(void const*)@GLIBCXX_3.4.9'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `vtable for std::basic_streambuf<char, std::char_traits<char> >@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)@GLIBCXX_3.4.21'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::basic_streambuf<char, std::char_traits<char> >::xsgetn(char*, long)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct(unsigned long, char)@GLIBCXX_3.4.21'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::basic_filebuf<char, std::char_traits<char> >::open(char const*, std::_Ios_Openmode)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::condition_variable::~condition_variable()@GLIBCXX_3.4.11'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::ios_base::ios_base()@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `vtable for __cxxabiv1::__vmi_class_type_info@CXXABI_1.3'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__throw_length_error(char const*)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__throw_system_error(int)@GLIBCXX_3.4.11'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::ostream& std::ostream::_M_insert<double>(double)@GLIBCXX_3.4.9'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::basic_streambuf<char, std::char_traits<char> >::operator=(std::basic_streambuf<char, std::char_traits<char> > const&)@GLIBCXX_3.4'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)@GLIBCXX_3.4.21'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `__cxa_guard_release@CXXABI_1.3'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace_aux(unsigned long, unsigned long, unsigned long, char)@GLIBCXX_3.4.21'
#14 8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::_Rb_tree_decrement(std::_Rb_tree_node_base*)@GLIBCXX_3.4'
#14 8.180 collect2: error: ld returned 1 exit status
#14 8.180 
#14 ERROR: process "/bin/sh -c CGO_ENABLED=1 GOOS=linux go build -o bin/pdfium worker/main.go" did not complete successfully: exit code: 1
------
 > [10/10] RUN CGO_ENABLED=1 GOOS=linux go build -o bin/pdfium worker/main.go:
8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__throw_length_error(char const*)@GLIBCXX_3.4'
8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__throw_system_error(int)@GLIBCXX_3.4.11'
8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::ostream& std::ostream::_M_insert<double>(double)@GLIBCXX_3.4.9'
8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::basic_streambuf<char, std::char_traits<char> >::operator=(std::basic_streambuf<char, std::char_traits<char> > const&)@GLIBCXX_3.4'
8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)@GLIBCXX_3.4.21'
8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `__cxa_guard_release@CXXABI_1.3'
8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace_aux(unsigned long, unsigned long, unsigned long, char)@GLIBCXX_3.4.21'
8.180 /usr/lib/gcc/x86_64-alpine-linux-musl/13.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/pdfium/lib/libpdfium.so: undefined reference to `std::_Rb_tree_decrement(std::_Rb_tree_node_base*)@GLIBCXX_3.4'
8.180 collect2: error: ld returned 1 exit status

This makes me wonder if the musl build is actually a musl build, looking at the glibc references.

bblanchon commented 1 year ago

Hi @jerbob92,

I wonder if it could come from e530f1eb92b30e414e787a2adfa6f95e10a7b9d0. Unfortunately, I could not find the reason for this change; I wish I documented it somewhere.

Could you try with use_custom_libcxx set to true?

Best regards, Benoit

jerbob92 commented 1 year ago

@bblanchon just tried and you can't compile with use_custom_libcxx=true, it results in a bunch of errors while compiling libc++ and the following warning:

WARNING at build arg file (use "gn args <out_dir>" to edit):11:22: Build argument has no effect.
use_allocator_shim = false
                     ^----
The variable "use_allocator_shim" was set as a build argument
but never appeared in a declare_args() block in any buildfile.
jerbob92 commented 1 year ago

I tried to build branch chromium/5092, but for some reason that didn't work at all, so I can't validate if it worked before the change of use_custom_libcxx.

jerbob92 commented 1 year ago

I tried to use the latest libc++ but that resulted in a bunch more/different errors so I wonder if it's supposed to build with musl, it does have the options _LIBCPP_HAS_MUSL_LIBC and LIBCXX_HAS_MUSL_LIBC

jerbob92 commented 1 year ago

I think use_custom_libcxx should be kept to false, if you put it to true it will try to compile libc++ (from LLVM) with musl, which seems problematic. This should not be necessary because the cross-compile kit from musl comes with a C++ compiler. I have not found out yet where these symbols are coming from though...

jerbob92 commented 1 year ago

Possible fix in #130

jerbob92 commented 1 year ago

@bblanchon We do have to check if this gives the expected result though. I'm not completely sure we're not just embedding the host libraries statically now :thinking: