@@ -121,6 +121,10 @@ static LIST_ENVS: &[&str] = &[
121121const TRIPLE_X86_64_UNKNOWN_LINUX : & str = "x86_64-unknown-linux-gnu" ;
122122#[ cfg( all( not( windows) , target_env = "musl" ) ) ]
123123const TRIPLE_X86_64_UNKNOWN_LINUX : & str = "x86_64-unknown-linux-musl" ;
124+ #[ cfg( all( not( windows) , not( target_env = "musl" ) ) ) ]
125+ const TRIPLE_AARCH64_UNKNOWN_LINUX : & str = "aarch64-unknown-linux-gnu" ;
126+ #[ cfg( all( not( windows) , target_env = "musl" ) ) ]
127+ const TRIPLE_AARCH64_UNKNOWN_LINUX : & str = "aarch64-unknown-linux-musl" ;
124128
125129// MIPS platforms don't indicate endianness in uname, however binaries only
126130// run on boxes with the same endianness, as expected.
@@ -245,7 +249,7 @@ impl TargetTriple {
245249 ( b"Linux" , b"arm" ) => Some ( "arm-unknown-linux-gnueabi" ) ,
246250 ( b"Linux" , b"armv7l" ) => Some ( "armv7-unknown-linux-gnueabihf" ) ,
247251 ( b"Linux" , b"armv8l" ) => Some ( "armv7-unknown-linux-gnueabihf" ) ,
248- ( b"Linux" , b"aarch64" ) => Some ( "aarch64-unknown-linux-gnu" ) ,
252+ ( b"Linux" , b"aarch64" ) => Some ( TRIPLE_AARCH64_UNKNOWN_LINUX ) ,
249253 ( b"Darwin" , b"x86_64" ) => Some ( "x86_64-apple-darwin" ) ,
250254 ( b"Darwin" , b"i686" ) => Some ( "i686-apple-darwin" ) ,
251255 ( b"FreeBSD" , b"x86_64" ) => Some ( "x86_64-unknown-freebsd" ) ,
@@ -373,10 +377,10 @@ impl PartialToolchainDesc {
373377 let env = if self . target . os . is_some ( ) {
374378 self . target . env
375379 } else {
376- self . target . env . or_else ( || host_env)
380+ self . target . env . or ( host_env)
377381 } ;
378- let arch = self . target . arch . unwrap_or_else ( || host_arch) ;
379- let os = self . target . os . unwrap_or_else ( || host_os) ;
382+ let arch = self . target . arch . unwrap_or ( host_arch) ;
383+ let os = self . target . os . unwrap_or ( host_os) ;
380384
381385 let trip = if let Some ( env) = env {
382386 format ! ( "{}-{}-{}" , arch, os, env)
0 commit comments