# improve stage2 COFF LLD linking · gitcafe/zig

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

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

Visibility: public

Requested revision: 0da7c4b0c8a2a2fe0862f7757bc5976342d51dc8

Requested commit: 0da7c4b0c8a2a2fe0862f7757bc5976342d51dc8

Commit: 0da7c4b0c8a2a2fe0862f7757bc5976342d51dc8

Tree: a009c84f49be7b52e13964014222cb960915d136

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
improve stage2 COFF LLD linking

 * change some {} to be {s} to gain type safety
 * fix libraries being libfoo.lib instead of foo.lib for COFF
 * when linking mingw-w64, add the "always link" libs so that we
   generate DLL import .lib files for them as the linker code relies on.
 * COFF LLD linker does not support -r so we do a file copy as an
   alternative to the -r thing that ELF linking does.
   I will file an issue for the corresponding TODO upon merging this
   branch, to look into an optimization that possibly elides this copy
   when the source and destination are both cache directories.
 * add a CLI error message when trying to link multiple objects into one
   and using COFF object format.

```

## Parents

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

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