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

Pavel Iliin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 8 09:52:48 PDT 2023


ilinpv 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)
----------------
ilinpv wrote:
> MaskRay wrote:
> > 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
> We don't need this "Android API check and return" in init_cpu_features_resolver when it is called from constructor ##init_cpu_features## where hwcaps are obtained through getauxval calls.
It seems there is no other way than split it in ##_constructor## and ##_resolver## parts.


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