[all-commits] [llvm/llvm-project] ea7319: [clang][PAC] Make ptrauth_qualifier and ptrauth_in...

Oliver Hunt via All-commits all-commits at lists.llvm.org
Fri Aug 15 18:48:15 PDT 2025


  Branch: refs/heads/users/ojhunt/de-and-re-featurify-ptrauth-qualifier-and-intrinsics
  Home:   https://github.com/llvm/llvm-project
  Commit: ea731927d6bdf85a3cdb333b756447658f2c2ea6
      https://github.com/llvm/llvm-project/commit/ea731927d6bdf85a3cdb333b756447658f2c2ea6
  Author: Oliver Hunt <oliver at apple.com>
  Date:   2025-08-15 (Fri, 15 Aug 2025)

  Changed paths:
    M clang/include/clang/Basic/Features.def
    M clang/lib/Frontend/FrontendActions.cpp
    M clang/lib/Frontend/InitPreprocessor.cpp
    M clang/lib/Headers/ptrauth.h
    M clang/lib/Lex/PPMacroExpansion.cpp
    M clang/test/Preprocessor/ptrauth_extension.c
    M clang/test/Preprocessor/ptrauth_feature.c
    M clang/test/Sema/ptrauth-qualifier.c
    M clang/test/SemaObjC/ptrauth-qualifier.m

  Log Message:
  -----------
  [clang][PAC] Make ptrauth_qualifier and ptrauth_intrinsic Darwin only features

For backwards compatibility reasons the ptrauth_qualifier and ptrauth_intrinsic
features need to be testable with __has_feature() on Apple platforms, but for
other platforms this backwards compatibility issue does not exist.

This PR resolves these issues by making the ptrauth_qualifier and
ptrauth_intrinsic tests conditional upon a darwin target. This also
allows us to revert the ptrauth_qualifier check from an extension to a
feature test again, as is required on these platforms.

At the same time we introduce a new predefined macro __PTRAUTH__
that answers the same question as __has_feature(ptrauth_qualifier)
and __has_feature(ptrauth_intrinsic) as those tests are synonymous
and only exist separately for compatibility reasons.

The requirement to test for the __PTRAUTH__ macro also resolves the
hazard presented by mixing the ptrauth_qualifier flag (that impacts
ABI and security policies) with -pedantics-errors, which makes
__has_extension return false for all extensions.



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