@@ -95,6 +95,12 @@ static LIST_ENVS: &'static [&'static str] = &[
95
95
"musl" ,
96
96
] ;
97
97
98
+ // MUSL and GNU targets are both linux
99
+ #[ cfg( all( not( windows) , not( target_env = "musl" ) ) ) ]
100
+ const TRIPLE_X86_64_UNKNOWN_LINUX : & ' static str = "x86_64-unknown-linux-gnu" ;
101
+ #[ cfg( all( not( windows) , target_env = "musl" ) ) ]
102
+ const TRIPLE_X86_64_UNKNOWN_LINUX : & ' static str = "x86_64-unknown-linux-musl" ;
103
+
98
104
// MIPS platforms don't indicate endianness in uname, however binaries only
99
105
// run on boxes with the same endianness, as expected.
100
106
// Hence we could distinguish between the variants with compile-time cfg()
@@ -175,7 +181,7 @@ impl TargetTriple {
175
181
( _, b"aarch64" ) if cfg ! ( target_os = "android" ) => Some ( "aarch64-linux-android" ) ,
176
182
( _, b"i686" ) if cfg ! ( target_os = "android" ) => Some ( "i686-linux-android" ) ,
177
183
( _, b"x86_64" ) if cfg ! ( target_os = "android" ) => Some ( "x86_64-linux-android" ) ,
178
- ( b"Linux" , b"x86_64" ) => Some ( "x86_64-unknown-linux-gnu" ) ,
184
+ ( b"Linux" , b"x86_64" ) => Some ( TRIPLE_X86_64_UNKNOWN_LINUX ) ,
179
185
( b"Linux" , b"i686" ) => Some ( "i686-unknown-linux-gnu" ) ,
180
186
( b"Linux" , b"mips" ) => Some ( TRIPLE_MIPS_UNKNOWN_LINUX_GNU ) ,
181
187
( b"Linux" , b"mips64" ) => Some ( TRIPLE_MIPS64_UNKNOWN_LINUX_GNUABI64 ) ,
0 commit comments