[clang-tools-extra] [llvm] [clang] [AArch64][Clang] Fix linker error for function multiversioning (PR #74358)

via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 5 07:21:58 PST 2023


================
@@ -4178,8 +4184,22 @@ void CodeGenModule::emitMultiVersionFunctions() {
     }
 
     llvm::Constant *ResolverConstant = GetOrCreateMultiVersionResolver(GD);
-    if (auto *IFunc = dyn_cast<llvm::GlobalIFunc>(ResolverConstant))
+    if (auto *IFunc = dyn_cast<llvm::GlobalIFunc>(ResolverConstant)) {
       ResolverConstant = IFunc->getResolver();
+      if (FD->isTargetClonesMultiVersion()) {
+        const CGFunctionInfo &FI = getTypes().arrangeGlobalDeclaration(GD);
+        llvm::FunctionType *DeclTy = getTypes().GetFunctionType(FI);
+        std::string MangledName = getMangledNameImpl(
+            *this, GD, FD, /*OmitMultiVersionMangling=*/true);
+        // In prior versions of Clang, the mangling for ifuncs incorrectly
+        // included an .ifunc suffix. This alias is generated for backward
+        // compatibility and should be deprecated in the future.
----------------
DanielKristofKiss wrote:

Added to the original series.

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


More information about the cfe-commits mailing list