Skip to content

Commit

Permalink
Explicitly check that we are looking at GNU ld, and otherwise skip th…
Browse files Browse the repository at this point in the history
…e check.

(The first version of the PR had this implicitly by always searching for the
string literal "GNU ld version " when looking for where to start the search for
the version number.)
  • Loading branch information
pnkfelix committed Dec 4, 2019
1 parent 357542f commit c4a76c4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/librustc_codegen_ssa/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,12 @@ fn check_for_buggy_ld_version(sess: &Session,
};
debug!("check_for_buggy_ld_version first_line: {:?}", first_line);

if !first_line.contains("GNU ld") {
// If we cannot find "GNU ld" in the version string, then assume that
// this is not actually GNU ld; no need for warning.
return;
}

let version_suffix_start = match first_line.find(" 2.") {
None => {
// if we cannot find ` 2.`, then assume that this an ld version that
Expand Down

0 comments on commit c4a76c4

Please sign in to comment.