@@ -767,7 +767,6 @@ pub const InitOptions = struct {
767767 compatibility_version : ? std.builtin.Version = null ,
768768 libc_installation : ? * const LibCInstallation = null ,
769769 machine_code_model : std.builtin.CodeModel = .default ,
770- target_abi : ? std.Target.TargetAbi ,
771770 clang_preprocessor_mode : ClangPreprocessorMode = .no ,
772771 /// This is for stage1 and should be deleted upon completion of self-hosting.
773772 color : @import ("main.zig" ).Color = .auto ,
@@ -1183,7 +1182,6 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
11831182 cache .hash .add (options .target .os .getVersionRange ());
11841183 cache .hash .add (options .is_native_os );
11851184 cache .hash .add (options .target .abi );
1186- cache .hash .addOptionalBytes (if (options .target_abi ) | t | @tagName (t ) else null );
11871185 cache .hash .add (ofmt );
11881186 cache .hash .add (pic );
11891187 cache .hash .add (pie );
@@ -1496,7 +1494,6 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation {
14961494 .single_threaded = single_threaded ,
14971495 .verbose_link = options .verbose_link ,
14981496 .machine_code_model = options .machine_code_model ,
1499- .target_abi = options .target_abi ,
15001497 .dll_export_fns = dll_export_fns ,
15011498 .error_return_tracing = error_return_tracing ,
15021499 .llvm_cpu_features = llvm_cpu_features ,
@@ -3460,9 +3457,6 @@ pub fn addCCArgs(
34603457 try argv .append ("-mthumb" );
34613458 }
34623459
3463- if (comp .bin_file .options .target_abi ) | target_abi | {
3464- try argv .append (try std .fmt .allocPrint (arena , "-mabi={s}" , .{@tagName (target_abi )}));
3465- }
34663460 if (comp .sanitize_c and ! comp .bin_file .options .tsan ) {
34673461 try argv .append ("-fsanitize=undefined" );
34683462 try argv .append ("-fsanitize-trap=undefined" );
@@ -3595,18 +3589,18 @@ pub fn addCCArgs(
35953589 // TODO
35963590 },
35973591 }
3598-
3599- if (comp .bin_file .options .target_abi ) | target_abi | {
3600- try argv .append (try std .fmt .allocPrint (arena , "-mabi={s}" , .{@tagName (target_abi )}));
3601- }
3602-
36033592 if (target_util .clangAssemblerSupportsMcpuArg (target )) {
36043593 if (target .cpu .model .llvm_name ) | llvm_name | {
36053594 try argv .append (try std .fmt .allocPrint (arena , "-mcpu={s}" , .{llvm_name }));
36063595 }
36073596 }
36083597 },
36093598 }
3599+
3600+ if (target_util .llvmMachineAbi (target )) | mabi | {
3601+ try argv .append (try std .fmt .allocPrint (arena , "-mabi={s}" , .{mabi }));
3602+ }
3603+
36103604 if (out_dep_path ) | p | {
36113605 try argv .appendSlice (&[_ ][]const u8 { "-MD" , "-MV" , "-MF" , p });
36123606 }
@@ -4395,7 +4389,6 @@ fn buildOutputFromZig(
43954389 .strip = comp .compilerRtStrip (),
43964390 .is_native_os = comp .bin_file .options .is_native_os ,
43974391 .is_native_abi = comp .bin_file .options .is_native_abi ,
4398- .target_abi = comp .bin_file .options .target_abi ,
43994392 .self_exe_path = comp .self_exe_path ,
44004393 .verbose_cc = comp .verbose_cc ,
44014394 .verbose_link = comp .bin_file .options .verbose_link ,
@@ -4584,7 +4577,7 @@ fn updateStage1Module(comp: *Compilation, main_progress_node: *std.Progress.Node
45844577 .is_native_cpu = false , // Only true when bootstrapping the compiler.
45854578 .llvm_cpu_name = if (target .cpu .model .llvm_name ) | s | s .ptr else null ,
45864579 .llvm_cpu_features = comp .bin_file .options .llvm_cpu_features .? ,
4587- .llvm_target_abi = if (comp . bin_file . options . target_abi ) | t | @tagName ( t ) else null ,
4580+ .llvm_target_abi = if (target_util . llvmMachineAbi ( target )) | s | s . ptr else null ,
45884581 };
45894582
45904583 comp .stage1_cache_manifest = & man ;
@@ -4836,7 +4829,6 @@ pub fn build_crt_file(
48364829 .strip = comp .compilerRtStrip (),
48374830 .is_native_os = comp .bin_file .options .is_native_os ,
48384831 .is_native_abi = comp .bin_file .options .is_native_abi ,
4839- .target_abi = comp .bin_file .options .target_abi ,
48404832 .self_exe_path = comp .self_exe_path ,
48414833 .c_source_files = c_source_files ,
48424834 .verbose_cc = comp .verbose_cc ,
0 commit comments