Repository: rust
Issue: Unable to build for aarch64-unknown-linux-musl due to linker error
Labels: A-linkage,A-lints,T-compiler,C-discussion,L-linker_messages

<!--
Thank you for finding an Internal Compiler Error! 🧊  If possible, try to provide
a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for
how to create smaller examples.
http://blog.pnkfx.org/blog/2019/11/18/rust-bug-minimization-patterns/
-->

### Code

```Rust
// Any general rust binary
fn main() {

}
```


### Meta
<!--
If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions.
-->

```
2025-01-26
rust version 1.86.0-nightly
```

### Error output

```
error: linker stderr: + set -euo pipefail
       + main /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/self-contained/crt1.o /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/self-contained/crti.o /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/self-contained/crtbegin.o /tmp/rustcMRMm0k/symbols.o /target/aarch64-unknown-linux-musl/release/deps/lead-1f9b10ec67568278.lead.3071a641ae748844-cgu.0.rcgu.o /target/aarch64-unknown-linux-musl/release/deps/lead-1f9b10ec67568278.c7k22yv4ejhuebl8qlxz30v80.rcgu.o -Wl,--as-needed -Wl,-Bstatic /target/aarch64-unknown-linux-musl/release/deps/liblead_lib-bacbb8bfd222c4bc.rlib /target/aarch64-unknown-linux-musl/release/deps/libtokio-2a08c53988ff36e2.rlib /target/aarch64-unknown-linux-musl/release/deps/libpin_project_lite-780a0af350feaf81.rlib /target/aarch64-unknown-linux-musl/release/deps/libserde_json-47ec56fca705be98.rlib /target/aarch64-unknown-linux-musl/release/deps/libitoa-2b078b22c12625d1.rlib /target/aarch64-unknown-linux-musl/release/deps/libryu-bf0d602fea867257.rlib /target/aarch64-unknown-linux-musl/release/deps/libserde-a1e14f5d7bb654b5.rlib /target/aarch64-unknown-linux-musl/release/deps/libsysinfo-eba4aaffb10bb843.rlib /target/aarch64-unknown-linux-musl/release/deps/libmemchr-9271502c4c235762.rlib /target/aarch64-unknown-linux-musl/release/deps/liblibc-c2df7424b4a503ee.rlib /target/aarch64-unknown-linux-musl/release/deps/libtermcolor-a0bf074affadcd0e.rlib /target/aarch64-unknown-linux-musl/release/deps/liblibloading-85d4fcd29f421964.rlib -ldl /target/aarch64-unknown-linux-musl/release/deps/libcfg_if-f51b0f5c6a991aaf.rlib /target/aarch64-unknown-linux-musl/release/deps/libinterpreter-2578f24c781ac431.rlib /target/aarch64-unknown-linux-musl/release/deps/libchalk_rs-0a1a1dda2caf4043.rlib /target/aarch64-unknown-linux-musl/release/deps/libstd-134d330340b3f11d.rlib /target/aarch64-unknown-linux-musl/release/deps/libpanic_unwind-874d3ed394a68975.rlib /target/aarch64-unknown-linux-musl/release/deps/libobject-b5d3c6a99dfa42fe.rlib /target/aarch64-unknown-linux-musl/release/deps/libmemchr-e8e488bcdb2cb511.rlib /target/aarch64-unknown-linux-musl/release/deps/libaddr2line-b69ae8fd75a99eb2.rlib /target/aarch64-unknown-linux-musl/release/deps/libgimli-8c254d9ac35de2d1.rlib /target/aarch64-unknown-linux-musl/release/deps/librustc_demangle-da6c261b96e0811c.rlib /target/aarch64-unknown-linux-musl/release/deps/libstd_detect-4df6928bf7ceb181.rlib /target/aarch64-unknown-linux-musl/release/deps/libhashbrown-e08e7bca1be74d3e.rlib /target/aarch64-unknown-linux-musl/release/deps/librustc_std_workspace_alloc-469d6ec4f00c806d.rlib /target/aarch64-unknown-linux-musl/release/deps/libminiz_oxide-f7340bd2d7755a3b.rlib /target/aarch64-unknown-linux-musl/release/deps/libadler2-0020ebc36cbafeb6.rlib /target/aarch64-unknown-linux-musl/release/deps/libunwind-a1edb29db249baea.rlib -lunwind /target/aarch64-unknown-linux-musl/release/deps/libcfg_if-77a284f515878d98.rlib /target/aarch64-unknown-linux-musl/release/deps/liblibc-31ad04b4538d525a.rlib -lc /target/aarch64-unknown-linux-musl/release/deps/liballoc-30aa088104f0fc7f.rlib /target/aarch64-unknown-linux-musl/release/deps/librustc_std_workspace_core-5466acb924e4ccef.rlib /target/aarch64-unknown-linux-musl/release/deps/libcore-a164a7b283c75181.rlib /target/aarch64-unknown-linux-musl/release/deps/libcompiler_builtins-c0dfb468808d9541.rlib -Wl,-Bdynamic -Wl,--eh-frame-hdr -Wl,-z,noexecstack -nostartfiles -L /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/self-contained -L /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib -o /target/aarch64-unknown-linux-musl/release/deps/lead-1f9b10ec67568278 -Wl,--gc-sections -static -no-pie -Wl,-z,relro,-z,now -Wl,-O1 -Wl,--strip-debug -nodefaultlibs /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/self-contained/crtend.o /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/self-contained/crtn.o
       + local minor
       + local patched_minor=48
       ++ rustc_minor_version
       ++ [[ -z 86 ]]
       ++ echo 86
       + minor=86
       + [[ 64 -eq 0 ]]
       + [[ 86 -ge 48 ]]
       + exec aarch64-linux-musl-gcc /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/self-contained/crt1.o /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/self-contained/crti.o /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/self-contained/crtbegin.o /tmp/rustcMRMm0k/symbols.o /target/aarch64-unknown-linux-musl/release/deps/lead-1f9b10ec67568278.lead.3071a641ae748844-cgu.0.rcgu.o /target/aarch64-unknown-linux-musl/release/deps/lead-1f9b10ec67568278.c7k22yv4ejhuebl8qlxz30v80.rcgu.o -Wl,--as-needed -Wl,-Bstatic /target/aarch64-unknown-linux-musl/release/deps/liblead_lib-bacbb8bfd222c4bc.rlib /target/aarch64-unknown-linux-musl/release/deps/libtokio-2a08c53988ff36e2.rlib /target/aarch64-unknown-linux-musl/release/deps/libpin_project_lite-780a0af350feaf81.rlib /target/aarch64-unknown-linux-musl/release/deps/libserde_json-47ec56fca705be98.rlib /target/aarch64-unknown-linux-musl/release/deps/libitoa-2b078b22c12625d1.rlib /target/aarch64-unknown-linux-musl/release/deps/libryu-bf0d602fea867257.rlib /target/aarch64-unknown-linux-musl/release/deps/libserde-a1e14f5d7bb654b5.rlib /target/aarch64-unknown-linux-musl/release/deps/libsysinfo-eba4aaffb10bb843.rlib /target/aarch64-unknown-linux-musl/release/deps/libmemchr-9271502c4c235762.rlib /target/aarch64-unknown-linux-musl/release/deps/liblibc-c2df7424b4a503ee.rlib /target/aarch64-unknown-linux-musl/release/deps/libtermcolor-a0bf074affadcd0e.rlib /target/aarch64-unknown-linux-musl/release/deps/liblibloading-85d4fcd29f421964.rlib -ldl /target/aarch64-unknown-linux-musl/release/deps/libcfg_if-f51b0f5c6a991aaf.rlib /target/aarch64-unknown-linux-musl/release/deps/libinterpreter-2578f24c781ac431.rlib /target/aarch64-unknown-linux-musl/release/deps/libchalk_rs-0a1a1dda2caf4043.rlib /target/aarch64-unknown-linux-musl/release/deps/libstd-134d330340b3f11d.rlib /target/aarch64-unknown-linux-musl/release/deps/libpanic_unwind-874d3ed394a68975.rlib /target/aarch64-unknown-linux-musl/release/deps/libobject-b5d3c6a99dfa42fe.rlib /target/aarch64-unknown-linux-musl/release/deps/libmemchr-e8e488bcdb2cb511.rlib /target/aarch64-unknown-linux-musl/release/deps/libaddr2line-b69ae8fd75a99eb2.rlib /target/aarch64-unknown-linux-musl/release/deps/libgimli-8c254d9ac35de2d1.rlib /target/aarch64-unknown-linux-musl/release/deps/librustc_demangle-da6c261b96e0811c.rlib /target/aarch64-unknown-linux-musl/release/deps/libstd_detect-4df6928bf7ceb181.rlib /target/aarch64-unknown-linux-musl/release/deps/libhashbrown-e08e7bca1be74d3e.rlib /target/aarch64-unknown-linux-musl/release/deps/librustc_std_workspace_alloc-469d6ec4f00c806d.rlib /target/aarch64-unknown-linux-musl/release/deps/libminiz_oxide-f7340bd2d7755a3b.rlib /target/aarch64-unknown-linux-musl/release/deps/libadler2-0020ebc36cbafeb6.rlib /target/aarch64-unknown-linux-musl/release/deps/libunwind-a1edb29db249baea.rlib -lunwind /target/aarch64-unknown-linux-musl/release/deps/libcfg_if-77a284f515878d98.rlib /target/aarch64-unknown-linux-musl/release/deps/liblibc-31ad04b4538d525a.rlib -lc /target/aarch64-unknown-linux-musl/release/deps/liballoc-30aa088104f0fc7f.rlib /target/aarch64-unknown-linux-musl/release/deps/librustc_std_workspace_core-5466acb924e4ccef.rlib /target/aarch64-unknown-linux-musl/release/deps/libcore-a164a7b283c75181.rlib /target/aarch64-unknown-linux-musl/release/deps/libcompiler_builtins-c0dfb468808d9541.rlib -Wl,-Bdynamic -Wl,--eh-frame-hdr -Wl,-z,noexecstack -nostartfiles -L /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/self-contained -L /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib -o /target/aarch64-unknown-linux-musl/release/deps/lead-1f9b10ec67568278 -Wl,--gc-sections -static -no-pie -Wl,-z,relro,-z,now -Wl,-O1 -Wl,--strip-debug -nodefaultlibs /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/self-contained/crtend.o /home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-musl/lib/self-contained/crtn.o
  |
  = note: `-D linker-messages` implied by `-D warnings`
  = help: to override `-D warnings` add `#[allow(linker_messages)]`

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

<!--
Include a backtrace in the code block by setting `RUST_BACKTRACE=1` in your
environment. E.g. `RUST_BACKTRACE=1 cargo build`.
-->
<details><summary><strong>Backtrace</strong></summary>
<p>

```
<backtrace>
```

</p>
</details>