1
Fork 0

rustc_target: Add a compatibility layer to separate internal and user-facing linker flavors

This commit is contained in:
Vadim Petrochenkov 2022-08-14 20:28:34 +03:00
parent 4f9898a794
commit 7dc186ff7e
5 changed files with 152 additions and 61 deletions

View file

@ -1236,7 +1236,8 @@ pub fn linker_and_flavor(sess: &Session) -> (PathBuf, LinkerFlavor) {
// linker and linker flavor specified via command line have precedence over what the target
// specification specifies
if let Some(ret) = infer_from(sess, sess.opts.cg.linker.clone(), sess.opts.cg.linker_flavor) {
let linker_flavor = sess.opts.cg.linker_flavor.map(LinkerFlavor::from_cli);
if let Some(ret) = infer_from(sess, sess.opts.cg.linker.clone(), linker_flavor) {
return ret;
}