@@ -121,6 +121,10 @@ static LIST_ENVS: &[&str] = &[
121
121
const TRIPLE_X86_64_UNKNOWN_LINUX : & str = "x86_64-unknown-linux-gnu" ;
122
122
#[ cfg( all( not( windows) , target_env = "musl" ) ) ]
123
123
const 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" ;
124
128
125
129
// MIPS platforms don't indicate endianness in uname, however binaries only
126
130
// run on boxes with the same endianness, as expected.
@@ -245,7 +249,7 @@ impl TargetTriple {
245
249
( b"Linux" , b"arm" ) => Some ( "arm-unknown-linux-gnueabi" ) ,
246
250
( b"Linux" , b"armv7l" ) => Some ( "armv7-unknown-linux-gnueabihf" ) ,
247
251
( 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 ) ,
249
253
( b"Darwin" , b"x86_64" ) => Some ( "x86_64-apple-darwin" ) ,
250
254
( b"Darwin" , b"i686" ) => Some ( "i686-apple-darwin" ) ,
251
255
( b"FreeBSD" , b"x86_64" ) => Some ( "x86_64-unknown-freebsd" ) ,
@@ -373,10 +377,10 @@ impl PartialToolchainDesc {
373
377
let env = if self . target . os . is_some ( ) {
374
378
self . target . env
375
379
} else {
376
- self . target . env . or_else ( || host_env)
380
+ self . target . env . or ( host_env)
377
381
} ;
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) ;
380
384
381
385
let trip = if let Some ( env) = env {
382
386
format ! ( "{}-{}-{}" , arch, os, env)
0 commit comments