BurtonQin / lockbud

Statically detect memory, concurrency bugs and possible panic locations for Rust.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Linking Error

obraunsdorf opened this issue · comments

Hi,
I tried installing the detector as described in the Readme using cargo install --path . within a docker container running the rust:latest image.
Unfortunately the following error occurs.

error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-Wl,--eh-frame-hdr" "-L" "/usr/local/rustup/toolchains/nightly-2021-01-13-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/workspace/target/release/deps/rust_lock_bug_detector-c90916a71681a1c3.rust_lock_bug_detector.3zkkwcmj-cgu.0.rcgu.o" "/workspace/target/release/deps/rust_lock_bug_detector-c90916a71681a1c3.rust_lock_bug_detector.3zkkwcmj-cgu.1.rcgu.o" "/workspace/target/release/deps/rust_lock_bug_detector-c90916a71681a1c3.rust_lock_bug_detector.3zkkwcmj-cgu.10.rcgu.o" "/workspace/target/release/deps/rust_lock_bug_detector-c90916a71681a1c3.rust_lock_bug_detector.3zkkwcmj-cgu.11.rcgu.o" "/workspace/target/release/deps/rust_lock_bug_detector-c90916a71681a1c3.rust_lock_bug_detector.3zkkwcmj-cgu.12.rcgu.o" "/workspace/target/release/deps/rust_lock_bug_detector-c90916a71681a1c3.rust_lock_bug_detector.3zkkwcmj-cgu.13.rcgu.o" "/workspace/target/release/deps/rust_lock_bug_detector-c90916a71681a1c3.rust_lock_bug_detector.3zkkwcmj-cgu.14.rcgu.o" "/workspace/target/release/deps/rust_lock_bug_detector-c90916a71681a1c3.rust_lock_bug_detector.3zkkwcmj-cgu.15.rcgu.o" "/workspace/target/release/deps/rust_lock_bug_detector-c90916a71681a1c3.rust_lock_bug_detector.3zkkwcmj-cgu.2.rcgu.o" "/workspace/target/release/deps/rust_lock_bug_detector-c90916a71681a1c3.rust_lock_bug_detector.3zkkwcmj-cgu.3.rcgu.o" "/workspace/target/release/deps/rust_lock_bug_detector-c90916a71681a1c3.rust_lock_bug_detector.3zkkwcmj-cgu.4.rcgu.o" "/workspace/target/release/deps/rust_lock_bug_detector-c90916a71681a1c3.rust_lock_bug_detector.3zkkwcmj-cgu.5.rcgu.o" "/workspace/target/release/deps/rust_lock_bug_detector-c90916a71681a1c3.rust_lock_bug_detector.3zkkwcmj-cgu.6.rcgu.o" "/workspace/target/release/deps/rust_lock_bug_detector-c90916a71681a1c3.rust_lock_bug_detector.3zkkwcmj-cgu.7.rcgu.o" "/workspace/target/release/deps/rust_lock_bug_detector-c90916a71681a1c3.rust_lock_bug_detector.3zkkwcmj-cgu.8.rcgu.o" "/workspace/target/release/deps/rust_lock_bug_detector-c90916a71681a1c3.rust_lock_bug_detector.3zkkwcmj-cgu.9.rcgu.o" "-o" "/workspace/target/release/deps/rust_lock_bug_detector-c90916a71681a1c3" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-Wl,-O1" "-nodefaultlibs" "-L" "/workspace/target/release/deps" "-L" "/usr/local/rustup/toolchains/nightly-2021-01-13-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/usr/local/rustup/toolchains/nightly-2021-01-13-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-lrustc_driver-28f4036956f26eb4" "-Wl,--start-group" "-L" "/usr/local/rustup/toolchains/nightly-2021-01-13-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-lstd-8ca495943bae7405" "-Wl,--end-group" "-Wl,-Bstatic" "/usr/local/rustup/toolchains/nightly-2021-01-13-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-ea377e9224b11a8a.rlib" "-Wl,-Bdynamic" "-lLLVM-11-rust-1.51.0-nightly" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc"
  = note: /usr/bin/ld: cannot find -lLLVM-11-rust-1.51.0-nightly
          collect2: error: ld returned 1 exit status

Thx @obraunsdorf. I found that component llvm-tools-preview is a requirement to fix this issue. I've added that in README.md in PR #9. Could you check if it can work after running "rustup component add llvm-tools-preview" under dir "rust-lock-bug-detector"?

That solved it, thank you :)