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

make is unsuccessful on MacOS #3

Open
abhipras opened this issue Mar 12, 2015 · 3 comments
Open

make is unsuccessful on MacOS #3

abhipras opened this issue Mar 12, 2015 · 3 comments

Comments

@abhipras
Copy link

When I run make, I get the following error

                                             ^~~~~~~~~~~~~~~~~~~
error: linking with `cc` failed: exit code: 1
note: "cc" "-m64" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-o" "/Users/macpro/erlang_projects/erlang-rust-nif/rust_src/target/debug/liber-75adb9f2bb77bd1a.dylib" "/Users/macpro/erlang_projects/erlang-rust-nif/rust_src/target/debug/er-75adb9f2bb77bd1a.o" "-Wl,-force_load,/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libmorestack.a" "/Users/macpro/erlang_projects/erlang-rust-nif/rust_src/target/debug/er-75adb9f2bb77bd1a.metadata.o" "-Wl,-dead_strip" "-nodefaultlibs" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libstd-4e7c5e5c.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libcollections-4e7c5e5c.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libunicode-4e7c5e5c.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/librand-4e7c5e5c.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/liballoc-4e7c5e5c.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/liblibc-4e7c5e5c.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libcore-4e7c5e5c.rlib" "-L" "/Users/macpro/erlang_projects/erlang-rust-nif/rust_src/target/debug" "-L" "/Users/macpro/erlang_projects/erlang-rust-nif/rust_src/target/debug/deps" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-L" "/Users/macpro/erlang_projects/erlang-rust-nif/rust_src/.rust/lib/x86_64-apple-darwin" "-L" "/Users/macpro/erlang_projects/erlang-rust-nif/rust_src/lib/x86_64-apple-darwin" "-lSystem" "-lpthread" "-lc" "-lm" "-dynamiclib" "-Wl,-dylib" "-lcompiler-rt"
note: ld: warning: directory not found for option '-L/Users/macpro/erlang_projects/erlang-rust-nif/rust_src/.rust/lib/x86_64-apple-darwin'
ld: warning: directory not found for option '-L/Users/macpro/erlang_projects/erlang-rust-nif/rust_src/lib/x86_64-apple-darwin'
Undefined symbols for architecture x86_64:
  "_enif_make_badarg", referenced from:
      native_add::__rust_abi in er-75adb9f2bb77bd1a.o
  "_enif_get_int", referenced from:
      native_add::__rust_abi in er-75adb9f2bb77bd1a.o
  "_enif_make_int", referenced from:
      native_add::__rust_abi in er-75adb9f2bb77bd1a.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

error: aborting due to previous error
Could not compile `er`.
@erszcz
Copy link
Owner

erszcz commented Mar 12, 2015

Hi! I'm aware of that, but don't have time to fix it. Please try branch macosx-wip, but don't forget to customize the Makefile:

ERLANG_SRC_DIR ?= ${HOME}/.kerl/builds/17.1/otp_src_17.1
ERLANG_EI_LIB_DIR ?= ${HOME}/apps/erlang/17.1/lib/erl_interface-3.7.17/lib

@erszcz
Copy link
Owner

erszcz commented Mar 12, 2015

This problem really boils down to adding -flat_namespace -undefined suppress to the compiler command line. If you know how to convince Cargo to do that, it should build just fine.

@ChinaXing
Copy link

-flat_namespace -undefined suppress it works

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

3 participants