Skip to content

Conversation

lucksus
Copy link
Member

@lucksus lucksus commented Sep 19, 2024

  • is_component_build = true is the main flag to make V8 build to shared libraries
  • in build.rs, override check for V8_FROM_SOURCE with true so this fork will have changes to V8 build applied within cargo builds of consuming projects without having to set this flag
  • list all dylibs created by V8 in build.rs to have cargo link against those accordingly
  • get all needed objects to be linked into a complete set of dylibs so we don't have unresolved symbols when building a consuming executable project

@lucksus lucksus changed the base branch from main to v0.92.0 September 19, 2024 13:43
@lucksus
Copy link
Member Author

lucksus commented Sep 19, 2024

Remaining unresolved symbols when building consuming executable:

          Undefined symbols for architecture arm64:
            "v8::ArrayBuffer::New(v8::Isolate*, std::Cr::shared_ptr<v8::BackingStore>)", referenced from:
                _v8__ArrayBuffer__New__with_backing_store in libv8-24ee3ccd1c74655e.rlib[19](binding.o)
            "v8::SharedArrayBuffer::New(v8::Isolate*, std::Cr::shared_ptr<v8::BackingStore>)", referenced from:
                _v8__SharedArrayBuffer__New__with_backing_store in libv8-24ee3ccd1c74655e.rlib[19](binding.o)
            "v8::platform::NewDefaultPlatform(int, v8::platform::IdleTaskSupport, v8::platform::InProcessStackDumping, std::Cr::unique_ptr<v8::TracingController, std::Cr::default_delete<v8::TracingController>>, v8::platform::PriorityMode)", referenced from:
                _v8__Platform__NewDefaultPlatform in libv8-24ee3ccd1c74655e.rlib[19](binding.o)
            "cppgc::internal::EnsureGCInfoIndexTrait::EnsureGCInfoIndex(std::Cr::atomic<unsigned short>&, void (*)(cppgc::Visitor*, void const*), void (*)(void*))", referenced from:
                _cppgc__make_garbage_collectable in libv8-24ee3ccd1c74655e.rlib[19](binding.o)
          ld: symbol(s) not found for architecture arm64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

Project has this in its build.rs:

    println!("cargo:rustc-link-lib=dylib=c++_chrome");
    println!("cargo:rustc-link-lib=dylib=third_party_icu_icui18n");
    println!("cargo:rustc-link-lib=dylib=icuuc");
    println!("cargo:rustc-link-lib=dylib=third_party_abseil-cpp_absl");
    println!("cargo:rustc-link-lib=dylib=v8");
    println!("cargo:rustc-link-lib=dylib=v8_libbase");
    println!("cargo:rustc-link-lib=dylib=v8_libplatform");
    
    println!("cargo:rustc-link-search=native=/Users/nicolasluck/Coasys/code/rusty_v8/target/release/gn_out");

mentioning all dylibs that were build to gn_out.

lucksus and others added 24 commits September 20, 2024 16:33
… of clang_path to avoid problem with spaces in filenames
…handling of clang_path to avoid problem with spaces in filenames"

This reverts commit b6b0839.
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

Successfully merging this pull request may close these issues.

3 participants