Quick Update: I am working on linking against the zlib and icu vcpkg ports instead of the embedded ones, in the meantime I am attaching the patches for 8.3.110.13.
Once you have synched to 8.3.110.13, apply the v8.patch in the v8 directory and the build.patch in the build directory: git apply v8.patch git apply build.patch Then configure with gn: gn gen out/x64.release.msvc --args="is_debug=false is_component_build=true target_cpu=\"x64\" is_clang=false use_custom_libcxx=false v8_enable_verify_heap=false" gn gen out/x64.debug.msvc --args="is_debug=true is_component_build=true target_cpu=\"x64\" is_clang=false use_custom_libcxx=false v8_enable_verify_heap=false" and build with ninja: ninja -C out/x64.release.msvc ninja -C out/x64.debug.msvc These changes are small, so it would be nice to have them in master "hint-hint", I may be able to create a CL later on, but if someone can help with that, it would be great. Cheers! On Thursday, July 9, 2020 at 2:06:21 PM UTC-6, Rodrigo Hernandez wrote: > > Hello, > > I am trying to create a VCPKG (https://github.com/microsoft/vcpkg) port > of v8, > and in doing so I am syncing to tag 8.3.110.13 as suggested here: > https://v8.dev/docs/version-numbers > > Since this is package manager, I want to build against msvc's c++ lib, so > I am using use_custom_libcxx=false, > however I am seeing linking errors related to undefined symbols on debug > builds like: > > [1797/2086] LINK(DLL) v8.dll v8.dll.lib v8.dll.pdb > FAILED: v8.dll v8.dll.lib v8.dll.pdb > C:/Code/vcpkg/buildtrees/v8/src/epot_tools-f6c91d5fca/bootstrap-3_8_0_chromium_8_bin/python/bin/python.exe > > ../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x64 > False link.exe /nologo /IMPLIB:./v8.dll.lib /DLL /OUT:./v8.dll > /PDB:./v8.dll.pdb @./v8.dll.rsp > class-verifiers-tq.obj : error LNK2019: unresolved external symbol > "public: class v8::internal::TNode<struct v8::internal::BoolT> __cdecl > v8::internal::TorqueGeneratedExportedMacrosAssembler::IsFastJSArray(class > v8::internal::TNode<class v8::internal::Object>,class > v8::internal::TNode<class v8::internal::Context>)" > (?IsFastJSArray@TorqueGeneratedExportedMacrosAssembler@internal@v8@@QEAA?AV?$TNode@UBoolT@internal@v8@@@23@V?$TNode@VObject@internal@v8@@@23@V?$TNode@VContext@internal@v8@@@23@@Z) > > referenced in function "public: class v8::internal::TNode<class > v8::internal::JSArray> __cdecl > v8::internal::CodeStubAssembler::TaggedToFastJSArray(class > v8::internal::TNode<class v8::internal::Context>,class > v8::internal::TNode<class v8::internal::Object>,class > v8::internal::compiler::CodeAssemblerLabel *)" > (?TaggedToFastJSArray@CodeStubAssembler@internal@v8@@QEAA?AV?$TNode@VJSArray@internal@v8@@@23@V?$TNode@VContext@internal@v8@@@23@V?$TNode@VObject@internal@v8@@@23@PEAVCodeAssemblerLabel@compiler@23@@Z) > > There's 75 symbols missing in total, all in class-verifiers-tq.obj, I can > post the rest if needed, but hopefully this will give you an idea. > > On release builds there is only one undefined symbol: void __cdecl > v8::internal::FixedArray::set(int,class v8::internal::Smi), which I believe > should be in fixed-array-tq-csa.obj, > but it is not there. There are 2 overrides right next to its definition in > fixed-array-inl.h that do seem to exist in the object file but this one > isn't. > > here is the error output: > > ninja: Entering directory `out\x64.release' > [1/298] LINK mksnapshot.exe mksnapshot.exe.pdb > FAILED: mksnapshot.exe mksnapshot.exe.pdb > C:/Code/vcpkg/buildtrees/v8/src/epot_tools-f6c91d5fca/bootstrap-3_8_0_chromium_8_bin/python/bin/python.exe > > ../../build/toolchain/win/tool_wrapper.py link-wrapper environment.x64 > False link.exe /nologo /OUT:./mksnapshot.exe /PDB:./mksnapshot.exe.pdb > @./mksnapshot.exe.rsp > exported-macros-assembler-tq.obj : error LNK2019: unresolved external > symbol "public: void __cdecl v8::internal::FixedArray::set(int,class > v8::internal::Smi)" (?set@FixedArray@internal@v8@@QEAAXHVSmi@23@@Z) > referenced in function "protected: void __cdecl > v8::internal::OrderedHashTable<class > v8::internal::OrderedHashMap,2>::SetNumberOfBuckets(int)" > (?SetNumberOfBuckets@?$OrderedHashTable@VOrderedHashMap@internal@v8@@$01@internal@v8@@IEAAXH@Z) > > .\mksnapshot.exe : fatal error LNK1120: 1 unresolved externals > > Is there something I can patch to make this work? is this a known issue? > > Also, is there a way to add a debug postfix/suffix like "d" to debug > libraries? > > Thanks in advance! > -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/v8-users/778bed03-806d-4f7c-a5b6-df2c5209ffa4o%40googlegroups.com.
diff --git a/config/compiler/BUILD.gn b/config/compiler/BUILD.gn index 5fa34150a..45a2e6c24 100644 --- a/config/compiler/BUILD.gn +++ b/config/compiler/BUILD.gn @@ -1472,6 +1472,8 @@ config("default_warnings") { # which we no longer use. Check if it makes sense to remove # this as well. http://crbug.com/316352 "-Wno-unneeded-internal-declaration", + "-Wno-invalid-offsetof", + "-Wno-range-loop-construct", ] # use_xcode_clang only refers to the iOS toolchain, host binaries use @@ -1869,11 +1871,21 @@ config("no_incompatible_pointer_warnings") { # Shared settings for both "optimize" and "optimize_max" configs. # IMPORTANT: On Windows "/O1" and "/O2" must go before the common flags. if (is_win) { - common_optimize_on_cflags = [ + common_optimize_on_cflags = [] + if(is_clang) { + common_optimize_on_cflags += [ "/Ob2", # Both explicit and auto inlining. + ] + } else { + common_optimize_on_cflags += [ + "/Ob3", # Both explicit and auto inlining. + ] + } + common_optimize_on_cflags += [ "/Oy-", # Disable omitting frame pointers, must be after /O2. "/Zc:inline", # Remove unreferenced COMDAT (faster links). ] + if (!is_asan) { common_optimize_on_cflags += [ # Put data in separate COMDATs. This allows the linker
diff --git a/src/compiler/node-cache.h b/src/compiler/node-cache.h index 935e5778e3..d5dae22512 100644 --- a/src/compiler/node-cache.h +++ b/src/compiler/node-cache.h @@ -29,7 +29,7 @@ class Node; // nodes such as constants, parameters, etc. template <typename Key, typename Hash = base::hash<Key>, typename Pred = std::equal_to<Key> > -class EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE) NodeCache final { +class V8_EXPORT_PRIVATE NodeCache final { public: explicit NodeCache(Zone* zone) : map_(zone) {} ~NodeCache() = default; diff --git a/src/objects/feedback-vector.cc b/src/objects/feedback-vector.cc index 929b312f22..7beff3395d 100644 --- a/src/objects/feedback-vector.cc +++ b/src/objects/feedback-vector.cc @@ -114,9 +114,9 @@ Handle<FeedbackMetadata> FeedbackMetadata::New(LocalIsolate* isolate, return metadata; } -template Handle<FeedbackMetadata> FeedbackMetadata::New( +template V8_EXPORT Handle<FeedbackMetadata> FeedbackMetadata::New( Isolate* isolate, const FeedbackVectorSpec* spec); -template Handle<FeedbackMetadata> FeedbackMetadata::New( +template V8_EXPORT Handle<FeedbackMetadata> FeedbackMetadata::New( OffThreadIsolate* isolate, const FeedbackVectorSpec* spec); bool FeedbackMetadata::SpecDiffersFrom( diff --git a/test/cctest/BUILD.gn b/test/cctest/BUILD.gn index 89fe36f65b..588950228b 100644 --- a/test/cctest/BUILD.gn +++ b/test/cctest/BUILD.gn @@ -421,6 +421,9 @@ v8_source_set("cctest_sources") { # C4309: 'static_cast': truncation of constant value cflags += [ "/wd4309" ] + # Buffer overrun warning... intended? + cflags += [ "/wd4789" ] + # MSVS wants this for gay-{precision,shortest}.cc. cflags += [ "/bigobj" ] diff --git a/tools/v8windbg/BUILD.gn b/tools/v8windbg/BUILD.gn index 10d06a127f..a269b81136 100644 --- a/tools/v8windbg/BUILD.gn +++ b/tools/v8windbg/BUILD.gn @@ -8,6 +8,12 @@ config("v8windbg_config") { # Required for successful compilation of SDK header file DbgModel.h. cflags_cc = [ "/Zc:twoPhase-" ] + if(is_win && !is_clang){ + # Avoid "The contents of <optional> are available only with C++17 or later." + # warning from MSVC + cflags_cc += [ "/std:c++latest" ] + } + include_dirs = [ "../.." ] }