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

Fresh install of rustup gives "linking with cc failed: exit status: 1" #4042

Closed
2 tasks done
fenilli opened this issue Oct 6, 2024 · 1 comment
Closed
2 tasks done
Labels
not-rustup Whatever is described in this issue isn't Rustup's fault

Comments

@fenilli
Copy link

fenilli commented Oct 6, 2024

Verification

Problem

A fresh install of rustup in zorin os gives:

cargo run
   Compiling no_name v0.1.0 (/home/fenilli/Desktop/no_name)
error: linking with `cc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/home/fenilli/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/home/fenilli/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/home/fenilli/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/home/fenilli/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin" VSLANG="1033" "cc" "-m64" "/tmp/rustc6IMaA7/symbols.o" "/home/fenilli/Desktop/no_name/target/debug/deps/no_name-d9b90d4be2419702.1zbf99ndv6939puzzn6p26los.rcgu.o" "/home/fenilli/Desktop/no_name/target/debug/deps/no_name-d9b90d4be2419702.6wyyaja2umqw0d8nt270u13qk.rcgu.o" "/home/fenilli/Desktop/no_name/target/debug/deps/no_name-d9b90d4be2419702.a2itg91xahkldzw9kgyfucify.rcgu.o" "/home/fenilli/Desktop/no_name/target/debug/deps/no_name-d9b90d4be2419702.b63fvr20l2futxsmbbgwfruuc.rcgu.o" "/home/fenilli/Desktop/no_name/target/debug/deps/no_name-d9b90d4be2419702.d5edjvb0dhmcc8rhbcpcj7eh0.rcgu.o" "/home/fenilli/Desktop/no_name/target/debug/deps/no_name-d9b90d4be2419702.evagspyinn64el5p25h45l1mh.rcgu.o" "/home/fenilli/Desktop/no_name/target/debug/deps/no_name-d9b90d4be2419702.62x3n5mj3d6xfq6oruf39yz7c.rcgu.o" "-Wl,--as-needed" "-L" "/home/fenilli/Desktop/no_name/target/debug/deps" "-L" "/home/fenilli/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/fenilli/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-1c4b19562077c20d.rlib" "/home/fenilli/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-85a631ebc91746e0.rlib" "/home/fenilli/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-fdace1a0b4cda412.rlib" "/home/fenilli/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-e5c28d21823e9a85.rlib" "/home/fenilli/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-1e0edbcd516a8cce.rlib" "/home/fenilli/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-77a1dc5e8fb357d6.rlib" "/home/fenilli/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-8c9d2edb6dff139f.rlib" "/home/fenilli/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-ecadd85ae8bacc0c.rlib" "/home/fenilli/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-67895a0c8dd8130b.rlib" "/home/fenilli/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-5b4263e767961458.rlib" "/home/fenilli/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-4f03d5a171522141.rlib" "/home/fenilli/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-9e4e8543de06315e.rlib" "/home/fenilli/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-7fc51dfce9c057eb.rlib" "/home/fenilli/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-7ec98a9b1cc1792f.rlib" "/home/fenilli/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-2f9b4333f6d32438.rlib" "/home/fenilli/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-b6fe0262c36c500a.rlib" "/home/fenilli/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-2a862c0b1c86f483.rlib" "/home/fenilli/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-500f37ee5bcf0ffe.rlib" "/home/fenilli/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-06dfbf1de02fde3b.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/home/fenilli/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/fenilli/Desktop/no_name/target/debug/deps/no_name-d9b90d4be2419702" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
  = note: /usr/bin/ld: cannot find Scrt1.o: No such file or directory
          /usr/bin/ld: cannot find crti.o: No such file or directory
          collect2: error: ld returned 1 exit status
          

error: could not compile `no_name` (bin "no_name") due to 1 previous error

Steps

  1. Install rustup using curl
  2. Run cargo new no_name
  3. Run cargo run or cargo build

Possible Solution(s)

Add mention in the documentation or FAQ about this common problem with solutions to it like sudo apt install gcc-multilib for ubuntu.

Notes

No response

Rustup version

rustup 1.27.1 (54dd3d0 2024-04-24)

Installed toolchains

Default host: x86_64-unknown-linux-gnu
rustup home: /home/fenilli/.rustup

stable-x86_64-unknown-linux-gnu (default)
rustc 1.81.0 (eeb90cda1 2024-09-04)

OS version

Distributor ID: Zorin
Description: Zorin OS 17.2
Release: 17
Codename: jammy

@fenilli fenilli added the bug label Oct 6, 2024
@rami3l
Copy link
Member

rami3l commented Oct 7, 2024

@fenilli Thanks for filing this issue!

This looks more like a general question regarding the actual usage of the Rust toolchain rather than the scope of this project, i.e. its distribution.

As such, I'm closing this issue as a duplicate of rust-lang/rust#25289.

Installing multilib is indeed the solution of one of the possible root causes (rust-lang/rust#25289 (comment)), but an ld exit code of 1 could mean many different things and needs to be analyzed case by case.

@rami3l rami3l added not-rustup Whatever is described in this issue isn't Rustup's fault and removed bug labels Oct 7, 2024
@rami3l rami3l closed this as not planned Won't fix, can't repro, duplicate, stale Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-rustup Whatever is described in this issue isn't Rustup's fault
Projects
None yet
Development

No branches or pull requests

2 participants