# Compilation: retain ZCU object when emitting unstripped Mach-O binary · gitcafe/zig

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

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

Visibility: public

Requested revision: 0096c0806c0f939140ef61216d967b00e571018c

Requested commit: 0096c0806c0f939140ef61216d967b00e571018c

Commit: 0096c0806c0f939140ef61216d967b00e571018c

Tree: 15d7b6b8669d537e67a544610680e597893843d3

Author: mlugg

Committer: Matthew Lugg

## Message

```
Compilation: retain ZCU object when emitting unstripped Mach-O binary

On macOS, when using the LLVM backend, the output binary retains a
reference to this object file's debug info (as opposed to self-hosted
backends which instead emit a dSYM bundle). As such, we need to retain
this object file in such cases. This object does unfortunately "leak",
in that it won't be reused and will just sit in the cache forever (or
until GC'd in the future). But that's no worse than the cache behavior
prior to the rework that caused this, and it will become less of a
problem over time as the self-hosted backend gains usability for debug
builds and eventually becomes the default.

Resolves: #24369

```

## Parents

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

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