[compiler-rt] [lld] [lldb] [flang] [clang] [mlir] [llvm] [libcxx] [builtins] Refactor cpu_model support to reduce #if nesting. NFCI (PR #75635)

Petr Hosek via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 20 01:26:24 PST 2023


petrhosek wrote:

I have discovered another issue, on Fuchsia `libclang_rt.builtins.a` now has a reference to `getauxval` which it didn't have before. This is really undesirable because on Fuchsia, there's no `auxv` to begin with. I believe this is because before, the `__init_cpu_features` definition was guarded by:

```
#if defined(__has_include)
#if __has_include(<sys/auxv.h>)
#include <sys/auxv.h>
...
#if __has_include(<asm/hwcap.h>)
#include <asm/hwcap.h>
```
These `#if __has_include(...)` conditionals would evaluate to false on Fuchsia since we don't have those headers, but they have been moved in the refactored version.

https://github.com/llvm/llvm-project/pull/75635


More information about the cfe-commits mailing list