Repository: rust
Issue: Compiler test failing to link on my machine
Labels: A-testsuite,T-compiler,C-bug,O-NixOS

`x test` fails for test `tests/ui/process/nofile-limit.rs`

```
failures:

---- [ui] tests/ui/process/nofile-limit.rs stdout ----

error: test compilation failed although it shouldn't!
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/ardi/repos/rust/tests/ui/process/nofile-limit.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/home/ardi/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/home/ardi/repos/rust/vendor" "--sysroot" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/stage1" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "-O" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-o" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/test/ui/process/nofile-limit/a" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/test/ui/process/nofile-limit/auxiliary" "-Ctarget-feature=+crt-static" "-Crpath=no" "-Crelocation-model=static"
stdout: none
--- stderr -------------------------------
error: linking with `cc` failed: exit status: 1
   |
   = note: LC_ALL="C" PATH="/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/bin:/home/ardi/.cargo/bin:/home/ardi/.cargo/env:/home/ardi/bin:~/.cargo/env :/root/.cargo/bin:/root/.cargo/env:/root/bin:/home/ardi/.local/share/pnpm:/nix/store/d03vq9y80w0vkmd9c37jf3zigr8s4v5p-kitty-0.33.1/bin:/nix/store/32hx7y3vn8l5wvpzw7jgradnxnlsb6y2-imagemagick-7.1.1-29/bin:/nix/store/2nhjsfc4pg74vqnsbjmnpi7359y6f3wi-ncurses-6.4-dev/bin:/run/wrappers/bin:/home/ardi/.nix-profile/bin:/nix/profile/bin:/home/ardi/.local/state/nix/profile/bin:/etc/profiles/per-user/ardi/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/nix/store/jsjfmx7r6cpyixxsg7bjl5cy3y8hw7k7-binutils-wrapper-2.41/bin:/nix/store/pc6yqwmnzy0xqdzm7j9kxhl0hrmk4p50-pciutils-3.11.1/bin:/nix/store/ac1hb5dc2z4biwgy8mjrhlifffkkrvdq-gcc-wrapper-13.2.0/bin" VSLANG="1033" "cc" "-m64" "/tmp/rustc73dC6M/symbols.o" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/test/ui/process/nofile-limit/a.nofile_limit.c5aa8a555885375c-cgu.0.rcgu.o" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/test/ui/process/nofile-limit/a.dd8hyozmsbxqgmoazn6utf5yl.rcgu.o" "-Wl,--as-needed" "-L" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/test/ui/process/nofile-limit/auxiliary" "-L" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-60ef30d958676897.rlib" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-fe57946337226baf.rlib" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-246a29011bde6415.rlib" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-5479b4a8d20f4688.rlib" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-2e4b8abd52125a19.rlib" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-3303cd3597228057.rlib" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-b4a7b7a72b12d448.rlib" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-d26554f9c1de6e27.rlib" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-8251e5e30578c862.rlib" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-a599b0ab33a7957b.rlib" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-f16e742e2b34d1a0.rlib" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-a7ad421e198006f9.rlib" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-a8e0e58cddd34f3f.rlib" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-bf936e0afd0ee19c.rlib" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-92d1fb2ed60f9bbe.rlib" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-lgcc_eh" "-lgcc" "-lc" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-b71e06355cb12e0e.rlib" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-eb77b523032bebb9.rlib" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-32c977092b49eb6a.rlib" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-c10ed332e0b9c5b7.rlib" "-Wl,-Bdynamic" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/ardi/repos/rust/build/x86_64-unknown-linux-gnu/test/ui/process/nofile-limit/a" "-Wl,--gc-sections" "-static" "-no-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-Wl,--strip-debug" "-nodefaultlibs"
   = note: clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
           /nix/store/hqvni28zpibl6jsqqimcvng6h6qm58xy-binutils-2.41/bin/ld: cannot find -lutil: No such file or directory
           /nix/store/hqvni28zpibl6jsqqimcvng6h6qm58xy-binutils-2.41/bin/ld: cannot find -lrt: No such file or directory
           /nix/store/hqvni28zpibl6jsqqimcvng6h6qm58xy-binutils-2.41/bin/ld: cannot find -lpthread: No such file or directory
           /nix/store/hqvni28zpibl6jsqqimcvng6h6qm58xy-binutils-2.41/bin/ld: cannot find -lm: No such file or directory
           /nix/store/hqvni28zpibl6jsqqimcvng6h6qm58xy-binutils-2.41/bin/ld: cannot find -ldl: No such file or directory
           /nix/store/hqvni28zpibl6jsqqimcvng6h6qm58xy-binutils-2.41/bin/ld: cannot find -lc: No such file or directory
           /nix/store/hqvni28zpibl6jsqqimcvng6h6qm58xy-binutils-2.41/bin/ld: cannot find -lc: No such file or directory
           clang: error: linker command failed with exit code 1 (use -v to see invocation)


error: aborting due to 1 previous error
------------------------------------------



failures:
    [ui] tests/ui/process/nofile-limit.rs
```

```
uname -a
Linux nixos 6.6.26 #1-NixOS SMP PREEMPT_DYNAMIC Wed Apr 10 14:36:08 UTC 2024 x86_64 GNU/Linux
```