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

V8 ABSEIL Build Fails On Windows #766

Open
mirceagoga opened this issue May 29, 2024 · 7 comments
Open

V8 ABSEIL Build Fails On Windows #766

mirceagoga opened this issue May 29, 2024 · 7 comments

Comments

@mirceagoga
Copy link

v8 version: 12.7.138
OS: Windows 11
Build Tools: Clang and Visual Studio 2022

Hello,

I'm trying to upgrade from v8 11.6 to the latest 12.7 on Windows but it fails at third_party_abseil-cpp_absl link step.

How to reproduce:

  1. run config: python3 tools\dev\v8gen.py -b x64.release x64.release -- is_debug=false is_clang=true is_component_build=true use_custom_libcxx=false use_lld=false v8_static_library=false v8_monolithic=false v8_use_external_startup_data=true v8_enable_test_features=false v8_enable_i18n_support=false treat_warnings_as_errors=false v8_enable_pointer_compression=false
  2. run ninja -v -C out.gn/x64.release third_party_abseil-cpp_absl.dll

The log is huge but it cosists of "error LNK2001: unresolved external symbol ...":

ninja -C out.gn/x64.release third_party_abseil-cpp_absl.dll ninja: Entering directory 'out.gn/x64.release' [1/1] LINK(DLL) third_party_abseil-cpp_absl.dll third_party_abseil-cpp_absl.dll.lib third_party_abseil-cpp_absl.dll.pdb " FAILED: third_party_abseil-cpp_absl.dll third_party_abseil-cpp_absl.dll.lib third_party_abseil-cpp_absl.dll.pdb "C:/depot_tools/bootstrap-2@3_11_8_chromium_35_bin/python3/bin/python3.exe" ../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x64 False link.exe "/OUT:./third_party_abseil-cpp_absl.dll" /nologo "/IMPLIB:./third_party_abseil-cpp_absl.dll.lib" /DLL "/PDB:./third_party_abseil-cpp_absl.dll.pdb" "@./third_party_abseil-cpp_absl.dll.rsp" third_party_abseil-cpp_absl.dll.exp : error LNK2001: unresolved external symbol "public: __cdecl absl::AlphaNum::AlphaNum<class std::__Cr::allocator<char> >(class std::__Cr::basic_string<char,struct std::__Cr::char_traits<char>,class std::__Cr::allocator<char> > const &)" (??$?0V?$allocator@D@__Cr@std@@@AlphaNum@absl@@QEAA@AEBV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@@Z) third_party_abseil-cpp_absl.dll.exp : error LNK2001: unresolved external symbol "public: __cdecl absl::Cord::Cord<class std::__Cr::basic_string<char,struct std::__Cr::char_traits<char>,class std::__Cr::allocator<char> >,0>(class std::__Cr::basic_string<char,struct std::__Cr::char_traits<char>,class std::__Cr::allocator<char> > &&)" (??$?0V?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@$0A@@Cord@absl@@QEAA@$$QEAV?$basic_string@DU?$char_traits@D@__Cr@std@@V?$allocator@D@23@@__Cr@std@@@Z)

Things I tried:

  1. build with MSVC build tools: abseil works, other v8 project fails
  2. use /std:c++20, /std:c++17: the same
  3. build only abseil with MSVC (is_clang=false) and modify v8/BUILD.gn to use that one: other link issues on mksnapsot step:
    ninja -C out.gn/release v8 v8_libplatform v8_libbase ninja: Entering directory 'out.gn/x64.release' [1/11] LINK mksnapshot.exe mksnapshot.exe.pdb FAILED: mksnapshot.exe mksnapshot.exe.pdb "C:/depot_tools/bootstrap-2@3_11_8_chromium_35_bin/python3/bin/python3.exe" ../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x64 False link.exe "/OUT:./mksnapshot.exe" /nologo "/PDB:./mksnapshot.exe.pdb" "@./mksnapshot.exe.rsp" wasm-revec-phase.obj : error LNK2001: unresolved external symbol "private: void __cdecl absl::container_internal::HashSetResizeHelper::InitControlBytesAfterSoo(enum absl::container_internal::ctrl_t *,enum absl::container_internal::ctrl_t,unsigned __int64)" (?InitControlBytesAfterSoo@HashSetResizeHelper@container_internal@absl@@AEAAXPEAW4ctrl_t@23@W4423@_K@Z) wasm-gc-optimize-phase.obj : error LNK2001: unresolved external symbol "private: void __cdecl absl::container_internal::HashSetResizeHelper::InitControlBytesAfterSoo(enum absl::container_internal::ctrl_t *,enum absl::container_internal::ctrl_t,unsigned __int64)" (?InitControlBytesAfterSoo@HashSetResizeHelper@container_internal@absl@@AEAAXPEAW4ctrl_t@23@W4423@_K@Z) wasm-gc-typed-optimization-reducer.obj : error LNK2001: unresolved external symbol "private: void __cdecl absl::container_internal::HashSetResizeHelper::InitControlBytesAfterSoo(enum absl::container_internal::ctrl_t *,enum absl::container_internal::ctrl_t,unsigned __int64)" (?InitControlBytesAfterSoo@HashSetResizeHelper@container_internal@absl@@AEAAXPEAW4ctrl_t@23@W4423@_K@Z) wasm-lowering-phase.obj : error LNK2001: unresolved external symbol "private: void __cdecl absl::container_internal::HashSetResizeHelper::InitControlBytesAfterSoo(enum absl::container_internal::ctrl_t *,enum absl::container_internal::ctrl_t,unsigned __int64)" (?InitControlBytesAfterSoo@HashSetResizeHelper@container_internal@absl@@AEAAXPEAW4ctrl_t@23@W4423@_K@Z) wasm-optimize-phase.obj : error LNK2001: unresolved external symbol "private: void __cdecl absl::container_internal::HashSetResizeHelper::InitControlBytesAfterSoo(enum absl::container_internal::ctrl_t *,enum absl::container_internal::ctrl_t,unsigned __int64)" (?InitControlBytesAfterSoo@HashSetResizeHelper@container_internal@absl@@AEAAXPEAW4ctrl_t@23@W4423@_K@Z)

From what I know, Clang compiler is a must on Windows.
Does anyone know a workaround for this issue ?

@quirkyli
Copy link

quirkyli commented Jul 8, 2024

We have the same issue now, and hope for a solution..... @mathiasbynens @RReverser
@mirceagoga Do you find any solution?

@mirceagoga
Copy link
Author

@quirkyli I used an older version, 11.6, which doesn`t have dependency on this dll.

@quirkyli
Copy link

@mirceagoga Thanks for your comment. But we have to upgrade v8, since security requirement.....So, still for hope for a solution for high version....

@LeszekSwirski
Copy link
Contributor

Does it work with is_component_build = false? This looks like abseil has symbol export issues.

@quirkyli
Copy link

Hi @LeszekSwirski , I also tried this parameter, but still didn't work. I found the same issue in this website https://groups.google.com/g/v8-users/c/NT1_kNtE-hE/m/F8JgWM4EAAAJ. It seems that compiling static library is ok, but compiling version 12.X of dynamic library is failed.

@caoccao
Copy link

caoccao commented Jul 18, 2024

I always build v8_monolith, then build a DLL on top of it. It works well with v12.x.

@lexusv8ls600h
Copy link

The issue seems to be in symbols_x64_rel.def, which attempts to export some unavailable symbols.
One possible workaround is:

  1. remove all unavailable symbols to let the build go
  2. then you will have the problematic abseil dlls
  3. build abseil with cmake to generate new abseil dlls
  4. use the new dlls to replace the problematic ones

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

5 participants