# linker: remove \`\-z noexecstack\` option · gitcafe/zig

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

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

Visibility: public

Requested revision: 5816d3eaec3f3bb04e70c89aa402ba9e0e5e7b2c

Requested commit: 5816d3eaec3f3bb04e70c89aa402ba9e0e5e7b2c

Commit: 5816d3eaec3f3bb04e70c89aa402ba9e0e5e7b2c

Tree: 2cccbd1ac1b95a10823fdd092d3d38ee84b76e8d

Author: Isaac Freund

Committer: Andrew Kelley

## Message

```
linker: remove `-z noexecstack` option

Note that the current documentation for the `-z noexecstack` is
incorrect. This indicates that an object *does not* require an
executable stack.

This is actually the default of LLD, and there has never been a way to
override this default by passing `-z execstack` to LLD.

This commit removes the redundant `-z noexecstack` option from
zig build-exe/build-lib/build-obj and ignores the option if passed
to zig cc for compatibility.

As far as I can tell, there is no reason for code to require an
executable stack. This option only exists because the stack was
originally executable by default and some programs came to depend
on that behavior. Instead, mprotect(2) may be used to make memory
pages executable.

```

## Parents

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

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