neon: 0.3.2 linker error on macOS

When I try to build with neon-cli 0.3.2 on macOS it fails with:

ld: warning: cannot export hidden symbol compiler_builtins::mem::memcpy::h89bf2c29275db9b6 from /var/folders/09/3ccx9hvj499_767y34mtcr900000gn/T/rustc5SpE5s/libcompiler_builtins-4c0e14a54ecf951d.rlib(compiler_builtins-4c0e14a54ecf951d.compiler_builtins.dcjs62au-cgu.0.rcgu.o)
          ld: warning: cannot export hidden symbol compiler_builtins::mem::memmove::hb03f562604dc3076 from /var/folders/09/3ccx9hvj499_767y34mtcr900000gn/T/rustc5SpE5s/libcompiler_builtins-4c0e14a54ecf951d.rlib(compiler_builtins-4c0e14a54ecf951d.compiler_builtins.dcjs62au-cgu.0.rcgu.o)
          ld: warning: cannot export hidden symbol compiler_builtins::mem::memset::h1f53dc51033b23d1 from /var/folders/09/3ccx9hvj499_767y34mtcr900000gn/T/rustc5SpE5s/libcompiler_builtins-4c0e14a54ecf951d.rlib(compiler_builtins-4c0e14a54ecf951d.compiler_builtins.dcjs62au-cgu.0.rcgu.o)
          ld: warning: cannot export hidden symbol compiler_builtins::mem::memcmp::hc5ebea53cd23af68 from /var/folders/09/3ccx9hvj499_767y34mtcr900000gn/T/rustc5SpE5s/libcompiler_builtins-4c0e14a54ecf951d.rlib(compiler_builtins-4c0e14a54ecf951d.compiler_builtins.dcjs62au-cgu.0.rcgu.o)
[...]
Undefined symbols for architecture x86_64:
            "v8::Isolate::ThrowException(v8::Local<v8::Value>)", referenced from:
                _Neon_Error_Throw in libneon_runtime-0d1b50c0de5edd79.rlib(neon.o)
                _Neon_Error_ThrowErrorFromUtf8 in libneon_runtime-0d1b50c0de5edd79.rlib(neon.o)
            "v8::Value::IsNumber() const", referenced from:
                _Neon_Tag_IsNumber in libneon_runtime-0d1b50c0de5edd79.rlib(neon.o)
            "v8::HandleScope::CreateHandle(v8::internal::Isolate*, v8::internal::Object*)", referenced from:
                _Neon_Class_HasInstance in libneon_runtime-0d1b50c0de5edd79.rlib(neon.o)
[...]
          ld: symbol(s) not found for architecture x86_64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

with [...] I skipped similar lines, but I can provide full trace.

Switching back to 0.3.1 (npm install -g neon-cli@0.3.1) fixes the problem.

Tried with

  • NodeJS v10.15.3, v10.16.3 and v12.12.0.
  • rustc 1.38.0 (625451e37 2019-09-23)

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 18 (11 by maintainers)

Commits related to this issue

Most upvoted comments

@garyyu The following things need to be in place.

  • neon-build@>=0.3.3
  • build = "build.rs" in Cargo.toml`
  • build.rs running neon-build
  • crate-type = ["cdylib"] in Cargo.toml

Crate type might be the issue since this was previously incorrect in the neon-cli new project template.

That does fix it! Thanks for the help @kjvalencik, I appreciate it.

Also, as an unrelated side note, I wanted to also say thanks for your work getting this project back up and running. There was a time there when I wasn’t sure what the future of this project was going to be so it’s really nice to see more activity here.

@ernieturner Oh! I think I see the issue. There’s no build.rs file. It was previously only required for Windows, but now it’s required for both Windows and macOS.

https://github.com/neon-bindings/neon/blob/master/RELEASES.md#potentially-breaking https://github.com/neon-bindings/neon/blob/master/test/dynamic/native/build.rs https://github.com/neon-bindings/neon/blob/master/test/dynamic/native/Cargo.toml#L6

FYI, the core team is in discussion of giving breaking changes far more scrutiny. This builds args move was considered fairly minor, but has broken a few different builds.