[all-commits] [llvm/llvm-project] 2f8eb5: [clang][llvm][AArch64] Set hardening fn attrs on s...

Daniil Kovalev via All-commits all-commits at lists.llvm.org
Fri Jul 31 11:23:07 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2f8eb5b4be3eba5c7f58470d6538d00df53a55fc
      https://github.com/llvm/llvm-project/commit/2f8eb5b4be3eba5c7f58470d6538d00df53a55fc
  Author: Daniil Kovalev <dkovalev at accesssoftek.com>
  Date:   2026-07-31 (Fri, 31 Jul 2026)

  Changed paths:
    M clang/lib/CodeGen/CodeGenModule.cpp
    A clang/test/CodeGen/AArch64/ptrauth-function-attributes-synthetic.c
    M llvm/lib/IR/Function.cpp
    A llvm/test/Instrumentation/AddressSanitizer/ptrauth-module-flags-aarch64.ll
    A llvm/test/Transforms/GCOVProfiling/ptrauth-module-flags-aarch64.ll

  Log Message:
  -----------
  [clang][llvm][AArch64] Set hardening fn attrs on synthetic functions (#211013)

Compiler-synthesized functions such as `__llvm_gcov_writeout`,
`__llvm_gcov_reset` and `__llvm_gcov_init` were previously never
receiving the AArch64 hardening function attributes (ptrauth-returns,
ptrauth-auth-traps, ptrauth-indirect-gotos and
aarch64-jump-table-hardening) since the attributes were only emitted by
Clang and gated by `PointerAuthOptions` structure's corresponding
fields. See `setPointerAuthFnAttributes` and
`initPointerAuthFnAttributes` member functions of `TargetCodeGenInfo`.

This patch resolves this in the same manner as #83153 does for several
other attributes. Particularly, Clang now emits corresponding 4 module
flags (conditionally on whether the related feature is enabled) with Max
behavior, and LLVM's `Function::createWithDefaultAttr` derives the
matching function attributes from them. Max behavior with conditional
emission is safe because none of these features affect ABI, so promoting
an absent flag on module merge cannot break compatibility.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list