Skip to content

Commit

Permalink
Use build abi for building runtimes
Browse files Browse the repository at this point in the history
  • Loading branch information
NilsIrl committed Aug 20, 2024
1 parent f90db2e commit e3b60fc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,11 @@ pub fn build(b: *std.Build) void {

const cc = std.fmt.allocPrint(
b.allocator,
// TODO: find exact zig location
"zig cc --target={s}",
.{target.result.zigTriple(b.allocator) catch @panic("OOM")},
"{s} cc --target={s}",
.{
b.graph.zig_exe,
target.result.zigTriple(b.allocator) catch @panic("OOM"),
},
) catch @panic("OOM");

const squashfuse_autogen = b.addSystemCommand(&[_][]const u8{
Expand Down Expand Up @@ -284,27 +286,25 @@ pub fn build(b: *std.Build) void {

const aarch64_target = b.resolveTargetQuery(.{
.cpu_arch = .aarch64,
.abi = .musl,
.abi = target.result.abi,
.os_tag = .linux,
});

const x86_64_target = b.resolveTargetQuery(.{
.cpu_arch = .x86_64,
.abi = .musl,
.abi = target.result.abi,
.os_tag = .linux,
});

const runtime_x86_64 = b.addExecutable(.{
.name = "runtime_x86-64",
.target = x86_64_target,
.linkage = .static,
.optimize = optimize,
});

const runtime_aarch64 = b.addExecutable(.{
.name = "runtime_aarch64",
.target = aarch64_target,
.linkage = .static,
// FIXME: When compiled with ReleaseSafe reading files in the overlayfs
// will give EINVAL (Invalid Argument)
.optimize = .Debug,
Expand Down

0 comments on commit e3b60fc

Please sign in to comment.