authorgravatar for luuk@degram.devLuuk de Gram <luuk@degram.dev> 2022-12-28 16:36:46+01:00
committergravatar for luuk@degram.devLuuk de Gram <luuk@degram.dev> 2022-12-28 16:49:36+01:00
log8403612adc67d6398b3664b20eb453475688bd46
tree8af8c50adf7573adc255ea68e0c677e64f99035f
parent4bffe645c6e621cdda858f9eeb4436980fece25c
signaturelock-open Commit is signed but in an unrecognized format.

test/link: update linker tests

Force importing symbols to show the correct functions are being imported from the host environment.

2 files changed, 3 insertions(+), 1 deletions(-)

src/link/Wasm.zig+1-1
......@@ -3443,7 +3443,7 @@ fn linkWithLLD(wasm: *Wasm, comp: *Compilation, prog_node: *std.Progress.Node) !
34433443 try argv.append("--no-entry"); // So lld doesn't look for _start.
34443444 }
34453445 if (wasm.base.options.import_symbols) {
3446 try argv.appendSlice(&[_][]const u8{"--allow-undefined"});
3446 try argv.append("--allow-undefined");
34473447 }
34483448 try argv.appendSlice(&[_][]const u8{
34493449 "-o",
test/link/wasm/extern-mangle/build.zig+2
......@@ -10,6 +10,8 @@ pub fn build(b: *Builder) void {
1010 const lib = b.addSharedLibrary("lib", "lib.zig", .unversioned);
1111 lib.setBuildMode(mode);
1212 lib.setTarget(.{ .cpu_arch = .wasm32, .os_tag = .freestanding });
13 lib.import_symbols = true; // import `a` and `b`
14 lib.rdynamic = true; // export `foo`
1315 lib.install();
1416
1517 const check_lib = lib.checkObject(.wasm);