[clang] [PAC][clang] Fix ptrauth module flags behavior (PR #204226)

Daniil Kovalev via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 1 05:34:16 PDT 2026


================
@@ -1480,14 +1480,17 @@ void CodeGenModule::Release() {
     if (!LangOpts.isSignReturnAddressWithAKey())
       getModule().addModuleFlag(llvm::Module::Min,
                                 "sign-return-address-with-bkey", 2);
-
-    if (LangOpts.PointerAuthELFGOT)
-      getModule().addModuleFlag(llvm::Module::Error, "ptrauth-elf-got", 1);
+  }
+  if (T.isAArch64()) {
+    getModule().addModuleFlag(
----------------
kovdan01 wrote:

Thanks for this catch! Not under `isOSLinux` actually, since backend allows such flag for any ELF target (and signed GOT docs are also ELF-specific, not Linux-specific) - while this was never evaluated for non-Linux though.

So, I've added a check against `isOSBinFormatELF()`

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


More information about the cfe-commits mailing list