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