Skip to content

Commit 0207615

Browse files
authored
Rollup merge of rust-lang#134211 - flba-eb:add_qnx_archiver, r=compiler-errors
On Neutrino QNX, reduce the need to set archiver via environment variables This adds support for automatically selecting the correct `ar` tool when compiling for Neutrino QNX. Once rust-lang/cc-rs#1319 is merged and a new cc version is integrated, all environment variables of the [Neutrino documentation](https://github.com/rust-lang/rust/blob/stable/src/doc/rustc/src/platform-support/nto-qnx.md) can be removed. CC: ``@jonathanpallant`` ``@japaric`` ``@gh-tr`` ``@AkhilTThomas``
2 parents 101806e + 37bb774 commit 0207615

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/bootstrap/src/utils/cc_detect.rs

+10
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ fn cc2ar(cc: &Path, target: TargetSelection) -> Option<PathBuf> {
4444
Some(PathBuf::from("ar"))
4545
} else if target.contains("vxworks") {
4646
Some(PathBuf::from("wr-ar"))
47+
} else if target.contains("-nto-") {
48+
if target.starts_with("i586") {
49+
Some(PathBuf::from("ntox86-ar"))
50+
} else if target.starts_with("aarch64") {
51+
Some(PathBuf::from("ntoaarch64-ar"))
52+
} else if target.starts_with("x86_64") {
53+
Some(PathBuf::from("ntox86_64-ar"))
54+
} else {
55+
panic!("Unknown architecture, cannot determine archiver for Neutrino QNX");
56+
}
4757
} else if target.contains("android") || target.contains("-wasi") {
4858
Some(cc.parent().unwrap().join(PathBuf::from("llvm-ar")))
4959
} else {

0 commit comments

Comments
 (0)