-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make this repo build again #20
Comments
I took a look and the missing symbols are provided by diff --git a/build.zig b/build.zig
index 0b07c15..9c5ab2b 100644
--- a/build.zig
+++ b/build.zig
@@ -33,10 +33,19 @@ pub fn build(b: *std.build.Builder) !void {
.source = .{ .path = "src/main.zig" },
.dependencies = &.{pkgs.wasm},
});
- if (builtin.os.tag == .windows) {
- simple_exe.linkSystemLibrary("wasmtime.dll");
- } else {
- simple_exe.linkSystemLibrary("wasmtime");
+ switch (builtin.os.tag) {
+ .windows => {
+ simple_exe.linkSystemLibrary("wasmtime.dll");
+ simple_exe.linkSystemLibrary("unwind");
+ },
+ .linux => {
+ simple_exe.linkSystemLibrary("wasmtime");
+ simple_exe.linkSystemLibrary("unwind");
+ },
+ .macos => {
+ simple_exe.linkSystemLibrary("wasmtime");
+ },
+ else => unreachable,
}
simple_exe.linkLibC();
simple_exe.step.dependOn(b.getInstallStep()); Note that on macOS we always link dynamically and Once you get everything building again, I'd really appreciate a PR with the fixed :-) |
Thanks a lot, @kubkon, for looking into the problem. I was able to incorporate your changes into build.zig. While Linux finally builds, Windows still complains about "FILENOTFOUND" stuff...
I'd appreciate it if you could have another look. Apart from that, I started fixing the examples. This might take a couple of days (currently a bit limited in time)
This is my goal :) |
Hey,
first of all: thank you for the great work! Really happy to see a few people taking care of Zigs Wasm capabilities!
Unfortunately, this repo aged a bit, I wasn't able to make it work with zig-0.8.0 as wasm-zig is a little more ahead... Therefore I started to update this repo to make it runnable with zig-master and consequently with a recent version of the wasmtime API.
I anticipated a three-step process:
I'm currently in phase 1 and working on a PR. While
gyro build
&gyro build test
already work, I'm now about to fix the examples:simple
andgcd
already work on macos, Linux and Windows examples fail to build entirely.On Linux I get weird linking errors, which is the main reason I'm reaching out here. As macos build basically works, I see no reason why it shouldn't on Linux. However, I have no experience investigating such errors - my gut feeling tells me I either need an additional compile flag, there is an issue in wasm-zig or even an issue in the nightly of the zig version used.
Here an example of the linking errors:
gyro build run -Dexample=simple --search-prefix "$(pwd)/$WASMTIME"
Click to expand!
Windows fails as well, but I didn't spend any time investigating for now.
I'd really appreciate any idea/advice on how I to get Linux (and potentially even Windows ;) ) examples to build!
The text was updated successfully, but these errors were encountered: