aboutsummaryrefslogtreecommitdiff
path: root/src/zig_llvm.cpp
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2018-06-10 04:39:22 +0200
committerAndrew Kelley <superjoe30@gmail.com>2018-06-09 22:39:22 -0400
commitd464b2532200de3778ac7362e701791a11150d55 (patch)
tree0b78986c512fac465bd2f045ef72ff745af93354 /src/zig_llvm.cpp
parent7a9635555b5ddc681134ebe0e0e9f4f373ac5025 (diff)
downloadzig-d464b2532200de3778ac7362e701791a11150d55.tar.gz
zig-d464b2532200de3778ac7362e701791a11150d55.zip
support `--target-arch wasm32` (#1094)
Add wasm32 support to the build-obj, build-exe and build-lib commands of the stage 1 compiler. Wasm64 should work transparently once it's supported in upstream LLVM. To export a function: // lib.zig - for exposition, not necessary for this example pub use @import("add.zig"); // add.zig export fn add(a: i32, b: i32) i32 { return a + b; } To import a function: // cube.zig extern fn square(x: i32) i32; export fn cube(x: i32) i32 { return x * square(x); }
Diffstat (limited to 'src/zig_llvm.cpp')
-rw-r--r--src/zig_llvm.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp
index 5905fa8167..24f2a8a343 100644
--- a/src/zig_llvm.cpp
+++ b/src/zig_llvm.cpp
@@ -838,7 +838,7 @@ bool ZigLLDLink(ZigLLVM_ObjectFormatType oformat, const char **args, size_t arg_
return lld::mach_o::link(array_ref_args, diag);
case ZigLLVM_Wasm:
- assert(false); // TODO ZigLLDLink for Wasm
+ return lld::wasm::link(array_ref_args, false, diag);
}
assert(false); // unreachable
abort();