Comments (2)
I took a look and the missing symbols are provided by libunwind
(also note that the errors pop up in the first place since Zig/lld will prefer linking against static libs first). Zig ships libunwind
and so we only need to explicitly specify that we want to link against in the build.zig
script. Here's the diff, feel free to use it and no attribution is necessary:
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 libc
and libunwind
are provided by the OS and always available so no need to link against it there.
Once you get everything building again, I'd really appreciate a PR with the fixed :-)
from wasmtime-zig.
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...
D:\a\wasmtime-zig\wasmtime-zig\zig-windows-x86_64-0.10.0-dev.2473+e498fb155\lib\std\os\windows.zig:1593:32: 0x7ff78d4627eb in td.os.windows.CreateProcessW (build.obj)
.FILE_NOT_FOUND => return error.FileNotFound,
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)
Once you get everything building again, I'd appreciate a PR with the fixed :-)
This is my goal :)
from wasmtime-zig.
Related Issues (3)
- Rename anyref HOT 3
- Updating to new (breaking) Wasmtime API HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wasmtime-zig.