@@ -3346,35 +3346,6 @@ fn add_lld_args(
3346
3346
// this, `wasm-component-ld`, which is overridden if this option is passed.
3347
3347
if !sess. target . is_like_wasm {
3348
3348
cmd. cc_arg ( "-fuse-ld=lld" ) ;
3349
-
3350
- // On ELF platforms like at least x64 linux, GNU ld and LLD have opposite defaults on some
3351
- // section garbage-collection features. For example, the somewhat popular `linkme` crate and
3352
- // its dependents rely in practice on this difference: when using lld, they need `-z
3353
- // nostart-stop-gc` to prevent encapsulation symbols and sections from being
3354
- // garbage-collected.
3355
- //
3356
- // More information about all this can be found in:
3357
- // - https://maskray.me/blog/2021-01-31-metadata-sections-comdat-and-shf-link-order
3358
- // - https://lld.llvm.org/ELF/start-stop-gc
3359
- //
3360
- // So when using lld, we restore, for now, the traditional behavior to help migration, but
3361
- // will remove it in the future.
3362
- // Since this only disables an optimization, it shouldn't create issues, but is in theory
3363
- // slightly suboptimal. However, it:
3364
- // - doesn't have any visible impact on our benchmarks
3365
- // - reduces the need to disable lld for the crates that depend on this
3366
- //
3367
- // Note that lld can detect some cases where this difference is relied on, and emits a
3368
- // dedicated error to add this link arg. We could make use of this error to emit an FCW. As
3369
- // of writing this, we don't do it, because lld is already enabled by default on nightly
3370
- // without this mitigation: no working project would see the FCW, so we do this to help
3371
- // stabilization.
3372
- //
3373
- // FIXME: emit an FCW if linking fails due its absence, and then remove this link-arg in the
3374
- // future.
3375
- if sess. target . llvm_target == "x86_64-unknown-linux-gnu" {
3376
- cmd. link_arg ( "-znostart-stop-gc" ) ;
3377
- }
3378
3349
}
3379
3350
3380
3351
if !flavor. is_gnu ( ) {
0 commit comments