Files
Nico Weber cc04ed68b5 [libc] Stop passing --version to compiler when detecting target (#176680)
This reverts c267501c15, and also adds a `-c` flag.

Both gcc and clang print the `Target:` line that we're trying to find
just find with just `-v`.

When passing `--version`, gcc passes `--version` to the system linker,
and when using gcc on macOS, the system linker does not understand
`--version`. Since `--version` does not seem to be necessary, drop it.

Also, passing `-c` lets gcc not print linker details, so add that too,
as a belt-and-suspenders fix.

---

Makes `cmake` succeed for me on my mac with
`/Applications/CMake.app/Contents/bin/cmake ../llvm-project/llvm -G
Ninja -DLLVM_ENABLE_PROJECTS="libc" -DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_COMPILER=gcc-12 -DCMAKE_CXX_COMPILER=g++-12` (with gcc-12 from
homebrew).
2026-04-30 11:22:56 -04:00
..