]> git.lizzy.rs Git - rust.git/commit
rustc: Update linker flavor inference from filename
authorAlex Crichton <alex@alexcrichton.com>
Tue, 19 Mar 2019 20:01:14 +0000 (13:01 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 19 Mar 2019 20:01:14 +0000 (13:01 -0700)
commit664838582b6d973620930a2ba75f369f44debecd
treeb05d8a6703fb905672130d1ac7eb52b6d7183b39
parent7a4df3b53da369110984a2b57419c05a53e33b38
rustc: Update linker flavor inference from filename

This commit fixes what is believed to be a preexisting bug in the linker
flavor inference and additionally adds a new features. Previously if the
linker didn't end in `exe` the entire file name was compared to infer
the linker's flavor. This commit fixes the code to instead
unconditionally inspect `file_stem()` which is the relevant part we're
looking at to figure out what the linker flavor is.

Additionally this commit now also adds recognition of `clang` and clang
wrappers that end in `-clang` (which look like gcc wrappers). This
should allow clang-specific wrappers to get correctly inferred to the
`Gcc` linker flavor rather than the default linker flavor configured for
a target.
src/librustc_codegen_ssa/back/link.rs