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

Linking error rust_sodium using neon crate #722

Closed
b-zee opened this Issue Jan 13, 2019 · 3 comments

Comments

Projects
None yet
2 participants
@b-zee
Copy link

b-zee commented Jan 13, 2019

This might be a very specific error, but I'm not sure where to post else.

I'm trying to use neon to build a Node.js Addon for safe_app. My Rust package is located here: https://github.com/b-zee/safe_app_node/tree/master/native

When compiling this with cargo build (stable as well as nightly), I get this:

$ cargo +stable build
   Compiling safe_app_node v0.1.0 (/home/benno/src/safe_app_node/native)
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/benno/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/benno/src/safe_app_node/native/target/debug/deps/safe_app_node.1obz44bdcj53mqsa.rcgu.o" "/home/benno/src/safe_app_node/native/target/debug/deps/safe_app_node.1t1a2ehv6r2194rc.rcgu.o" "/home/benno/src/safe_app_node/native/target/debug/deps/safe_app_node.1za13ak0jnf7sipq.rcgu.o" "/home/benno/src/safe_app_node/native/target/debug/deps/safe_app_node.23tllrpmdoezrg8o.rcgu.o" "/home/benno/src/safe_app_node/native/target/debug/deps/safe_app_node.263niw79bm20dxma.rcgu.o" "/home/benno/src/safe_app_node/native/target/debug/deps/safe_app_node.28z7tlyszl3odkrj.rcgu.o" "/home/benno/src/safe_app_node/native/target/debug/deps/safe_app_node.2dw4ii990w48wcvm.rcgu.o" "/home/benno/src/safe_app_node/native/target/debug/deps/safe_app_node.2ls5k9j6eyl18hjv.rcgu.o" "/home/benno/src/safe_app_node/native/target/debug/deps/safe_app_node.2sg7035uhv2lesux.rcgu.o" "/home/benno/src/safe_app_node/native/target/debug/deps/safe_app_node.2trc6ri32jrqusom.rcgu.o" "/home/benno/src/safe_app_node/native/target/debug/deps/safe_app_node.2vg78b0phx5y6gt4.rcgu.o" "/home/benno/src/safe_app_node/native/target/debug/deps/safe_app_node.2z5r9qhklnch0arr.rcgu.o" "/home/benno/src/safe_app_node/native/target/debug/deps/safe_app_node.34p1geb5zz36olj4.rcgu.o" "/home/benno/src/safe_app_node/native/target/debug/deps/safe_app_node.3kv0gm97izyooogj.rcgu.o" "/home/benno/src/safe_app_node/native/target/debug/deps/safe_app_node.3mbi6ev8665tb0yl.rcgu.o" "/home/benno/src/safe_app_node/native/target/debug/deps/safe_app_node.3ov8u985dixjbxz5.rcgu.o" "/home/benno/src/safe_app_node/native/target/debug/deps/safe_app_node.4wq4t7yoopi7cxs4.rcgu.o" "/home/benno/src/safe_app_node/native/target/debug/deps/safe_app_node.56k0u7svtvb2i839.rcgu.o" "/home/benno/src/safe_app_node/native/target/debug/deps/safe_app_node.5csdetmjlpttr4z5.rcgu.o" "/home/benno/src/safe_app_node/native/target/debug/deps/safe_app_node.5ehn85ubqnsg7fz0.rcgu.o" "/home/benno/src/safe_app_node/native/target/debug/deps/safe_app_node.hnedrxycpo2z2yn.rcgu.o" "/home/benno/src/safe_app_node/native/target/debug/deps/safe_app_node.hspwxjpzbhq7vwo.rcgu.o" "-o" "/home/benno/src/safe_app_node/native/target/debug/deps/libsafe_app_node.so" "/home/benno/src/safe_app_node/native/target/debug/deps/safe_app_node.3t0dfr1jdht10z7z.rcgu.o" "/home/benno/src/safe_app_node/native/target/debug/deps/safe_app_node.2l1fmik5zykootf9.rcgu.o" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-L" "/home/benno/src/safe_app_node/native/target/debug/deps" "-L" "/home/benno/src/safe_app_node/native/target/debug/build/neon-runtime-4180a4fc01b04f92/out" "-L" "/home/benno/src/safe_app_node/native/target/debug/build/miniz-sys-cbebc793876cde9a/out" "-L" "/home/benno/src/safe_app_node/native/target/debug/build/rust_sodium-sys-1c16f7bb98e02e94/out/installed/lib" "-L" "/home/benno/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libsafe_app-a47f2ea8e4630018.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libsafe_core-33da5aacd8901d97.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libtokio_core-fe1dde68f83e1316.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libscoped_tls-263167941deac72b.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libtokio-f2f9c77d245056ad.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libtokio_uds-488779cf48f8eabb.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libmio_uds-191195bfa1758923.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libtokio_udp-34b40293d56660ad.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libtokio_tcp-383e84671cc99108.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libtokio_timer-43b1e250d992ad1a.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libtokio_reactor-8c2059b510bb48ef.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libtokio_fs-e493fd02b3b6895b.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libtokio_threadpool-7f960d8654ff8cba.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libcrossbeam_deque-5b1b7f6b2b72ffaf.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libcrossbeam_epoch-a08b4b40ca6620d3.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libmemoffset-f16460d3f6736585.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libarrayvec-740ee174f059b61c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libnodrop-2f9d1e00bc00c16c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libcrossbeam_channel-7b3b1bc6bef25bfe.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libparking_lot-8f73d03efc07bec8.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libparking_lot_core-7ea3e3cdc4f78eac.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libsmallvec-ba4312df925312e6.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libunreachable-9c18df786dfdfc1d.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libvoid-20f9a661b97ec2ec.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/librand-e3fabe61930f9dde.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/librand_xorshift-3dd6b2ae6532f6a5.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/librand_pcg-e7fbe7a4691abf67.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/librand_hc-193aaec7b88f844e.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/librand_chacha-0947a9a6c32affc1.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/librand_isaac-e9fea33fd193b83f.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/librand_os-f7fcb2fa1fa3039f.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/librand_core-0eceb13e5c136feb.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/liblock_api-2db1a8208d8207a8.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libowning_ref-b78d45794af2aa02.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libstable_deref_trait-9f76f6fdc44adb53.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libscopeguard-bb234f01a2682a8a.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libtokio_codec-3f24f55c310ce27e.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libtokio_io-197ea1e2fe99d7e8.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libtokio_current_thread-e6b4fccc154eef97.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libtokio_executor-db085746e714ba34.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libcrossbeam_utils-5b212b0f27824d85.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libself_encryption-74b80b13e5cd9366.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libmemmap-ec662c0f502733ca.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libbrotli-43547abab473121c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libbrotli_decompressor-e1b604e632310ac2.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/liballoc_no_stdlib-6ca4856ca26be006.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libdata_encoding-6af89aa7dd7e05eb.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libchrono-74e223b7af395d66.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/librouting-31ded4831de76242.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libresource_proof-e25a6e3c99600699.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libnum_bigint-f09b112677400567.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/librustc_serialize-9508ab04d84b0c2e.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/liblru_time_cache-8500746d62035666.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libitertools-c38144b0383799a5.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libeither-22e92b47b9b79d78.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libcrust-0052f03e21495cd2.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libtiny_keccak-536da1d35649fbb7.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/librust_sodium-5c93b9e35a28b08f.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/librust_sodium_sys-16d6eaeb0b9b9a35.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libigd-d2729967c37604bc.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libxmltree-c706d5277703ac2f.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libxml-16d3d9f1fa16681b.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libbitflags-6348c97519d05823.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libhyper-92aeebdd1adf4b64.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libmime-f5818126b8f2ce21.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/liblanguage_tags-560ccffe6c7cc0bc.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libtypeable-01ee66ae97ad241f.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libnum_cpus-403aff2755cb85bf.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libunicase-975f82a35e0ccdc5.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libget_if_addrs-ee670e59322fec72.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libc_linked_list-a1f4bfc7849035c4.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libhex-32f8c353e92457ad.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libmaidsafe_utilities-b7e759c93331b9d7.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libws-b6eb4ff17c4b7508.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libbytes-4870a86b20548b66.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libslab-bce023cac3ad8fd4.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libsha1-22ff90e029b499f2.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libmio-6dd784fb963232fb.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libslab-aeeeff3fc23ce2a0.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libiovec-005280d694a88389.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libnet2-e56ed040d7d9dc3c.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/liblazycell-d57f602faccac308.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libhttparse-d809224f2da67ed5.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/liburl-48d8360f6a6793f0.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libpercent_encoding-43677001a375deee.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libidna-1f4fdcaf4cb26e7d.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libunicode_normalization-669d4423ec0a6953.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libunicode_bidi-b26a18591d1eef04.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libmatches-2d7356b8fe9b881d.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libregex-115638fd726d5713.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libutf8_ranges-e195781ad0011dd8.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libregex_syntax-f140310bb257129e.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libucd_util-b81335c88a08b463.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libthread_local-8d08b5002efdeaa1.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/liblazy_static-509a2e653116fcf3.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libaho_corasick-d2f5c0d13e314728.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libmemchr-41ec88fb51a14bf4.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/librand-10d206308ccb277a.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/librand-4b7651cff5b32f52.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/liblog4rs-aab72d8a7f976e46.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libtoml-c20243731401113e.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libserde_value-46851c8b3cb7bbac.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libordered_float-1dc07e21f2f222ca.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libserde_yaml-1dba459d5bfe4003.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libyaml_rust-0a2ea1254eb7022a.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/liblinked_hash_map-cc7a398ad6eea8fe.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libdtoa-404cacfba5d4ad47.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libflate2-1cf61f92e2037123.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libminiz_sys-1ec069179bc02293.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libchrono-4d2bede0ba70b2fc.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libnum-96cf7559eacb6770.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libnum_iter-d1728e29db6d4308.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libnum_integer-8a7880f4fe5eb9c6.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libtime-e9590389e8eb8d06.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libtypemap-9e63f1d2fcd6f399.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libunsafe_any-e8c0df3cbe5e2107.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libtraitobject-1b97f04fc7ab4db4.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/liblog_mdc-4efb12e00b97103a.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libhumantime-0c75e21e5361151b.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libfnv-67d23d793a84bf7e.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libcrossbeam-be26629a741973e4.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libantidote-110d464f249e3c9f.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/liblog-1631a8157a3e19d8.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libbincode-78c278ed27619cee.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libnum_traits-e0f66d16ee9cbb38.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libnum_traits-c5e06e595a0cb625.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/liblru_cache-33b509b467c4ac49.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/liblinked_hash_map-427ca5bab9813a3b.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libfutures-474ab6be12c27105.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libffi_utils-e274f784fc52d286.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libwalkdir-b90aec21ec702245.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libsame_file-7541112b362128b6.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/liblog-f2d4af19c5fff050.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libcfg_if-8a744a38092605fe.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libbase64-1c0dbba35f357c42.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libsafemem-c400a161ac233966.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libbyteorder-4a6f739fda6afe71.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libconfig_file_handler-e0a5f5206fea6427.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libunwrap-e3fe6ccc3785076a.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libquick_error-cfe489ed74a99fd2.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/liblazy_static-84873ba05e555585.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libserde_json-06f8abc07a96f447.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libryu-65864fae2ee4ec12.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libitoa-f57da6b39c9b5c71.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libserde-2c82cec8327e8fe2.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libfs2-8ef73fb8ca5ebef7.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/liblibc-543775c145a04fb6.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libneon-958a33b85bc47ff7.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libsemver-5416b6de0ea051e7.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libsemver_parser-ccd91ddac9cf8ea5.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libcslice-e116dad8a3ac7add.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libneon_runtime-9cd3514d9f261edf.rlib" "-Wl,--no-whole-archive" "-Wl,--start-group" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libstd-89cf9eb8d404bb7b.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libpanic_unwind-b4f2368c97086610.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libunwind-4c51ac82f70822c1.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/liballoc_system-34fc26c16207806e.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/liblibc-d0b3565c39ede68e.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/liballoc-ac8a19e2dea4f5a1.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustcSyC92a/libcore-bc99d396b91fe14a.rlib" "-Wl,--no-whole-archive" "-Wl,--end-group" "/tmp/rustcSyC92a/libcompiler_builtins-5f64e7823d30511e.rlib" "-Wl,-Bdynamic" "-lutil" "-lutil" "-ldl" "-lrt" "-lpthread" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil" "-shared"
  = note: /usr/bin/ld: /tmp/rustcSyC92a/librust_sodium_sys-16d6eaeb0b9b9a35.rlib(librdrand_la-randombytes_salsa20_random.o): relocation R_X86_64_TPOFF32 against `stream' can not be used when making a shared object; recompile with -fPIC
          /usr/bin/ld: /tmp/rustcSyC92a/librust_sodium_sys-16d6eaeb0b9b9a35.rlib(libsodium_la-randombytes.o): relocation R_X86_64_PC32 against symbol `randombytes_sysrandom_implementation' can not be used when making a shared object; recompile with -fPIC
          /usr/bin/ld: final link failed: bad value
          collect2: error: ld returned 1 exit status


error: aborting due to previous error

error: Could not compile `safe_app_node`.

To learn more, run the command again with --verbose.

I've come across a similar issue wireapp/libsodium-neon#15 that includes the same error when linking rust_sodium_sys.

This probably has to do something with how neon works, but I'm not entirely sure what.

Edit: Neon is not the culprit, see my first reply for steps to reproduce without Neon. I am using stable and Arch Linux by the way.

@0xbe7a

This comment has been minimized.

Copy link

0xbe7a commented Jan 13, 2019

I have the same problem with sodiumoxide. The Build works if i compile on my ubuntu machine. Are you also using Archlinux?

@b-zee

This comment has been minimized.

Copy link
Author

b-zee commented Jan 13, 2019

Yes, I am using Arch Linux. Looking around at some related issues at rust_sodium it might have something to do with that.

I've just reproduced the same issue without Neon.

Steps:

  1. cargo new --lib safe_app_test
  2. Add safe_app dependency
  3. Add crate-type = ["dylib"] to [lib]
  4. Add a public function calling a safe_app function:
pub fn my_function() -> bool {
    safe_app::app_is_mock()
}
  1. cargo build

@0xbe7a Have you tried using any other OS?

@b-zee

This comment has been minimized.

Copy link
Author

b-zee commented Jan 13, 2019

I'm sorry for this issue. Re-reading some discussions about it, it can be solved with the introduced RUST_SODIUM_DISABLE_PIE=1 environment variable. I used it before I made this issue, but without cargo clean it apparently does not change a thing (while I could see it recompiles rust_sodium, so I'm confused).

Though this discussion is this relevant, it's solved.

Related references (hopefully making this issue more visible and apparent):

maidsafe/rust_sodium@0e9bbdb#commitcomment-21984958
jedisct1/libsodium#292
maidsafe/rust_sodium#34
maidsafe/rust_sodium#40

@b-zee b-zee closed this Jan 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment