[llvm] [AArch64] Make IFUNC opt-in rather than opt-out. (PR #171648)
Harald van Dijk via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 10 08:54:11 PST 2025
https://github.com/hvdijk created https://github.com/llvm/llvm-project/pull/171648
IFUNCs require loader support, so for arbitrary environments, the safe assumption is to assume that they are not supported.
In particular, aarch64-linux-pauthtest may be used with musl, and was wrongly detected as supporting IFUNCs.
>From 0bb2d2049fdd5ddf7bb4cc67c570700ce7f1841a Mon Sep 17 00:00:00 2001
From: Harald van Dijk <hdijk at accesssoftek.com>
Date: Wed, 10 Dec 2025 16:52:01 +0000
Subject: [PATCH] [AArch64] Make IFUNC opt-in rather than opt-out.
IFUNCs require loader support, so for arbitrary environments, the safe
assumption is to assume that they are not supported.
In particular, aarch64-linux-pauthtest may be used with musl, and was
wrongly detected as supporting IFUNCs.
---
llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
index 25fc59e3fc258..daf20591b6731 100644
--- a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
+++ b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
@@ -2402,11 +2402,8 @@ static bool targetSupportsIRelativeRelocation(const Triple &TT) {
if (!TT.isOSBinFormatELF())
return false;
- // musl doesn't support IFUNCs.
- if (TT.isMusl())
- return false;
-
- return true;
+ // IFUNCs are supported on glibc.
+ return TT.isGNUEnvironment();
}
// Emit an ifunc resolver that returns a signed pointer to the specified target,
More information about the llvm-commits
mailing list