Skip to content

rustc 1.30.0's linker flavor inference is a non-backwards compat change to -Clinker #55396

Closed
@jsgf

Description

@jsgf

In our environment we end up setting -Clinker to a script called ld.sh; this script is implemented in terms of gcc as rustc used to expect. Now it treats it as a direct invocation of ld.

This was introduced in #52101.

I think rather than inferring the linker flavor from the name of the executable, rustc should either:

  1. invoke the binary with --version to try to work out what its dealing with, and/or
  2. have a stable -Clinker-flavor option to set it explicitly

There's an unstable -Zlinker-flavor option, which I think should have been stabilized at the same time as flavor inference. Ideally inference should be opt-in with -Clinker-flavor=infer, with the default being the old default of -Clinker-flavor=gcc (at least for Linux platforms).

Metadata

Metadata

Labels

P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions