# wasm-linker: correctly pass \-\-shared and \-\-pie · gitcafe/zig

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

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

Visibility: public

Requested revision: 58618afaee7c14feedad4f115e9a4468bac4c529

Requested commit: 58618afaee7c14feedad4f115e9a4468bac4c529

Commit: 58618afaee7c14feedad4f115e9a4468bac4c529

Tree: 90a4a16f016817ec171c49b4f5e1b42dc504e0bd

Author: Luuk de Gram

Committer: Luuk de Gram

## Message

```
wasm-linker: correctly pass --shared and --pie

When linking a WebAssembly binary using wasm-ld, we will now correctly pass
--shared when building a dynamic library and --pie when `-fpic` is given.
This is a breaking change and users who currently build dynamic libraries
for WebAssembly but wish to have an executable without a main, should use
build-exe instead while supplying `-fno-entry`.

We also verify the user does not supply --export-memory when -dynamic is
enabled. By default we set this flag now to 'false' when `-dynamic` is used
to ensure we do not enable it as it's enabled by default for regular
WebAssembly binaries.

```

## Parents

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

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