# start moving \`zig cc\` to stage2 · gitcafe/zig

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

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

Visibility: public

Requested revision: 503ba7b27c6e8e248d271aec936623853cd8fcd1

Requested commit: 503ba7b27c6e8e248d271aec936623853cd8fcd1

Commit: 503ba7b27c6e8e248d271aec936623853cd8fcd1

Tree: 005438102ec6ba09cb9368397b9ff180f44790ad

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
start moving `zig cc` to stage2

 * build.zig: repair the ability to link against llvm, clang, and lld
 * move the zig cc arg parsing logic to stage2
   - the preprocessor flag is still TODO
   - the clang arg iterator code is improved to use slices instead of
     raw pointers because it no longer has to deal with an extern
     struct.
 * clean up error printing with a `fatal` function and use log API
   for messages rather than std.debug.print
 * add support for more CLI options to stage2 & update usage text
   - hooking up most of these new options is TODO
 * clean up the way libc and libc++ are detected via command line
   options. target information is used to determine if any of the libc
   candidate names are chosen.
 * add native library directory detection
 * implement the ability to invoke clang from stage2
 * introduce a build_options.have_llvm so we can comptime branch
   on whether LLVM is linked in or not.

```

## Parents

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

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