# don't trust llvm's GetHostCPUName · gitcafe/zig

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

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

Visibility: public

Requested revision: cbe9a51518db6f4e77a4f8c72e8cd9cd02fa7f49

Requested commit: cbe9a51518db6f4e77a4f8c72e8cd9cd02fa7f49

Commit: cbe9a51518db6f4e77a4f8c72e8cd9cd02fa7f49

Tree: 9efdeb5bcc24f2cbafec863ee422eede660b2c7c

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
don't trust llvm's GetHostCPUName

comment from this commit reproduced here:

I have observed the CPU name reported by LLVM being incorrect. On
the SourceHut build services, LLVM 9.0 reports the CPU as "athlon-xp",
which is a 32-bit CPU, even though the system is 64-bit and the reported
CPU features include, among other things, +64bit.
So the strategy taken here is that we observe both reported CPU, and the
reported CPU features. The features are trusted more; but if the features
match exactly the features of the reported CPU, then we trust the reported CPU.

```

## Parents

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

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