Closed neptoess closed 3 years ago
I tested this (without vendoring) and confirm the same error 😞 Interesting that the CI tests still pass on the github action linux machine 🤔 Will take a closer look to see what I can find.
@rogchap I noticed the GitHub Action build is using clang++ on Ubuntu, while cgo uses g++, and the golang Docker Hub image is based on Debian. I would think everything should be compatible, but it appears that’s not the case.
@neptoess There must have been some linker issues introduced to clang somewhere recently! 😞 I built v8 locally with g++ and it now runs fine on Docker/Debian.
@rogchap can we get a newer tag, e.g. v0.3.1, so we can get the updated static build when using go modules?
Sorry for the delay @neptoess. Was hoping to get #59 finished before the next version release. But with the holidays, have not finished it yet. Are you able to wait a "little" longer, or is this a blocker for you?
A little longer is fine
@neptoess This has been released in v0.4.0: https://github.com/rogchap/v8go/releases/tag/v0.4.0
@rogchap hello, I compiled v8go on debian 8, it seems failed
Do I need to compile v8 on debian 8 and refer to myself compiled libv8.a?
Hmmm 🤔 should work without compiling yourself. Are you using master branch rather than a regular release of v8go?
@robfig This error reappear after the merge of #102
The commit 6941971d1ef4e72fd4461c57ef3b21fdbba22007 changes the libv8.a for Linux x86_64
@cleiner Could you please have a look about this?
@kuoruan When I re-run the example program shown in the original issue with v0.5.1, I get no errors. Can you please open a new issue (feel free to reference this one in it) with details about what you're trying to build / run and the exact output you're seeing?
EDIT:
Running against the latest commit in master does indeed cause the error to return. My best guess is that this can be fixed by rebuilding deps/linux_x86_64/libv8.a
(or at least reverting the one that was committed in @cleiner 's PR)
#7 113.6 go: downloading rogchap.com/v8go v0.5.2-0.20210410040105-4c18ca58a475
#7 125.7 # rogchap.com/v8go
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(objects.o): in function `std::_Sp_counted_ptr_inplace<v8::internal::wasm::GlobalWasmCodeRef, std::allocator<v8::internal::wasm::GlobalWasmCodeRef>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
#7 125.7 objects.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88internal4wasm17GlobalWasmCodeRefESaIS3_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88internal4wasm17GlobalWasmCodeRefESaIS3_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x1f): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(wasm-engine.o): in function `std::_Sp_counted_ptr_inplace<v8::internal::OperationsBarrier, std::allocator<v8::internal::OperationsBarrier>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
#7 125.7 wasm-engine.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88internal17OperationsBarrierESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88internal17OperationsBarrierESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x1f): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(wasm-engine.o): in function `std::_Sp_counted_ptr_inplace<v8::internal::wasm::WasmEngine, std::allocator<v8::internal::wasm::WasmEngine>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
#7 125.7 wasm-engine.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88internal4wasm10WasmEngineESaIS3_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88internal4wasm10WasmEngineESaIS3_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x1f): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(streaming-decoder.o): in function `std::_Sp_counted_ptr_inplace<v8::internal::wasm::AsyncStreamingDecoder::SectionBuffer, std::allocator<v8::internal::wasm::AsyncStreamingDecoder::SectionBuffer>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
#7 125.7 streaming-decoder.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88internal4wasm21AsyncStreamingDecoder13SectionBufferESaIS4_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88internal4wasm21AsyncStreamingDecoder13SectionBufferESaIS4_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x1f): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(marker.o): in function `std::_Sp_counted_ptr_inplace<bool, std::allocator<bool>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
#7 125.7 marker.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIbSaIbELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIbSaIbELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x1f): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(isolate.o):isolate.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88internal8CountersESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88internal8CountersESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x1f): more undefined references to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)' follow
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(verifier.o): in function `v8::internal::compiler::Verifier::Visitor::Check(v8::internal::compiler::Node*, v8::internal::compiler::AllNodes const&)':
#7 125.7 verifier.cc:(.text._ZN2v88internal8compiler8Verifier7Visitor5CheckEPNS1_4NodeERKNS1_8AllNodesE+0x4e7): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: verifier.cc:(.text._ZN2v88internal8compiler8Verifier7Visitor5CheckEPNS1_4NodeERKNS1_8AllNodesE+0x89d): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: verifier.cc:(.text._ZN2v88internal8compiler8Verifier7Visitor5CheckEPNS1_4NodeERKNS1_8AllNodesE+0xd1c): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(cpp-heap.o): in function `std::_Sp_counted_ptr_inplace<v8::internal::(anonymous namespace)::CppgcPlatformAdapter, std::allocator<v8::internal::(anonymous namespace)::CppgcPlatformAdapter>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
#7 125.7 cpp-heap.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88internal12_GLOBAL__N_120CppgcPlatformAdapterESaIS3_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info+0x1f): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(module-compiler.o): in function `std::_Sp_counted_ptr_inplace<v8::base::Semaphore, std::allocator<v8::base::Semaphore>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
#7 125.7 module-compiler.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v84base9SemaphoreESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v84base9SemaphoreESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x1f): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(module-compiler.o): in function `std::_Sp_counted_ptr_inplace<v8::internal::wasm::JSToWasmWrapperCompilationUnit, std::allocator<v8::internal::wasm::JSToWasmWrapperCompilationUnit>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
#7 125.7 module-compiler.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88internal4wasm30JSToWasmWrapperCompilationUnitESaIS3_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88internal4wasm30JSToWasmWrapperCompilationUnitESaIS3_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x1f): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(machine-graph-verifier.o): in function `v8::internal::compiler::(anonymous namespace)::MachineRepresentationChecker::CheckValueInputRepresentationIs(v8::internal::compiler::Node const*, int, v8::internal::MachineRepresentation) [clone .isra.0] [clone .constprop.1]':
#7 125.7 machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker31CheckValueInputRepresentationIsEPKNS1_4NodeEiNS0_21MachineRepresentationE.isra.0.constprop.1+0xc3): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(machine-graph-verifier.o): in function `v8::internal::compiler::(anonymous namespace)::MachineRepresentationChecker::CheckValueInputForInt32Op(v8::internal::compiler::Node const*, int) [clone .isra.0] [clone .constprop.0]':
#7 125.7 machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker25CheckValueInputForInt32OpEPKNS1_4NodeEi.isra.0.constprop.0+0xbf): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker25CheckValueInputForInt32OpEPKNS1_4NodeEi.isra.0.constprop.0+0x14f): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(machine-graph-verifier.o): in function `v8::internal::compiler::(anonymous namespace)::MachineRepresentationChecker::CheckValueInputForInt64Op(v8::internal::compiler::Node const*, int) [clone .isra.0] [clone .constprop.0]':
#7 125.7 machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker25CheckValueInputForInt64OpEPKNS1_4NodeEi.isra.0.constprop.0+0xbf): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker25CheckValueInputForInt64OpEPKNS1_4NodeEi.isra.0.constprop.0+0x14e): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(machine-graph-verifier.o): in function `v8::internal::compiler::(anonymous namespace)::MachineRepresentationChecker::CheckValueInputIsCompressedOrTagged(v8::internal::compiler::Node const*, int) [clone .isra.0]':
#7 125.7 machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker35CheckValueInputIsCompressedOrTaggedEPKNS1_4NodeEi.isra.0+0xc8): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()' #7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(machine-graph-verifier.o):machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker23CheckValueInputIsTaggedEPKNS1_4NodeEi.isra.0+0xf3): more undefined references to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()' follow
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(machine-graph-verifier.o): in function `v8::internal::compiler::(anonymous namespace)::MachineRepresentationChecker::CheckValueInputRepresentationIs(v8::internal::compiler::Node const*, int, v8::internal::MachineRepresentation) [clone .isra.0]':
#7 125.7 machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker31CheckValueInputRepresentationIsEPKNS1_4NodeEiNS0_21MachineRepresentationE.isra.0+0xfd): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(machine-graph-verifier.o): in function `v8::internal::compiler::(anonymous namespace)::MachineRepresentationChecker::CheckValueInputForInt32Op(v8::internal::compiler::Node const*, int) [clone .isra.0]':
#7 125.7 machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker25CheckValueInputForInt32OpEPKNS1_4NodeEi.isra.0+0xf0): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker25CheckValueInputForInt32OpEPKNS1_4NodeEi.isra.0+0x1ca): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(machine-graph-verifier.o): in function `v8::internal::compiler::(anonymous namespace)::MachineRepresentationChecker::CheckValueInputForInt64Op(v8::internal::compiler::Node const*, int) [clone .isra.0]':
#7 125.7 machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker25CheckValueInputForInt64OpEPKNS1_4NodeEi.isra.0+0xd0): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker25CheckValueInputForInt64OpEPKNS1_4NodeEi.isra.0+0x15f): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(machine-graph-verifier.o): in function `v8::internal::compiler::(anonymous namespace)::MachineRepresentationChecker::Run() [clone .constprop.0]':
#7 125.7 machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker3RunEv.constprop.0+0x1c2): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker3RunEv.constprop.0+0x485): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
#7 125.7 /usr/bin/ld: machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker3RunEv.constprop.0+0x699): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker3RunEv.constprop.0+0x8ae): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
#7 125.7 /usr/bin/ld: machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker3RunEv.constprop.0+0xb6f): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker3RunEv.constprop.0+0x112a): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker3RunEv.constprop.0+0x1942): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
#7 125.7 /usr/bin/ld: machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker3RunEv.constprop.0+0x1a66): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(memory-optimizer.o): in function `v8::internal::compiler::(anonymous namespace)::WriteBarrierAssertFailed(v8::internal::compiler::Node*, v8::internal::compiler::Node*, char const*, v8::internal::Zone*)':
#7 125.7 memory-optimizer.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_124WriteBarrierAssertFailedEPNS1_4NodeES4_PKcPNS0_4ZoneE+0x46): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(representation-change.o): in function `v8::internal::compiler::RepresentationChanger::TypeError(v8::internal::compiler::Node*, v8::internal::MachineRepresentation, v8::internal::compiler::Type, v8::internal::MachineRepresentation)':
#7 125.7 representation-change.cc:(.text._ZN2v88internal8compiler21RepresentationChanger9TypeErrorEPNS1_4NodeENS0_21MachineRepresentationENS1_4TypeES5_+0x71): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: representation-change.cc:(.text._ZN2v88internal8compiler21RepresentationChanger9TypeErrorEPNS1_4NodeENS0_21MachineRepresentationENS1_4TypeES5_+0xbd): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(default-platform.o): in function `std::_Sp_counted_ptr_inplace<v8::platform::DefaultJobState, std::allocator<v8::platform::DefaultJobState>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
#7 125.7 default-platform.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88platform15DefaultJobStateESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88platform15DefaultJobStateESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x1f): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(default-platform.o): in function `std::_Sp_counted_ptr_inplace<v8::platform::DefaultWorkerThreadsTaskRunner, std::allocator<v8::platform::DefaultWorkerThreadsTaskRunner>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
#7 125.7 default-platform.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88platform30DefaultWorkerThreadsTaskRunnerESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88platform30DefaultWorkerThreadsTaskRunnerESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x1f): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
#7 125.7 /usr/bin/ld: /go/pkg/mod/rogchap.com/v8go@v0.5.2-0.20210410040105-4c18ca58a475/deps/linux_x86_64/libv8.a(default-platform.o): in function `std::_Sp_counted_ptr_inplace<v8::platform::DefaultForegroundTaskRunner, std::allocator<v8::platform::DefaultForegroundTaskRunner>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
#7 125.7 default-platform.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88platform27DefaultForegroundTaskRunnerESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88platform27DefaultForegroundTaskRunnerESaIS2_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x1f): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
#7 125.7 collect2: error: ld returned 1 exit status
------
executor failed running [/bin/sh -c go get rogchap.com/v8go@4c18ca58a475cc2375ac7e3ace8513ba21525b28 && go run main.go]: exit code: 2
@neptoess I assume it's caused by exclude_unwind_tables
being applied for all platforms. I'll look into it tomorrow.
@kuoruan
After some investigation it turns out that the github action runner for ubuntu-latest
was changed from 18.04 to 20.04 between #87 (i.e. the last known good version) and #102. 18.04 uses GCC 7 by default, 20.04 GCC 9 and the golang image has GCC 8. While GCC 8 can link against the lib built with GCC 7, it won't work if the lib is built with GCC 9.
There's an issue to update the golang base image which would probably fix this. The other option would be to change v8go's build to explicitly use ubuntu-18.04 for now. @rogchap, any thoughts?
Nice find @cleiner.
No issues with using 18.04 explicitly; probably better in the long run to avoid similar future updates.
I can action this and kickoff a re-build of the binary
Hi @rogchap Can we also update the lib version to 8.9.255.25
, there are some bug fix since 8.9.255.20
I have issues building with ko
and distroless. I'm getting like everything is undefined.
./main.go:32:14: undefined: v8go.NewIsolate
./main.go:34:17: undefined: v8go.NewObjectTemplate
./main.go:36:18: undefined: v8go.NewFunctionTemplate
./main.go:36:59: undefined: v8go.FunctionCallbackInfo
./main.go:36:87: undefined: v8go.Value
./main.go:40:23: undefined: v8go.NewPromiseResolver
./main.go:45:19: undefined: v8go.NewValue
./main.go:50:36: undefined: v8go.ReadOnly
./main.go:52:14: undefined: v8go.NewContext
./main.go:79:27: undefined: v8go.Pending
It's also not working when using just distroless image example Dockerfile https://github.com/GoogleContainerTools/distroless/blob/main/examples/go/Dockerfile
=> ERROR [build 7/7] RUN CGO_ENABLED=0 go build -o /go/bin/app 3.1s
------
> [build 7/7] RUN CGO_ENABLED=0 go build -o /go/bin/app:
#13 3.016 ./main.go:32:14: undefined: v8go.NewIsolate
#13 3.016 ./main.go:34:17: undefined: v8go.NewObjectTemplate
#13 3.016 ./main.go:36:18: undefined: v8go.NewFunctionTemplate
#13 3.016 ./main.go:36:59: undefined: v8go.FunctionCallbackInfo
#13 3.016 ./main.go:36:87: undefined: v8go.Value
#13 3.016 ./main.go:40:23: undefined: v8go.NewPromiseResolver
#13 3.016 ./main.go:45:19: undefined: v8go.NewValue
#13 3.016 ./main.go:50:36: undefined: v8go.ReadOnly
#13 3.016 ./main.go:52:14: undefined: v8go.NewContext
#13 3.016 ./main.go:79:27: undefined: v8go.Pending
#13 3.016 ./main.go:79:27: too many errors
------
executor failed running [/bin/sh -c CGO_ENABLED=0 go build -o /go/bin/app]: exit code: 2
@Mistic92 you have CGO_ENABLED=0. That won’t work, as cgo is needed to link libv8.a
Testing with a very basic
main.go
And the following Dockerfile
I get this from
docker build .
Replacing the
deps
folder with the one from v0.2.0 works.Also, after a
go mod vendor
, I need to copy thedeps
folder manually. This can be solved by including a .go file with a dummy variable in deps and each of its subdirectories, like this https://github.com/confluentinc/confluent-kafka-go/blob/master/kafka/librdkafka/librdkafka.go