@@ -2092,6 +2092,26 @@ impl Build {
2092
2092
cmd. push_cc_arg ( "-pthread" . into ( ) ) ;
2093
2093
}
2094
2094
}
2095
+
2096
+ if target. os == "nto" {
2097
+ // Select the target with `-V`, see qcc documentation:
2098
+ // QNX 7.1: https://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.neutrino.utilities/topic/q/qcc.html
2099
+ // QNX 8.0: https://www.qnx.com/developers/docs/8.0/com.qnx.doc.neutrino.utilities/topic/q/qcc.html
2100
+ // This assumes qcc/q++ as compiler, which is currently the only supported compiler for QNX.
2101
+ // See for details: https://github.com/rust-lang/cc-rs/pull/1319
2102
+ let arg = match target. arch {
2103
+ "i586" => "-Vgcc_ntox86_cxx" ,
2104
+ "aarch64" => "-Vgcc_ntoaarch64le_cxx" ,
2105
+ "x86_64" => "-Vgcc_ntox86_64_cxx" ,
2106
+ _ => {
2107
+ return Err ( Error :: new (
2108
+ ErrorKind :: InvalidTarget ,
2109
+ format ! ( "Unknown architecture for Neutrino QNX: {}" , target. arch) ,
2110
+ ) )
2111
+ }
2112
+ } ;
2113
+ cmd. push_cc_arg ( arg. into ( ) ) ;
2114
+ }
2095
2115
}
2096
2116
}
2097
2117
@@ -2803,6 +2823,13 @@ impl Build {
2803
2823
format ! ( "arm-kmc-eabi-{}" , gnu)
2804
2824
} else if target. arch == "aarch64" && target. vendor == "kmc" {
2805
2825
format ! ( "aarch64-kmc-elf-{}" , gnu)
2826
+ } else if target. os == "nto" {
2827
+ // See for details: https://github.com/rust-lang/cc-rs/pull/1319
2828
+ if self . cpp {
2829
+ "q++" . to_string ( )
2830
+ } else {
2831
+ "qcc" . to_string ( )
2832
+ }
2806
2833
} else if self . get_is_cross_compile ( ) ? {
2807
2834
let prefix = self . prefix_for_target ( & raw_target) ;
2808
2835
match prefix {
0 commit comments