@@ -319,8 +319,6 @@ pub struct Build {
319
319
enum ErrorKind {
320
320
/// Error occurred while performing I/O.
321
321
IOError ,
322
- /// Invalid architecture supplied.
323
- ArchitectureInvalid ,
324
322
/// Environment variable not found, with the var in question as extra info.
325
323
EnvVarNotFound ,
326
324
/// Error occurred while using external tools (ie: invocation of compiler).
@@ -2130,7 +2128,7 @@ impl Build {
2130
2128
}
2131
2129
}
2132
2130
ToolFamily :: Gnu => {
2133
- if target. os == "macos " {
2131
+ if target. vendor == "apple " {
2134
2132
let arch = map_darwin_target_from_rust_to_compiler_architecture ( target) ;
2135
2133
cmd. args . push ( "-arch" . into ( ) ) ;
2136
2134
cmd. args . push ( arch. into ( ) ) ;
@@ -2529,37 +2527,7 @@ impl Build {
2529
2527
fn apple_flags ( & self , cmd : & mut Tool ) -> Result < ( ) , Error > {
2530
2528
let target = self . get_target ( ) ?;
2531
2529
2532
- let arch = match & * target. full_arch {
2533
- "arm64" | "aarch64" | "arm64e" if target. os == "macos" => "-m64" ,
2534
- "x86_64" | "x86_64h" if target. os == "macos" => "-m64" ,
2535
- "arm" | "armv7" | "thumbv7" => "armv7" ,
2536
- "arm64_32" => "arm64_32" ,
2537
- "arm64" | "aarch64" => "arm64" ,
2538
- "arm64e" => "arm64e" ,
2539
- "armv7k" => "armv7k" ,
2540
- "armv7s" | "thumbv7s" => "armv7s" ,
2541
- "i386" | "i686" => "-m32" ,
2542
- "x86_64" | "x86_64h" => "-m64" ,
2543
- _ => {
2544
- return Err ( Error :: new (
2545
- ErrorKind :: ArchitectureInvalid ,
2546
- format ! ( "unknown architecture {} for Apple target" , target. full_arch) ,
2547
- ) ) ;
2548
- }
2549
- } ;
2550
-
2551
2530
let min_version = self . apple_deployment_target ( & target) ;
2552
-
2553
- if target. os != "macos" && target. abi != "macabi" {
2554
- if arch. starts_with ( '-' ) {
2555
- // -m32 or -m64
2556
- cmd. args . push ( arch. into ( ) ) ;
2557
- } else {
2558
- cmd. args . push ( "-arch" . into ( ) ) ;
2559
- cmd. args . push ( arch. into ( ) ) ;
2560
- }
2561
- }
2562
-
2563
2531
let version_flag = match ( & * target. os , & * target. abi ) {
2564
2532
( "macos" , "" ) => Some ( "-mmacosx-version-min" ) ,
2565
2533
( "ios" , "" ) => Some ( "-miphoneos-version-min" ) ,
0 commit comments