@@ -200,6 +200,7 @@ pub struct Tool {
200
200
family : ToolFamily ,
201
201
cuda : bool ,
202
202
removed_args : Vec < OsString > ,
203
+ has_internal_target_arg : bool ,
203
204
}
204
205
205
206
/// Represents the family of tools this tool belongs to.
@@ -1824,9 +1825,7 @@ impl Build {
1824
1825
// Target flags
1825
1826
match cmd. family {
1826
1827
ToolFamily :: Clang => {
1827
- if !( target. contains ( "android" )
1828
- && android_clang_compiler_uses_target_arg_internally ( & cmd. path ) )
1829
- {
1828
+ if !( target. contains ( "android" ) && cmd. has_internal_target_arg ) {
1830
1829
if target. contains ( "darwin" ) {
1831
1830
if let Some ( arch) =
1832
1831
map_darwin_target_from_rust_to_compiler_architecture ( target)
@@ -2696,6 +2695,7 @@ impl Build {
2696
2695
let file_name = path. to_str ( ) . unwrap ( ) . to_owned ( ) ;
2697
2696
let ( target, clang) = file_name. split_at ( file_name. rfind ( "-" ) . unwrap ( ) ) ;
2698
2697
2698
+ tool. has_internal_target_arg = true ;
2699
2699
tool. path . set_file_name ( clang. trim_start_matches ( "-" ) ) ;
2700
2700
tool. path . set_extension ( "exe" ) ;
2701
2701
tool. args . push ( format ! ( "--target={}" , target) . into ( ) ) ;
@@ -3522,6 +3522,7 @@ impl Tool {
3522
3522
family : family,
3523
3523
cuda : false ,
3524
3524
removed_args : Vec :: new ( ) ,
3525
+ has_internal_target_arg : false ,
3525
3526
}
3526
3527
}
3527
3528
@@ -3582,6 +3583,7 @@ impl Tool {
3582
3583
family : family,
3583
3584
cuda : cuda,
3584
3585
removed_args : Vec :: new ( ) ,
3586
+ has_internal_target_arg : false ,
3585
3587
}
3586
3588
}
3587
3589
0 commit comments