Repository: rust
Issue: rustc is now dynamically linked to zlib
Labels: A-LLVM,T-compiler,regression-from-stable-to-stable,T-release

Discovered in https://github.com/rust-lang/rust/pull/74395, the current beta links to libz dynamically (through LLVM).

This is new, and is perhaps something we don't want. On the other hand, zlib is pretty ubiquitous so it may be fine to leave it as is. I would like to see us add tests that the set of dynamically linked libraries is stable so we're at least aware of this happening (it slipped into rustc this time in  #72696 without that being noticed by the primary reviewer of that PR).

Separately, we should decide if zlib is sufficiently common that it's fine to dynamically link to it.

```
/home/mark/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc:
        linux-vdso.so.1 (0x00007ffeec130000)
        librustc_driver-a07dcbb4ed0bdde8.so => /home/mark/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-a07dcbb4ed0bdde8.so (0x00007f858d5f7000)
        libstd-c147cd9c030850ef.so => /home/mark/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/libstd-c147cd9c030850ef.so (0x00007f858d2f6000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f858d2ca000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f858d2c4000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f858d2b9000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f858d0c7000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f8591b6a000)
        libLLVM-10-rust-1.45.0-stable.so => /home/mark/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-10-rust-1.45.0-stable.so (0x00007f8588aca000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f8588aaf000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f8588960000)
/home/mark/.rustup/toolchains/beta-x86_64-unknown-linux-gnu/bin/rustc:
        linux-vdso.so.1 (0x00007ffd5ddb6000)
        librustc_driver-e231ac240cfaf689.so => /home/mark/.rustup/toolchains/beta-x86_64-unknown-linux-gnu/bin/../lib/librustc_driver-e231ac240cfaf689.so (0x00007f4a387a4000)
        libstd-d66e0ceb8eaec9b8.so => /home/mark/.rustup/toolchains/beta-x86_64-unknown-linux-gnu/bin/../lib/libstd-d66e0ceb8eaec9b8.so (0x00007f4a384a1000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f4a38475000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f4a3846f000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f4a38464000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4a38272000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f4a3cdd2000)
        libLLVM-10-rust-1.46.0-beta.so => /home/mark/.rustup/toolchains/beta-x86_64-unknown-linux-gnu/bin/../lib/../lib/libLLVM-10-rust-1.46.0-beta.so (0x00007f4a33c07000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f4a33bec000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f4a33a9d000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f4a33a81000)
```



<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_ASSIGN_START -->

<!-- TRIAGEBOT_ASSIGN_DATA_START$${"user":null}$$TRIAGEBOT_ASSIGN_DATA_END -->

<!-- TRIAGEBOT_ASSIGN_END -->
<!-- TRIAGEBOT_END -->