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

Build failed with linker errors #58

Closed
ReneMuala opened this issue Jan 20, 2023 · 2 comments
Closed

Build failed with linker errors #58

ReneMuala opened this issue Jan 20, 2023 · 2 comments

Comments

@ReneMuala
Copy link

I managed to get the makefiles working properly on MacOS 12.6, but the build process fails with the following linker errors.

/Applications/Xcode.app/Contents/Developer/usr/bin/make MODULE=vm module-static
CFLAGS="" LFLAGS="" JUST_HOME="/Users/renemuala/Documents/playground/just-js/just" /Applications/Xcode.app/Contents/Developer/usr/bin/make -C modules/vm/ FLAGS=-DSTATIC library
g++ -DSTATIC -c -fno-exceptions -ffunction-sections -fdata-sections -fPIC -std=c++17 -DV8_COMPRESS_POINTERS -I/Users/renemuala/Documents/playground/just-js/just -I/Users/renemuala/Documents/playground/just-js/just/deps/v8/include -g -O3 -march=native -mtune=native -Wall -Wextra -flto -Wno-unused-parameter vm.cc
g++ -g -shared -flto -pthread -m64  vm.o  -Wl,-install_name,vm.so -Wl,-dead_strip  -o vm.so
Undefined symbols for architecture x86_64:
  "v8::HandleScope::CreateHandle(v8::internal::Isolate*, unsigned long)", referenced from:
      just::vm::EnterContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::ExitContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileAndRunInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::HandleScope::HandleScope(v8::Isolate*)", referenced from:
      just::vm::RunModule(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::HandleScope::~HandleScope()", referenced from:
      just::vm::RunModule(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::api_internal::ToLocalEmpty()", referenced from:
      just::vm::CreateContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileAndRunInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunModule(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::api_internal::DisposeGlobal(unsigned long*)", referenced from:
      just::vm::CreateContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::api_internal::FromJustIsNothing()", referenced from:
      just::vm::CreateContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::api_internal::GlobalizeReference(v8::internal::Isolate*, unsigned long*)", referenced from:
      just::vm::CreateContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::api_internal::CopyGlobalReference(unsigned long*)", referenced from:
      just::vm::CreateContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::ObjectTemplate::SetInternalFieldCount(int)", referenced from:
      just::vm::CreateContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::ObjectTemplate::New(v8::Isolate*, v8::Local<v8::FunctionTemplate>)", referenced from:
      just::vm::CreateContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::Init(v8::Isolate*, v8::Local<v8::ObjectTemplate>) in lto.o
  "v8::PrimitiveArray::New(v8::Isolate*, int)", referenced from:
      just::vm::CompileInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileAndRunInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunModule(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::PrimitiveArray::Set(v8::Isolate*, int, v8::Local<v8::Primitive>)", referenced from:
      just::vm::CompileInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileAndRunInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunModule(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::ScriptCompiler::CachedData::~CachedData()", referenced from:
      just::vm::CompileInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileAndRunInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunModule(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::ScriptCompiler::CompileModule(v8::Isolate*, v8::ScriptCompiler::Source*, v8::ScriptCompiler::CompileOptions, v8::ScriptCompiler::NoCacheReason)", referenced from:
      just::vm::RunModule(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::ScriptCompiler::ConsumeCodeCacheTask::~ConsumeCodeCacheTask()", referenced from:
      just::vm::CompileInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileAndRunInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunModule(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::ScriptCompiler::CompileFunctionInContext(v8::Local<v8::Context>, v8::ScriptCompiler::Source*, unsigned long, v8::Local<v8::String>*, unsigned long, v8::Local<v8::Object>*, v8::ScriptCompiler::CompileOptions, v8::ScriptCompiler::NoCacheReason, v8::Local<v8::ScriptOrModule>*)", referenced from:
      just::vm::CompileScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::ScriptCompiler::Compile(v8::Local<v8::Context>, v8::ScriptCompiler::Source*, v8::ScriptCompiler::CompileOptions, v8::ScriptCompiler::NoCacheReason)", referenced from:
      just::vm::CompileInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileAndRunInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::Module::InstantiateModule(v8::Local<v8::Context>, v8::MaybeLocal<v8::Module> (*)(v8::Local<v8::Context>, v8::Local<v8::String>, v8::Local<v8::FixedArray>, v8::Local<v8::Module>))", referenced from:
      just::vm::RunModule(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::Module::Evaluate(v8::Local<v8::Context>)", referenced from:
      just::vm::RunModule(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::Number::New(v8::Isolate*, double)", referenced from:
      just::vm::CompileInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileAndRunInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunModule(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::Object::SetAlignedPointerInInternalField(int, void*)", referenced from:
      just::vm::CreateContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::Object::SlowGetAlignedPointerFromInternalField(int)", referenced from:
      just::vm::EnterContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::ExitContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileAndRunInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)", referenced from:
      just::vm::CreateContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::Object::Get(v8::Local<v8::Context>, unsigned int)", referenced from:
      just::vm::CompileScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)", referenced from:
      just::vm::CreateContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::Script::Run(v8::Local<v8::Context>)", referenced from:
      just::vm::CompileAndRunInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::String::NewFromUtf8Literal(v8::Isolate*, char const*, v8::NewStringType, int)", referenced from:
      just::vm::CreateContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::Context::AllowCodeGenerationFromStrings(bool)", referenced from:
      just::vm::CreateContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::Context::New(v8::Isolate*, v8::ExtensionConfiguration*, v8::MaybeLocal<v8::ObjectTemplate>, v8::MaybeLocal<v8::Value>, v8::DeserializeInternalFieldsCallback, v8::MicrotaskQueue*)", referenced from:
      just::vm::CreateContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::Context::Exit()", referenced from:
      just::vm::ExitContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::Context::Enter()", referenced from:
      just::vm::EnterContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::Context::Global()", referenced from:
      just::vm::CreateContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::Isolate::GetCurrentContext()", referenced from:
      just::vm::CompileScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunModule(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::Isolate::SetPromiseRejectCallback(void (*)(v8::PromiseRejectMessage))", referenced from:
      just::vm::CreateContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::Isolate::GetEnteredOrMicrotaskContext()", referenced from:
      just::vm::RunScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::Template::Set(v8::Local<v8::Name>, v8::Local<v8::Data>, v8::PropertyAttribute)", referenced from:
      just::vm::CreateContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::TryCatch::ReThrow()", referenced from:
      just::vm::CompileInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileAndRunInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunModule(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::TryCatch::TryCatch(v8::Isolate*)", referenced from:
      just::vm::CompileInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileAndRunInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunModule(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::TryCatch::~TryCatch()", referenced from:
      just::vm::CompileInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileAndRunInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunModule(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "just::SET_METHOD(v8::Isolate*, v8::Local<v8::ObjectTemplate>, char const*, void (*)(v8::FunctionCallbackInfo<v8::Value> const&))", referenced from:
      just::vm::Init(v8::Isolate*, v8::Local<v8::ObjectTemplate>) in lto.o
  "just::SET_MODULE(v8::Isolate*, v8::Local<v8::ObjectTemplate>, char const*, v8::Local<v8::ObjectTemplate>)", referenced from:
      just::vm::Init(v8::Isolate*, v8::Local<v8::ObjectTemplate>) in lto.o
  "just::OnModuleInstantiate(v8::Local<v8::Context>, v8::Local<v8::String>, v8::Local<v8::FixedArray>, v8::Local<v8::Module>)", referenced from:
      just::vm::RunModule(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "just::PromiseRejectCallback(v8::PromiseRejectMessage)", referenced from:
      just::vm::CreateContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "just::Init(v8::Isolate*, v8::Local<v8::ObjectTemplate>)", referenced from:
      just::vm::CreateContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::ScriptOrigin::VerifyHostDefinedOptions() const", referenced from:
      just::vm::CompileInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileAndRunInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunModule(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::Array::Length() const", referenced from:
      just::vm::CompileScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::Value::BooleanValue(v8::Isolate*) const", referenced from:
      just::vm::CreateContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::TryCatch::HasTerminated() const", referenced from:
      just::vm::CompileInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileAndRunInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunModule(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
  "v8::TryCatch::HasCaught() const", referenced from:
      just::vm::CompileInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileAndRunInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunInContext(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::CompileScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunScript(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
      just::vm::RunModule(v8::FunctionCallbackInfo<v8::Value> const&) in lto.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [library] Error 1
make[1]: *** [module-static] Error 2
make: *** [module-static-vm] Error 2

i tried to replace the libv8 file in deps by a macos version, but the build stills failing.

@lemanschik
Copy link

this is a linux only thing we did not integrate any macos related code here but i would want to work with you on that if you want to do so replacing libv8 is not the only thing you need to do. You need also the modules as mac os compatible versions

@ReneMuala
Copy link
Author

Sorry for the inconvenience, as a good part of linux systems are possible to build on mac, I was trying to build this one in a similar way.
I'd like to help port the software to macos as well.

@ReneMuala ReneMuala closed this as not planned Won't fix, can't repro, duplicate, stale Jan 28, 2023
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

2 participants