| ... | @@ -108,7 +108,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { | ... | @@ -108,7 +108,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { |
| 108 | // When there is a src/<arch>/foo.* then it should substitute for src/foo.* | 108 | // When there is a src/<arch>/foo.* then it should substitute for src/foo.* |
| 109 | // Even a .s file can substitute for a .c file. | 109 | // Even a .s file can substitute for a .c file. |
| 110 | const target = comp.getTarget(); | 110 | const target = comp.getTarget(); |
| 111 | const arch_name = archMuslName(target.cpu.arch); | 111 | const arch_name = archName(target.cpu.arch); |
| 112 | var source_table = std.StringArrayHashMap(Ext).init(comp.gpa); | 112 | var source_table = std.StringArrayHashMap(Ext).init(comp.gpa); |
| 113 | defer source_table.deinit(); | 113 | defer source_table.deinit(); |
| 114 | | 114 | |
| ... | @@ -248,7 +248,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { | ... | @@ -248,7 +248,7 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { |
| 248 | } | 248 | } |
| 249 | } | 249 | } |
| 250 | | 250 | |
| 251 | pub fn archMuslName(arch: std.Target.Cpu.Arch) [:0]const u8 { | 251 | pub fn archName(arch: std.Target.Cpu.Arch) [:0]const u8 { |
| 252 | switch (arch) { | 252 | switch (arch) { |
| 253 | .aarch64, .aarch64_be => return "aarch64", | 253 | .aarch64, .aarch64_be => return "aarch64", |
| 254 | .arm, .armeb, .thumb, .thumbeb => return "arm", | 254 | .arm, .armeb, .thumb, .thumbeb => return "arm", |
| ... | @@ -350,7 +350,7 @@ fn addCcArgs( | ... | @@ -350,7 +350,7 @@ fn addCcArgs( |
| 350 | want_O3: bool, | 350 | want_O3: bool, |
| 351 | ) error{OutOfMemory}!void { | 351 | ) error{OutOfMemory}!void { |
| 352 | const target = comp.getTarget(); | 352 | const target = comp.getTarget(); |
| 353 | const arch_name = archMuslName(target.cpu.arch); | 353 | const arch_name = archName(target.cpu.arch); |
| 354 | const os_name = @tagName(target.os.tag); | 354 | const os_name = @tagName(target.os.tag); |
| 355 | const triple = try std.fmt.allocPrint(arena, "{s}-{s}-musl", .{ arch_name, os_name }); | 355 | const triple = try std.fmt.allocPrint(arena, "{s}-{s}-musl", .{ arch_name, os_name }); |
| 356 | const o_arg = if (want_O3) "-O3" else "-Os"; | 356 | const o_arg = if (want_O3) "-O3" else "-Os"; |
| ... | @@ -398,7 +398,7 @@ fn addCcArgs( | ... | @@ -398,7 +398,7 @@ fn addCcArgs( |
| 398 | fn start_asm_path(comp: *Compilation, arena: *Allocator, basename: []const u8) ![]const u8 { | 398 | fn start_asm_path(comp: *Compilation, arena: *Allocator, basename: []const u8) ![]const u8 { |
| 399 | const target = comp.getTarget(); | 399 | const target = comp.getTarget(); |
| 400 | return comp.zig_lib_directory.join(arena, &[_][]const u8{ | 400 | return comp.zig_lib_directory.join(arena, &[_][]const u8{ |
| 401 | "libc", "musl", "crt", archMuslName(target.cpu.arch), basename, | 401 | "libc", "musl", "crt", archName(target.cpu.arch), basename, |
| 402 | }); | 402 | }); |
| 403 | } | 403 | } |
| 404 | | 404 | |