# macho: implement and handle \`\-needed\-\*\` and \`\-needed\_\*\` family of flags · gitcafe/zig

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

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

Visibility: public

Requested revision: 0dd28920daa5127ffe5a3691343fa519f7547cfd

Requested commit: 0dd28920daa5127ffe5a3691343fa519f7547cfd

Commit: 0dd28920daa5127ffe5a3691343fa519f7547cfd

Tree: 949f6078a42f12415508667377b40ea0e84eac0b

Author: Jakub Konka

Committer: Jakub Konka

## Message

```
macho: implement and handle `-needed-*` and `-needed_*` family of flags

MachO linker now handles `-needed-l<name>`, `-needed_library=<name>`
and `-needed_framework=<name>`. While on macOS `-l` is equivalent
to `-needed-l`, and `-framework` to `-needed_framework`, it can be
used to the same effect as on Linux if combined with `-dead_strip_dylibs`.

This commit also adds handling for `-needed_library` which is macOS
specific flag only (in addition to `-needed-l`).

Finally, in order to leverage new linker testing harness, this commit
added ability to specify lowering to those flags via `build.zig`:
`linkSystemLibraryNeeded` (and related), and `linkFrameworkNeeded`.

```

## Parents

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

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