# stage2: Fix wasm linker for llvm backend · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/6d84f22fa0d30f688a2fbe69acab2979373a7806)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 6d84f22fa0d30f688a2fbe69acab2979373a7806

Requested commit: 6d84f22fa0d30f688a2fbe69acab2979373a7806

Commit: 6d84f22fa0d30f688a2fbe69acab2979373a7806

Tree: 03d39cb2386d7c9da060e84de495a9e2de9dfc51

Author: Luuk de Gram

Committer: Andrew Kelley

## Message

```
stage2: Fix wasm linker for llvm backend

This fixes 2 entrypoints within the self-hosted wasm linker that would be called
for the llvm backend, whereas we should simply call into the llvm backend to perform such action.
i.e. not allocate a decl index when we have an llvm object, and when flushing a module,
we should be calling it on llvm's object, rather than have the wasm linker perform the operation.

Also, this fixes the wasm intrinsics for wasm.memory.size and wasm.memory.grow.
Lastly, this commit ensures that when an extern function is being resolved, we tell LLVM how
to import such function.

```

## Parents

- [716abe338907dbcb0ea115dd014c2e13c3a6637b](https://git.cafe/gitcafe/zig/commit/716abe338907dbcb0ea115dd014c2e13c3a6637b?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/6d84f22fa0d30f688a2fbe69acab2979373a7806?format=markdown)
