| ... | @@ -584,27 +584,26 @@ pub const TestContext = struct { | ... | @@ -584,27 +584,26 @@ pub const TestContext = struct { |
| 584 | .native => try argv.append(exe_path), | 584 | .native => try argv.append(exe_path), |
| 585 | .unavailable => return, // No executor available; pass test. | 585 | .unavailable => return, // No executor available; pass test. |
| 586 | | 586 | |
| 587 | .qemu => |qemu_bin_name| { | 587 | .qemu => |qemu_bin_name| if (enable_qemu) { |
| 588 | if (enable_qemu) qemu: { | 588 | // TODO Ability for test cases to specify whether to link libc. |
| 589 | // TODO Ability for test cases to specify whether to link libc. | 589 | const need_cross_glibc = false; // target.isGnuLibC() and self.is_linking_libc; |
| 590 | const need_cross_glibc = false; // target.isGnuLibC() and self.is_linking_libc; | 590 | const glibc_dir_arg = if (need_cross_glibc) |
| 591 | const glibc_dir_arg = if (need_cross_glibc) | 591 | glibc_multi_install_dir orelse return // glibc dir not available; pass test |
| 592 | glibc_multi_install_dir orelse break :qemu | 592 | else |
| 593 | else | 593 | null; |
| 594 | null; | 594 | try argv.append(qemu_bin_name); |
| 595 | try argv.append(qemu_bin_name); | 595 | if (glibc_dir_arg) |dir| { |
| 596 | if (glibc_dir_arg) |dir| { | 596 | const linux_triple = try target.linuxTriple(arena); |
| 597 | const linux_triple = try target.linuxTriple(arena); | 597 | const full_dir = try std.fs.path.join(arena, &[_][]const u8{ |
| 598 | const full_dir = try std.fs.path.join(arena, &[_][]const u8{ | 598 | dir, |
| 599 | dir, | 599 | linux_triple, |
| 600 | linux_triple, | 600 | }); |
| 601 | }); | 601 | |
| 602 | | 602 | try argv.append("-L"); |
| 603 | try argv.append("-L"); | 603 | try argv.append(full_dir); |
| 604 | try argv.append(full_dir); | | |
| 605 | } | | |
| 606 | try argv.append(exe_path); | | |
| 607 | } | 604 | } |
| | 605 | try argv.append(exe_path); |
| | 606 | } else { |
| 608 | return; // QEMU not available; pass test. | 607 | return; // QEMU not available; pass test. |
| 609 | }, | 608 | }, |
| 610 | | 609 | |
| ... | @@ -628,7 +627,7 @@ pub const TestContext = struct { | ... | @@ -628,7 +627,7 @@ pub const TestContext = struct { |
| 628 | | 627 | |
| 629 | break :x try std.ChildProcess.exec(.{ | 628 | break :x try std.ChildProcess.exec(.{ |
| 630 | .allocator = allocator, | 629 | .allocator = allocator, |
| 631 | .argv = &[_][]const u8{exe_path}, | 630 | .argv = argv.items, |
| 632 | .cwd_dir = tmp.dir, | 631 | .cwd_dir = tmp.dir, |
| 633 | }); | 632 | }); |
| 634 | }; | 633 | }; |