[FMV][AArch64] Document the interface for Function Multi-versioning.
Documents the Application Binary Interface requirements for Function Multi-versioning on System V platforms.
A global variable __aarch64_cpu_features that contains a
description of the detected CPU features is used for selecting
the best function version.
Initialization of the __aarch64_cpu_features is performed by
the runtime. A runtime function __init_cpu_features_resolver
must ensure that __aarch64_cpu_features is populated. This
function must be provided by the runtime environment and be
defined as DSO local.
Would you be able to write a quick summary for the description, and add a line in the Change History?
ping
Adding @jroelofs for visibility
Use a form of FMV that doesn't use ifuncs. I guess that has to be some kind of additional code that runs every time the function is called.
Another option: do what we're doing on Darwin, and use hand-rolled lazy-init function pointer's to resolvers that replace themselves with the callee the first time they're called.
Thanks for reviewing!
After further digging we found that the __aarch64_cpu_features global is used by __builtin_cpu_supports and the runtime library for SME. These two rely on constructors which run after the resolvers have run, meaning RELRO cannot be used in conjunction with them. Shall I word all of this info with a note, or just remove the mention of RELRO entirely?