commit 1ab3dff846cc422ebd915b149b48f3b596ca2455 (tree)
parent c9cc09a3bfb45d93b84577238047cd69ef0a7d88
Author: Andrew Kelley <andrew@ziglang.org>
Date: Wed, 12 May 2021 20:37:40 -0700
Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen
Need the latest commit which fixes std and behavior tests for cross
compiled glibcs.
Diffstat:
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/lib/std/build.zig b/lib/std/build.zig
@@ -2480,9 +2480,19 @@ pub const LibExeObjStep = struct {
try zig_args.append("--test-cmd");
try zig_args.append(bin_name);
if (glibc_dir_arg) |dir| {
- const full_dir = try fs.path.join(builder.allocator, &[_][]const u8{
- dir,
- try self.target.linuxTriple(builder.allocator),
+ // TODO look into making this a call to `linuxTriple`. This
+ // needs the directory to be called "i686" rather than
+ // "i386" which is why we do it manually here.
+ const fmt_str = "{s}" ++ fs.path.sep_str ++ "{s}-{s}-{s}";
+ const cpu_arch = self.target.getCpuArch();
+ const os_tag = self.target.getOsTag();
+ const abi = self.target.getAbi();
+ const cpu_arch_name: []const u8 = if (cpu_arch == .i386)
+ "i686"
+ else
+ @tagName(cpu_arch);
+ const full_dir = try std.fmt.allocPrint(builder.allocator, fmt_str, .{
+ dir, cpu_arch_name, @tagName(os_tag), @tagName(abi),
});
try zig_args.append("--test-cmd");