| ... | ... | @@ -1009,7 +1009,8 @@ fn runCommand( |
| 1009 | 1009 | else => break :interpret, |
| 1010 | 1010 | } |
| 1011 | 1011 | |
| 1012 | | const need_cross_glibc = exe.rootModuleTarget().isGnuLibC() and |
| 1012 | const root_target = exe.rootModuleTarget(); |
| 1013 | const need_cross_glibc = root_target.isGnuLibC() and |
| 1013 | 1014 | exe.is_linking_libc; |
| 1014 | 1015 | const other_target = exe.root_module.resolved_target.?.result; |
| 1015 | 1016 | switch (std.zig.system.getExternalExecutor(b.graph.host.result, &other_target, .{ |
| ... | ... | @@ -1039,23 +1040,16 @@ fn runCommand( |
| 1039 | 1040 | try interp_argv.append(bin_name); |
| 1040 | 1041 | |
| 1041 | 1042 | if (glibc_dir_arg) |dir| { |
| 1042 | | // TODO look into making this a call to `linuxTriple`. This |
| 1043 | | // needs the directory to be called "i686" rather than |
| 1044 | | // "x86" which is why we do it manually here. |
| 1045 | | const fmt_str = "{s}" ++ fs.path.sep_str ++ "{s}-{s}-{s}"; |
| 1046 | | const cpu_arch = exe.rootModuleTarget().cpu.arch; |
| 1047 | | const os_tag = exe.rootModuleTarget().os.tag; |
| 1048 | | const abi = exe.rootModuleTarget().abi; |
| 1049 | | const cpu_arch_name: []const u8 = if (cpu_arch == .x86) |
| 1050 | | "i686" |
| 1051 | | else |
| 1052 | | @tagName(cpu_arch); |
| 1053 | | const full_dir = try std.fmt.allocPrint(b.allocator, fmt_str, .{ |
| 1054 | | dir, cpu_arch_name, @tagName(os_tag), @tagName(abi), |
| 1055 | | }); |
| 1056 | | |
| 1057 | 1043 | try interp_argv.append("-L"); |
| 1058 | | try interp_argv.append(full_dir); |
| 1044 | try interp_argv.append(b.pathJoin(&.{ |
| 1045 | dir, |
| 1046 | try std.zig.target.glibcRuntimeTriple( |
| 1047 | b.allocator, |
| 1048 | root_target.cpu.arch, |
| 1049 | root_target.os.tag, |
| 1050 | root_target.abi, |
| 1051 | ), |
| 1052 | })); |
| 1059 | 1053 | } |
| 1060 | 1054 | |
| 1061 | 1055 | try interp_argv.appendSlice(argv); |
| ... | ... | @@ -1113,7 +1107,7 @@ fn runCommand( |
| 1113 | 1107 | if (allow_skip) return error.MakeSkipped; |
| 1114 | 1108 | |
| 1115 | 1109 | const host_name = try b.graph.host.result.zigTriple(b.allocator); |
| 1116 | | const foreign_name = try exe.rootModuleTarget().zigTriple(b.allocator); |
| 1110 | const foreign_name = try root_target.zigTriple(b.allocator); |
| 1117 | 1111 | |
| 1118 | 1112 | return step.fail("the host system ({s}) is unable to execute binaries from the target ({s})", .{ |
| 1119 | 1113 | host_name, foreign_name, |
| ... | ... | @@ -1121,7 +1115,7 @@ fn runCommand( |
| 1121 | 1115 | }, |
| 1122 | 1116 | } |
| 1123 | 1117 | |
| 1124 | | if (exe.rootModuleTarget().os.tag == .windows) { |
| 1118 | if (root_target.os.tag == .windows) { |
| 1125 | 1119 | // On Windows we don't have rpaths so we have to add .dll search paths to PATH |
| 1126 | 1120 | run.addPathForDynLibs(exe); |
| 1127 | 1121 | } |