Error: linking with `cc` failed: exit status: 1

Hello, I get error with cc these days, and don't know how to fix it. Every thing works find before.

This error happens when:

cargo build

or 

cargo test 

This error will not happen when:

cargo build --relase

What I tried:

reinstall rustup

cargo clean

Error:

error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-arch" "arm64" "/Users/user_a/project/target/debug/deps/user_ticker-2d62e7057dc8af2c.10kbn4uv63vhxk5f.rcgu.o" "/Users/user_a/project/target/debug/deps/user_ticker-2d62e7057dc8af2c.10s3mqsf46nr05qe.rcgu.o" "/Users/user_a/project/target/debug/deps/user_ticker-2d62e7057dc8af2c.139e5rwnae8rn4lb.rcgu.o" "/Users/user_a/project/target/debug/deps/user_ticker-2d62e7057dc8af2c.13uor8e06ebyg2wo.rcgu.o" "/Users/user_a/project/target/debug/deps/user_ticker-2d62e7057dc8af2c.14umqc67u18g810f.rcgu.o" "/Users/user_a/project/target/debug/deps/user_ticker-2d62e7057dc8af2c.17gpsuipatrcg7yj.rcgu.o" "/Users/user_a/project/target/debug/deps/user_ticker-2d62e7057dc8af2c.17lnvf1xr2jxxl5b.rcgu.o" "/Users/user_a/project/target/debug/deps/user_ticker-2d62e7057dc8af2c.1899kg13heq0gz2c.rcgu.o" "/Users/user_a/project/target/debug/deps/user_ticker-2d62e7057dc8af2c.19yzghlxkwut5jh9.rcgu.o" "/Users/user_a/project/target/debug/deps/user_ticker-2d62e7057dc8af2c.1aolc7b8jnxjr9kk.rcgu.o" "/Users/user_a/project/target/debug/deps/user_ticker-2d62e7057dc8af2c.1bz26lmnglqe40u1.rcgu.o" "/Users/user_a/project/target/debug/deps/user_ticker-2d62e7057dc8af2c.1clbjldpjt3vrfvm.rcgu.o" "/Users/user_a/project/target/debug/deps/user_ticker-2d62e7057dc8af2c.1ex59egge0q874fc.rcgu.o" "/Users/user_a/project/target/debug/deps/user_ticker-2d62e7057dc8af2c.1hxnaow8vo9xo4tf.rcgu.o" "/Users/user_a/project/target/debug/deps/user_ticker-2d62e7057dc8af2c.1ikypqlgiyqo4xzm.rcgu.o" "/Users/user_a/project/target/debug/deps/user_ticker-2d62e7057dc8af2c.1jquhurhfataaw3w.rcgu.o" "/Users/user_a/project/target/debug/deps/user_ticker-

.........

"/Users/user_a/project/target/debug/deps/libhashbrown-d8c8f18936fec1ca.rlib" "/Users/user_a/project/target/debug/deps/libserde-7d290b25e9fd6320.rlib" "/Users/user_a/project/target/debug/deps/libmobc-e5aa5c156c2ef5d0.rlib" "/Users/user_a/project/target/debug/deps/libfutures_channel-11befdfbcf240425.rlib" "/Users/user_a/project/target/debug/deps/libfutures_timer-0d19f38ffc84545d.rlib" "/Users/user_a/project/target/debug/deps/libthiserror-025e263ee09cce7d.rlib" "/Users/user_a/project/target/debug/deps/libredis-1d493ed83e1a79cf.rlib" "/Users/user_a/project/target/debug/deps/libdtoa-c141c6f34c0c52ec.rlib" "/Users/user_a/project/target/debug/deps/liburl-c3cb311128b3bd17.rlib" "/Users/user_a/project/target/debug/deps/libidna-4cbdd950c967b887.rlib" "/Users/user_a/project/target/debug/deps/libunicode_normalization-03f3a14659c1555c.rlib" "/Users/user_a/project/target/debug/deps/libtinyvec-d207ef3b549ed393.rlib" "/Users/user_a/project/target/debug/deps/libtinyvec_macros-041f8f0c9cfc6d0b.rlib" "/Users/user_a/project/target/debug/deps/libunicode_bidi-bbbd0fb202c97e05.rlib" "/Users/user_a/project/target/debug/deps/libform_urlencoded-54c8ce8386a2694e.rlib" "/Users/user_a/project/target/debug/deps/libpercent_encoding-7bf5a319a4d2af5e.rlib" "/Users/user_a/project/target/debug/deps/libmatches-da94800807cd40dc.rlib" "/Users/user_a/project/target/debug/deps/libitoa-89f44f73e91c96dd.rlib" "/Users/user_a/project/target/debug/deps/libsha1-96b7229fc1ec5322.rlib" "/Users/user_a/project/target/debug/deps/libaho_corasick-3ef634016201cf6c.rlib" "/Users/user_a/project/target/debug/deps/libmemchr-b6884d8246c2b964.rlib" "/Users/user_a/project/target/debug/deps/libregex_syntax-af77ad063800a3a8.rlib" "/Users/govo/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd-14131fec8d68ac91.rlib" "/Users/govo/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libpanic_unwind-b9f6e3876ed2586c.rlib" "/Users/govo/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libobject-86fcbf6a3440cba5.rlib" "/Users/govo/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libmemchr-d18a5d6796083fb1.rlib" "/Users/govo/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libaddr2line-d6774f4e1f890943.rlib" "/Users/govo/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libgimli-d280ea049e216073.rlib" "/Users/govo/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_demangle-adf188cef5835aec.rlib" "/Users/govo/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd_detect-3319673a080f2054.rlib" "/Users/govo/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libhashbrown-fdeb0068d017c92e.rlib" "/Users/govo/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_alloc-d3d760f168f99f16.rlib" "/Users/govo/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libunwind-bbc1ff69954ec7aa.rlib" "/Users/govo/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcfg_if-eb937e4ebb9dfc13.rlib" "/Users/govo/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liblibc-b7ebdbddd4f4f732.rlib" "/Users/govo/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liballoc-a4fd6bd0981bd1bd.rlib" "/Users/govo/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_core-a6ba5abd095110d9.rlib" "/Users/govo/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcore-081494498d0f8be5.rlib" "/Users/govo/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-4b0e4c844ac47183.rlib" "-framework" "Security" "-framework" "Security" "-framework" "CoreFoundation" "-framework" "CoreServices" "-liconv" "-lSystem" "-lresolv" "-lc" "-lm" "-liconv" "-L" "/Users/govo/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "-o" "/Users/user_a/project/target/debug/deps/user_ticker-2d62e7057dc8af2c" "-Wl,-dead_strip" "-nodefaultlibs"
  = note: ld: in /Users/user_a/project/target/debug/deps/libcrypto-b347d41261ef6f3e.rlib(util_helpers.o), archive member 'util_helpers.o' with length 3560 is not mach-o or llvm bitcode for architecture arm64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

My env is M1 pro 14

Other Env:

gcc --version

Apple clang version 13.1.6 (clang-1316.0.21.2.3)

Target: arm64-apple-darwin21.4.0

Thread model: posix

InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

clang --version

Apple clang version 13.1.6 (clang-1316.0.21.2.3)

Target: arm64-apple-darwin21.4.0

Thread model: posix

rustup -V

rustup 1.24.3 (ce5817a94 2021-05-31)

info: This is the version for the rustup toolchain manager, not the rustc compiler.

info: The currently active rustc version is rustc 1.60.0 (7737e0b5c 2022-04-04)

Thank you very much!

I reinstall my computer OS , the problem fixed.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.