# wasm-linker: implement \`\-fno-entry\` flag · gitcafe/zig

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

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

Visibility: public

Requested revision: 1cb7a01b25349c42dbe207b68f9e19b92890b3d2

Requested commit: 1cb7a01b25349c42dbe207b68f9e19b92890b3d2

Commit: 1cb7a01b25349c42dbe207b68f9e19b92890b3d2

Tree: 602589918ad620910c8462711492e1ffff6c2826

Author: Luuk de Gram

Committer: Luuk de Gram

## Message

```
wasm-linker: implement `-fno-entry` flag

This adds support for the `-fno-entry` and `-fentry` flags respectively, for
zig build-{exe/lib} and the build system. For `zig cc` we use the `--no-entry`
flag to be compatible with clang and existing tooling.

In `start.zig` we now make the main function optional when the target is
WebAssembly, as to allow for the build-exe command in combination with
`-fno-entry`.

When the execution model is set, and is set to 'reactor', we now verify
when an entry name is given it matches what is expected. When no entry
point is given, we set it to `_initialize` by default. This means the user
will also be met with an error when they use the reactor model, but did
not provide the correct function.

```

## Parents

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

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