Skip to content

Commit 184c873

Browse files
authored
Merge pull request #7 from clojurewasm/develop/hotfix-link-libc
fix(build): link libc to fix CI failures on Linux + cross-compile
2 parents 6faadc5 + 4dd58fb commit 184c873

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎build.zig‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,13 @@ pub fn build(b: *std.Build) void {
3636
} else null;
3737

3838
// Library module (test root)
39+
// link_libc: std.c.{getcwd,getenv,realpath,mprotect,write} are used by
40+
// runtime/lifecycle, lang/builtins/system, lang/interop/classes/file,
41+
// engine/vm/jit, runtime/io_default. Tracked for removal in F146.
3942
const mod = b.addModule("ClojureWasm", .{
4043
.root_source_file = b.path("src/root.zig"),
4144
.target = target,
45+
.link_libc = true,
4246
});
4347
mod.addImport("build_options", options_module);
4448
if (zwasm_mod) |m| mod.addImport("zwasm", m);
@@ -53,6 +57,7 @@ pub fn build(b: *std.Build) void {
5357
.root_source_file = b.path("src/cache_gen.zig"),
5458
.target = b.resolveTargetQuery(.{}),
5559
.optimize = .ReleaseSafe,
60+
.link_libc = true,
5661
}),
5762
});
5863
cache_gen.root_module.addImport("build_options", options_module);
@@ -78,6 +83,7 @@ pub fn build(b: *std.Build) void {
7883
.root_source_file = b.path("src/main.zig"),
7984
.target = target,
8085
.optimize = optimize,
86+
.link_libc = true,
8187
}),
8288
});
8389
exe.root_module.addImport("build_options", options_module);

0 commit comments

Comments
 (0)