[HELP] integrate V8 as shared library into electron framework.

10 views
Skip to first unread message

hao zeng

unread,
Jul 30, 2025, 4:27:41 AMJul 30
to v8-users
I was trying to build Electron framework with v8 as a shared library. I modified the src/v8/BUILD.gn, the definition of target v8_component has been changed to v8_shared_library, and i annotated the source file  "src/libplatform/tracing/trace-object.cc",
because the sources of v8 rely on a symbol exported from trace-object.cc.
After that, when i use release.gn( is_coponent_build = false,  is_official_build=true), there is an error like this:
[1/1] ACTION //v8:run_mksnapshot_default(//build/toolchain/win:win_clang_x64)
FAILED: gen/v8/embedded.S snapshot_blob.bin
C:/Users/xxx/software/depot_tools/bootstrap-2@3_11_8_chromium_35_bin/python3/bin/python3.exe ../../v8/tools/run.py ./mksnapshot --turbo_instruction_scheduling --stress-turbo-late-spilling --target_os=win --target_arch=x64 --embedded_src gen/v8/embedded.S --predictable --no-use-ic --turbo-elide-frames --embedded_variant Default --random-seed 314159265 --startup_blob snapshot_blob.bin --no-native-code-counters --concurrent-builtin-generation --concurrent-turbofan-max-threads=0
Return code is 2147483651

This means the cmd above returns a code 2147483651.
I have found this error with debug mode. Here are the call stacks.
v8_libplatform.dll!thread_start<unsigned int (__cdecl*)(void *),1>(void * const parameter) 
  v8_libplatform.dll!v8::base::ThreadEntry(void * arg) Line 1738 C++Line 97 C++
  [Inline Frame] v8_libplatform.dll!v8::base::Thread::NotifyStartedAndRun() Line 632 C++
  v8_libplatform.dll!v8::platform::DefaultWorkerThreadsTaskRunner::WorkerThread::Run() Line 96 C++
  v8_libplatform.dll!v8::platform::DefaultJobWorker::Run() Line 148 C++
  mksnapshot.exe!v8::internal::OptimizingCompileTaskExecutor::CompileTask::Run(v8::JobDelegate * delegate) Line 37 C++
> mksnapshot.exe!v8::internal::wasm::ValidateFunctions::NeverYieldDelegate::GetTaskId() Line 635 C++

Can u give me some suggesstions?
Reply all
Reply to author
Forward
0 new messages