protonscr

Build error: `collect2: fatal error: cannot find 'ld'`

protonopen
ValveSoftware/Proton#5958 · opened 2022-07-02 by athre0z · updated 2022-07-02 · 1 comments · github
Aathre0z 2022-07-02 github

When trying to compile latest head (75231818302bdf746d79ddf76e241363b9e2b5e8) from source, I'm running into the following error:

touch /home/ath/devel/Proton/build/build-proton_7.0-local/.wine-configure64
error: linking with `x86_64-linux-gnu-gcc` failed: exit status: 1
  |
  = note: "x86_64-linux-gnu-gcc" "-Wl,--version-script=/tmp/rustcsLOTLc/list" "-m64" "/home/ath/devel/Proton/build/build-proton_7.0-local/obj-mediaconv64/x86_64-unknown-linux-gnu/release/deps/protonmediaconverter.protonmediaconverter.25f6e458-cgu.1.rcgu.o" "-Wl,--as-needed" "-L" "/home/ath/devel/Proton/build/build-proton_7.0-local/obj-mediaconv64/x86_64-unknown-linux-gnu/release/deps" "-L" "/home/ath/devel/Proton/build/build-proton_7.0-local/obj-mediaconv64/release/deps" "-L" "/home/ath/devel/Proton/build/build-proton_7.0-local/dst-gstreamer64/lib64" "-L" "/home/ath/devel/Proton/build/build-proton_7.0-local/dst-gstreamer64/lib64" "-L" "/home/ath/devel/Proton/build/build-proton_7.0-local/dst-gst_base64/lib64" "-L" "/home/ath/devel/Proton/build/build-proton_7.0-local/dst-gstreamer64/lib64" "-L" "/home/ath/devel/Proton/build/build-proton_7.0-local/dst-gstreamer64/lib64" "-L" "/home/ath/devel/Proton/build/build-proton_7.0-local/dst-gst_base64/lib64" "-L" "/opt/rust/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,--start-group" "-Wl,--end-group" "-Wl,-Bstatic" "/opt/rust/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-2a0b2a4f96acb821.rlib" "-Wl,-Bdynamic" "-lgstaudio-1.0" "-lgstbase-1.0" "-lgsttag-1.0" "-lgstreamer-1.0" "-lgobject-2.0" "-lglib-2.0" "-lgstvideo-1.0" "-lgstbase-1.0" "-lgstreamer-1.0" "-lgobject-2.0" "-lglib-2.0" "-lgstbase-1.0" "-lgstreamer-1.0" "-lgobject-2.0" "-lglib-2.0" "-lgobject-2.0" "-lgstreamer-1.0" "-lgobject-2.0" "-lglib-2.0" "-lgobject-2.0" "-lglib-2.0" "-lgobject-2.0" "-lglib-2.0" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/opt/rust/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/ath/devel/Proton/build/build-proton_7.0-local/obj-mediaconv64/x86_64-unknown-linux-gnu/release/deps/libprotonmediaconverter.so" "-Wl,--gc-sections" "-shared" "-Wl,-zrelro" "-Wl,-znow" "-Wl,-O1" "-nodefaultlibs" "-fuse-ld=lld"
  = note: collect2: fatal error: cannot find 'ld'
          compilation terminated.

It looks like this sub-component attempts to link with lld, which isn't actually installed in the Docker container you are shipping. I figured it might be due to lld being present on the host and perhaps the configure script accidentally somehow propagating that into the container, but uninstalling LLVM on the host doesn't change anything. I'm on Arch with all packages at their latest version and compile using the podman container runtime. Command executed was simply make redist.

Aathre0z 2022-07-02 github

Ok, this turned out to be due to me having a customized Cargo config in ~/.cargo/config that instructs Cargo to link with lld. This somehow propagated into the containerized environment and then broke the build. I'm leaving it up to you folks to decide whether the host config being used in the container should be considered an issue or not.

Proton versions