# linker: fix build-obj and \-fno-emit-bin · gitcafe/zig

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

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

Visibility: public

Requested revision: ff66a18555dc6c00bd928f48462c3fc44f86ab6c

Requested commit: ff66a18555dc6c00bd928f48462c3fc44f86ab6c

Commit: ff66a18555dc6c00bd928f48462c3fc44f86ab6c

Tree: e30f1af8d95b1e634d4076cbc521ee2b35d5c90c

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
linker: fix build-obj and -fno-emit-bin

This commit fixes two problems:

* `zig build-obj` regressed from the cache-mode branch. It would crash
  because it assumed that dirname on the emit bin path would not be
  null. This assumption was invalid when outputting to the current
  working directory - a pretty common use case for `zig build-obj`.

* When using the LLVM backend, `-fno-emit-bin` combined with any other
  kind of emitting, such as `-femit-asm`, emitted nothing.

Both issues are now fixed.

```

## Parents

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

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