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

error: linking with cc failed: exit code: 1 #158

Open
saarshah opened this issue Jun 28, 2019 · 4 comments
Open

error: linking with cc failed: exit code: 1 #158

saarshah opened this issue Jun 28, 2019 · 4 comments

Comments

@saarshah
Copy link

My environment is as below;
rustc --version
rustc 1.37.0-nightly (de7c4e423 2019-06-23)
cargo --version
cargo 1.37.0-nightly (807429e1b 2019-06-11)
WSL : Ubuntu 18.04.2 LTS

When I run cargo afl build , received following error with command RUST_BACKTRACE=full cargo afl build ;

error: linking with cc failed: exit code: 1
|
= note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.0.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.1.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.10.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.11.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.12.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.13.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.14.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.15.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.2.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.3.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.4.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.5.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.6.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.7.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.8.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.9.rcgu.o" "-o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.4d27jvcxjvs12e1j.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-Wl,-O1" "-nodefaultlibs" "-L" "/mnt/c/Users/Ali/myProject-rust/target/debug/deps" "-L" "/home/saarshah/.local/share/afl.rs/rustc-1.37.0-nightly-de7c4e4/afl.rs-0.4.3/afl-llvm-rt" "-L" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-lafl-llvm-rt" "-Wl,--start-group" "-Wl,-Bstatic" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-d02520163eb5c3fb.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-f9d005790cbe2e04.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace-9a7649708f619f95.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace_sys-a9c5860e818703cf.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-9b5d69266c8348e9.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-8ac95f18462656f4.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-f3c90959ca0f050f.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-2ddd77abb50e1ad9.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-a1d86b7ded82f430.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-276eb929203479ae.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-9476d949197c9007.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-b1cee10341f7c85c.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-763222dcec00e4cd.rlib" "-Wl,--end-group" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-b62da616a55f3150.rlib" "-Wl,-Bdynamic" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil"
= note: /usr/bin/ld: __sancov_guards has both ordered [__sancov_guards' in /mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.1.rcgu.o] and unordered [__sancov_guards' in /mnt/c/Users/Ali/myProject-rust/target/debug/build/bindgen-d2534959d7c9fdb6/build_script_build-d2534959d7c9fdb6.build_script_build.6b6mfejq-cgu.1.rcgu.o] sections
/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 bindgen.
warning: build failed, waiting for other jobs to finish...
error: linking with cc failed: exit code: 1
|
= note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.0.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.1.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.10.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.11.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.12.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.13.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.14.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.15.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.2.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.3.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.4.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.5.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.6.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.7.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.8.rcgu.o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.9.rcgu.o" "-o" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c" "/mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.4i4psbdhq70cwtbw.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-Wl,-O1" "-nodefaultlibs" "-L" "/mnt/c/Users/Ali/myProject-rust/target/debug/deps" "-L" "/home/saarshah/.local/share/afl.rs/rustc-1.37.0-nightly-de7c4e4/afl.rs-0.4.3/afl-llvm-rt" "-L" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-lafl-llvm-rt" "-Wl,--start-group" "-Wl,-Bstatic" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-d02520163eb5c3fb.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-f9d005790cbe2e04.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace-9a7649708f619f95.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace_sys-a9c5860e818703cf.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-9b5d69266c8348e9.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-8ac95f18462656f4.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-f3c90959ca0f050f.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-2ddd77abb50e1ad9.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-a1d86b7ded82f430.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-276eb929203479ae.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-9476d949197c9007.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-b1cee10341f7c85c.rlib" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-763222dcec00e4cd.rlib" "-Wl,--end-group" "/home/saarshah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-b62da616a55f3150.rlib" "-Wl,-Bdynamic" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil"
= note: /usr/bin/ld: __sancov_guards has both ordered [__sancov_guards' in /mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.0.rcgu.o] and unordered [__sancov_guards' in /mnt/c/Users/Ali/myProject-rust/target/debug/build/typenum-bf1be05145565e8c/build_script_main-bf1be05145565e8c.build_script_main.61krjhde-cgu.0.rcgu.o] sections
/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 typenum.
warning: build failed, waiting for other jobs to finish...
error: build failed

@stusmall
Copy link

stusmall commented Aug 2, 2019

Same here but with failure_derive

@RazrFalcon
Copy link

Same problem.

@abonander
Copy link

Upgrade to LLVM broke compiling with sanitizers in release mode; I can compile if I do env RUSTFLAGS='-C opt-level=0' cargo afl build as per rust-lang/rust#53945 (comment)

@DhanAnJay-Ahire
Copy link

After. updating the OS from 10.12 to 10.14 Catalina then I have started getting this issue, So to solve this incompatible issue I have updated my Xcode developer kit using. below command and its started working out, so please try it once, I have tried and its solved now...I can execute my cargo and its working as expected

xcode-select --install

olof-nord added a commit to olof-nord/zkgroup that referenced this issue May 2, 2021
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

5 participants