-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PAC][clang] Define ptrauth driver flags and preprocessor features #85232
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ With the latest revision this PR passed the C/C++ code formatter. |
Define the following clang driver flags: - `-fptrauth-intrinsics`: `PointerAuthIntrinsics` in `LangOptions`, `ptrauth_intrinsics` preprocessor feature; - `-fptrauth-calls`: `PointerAuthCalls` in `LangOptions`, `ptrauth_calls` and `ptrauth_member_function_pointer_type_discrimination` preprocessor features; - `-fptrauth-returns`: `PointerAuthReturns` in `LangOptions`, `ptrauth_returns` preprocessor feature; - `-fptrauth-auth-traps`: `PointerAuthAuthTraps` in `LangOptions`; - `-fptrauth-vtable-pointer-address-discrimination`: `PointerAuthVTPtrAddressDiscrimination` in `LangOptions`, `ptrauth_vtable_pointer_address_discrimination` preprocessor feature; - `-fptrauth-vtable-pointer-type-discrimination`: `PointerAuthVTPtrTypeDiscrimination` in `LangOptions`, `ptrauth_vtable_pointer_type_discrimination` preprocessor feature; - `-fptrauth-init-fini`: `PointerAuthInitFini` in `LangOptions`, `ptrauth_init_fini` preprocessor feature; The patch only defines the flags and having corresponding `LangOptions` set does not affect codegen yet. Co-authored-by: Ahmed Bougacha <ahmed@bougacha.org>
kovdan01
force-pushed
the
pauth-clang-flags
branch
from
March 14, 2024 14:56
d0138c7
to
1394471
Compare
kovdan01
added a commit
that referenced
this pull request
Apr 2, 2024
…RE_PAUTH` (#85231) This adds support for `GNU_PROPERTY_AARCH64_FEATURE_PAUTH` feature (as defined in ARM-software/abi-aa#240) handling in llvm-readobj and llvm-readelf. The following constants for supported platforms are also introduced: - `AARCH64_PAUTH_PLATFORM_INVALID = 0x0` - `AARCH64_PAUTH_PLATFORM_BAREMETAL = 0x1` - `AARCH64_PAUTH_PLATFORM_LLVM_LINUX = 0x10000002` For the llvm_linux platform, output of the tools contains descriptions of PAuth features which are enabled/disabled depending on the version value. Version value bits correspond to the following `LangOptions` defined in #85232: - bit 0: `PointerAuthIntrinsics`; - bit 1: `PointerAuthCalls`; - bit 2: `PointerAuthReturns`; - bit 3: `PointerAuthAuthTraps`; - bit 4: `PointerAuthVTPtrAddressDiscrimination`; - bit 5: `PointerAuthVTPtrTypeDiscrimination`; - bit 6: `PointerAuthInitFini`. Support for `.note.AARCH64-PAUTH-ABI-tag` is dropped since it's deleted from the spec in ARM-software/abi-aa#250.
kovdan01
added a commit
that referenced
this pull request
Apr 4, 2024
…RE_PAUTH` (#87545) Reland #85231 after fixing build failure https://lab.llvm.org/buildbot/#/builders/186/builds/15631. Use `PRIx64` for format output of `uint64_t` as hex. Original PR description below. This adds support for `GNU_PROPERTY_AARCH64_FEATURE_PAUTH` feature (as defined in ARM-software/abi-aa#240) handling in llvm-readobj and llvm-readelf. The following constants for supported platforms are also introduced: - `AARCH64_PAUTH_PLATFORM_INVALID = 0x0` - `AARCH64_PAUTH_PLATFORM_BAREMETAL = 0x1` - `AARCH64_PAUTH_PLATFORM_LLVM_LINUX = 0x10000002` For the llvm_linux platform, output of the tools contains descriptions of PAuth features which are enabled/disabled depending on the version value. Version value bits correspond to the following `LangOptions` defined in #85232: - bit 0: `PointerAuthIntrinsics`; - bit 1: `PointerAuthCalls`; - bit 2: `PointerAuthReturns`; - bit 3: `PointerAuthAuthTraps`; - bit 4: `PointerAuthVTPtrAddressDiscrimination`; - bit 5: `PointerAuthVTPtrTypeDiscrimination`; - bit 6: `PointerAuthInitFini`. Support for `.note.AARCH64-PAUTH-ABI-tag` is dropped since it's deleted from the spec in ARM-software/abi-aa#250.
kovdan01
added a commit
that referenced
this pull request
May 9, 2024
Depends on #87545 Emit PAuth ABI compatibility tag values as llvm module flags: - `aarch64-elf-pauthabi-platform` - `aarch64-elf-pauthabi-version` For platform 0x10000002 (llvm_linux), the version value bits correspond to the following LangOptions defined in #85232: - bit 0: `PointerAuthIntrinsics`; - bit 1: `PointerAuthCalls`; - bit 2: `PointerAuthReturns`; - bit 3: `PointerAuthAuthTraps`; - bit 4: `PointerAuthVTPtrAddressDiscrimination`; - bit 5: `PointerAuthVTPtrTypeDiscrimination`; - bit 6: `PointerAuthInitFini`. --------- Co-authored-by: Ahmed Bougacha <ahmed@bougacha.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Define the following clang driver flags:
-fptrauth-intrinsics
:PointerAuthIntrinsics
inLangOptions
,ptrauth_intrinsics
preprocessor feature;-fptrauth-calls
:PointerAuthCalls
inLangOptions
,ptrauth_calls
andptrauth_member_function_pointer_type_discrimination
preprocessor features;-fptrauth-returns
:PointerAuthReturns
inLangOptions
,ptrauth_returns
preprocessor feature;-fptrauth-auth-traps
:PointerAuthAuthTraps
inLangOptions
;-fptrauth-vtable-pointer-address-discrimination
:PointerAuthVTPtrAddressDiscrimination
inLangOptions
,ptrauth_vtable_pointer_address_discrimination
preprocessor feature;-fptrauth-vtable-pointer-type-discrimination
:PointerAuthVTPtrTypeDiscrimination
inLangOptions
,ptrauth_vtable_pointer_type_discrimination
preprocessor feature;-fptrauth-init-fini
:PointerAuthInitFini
inLangOptions
,ptrauth_init_fini
preprocessor feature;The patch only defines the flags and having corresponding
LangOptions
set does not affect codegen yet.Co-authored-by: Ahmed Bougacha ahmed@bougacha.org