v8go: libv8.a bundled with v0.3.0 doesn't work with golang Docker image
Testing with a very basic main.go
package main
import "rogchap.com/v8go"
func main() {
if _, err := v8go.NewIsolate(); err != nil {
panic(err)
}
}
And the following Dockerfile
FROM golang:1.15
WORKDIR /go/src/v8
COPY . .
RUN go run main.go
I get this from docker build .
Sending build context to Docker daemon 75.76MB
Step 1/4 : FROM golang:1.15
---> 05c8f6d2538a
Step 2/4 : WORKDIR /go/src/v8
---> Using cache
---> 70761780e417
Step 3/4 : COPY . .
---> 96c01a616e96
Step 4/4 : RUN go run main.go
---> Running in f434a5b958aa
# rogchap.com/v8go
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(isolate.o): in function `std::_Sp_counted_ptr_inplace<v8::internal::Counters, std::allocator<v8::internal::Counters>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
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]+0x16): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(isolate.o): in function `std::_Sp_counted_ptr_inplace<v8::internal::metrics::Recorder, std::allocator<v8::internal::metrics::Recorder>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
isolate.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88internal7metrics8RecorderESaIS3_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88internal7metrics8RecorderESaIS3_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x16): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
/usr/bin/ld: vendor/rogchap.com/v8go/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&)':
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]+0x16): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(wasm-code-manager.o): in function `std::_Sp_counted_ptr_inplace<v8::internal::OwnedVector<unsigned char const>, std::allocator<v8::internal::OwnedVector<unsigned char const> >, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
wasm-code-manager.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88internal11OwnedVectorIKhEESaIS4_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceIN2v88internal11OwnedVectorIKhEESaIS4_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x16): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(wasm-code-manager.o): in function `std::_Sp_counted_ptr_inplace<v8::internal::wasm::(anonymous namespace)::NativeModuleWireBytesStorage, std::allocator<v8::internal::wasm::(anonymous namespace)::NativeModuleWireBytesStorage>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
wasm-code-manager.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88internal4wasm12_GLOBAL__N_128NativeModuleWireBytesStorageESaIS4_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info+0x16): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(wasm-engine.o):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]+0x16): more undefined references to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)' follow
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(typer.o): in function `v8::internal::compiler::Typer::Visitor::UpdateType(v8::internal::compiler::Node*, v8::internal::compiler::Type)':
typer.cc:(.text._ZN2v88internal8compiler5Typer7Visitor10UpdateTypeEPNS1_4NodeENS1_4TypeE[_ZN2v88internal8compiler5Typer7Visitor10UpdateTypeEPNS1_4NodeENS1_4TypeE]+0xd9): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(verifier.o): in function `v8::internal::compiler::Verifier::Visitor::CheckNotTyped(v8::internal::compiler::Node*)':
verifier.cc:(.text._ZN2v88internal8compiler8Verifier7Visitor13CheckNotTypedEPNS1_4NodeE[_ZN2v88internal8compiler8Verifier7Visitor13CheckNotTypedEPNS1_4NodeE]+0x4f): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(verifier.o): in function `v8::internal::compiler::Verifier::Visitor::CheckOutput(v8::internal::compiler::Node*, v8::internal::compiler::Node*, int, char const*)':
verifier.cc:(.text._ZN2v88internal8compiler8Verifier7Visitor11CheckOutputEPNS1_4NodeES5_iPKc[_ZN2v88internal8compiler8Verifier7Visitor11CheckOutputEPNS1_4NodeES5_iPKc]+0x5e): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(verifier.o): in function `v8::internal::compiler::Verifier::Visitor::CheckTypeIs(v8::internal::compiler::Node*, v8::internal::compiler::Type)':
verifier.cc:(.text._ZN2v88internal8compiler8Verifier7Visitor11CheckTypeIsEPNS1_4NodeENS1_4TypeE[_ZN2v88internal8compiler8Verifier7Visitor11CheckTypeIsEPNS1_4NodeENS1_4TypeE]+0x79): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(verifier.o): in function `v8::internal::compiler::Verifier::Visitor::CheckValueInputIs(v8::internal::compiler::Node*, int, v8::internal::compiler::Type)':
verifier.cc:(.text._ZN2v88internal8compiler8Verifier7Visitor17CheckValueInputIsEPNS1_4NodeEiNS1_4TypeE[_ZN2v88internal8compiler8Verifier7Visitor17CheckValueInputIsEPNS1_4NodeEiNS1_4TypeE]+0x11e): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: vendor/rogchap.com/v8go/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&)':
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]+0x16): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(module-compiler.o): in function `std::_Sp_counted_ptr_inplace<v8::internal::wasm::(anonymous namespace)::BackgroundCompileToken, std::allocator<v8::internal::wasm::(anonymous namespace)::BackgroundCompileToken>, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
module-compiler.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceIN2v88internal4wasm12_GLOBAL__N_122BackgroundCompileTokenESaIS4_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info+0x16): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(module-compiler.o): in function `std::_Sp_counted_ptr_inplace<std::atomic<int>, std::allocator<std::atomic<int> >, (__gnu_cxx::_Lock_policy)2>::_M_get_deleter(std::type_info const&)':
module-compiler.cc:(.text._ZNSt23_Sp_counted_ptr_inplaceISt6atomicIiESaIS1_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info[_ZNSt23_Sp_counted_ptr_inplaceISt6atomicIiESaIS1_ELN9__gnu_cxx12_Lock_policyE2EE14_M_get_deleterERKSt9type_info]+0x16): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
/usr/bin/ld: vendor/rogchap.com/v8go/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&)':
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]+0x16): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
/usr/bin/ld: vendor/rogchap.com/v8go/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&)':
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]+0x16): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(machine-graph-verifier.o): in function `v8::internal::compiler::MachineGraphVerifier::Run(v8::internal::compiler::Graph*, v8::internal::compiler::Schedule const*, v8::internal::compiler::Linkage*, bool, char const*, v8::internal::Zone*)':
machine-graph-verifier.cc:(.text._ZN2v88internal8compiler20MachineGraphVerifier3RunEPNS1_5GraphEPKNS1_8ScheduleEPNS1_7LinkageEbPKcPNS0_4ZoneE+0x12f7): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
/usr/bin/ld: vendor/rogchap.com/v8go/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)':
machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker25CheckValueInputForInt64OpEPKNS1_4NodeEi+0xd3): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker25CheckValueInputForInt64OpEPKNS1_4NodeEi+0x178): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: vendor/rogchap.com/v8go/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)':
machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker31CheckValueInputRepresentationIsEPKNS1_4NodeEiNS0_21MachineRepresentationE+0xf5): undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream()'
/usr/bin/ld: vendor/rogchap.com/v8go/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)':
machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker35CheckValueInputIsCompressedOrTaggedEPKNS1_4NodeEi+0xf5): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(machine-graph-verifier.o): in function `v8::internal::compiler::(anonymous namespace)::MachineRepresentationChecker::CheckValueInputIsTagged(v8::internal::compiler::Node const*, int)':
machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker23CheckValueInputIsTaggedEPKNS1_4NodeEi+0xf5): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(machine-graph-verifier.o): in function `v8::internal::compiler::(anonymous namespace)::MachineRepresentationChecker::CheckValueInputForFloat64Op(v8::internal::compiler::Node const*, int)':
machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker27CheckValueInputForFloat64OpEPKNS1_4NodeEi+0xf2): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(machine-graph-verifier.o): in function `v8::internal::compiler::(anonymous namespace)::MachineRepresentationChecker::CheckValueInputIsTaggedOrPointer(v8::internal::compiler::Node const*, int)':
machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker32CheckValueInputIsTaggedOrPointerEPKNS1_4NodeEi+0xf5): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: vendor/rogchap.com/v8go/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)':
machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker25CheckValueInputForInt32OpEPKNS1_4NodeEi+0xcf): undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()'
/usr/bin/ld: vendor/rogchap.com/v8go/deps/linux-x86_64/libv8.a(machine-graph-verifier.o):machine-graph-verifier.cc:(.text._ZN2v88internal8compiler12_GLOBAL__N_128MachineRepresentationChecker25CheckValueInputForInt32OpEPKNS1_4NodeEi+0x137): more undefined references to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()' follow
/usr/bin/ld: vendor/rogchap.com/v8go/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&)':
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]+0x16): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
/usr/bin/ld: vendor/rogchap.com/v8go/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&)':
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]+0x16): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
/usr/bin/ld: vendor/rogchap.com/v8go/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&)':
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]+0x16): undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'
collect2: error: ld returned 1 exit status
The command '/bin/sh -c go run main.go' returned a non-zero code: 2
Replacing the deps folder with the one from v0.2.0 works.
Also, after a go mod vendor, I need to copy the deps 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
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 18 (16 by maintainers)
Hi @rogchap Can we also update the lib version to
8.9.255.25, there are some bug fix since8.9.255.20@neptoess I assume it’s caused by
exclude_unwind_tablesbeing applied for all platforms. I’ll look into it tomorrow.@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)@neptoess This has been released in v0.4.0: https://github.com/rogchap/v8go/releases/tag/v0.4.0
@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.