rustwasm / wasm-bindgen

Facilitating high-level interactions between Wasm modules and JavaScript
https://rustwasm.github.io/docs/wasm-bindgen/
Apache License 2.0
7.8k stars 1.08k forks source link

Has conflict with `ed25519_dalek` #763

Closed qdwang closed 6 years ago

qdwang commented 6 years ago

When I extern the crate ed25519_dalek , the compile will end like this

error: linking with `rust-lld` failed: exit code: 1
  |
  = note: "rust-lld" "-flavor" "wasm" "-L" "/home/dev/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/test.19xskxhu99mmadr0.rcgu.o" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/test.1ev0pg2yv7uq1tqt.rcgu.o" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/test.203hy7dgui6bysqw.rcgu.o" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/test.2qnir25p85uw5e91.rcgu.o" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/test.2x1ayn3utzndh3z5.rcgu.o" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/test.3aw1q4sdcss0n5tm.rcgu.o" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/test.3phyj76f7lcamt00.rcgu.o" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/test.3ve720hme8awgbb8.rcgu.o" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/test.42cqg2gvlfh13jqa.rcgu.o" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/test.4c9jdzio2h2iqwre.rcgu.o" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/test.4knf50xkgnpkdn9q.rcgu.o" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/test.4qabq9alfehet0xh.rcgu.o" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/test.4qgsvaf0lftxuy08.rcgu.o" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/test.4qrk1gmu355nv1uj.rcgu.o" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/test.52rrpc90m0pu602.rcgu.o" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/test.560kl75tqxcg9ljl.rcgu.o" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/test.jdeba4i7ylmsrk6.rcgu.o" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/test.pi9yxtkntvulsxw.rcgu.o" "-o" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/test.wasm" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/test.1c2l7k2jkxtny0o2.rcgu.o" "--gc-sections" "-O0" "-L" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps" "-L" "/home/dev/Codes/tradebot/target/debug/deps" "-L" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/build/clear_on_drop-1f21896c053755b3/out" "-L" "/home/dev/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/libwasm_bindgen-a3aec8487745a594.rlib" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/libed25519_dalek-cdb9cfb70e9e8472.rlib" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/libfailure-b228f34278b2f690.rlib" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/libcurve25519_dalek-9b890ea9e6d2dad5.rlib" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/libsubtle-e155a88dd5eecbea.rlib" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/libdigest-46cde12acb8ffb41.rlib" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/libgeneric_array-ee2ec8f11a864a5b.rlib" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/libtypenum-540eaecc4104c4dd.rlib" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/libbyteorder-b1a6916f62dbbcac.rlib" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/libclear_on_drop-586b852cf95f1b22.rlib" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/librand-cc74bf65b47dde11.rlib" "/home/dev/Codes/tradebot/target/wasm32-unknown-unknown/debug/deps/librand_core-55114bc3eabdc575.rlib" "/home/dev/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libstd-8e3cec0bb5629fcf.rlib" "/home/dev/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libpanic_abort-265eee3a5db30414.rlib" "/home/dev/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libunwind-82e47e05c06673bf.rlib" "/home/dev/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/liblibc-910b3a262d3373d2.rlib" "/home/dev/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/liballoc_system-2bb85ef94d0944b3.rlib" "/home/dev/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libdlmalloc-9d814e313fb2f115.rlib" "/home/dev/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/liballoc-42c17fcb46d45429.rlib" "/home/dev/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-464bb610bde6bbbb.rlib" "/home/dev/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcompiler_builtins-78c4fbf931ab15cb.rlib" "--no-threads" "-z" "stack-size=1048576" "--stack-first" "--allow-undefined" "--no-entry" "--export-table"
  = note: rust-lld: error: unknown file type: hide.o

error: aborting due to previous error
alexcrichton commented 6 years ago

Thanks for the report! I don't think this is an issue wasm-bindgen but rather this is an issue with the clear-on-drop crate which includes a C file that likely isn't compiled quite right for the wasm target. It looks though like that crate has a feature to avoid compiling the C, so making sure that's used should do the trick!

aep commented 6 years ago

jup the nightly feature of ed25519_dalek works.