[PATCH] D158641: [AArch64][Android][DRAFT] Fix FMV ifunc resolver usage on old Android APIs.

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 26 14:05:58 PDT 2023


MaskRay added inline comments.


================
Comment at: compiler-rt/lib/builtins/cpu_model.c:1379
 
+void init_cpu_features_resolver(unsigned long hwcap, const __ifunc_arg_t *arg) {
+  if (__aarch64_cpu_features.features)
----------------
It seems that we don't need the `_constructor` function. We can just move the 

```
#if defined(__ANDROID__)
  // ifunc resolvers don't have hwcaps in arguments on Android API lower
  // than 30. In this case set detection done and keep all CPU features
  // unsupported (zeros).
  if (android_get_device_api_level() < 30) {
    setCPUFeature(FEAT_MAX);
    return;
  }
```

logic to init_cpu_features_resolver


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158641/new/

https://reviews.llvm.org/D158641



More information about the cfe-commits mailing list