Skip to content

Commit

Permalink
Rollup merge of #125417 - lqd:lld-retry, r=petrochenkov
Browse files Browse the repository at this point in the history
self-contained linker: retry linking without `-fuse-ld=lld` on CCs that don't support it

For the self-contained linker, this PR applies [the strategy](rust-lang/rust#125330 (comment)) of retrying the linking step when the driver doesn't support `-fuse-ld=lld`, but with the option removed. This is the same strategy we already use of retrying when e.g. `-no-pie` is not supported.

Fixes #125330
r? `@petrochenkov`

I have no idea how we could add a test here, much like we don't have one for `-no-pie` or `-static-pie` -- let me know if you have ideas -- but I tested on a CentOS7 image:

```console
[root@d25b38376ede tmp]# ../build/host/stage1/bin/rustc helloworld.rs
 WARN rustc_codegen_ssa::back::link The linker driver does not support `-fuse-ld=lld`. Retrying without it.

[root@d25b38376ede tmp]# readelf -p .comment helloworld

String dump of section '.comment':
  [     0]  GCC: (GNU) 4.8.5 20150623 (Red Hat 4.8.5-44)
  [    2d]  rustc version 1.80.0-dev
```

I wasn't able to test with `cross` as the issue describes: I wasn't able to reproduce that behavior locally.
  • Loading branch information
matthiaskrgr committed May 23, 2024
2 parents 789d269 + a79ce97 commit 93d526c
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 93d526c

Please sign in to comment.