Library support for aarch64-unknown-linux-pauthtest target - #156548
Conversation
|
The relevant change is only in the two most recent commits, the rest is from the target introduction PR. |
|
@davidtwco, @folkertdev, @tgross35, @madsmtm FWI this is a follow up to #155722 |
|
This PR modifies If appropriate, please update Some changes occurred in src/tools/compiletest cc @jieyouxu The GCC codegen subtree was changed
Some changes occurred in src/doc/rustc/src/platform-support cc @Noratrieb This PR modifies cc @jieyouxu These commits modify compiler targets. |
|
r? @folkertdev rustbot has assigned @folkertdev. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Rollup of 25 pull requests Successful merges: - #158871 (add relnotes for 1.97.0) - #158968 (stdarch subtree update) - #157690 (codegen_ssa: pack small const aggregates into immediate stores) - #158541 (Move `std::io::Write` to `core::io`) - #154445 (rustdoc: Represent `--output-format=json` coverage and ir differently) - #156370 (Reject linked dylib EII default overrides) - #157153 (allow `Allocator`s to be used as `#[global_allocator]`s) - #158495 (Rename HAS_CT_PROJECTION to HAS_CONST_ALIAS) - #158617 (allow mGCA const arguments to fall back to anon consts) - #158645 (Fix splat ICEs and ban it in closures) - #158655 (Fix coroutine MIR saved local remapping) - #158666 (Carry the `b_offset` inside `BackendRepr::ScalarPair`) - #158870 (std: merge the unix-like io::error modules into one file) - #158920 (Update wasm-component-ld to 0.5.26) - #158926 (wrapping_sh* methods: clarify underspecified reference) - #158927 (add core test run with `-Zforce-intrinsic-fallback`) - #158932 (Do not build the compiler when invoking `x perf compare`) - #158937 (Emit the emscripten entry point as `__main_argc_argv`) - #151379 (Stabilize `VecDeque::retain_back` from `truncate_front`) - #156144 (Better docs for PartialEq (includes macro rename)) - #156548 ( Library support for aarch64-unknown-linux-pauthtest target) - #158307 (CI job for parallel frontend ui tests) - #158347 (Improve generic parameters handling for #[diagnostic::on_const]) - #158722 (delegation: do not always inherit `ConstArgHasType` predicates) - #158741 (Simplify `Option::into_flat_iter` signature)
Library support for aarch64-unknown-linux-pauthtest target This is a follow up to rust-lang#155722, adding library support for the target.
Rollup of 23 pull requests Successful merges: - #158968 (stdarch subtree update) - #154445 (rustdoc: Represent `--output-format=json` coverage and ir differently) - #158495 (Rename HAS_CT_PROJECTION to HAS_CONST_ALIAS) - #158666 (Carry the `b_offset` inside `BackendRepr::ScalarPair`) - #158870 (std: merge the unix-like io::error modules into one file) - #158920 (Update wasm-component-ld to 0.5.26) - #158926 (wrapping_sh* methods: clarify underspecified reference) - #158927 (add core test run with `-Zforce-intrinsic-fallback`) - #158932 (Do not build the compiler when invoking `x perf compare`) - #158937 (Emit the emscripten entry point as `__main_argc_argv`) - #151379 (Stabilize `VecDeque::retain_back` from `truncate_front`) - #156144 (Better docs for PartialEq (includes macro rename)) - #156548 ( Library support for aarch64-unknown-linux-pauthtest target) - #157995 (`Vec::dedup_by` docs explicit function argument order) - #158307 (CI job for parallel frontend ui tests) - #158741 (Simplify `Option::into_flat_iter` signature) - #158807 (Add regression test for CString::clone_into unwind safety) - #158862 (Fix the span for parameter suggestion ) - #158894 (Make the ordering of non-terminal binds in ambiguity error messages deterministic) - #158902 (add codegen test for range length bound propagation) - #158913 (Update `browser-ui-test` version to `0.24.1`) - #158935 (std: support real fd methods on Emscripten) - #158978 (Add regression test for too-big by-value ABI args)
Rollup of 23 pull requests Successful merges: - rust-lang/rust#158968 (stdarch subtree update) - rust-lang/rust#154445 (rustdoc: Represent `--output-format=json` coverage and ir differently) - rust-lang/rust#158495 (Rename HAS_CT_PROJECTION to HAS_CONST_ALIAS) - rust-lang/rust#158666 (Carry the `b_offset` inside `BackendRepr::ScalarPair`) - rust-lang/rust#158870 (std: merge the unix-like io::error modules into one file) - rust-lang/rust#158920 (Update wasm-component-ld to 0.5.26) - rust-lang/rust#158926 (wrapping_sh* methods: clarify underspecified reference) - rust-lang/rust#158927 (add core test run with `-Zforce-intrinsic-fallback`) - rust-lang/rust#158932 (Do not build the compiler when invoking `x perf compare`) - rust-lang/rust#158937 (Emit the emscripten entry point as `__main_argc_argv`) - rust-lang/rust#151379 (Stabilize `VecDeque::retain_back` from `truncate_front`) - rust-lang/rust#156144 (Better docs for PartialEq (includes macro rename)) - rust-lang/rust#156548 ( Library support for aarch64-unknown-linux-pauthtest target) - rust-lang/rust#157995 (`Vec::dedup_by` docs explicit function argument order) - rust-lang/rust#158307 (CI job for parallel frontend ui tests) - rust-lang/rust#158741 (Simplify `Option::into_flat_iter` signature) - rust-lang/rust#158807 (Add regression test for CString::clone_into unwind safety) - rust-lang/rust#158862 (Fix the span for parameter suggestion ) - rust-lang/rust#158894 (Make the ordering of non-terminal binds in ambiguity error messages deterministic) - rust-lang/rust#158902 (add codegen test for range length bound propagation) - rust-lang/rust#158913 (Update `browser-ui-test` version to `0.24.1`) - rust-lang/rust#158935 (std: support real fd methods on Emscripten) - rust-lang/rust#158978 (Add regression test for too-big by-value ABI args)
Rollup of 23 pull requests Successful merges: - rust-lang/rust#158968 (stdarch subtree update) - rust-lang/rust#154445 (rustdoc: Represent `--output-format=json` coverage and ir differently) - rust-lang/rust#158495 (Rename HAS_CT_PROJECTION to HAS_CONST_ALIAS) - rust-lang/rust#158666 (Carry the `b_offset` inside `BackendRepr::ScalarPair`) - rust-lang/rust#158870 (std: merge the unix-like io::error modules into one file) - rust-lang/rust#158920 (Update wasm-component-ld to 0.5.26) - rust-lang/rust#158926 (wrapping_sh* methods: clarify underspecified reference) - rust-lang/rust#158927 (add core test run with `-Zforce-intrinsic-fallback`) - rust-lang/rust#158932 (Do not build the compiler when invoking `x perf compare`) - rust-lang/rust#158937 (Emit the emscripten entry point as `__main_argc_argv`) - rust-lang/rust#151379 (Stabilize `VecDeque::retain_back` from `truncate_front`) - rust-lang/rust#156144 (Better docs for PartialEq (includes macro rename)) - rust-lang/rust#156548 ( Library support for aarch64-unknown-linux-pauthtest target) - rust-lang/rust#157995 (`Vec::dedup_by` docs explicit function argument order) - rust-lang/rust#158307 (CI job for parallel frontend ui tests) - rust-lang/rust#158741 (Simplify `Option::into_flat_iter` signature) - rust-lang/rust#158807 (Add regression test for CString::clone_into unwind safety) - rust-lang/rust#158862 (Fix the span for parameter suggestion ) - rust-lang/rust#158894 (Make the ordering of non-terminal binds in ambiguity error messages deterministic) - rust-lang/rust#158902 (add codegen test for range length bound propagation) - rust-lang/rust#158913 (Update `browser-ui-test` version to `0.24.1`) - rust-lang/rust#158935 (std: support real fd methods on Emscripten) - rust-lang/rust#158978 (Add regression test for too-big by-value ABI args)
Rollup of 23 pull requests Successful merges: - rust-lang/rust#158968 (stdarch subtree update) - rust-lang/rust#154445 (rustdoc: Represent `--output-format=json` coverage and ir differently) - rust-lang/rust#158495 (Rename HAS_CT_PROJECTION to HAS_CONST_ALIAS) - rust-lang/rust#158666 (Carry the `b_offset` inside `BackendRepr::ScalarPair`) - rust-lang/rust#158870 (std: merge the unix-like io::error modules into one file) - rust-lang/rust#158920 (Update wasm-component-ld to 0.5.26) - rust-lang/rust#158926 (wrapping_sh* methods: clarify underspecified reference) - rust-lang/rust#158927 (add core test run with `-Zforce-intrinsic-fallback`) - rust-lang/rust#158932 (Do not build the compiler when invoking `x perf compare`) - rust-lang/rust#158937 (Emit the emscripten entry point as `__main_argc_argv`) - rust-lang/rust#151379 (Stabilize `VecDeque::retain_back` from `truncate_front`) - rust-lang/rust#156144 (Better docs for PartialEq (includes macro rename)) - rust-lang/rust#156548 ( Library support for aarch64-unknown-linux-pauthtest target) - rust-lang/rust#157995 (`Vec::dedup_by` docs explicit function argument order) - rust-lang/rust#158307 (CI job for parallel frontend ui tests) - rust-lang/rust#158741 (Simplify `Option::into_flat_iter` signature) - rust-lang/rust#158807 (Add regression test for CString::clone_into unwind safety) - rust-lang/rust#158862 (Fix the span for parameter suggestion ) - rust-lang/rust#158894 (Make the ordering of non-terminal binds in ambiguity error messages deterministic) - rust-lang/rust#158902 (add codegen test for range length bound propagation) - rust-lang/rust#158913 (Update `browser-ui-test` version to `0.24.1`) - rust-lang/rust#158935 (std: support real fd methods on Emscripten) - rust-lang/rust#158978 (Add regression test for too-big by-value ABI args)
Rollup of 23 pull requests Successful merges: - rust-lang/rust#158968 (stdarch subtree update) - rust-lang/rust#154445 (rustdoc: Represent `--output-format=json` coverage and ir differently) - rust-lang/rust#158495 (Rename HAS_CT_PROJECTION to HAS_CONST_ALIAS) - rust-lang/rust#158666 (Carry the `b_offset` inside `BackendRepr::ScalarPair`) - rust-lang/rust#158870 (std: merge the unix-like io::error modules into one file) - rust-lang/rust#158920 (Update wasm-component-ld to 0.5.26) - rust-lang/rust#158926 (wrapping_sh* methods: clarify underspecified reference) - rust-lang/rust#158927 (add core test run with `-Zforce-intrinsic-fallback`) - rust-lang/rust#158932 (Do not build the compiler when invoking `x perf compare`) - rust-lang/rust#158937 (Emit the emscripten entry point as `__main_argc_argv`) - rust-lang/rust#151379 (Stabilize `VecDeque::retain_back` from `truncate_front`) - rust-lang/rust#156144 (Better docs for PartialEq (includes macro rename)) - rust-lang/rust#156548 ( Library support for aarch64-unknown-linux-pauthtest target) - rust-lang/rust#157995 (`Vec::dedup_by` docs explicit function argument order) - rust-lang/rust#158307 (CI job for parallel frontend ui tests) - rust-lang/rust#158741 (Simplify `Option::into_flat_iter` signature) - rust-lang/rust#158807 (Add regression test for CString::clone_into unwind safety) - rust-lang/rust#158862 (Fix the span for parameter suggestion ) - rust-lang/rust#158894 (Make the ordering of non-terminal binds in ambiguity error messages deterministic) - rust-lang/rust#158902 (add codegen test for range length bound propagation) - rust-lang/rust#158913 (Update `browser-ui-test` version to `0.24.1`) - rust-lang/rust#158935 (std: support real fd methods on Emscripten) - rust-lang/rust#158978 (Add regression test for too-big by-value ABI args)
…=davidtwco [PAC] Encoder and hash (1/8) This patch implements Rust's equivalent of Clang's function pointer type discriminator computation used for pointer authentication. Compatibility with Clang is a primary design goal. For a given extern "C" function type, the discriminator produced by Rust must match the value computed by Clang so that function pointers can be exchanged safely between Rust and C code while preserving pointer authentication semantics. The implementation mirrors Clang's behavior in ASTContext::encodeTypeForFunctionPointerAuth, ensuring that identical C-compatible function types produce identical discriminators. See: https://clang.llvm.org/doxygen/ASTContext_8cpp.html#abb1375e068e807917527842d05cadea3. --- This is part 1 of a sequence of 8 PRs that together implement support for function pointer type discrimination: 1. [Encoder and hash](rust-lang#159071) 2. [FnAbi, llvm.ptrauth.resign and Session API change](rust-lang#159074) 3. [FPTR_TYPE_DISCR in ABI Version](rust-lang#159075) 4. [Static allocs](rust-lang#159081) 5. [Transmutes](rust-lang#159082) 6. [Propagate discriminator logic through remaining get_fn_ptr calls sites](rust-lang#159084) 7. [Minicore updates to support fn ptr type discriminator tests](rust-lang#159086) 8. [Fn ptr type discrimination tests](rust-lang#159087) --- Useful links: * Previous PAC work: * `pauthtest` introduction: rust-lang#155722 * Library support follow up: rust-lang#156548 * Config follow up: rust-lang#156712 * [Project goal](https://rust-lang.github.io/rust-project-goals/2026/aarch64_pointer_authentication_pauthtest.html) and [tracking issue](rust-lang/goals#618) * Clang's implementation of [ASTContext::encodeTypeForFunctionPointerAuth](https://clang.llvm.org/doxygen/ASTContext_8cpp.html#abb1375e068e807917527842d05cadea3) * LLVM's [SpiHash](https://github.com/llvm/llvm-project/blob/main/third-party/siphash/include/siphash/SipHash.h)
…=davidtwco [PAC] Encoder and hash (1/8) This patch implements Rust's equivalent of Clang's function pointer type discriminator computation used for pointer authentication. Compatibility with Clang is a primary design goal. For a given extern "C" function type, the discriminator produced by Rust must match the value computed by Clang so that function pointers can be exchanged safely between Rust and C code while preserving pointer authentication semantics. The implementation mirrors Clang's behavior in ASTContext::encodeTypeForFunctionPointerAuth, ensuring that identical C-compatible function types produce identical discriminators. See: https://clang.llvm.org/doxygen/ASTContext_8cpp.html#abb1375e068e807917527842d05cadea3. --- This is part 1 of a sequence of 8 PRs that together implement support for function pointer type discrimination: 1. [Encoder and hash](rust-lang#159071) 2. [FnAbi, llvm.ptrauth.resign and Session API change](rust-lang#159074) 3. [FPTR_TYPE_DISCR in ABI Version](rust-lang#159075) 4. [Static allocs](rust-lang#159081) 5. [Transmutes](rust-lang#159082) 6. [Propagate discriminator logic through remaining get_fn_ptr calls sites](rust-lang#159084) 7. [Minicore updates to support fn ptr type discriminator tests](rust-lang#159086) 8. [Fn ptr type discrimination tests](rust-lang#159087) --- Useful links: * Previous PAC work: * `pauthtest` introduction: rust-lang#155722 * Library support follow up: rust-lang#156548 * Config follow up: rust-lang#156712 * [Project goal](https://rust-lang.github.io/rust-project-goals/2026/aarch64_pointer_authentication_pauthtest.html) and [tracking issue](rust-lang/goals#618) * Clang's implementation of [ASTContext::encodeTypeForFunctionPointerAuth](https://clang.llvm.org/doxygen/ASTContext_8cpp.html#abb1375e068e807917527842d05cadea3) * LLVM's [SpiHash](https://github.com/llvm/llvm-project/blob/main/third-party/siphash/include/siphash/SipHash.h)
…=davidtwco [PAC] Encoder and hash (1/8) This patch implements Rust's equivalent of Clang's function pointer type discriminator computation used for pointer authentication. Compatibility with Clang is a primary design goal. For a given extern "C" function type, the discriminator produced by Rust must match the value computed by Clang so that function pointers can be exchanged safely between Rust and C code while preserving pointer authentication semantics. The implementation mirrors Clang's behavior in ASTContext::encodeTypeForFunctionPointerAuth, ensuring that identical C-compatible function types produce identical discriminators. See: https://clang.llvm.org/doxygen/ASTContext_8cpp.html#abb1375e068e807917527842d05cadea3. --- This is part 1 of a sequence of 8 PRs that together implement support for function pointer type discrimination: 1. [Encoder and hash](rust-lang#159071) 2. [FnAbi, llvm.ptrauth.resign and Session API change](rust-lang#159074) 3. [FPTR_TYPE_DISCR in ABI Version](rust-lang#159075) 4. [Static allocs](rust-lang#159081) 5. [Transmutes](rust-lang#159082) 6. [Propagate discriminator logic through remaining get_fn_ptr calls sites](rust-lang#159084) 7. [Minicore updates to support fn ptr type discriminator tests](rust-lang#159086) 8. [Fn ptr type discrimination tests](rust-lang#159087) --- Useful links: * Previous PAC work: * `pauthtest` introduction: rust-lang#155722 * Library support follow up: rust-lang#156548 * Config follow up: rust-lang#156712 * [Project goal](https://rust-lang.github.io/rust-project-goals/2026/aarch64_pointer_authentication_pauthtest.html) and [tracking issue](rust-lang/goals#618) * Clang's implementation of [ASTContext::encodeTypeForFunctionPointerAuth](https://clang.llvm.org/doxygen/ASTContext_8cpp.html#abb1375e068e807917527842d05cadea3) * LLVM's [SpiHash](https://github.com/llvm/llvm-project/blob/main/third-party/siphash/include/siphash/SipHash.h)
[PAC] Encoder and hash (1/8) This patch implements Rust's equivalent of Clang's function pointer type discriminator computation used for pointer authentication. Compatibility with Clang is a primary design goal. For a given extern "C" function type, the discriminator produced by Rust must match the value computed by Clang so that function pointers can be exchanged safely between Rust and C code while preserving pointer authentication semantics. The implementation mirrors Clang's behavior in ASTContext::encodeTypeForFunctionPointerAuth, ensuring that identical C-compatible function types produce identical discriminators. See: https://clang.llvm.org/doxygen/ASTContext_8cpp.html#abb1375e068e807917527842d05cadea3. --- This is part 1 of a sequence of 8 PRs that together implement support for function pointer type discrimination: 1. [Encoder and hash](#159071) 2. [FnAbi, llvm.ptrauth.resign and Session API change](#159074) 3. [FPTR_TYPE_DISCR in ABI Version](#159075) 4. [Static allocs](#159081) 5. [Transmutes](#159082) 6. [Propagate discriminator logic through remaining get_fn_ptr calls sites](#159084) 7. [Minicore updates to support fn ptr type discriminator tests](#159086) 8. [Fn ptr type discrimination tests](#159087) --- Useful links: * Previous PAC work: * `pauthtest` introduction: #155722 * Library support follow up: #156548 * Config follow up: #156712 * [Project goal](https://rust-lang.github.io/rust-project-goals/2026/aarch64_pointer_authentication_pauthtest.html) and [tracking issue](rust-lang/goals#618) * Clang's implementation of [ASTContext::encodeTypeForFunctionPointerAuth](https://clang.llvm.org/doxygen/ASTContext_8cpp.html#abb1375e068e807917527842d05cadea3) * LLVM's [SpiHash](https://github.com/llvm/llvm-project/blob/main/third-party/siphash/include/siphash/SipHash.h)
…=davidtwco [PAC] Encoder and hash (1/8) This patch implements Rust's equivalent of Clang's function pointer type discriminator computation used for pointer authentication. Compatibility with Clang is a primary design goal. For a given extern "C" function type, the discriminator produced by Rust must match the value computed by Clang so that function pointers can be exchanged safely between Rust and C code while preserving pointer authentication semantics. The implementation mirrors Clang's behavior in ASTContext::encodeTypeForFunctionPointerAuth, ensuring that identical C-compatible function types produce identical discriminators. See: https://clang.llvm.org/doxygen/ASTContext_8cpp.html#abb1375e068e807917527842d05cadea3. --- This is part 1 of a sequence of 8 PRs that together implement support for function pointer type discrimination: 1. [Encoder and hash](rust-lang#159071) 2. [FnAbi, llvm.ptrauth.resign and Session API change](rust-lang#159074) 3. [FPTR_TYPE_DISCR in ABI Version](rust-lang#159075) 4. [Static allocs](rust-lang#159081) 5. [Transmutes](rust-lang#159082) 6. [Propagate discriminator logic through remaining get_fn_ptr calls sites](rust-lang#159084) 7. [Minicore updates to support fn ptr type discriminator tests](rust-lang#159086) 8. [Fn ptr type discrimination tests](rust-lang#159087) --- Useful links: * Previous PAC work: * `pauthtest` introduction: rust-lang#155722 * Library support follow up: rust-lang#156548 * Config follow up: rust-lang#156712 * [Project goal](https://rust-lang.github.io/rust-project-goals/2026/aarch64_pointer_authentication_pauthtest.html) and [tracking issue](rust-lang/goals#618) * Clang's implementation of [ASTContext::encodeTypeForFunctionPointerAuth](https://clang.llvm.org/doxygen/ASTContext_8cpp.html#abb1375e068e807917527842d05cadea3) * LLVM's [SpiHash](https://github.com/llvm/llvm-project/blob/main/third-party/siphash/include/siphash/SipHash.h)
…=davidtwco [PAC] Encoder and hash (1/8) This patch implements Rust's equivalent of Clang's function pointer type discriminator computation used for pointer authentication. Compatibility with Clang is a primary design goal. For a given extern "C" function type, the discriminator produced by Rust must match the value computed by Clang so that function pointers can be exchanged safely between Rust and C code while preserving pointer authentication semantics. The implementation mirrors Clang's behavior in ASTContext::encodeTypeForFunctionPointerAuth, ensuring that identical C-compatible function types produce identical discriminators. See: https://clang.llvm.org/doxygen/ASTContext_8cpp.html#abb1375e068e807917527842d05cadea3. --- This is part 1 of a sequence of 8 PRs that together implement support for function pointer type discrimination: 1. [Encoder and hash](rust-lang#159071) 2. [FnAbi, llvm.ptrauth.resign and Session API change](rust-lang#159074) 3. [FPTR_TYPE_DISCR in ABI Version](rust-lang#159075) 4. [Static allocs](rust-lang#159081) 5. [Transmutes](rust-lang#159082) 6. [Propagate discriminator logic through remaining get_fn_ptr calls sites](rust-lang#159084) 7. [Minicore updates to support fn ptr type discriminator tests](rust-lang#159086) 8. [Fn ptr type discrimination tests](rust-lang#159087) --- Useful links: * Previous PAC work: * `pauthtest` introduction: rust-lang#155722 * Library support follow up: rust-lang#156548 * Config follow up: rust-lang#156712 * [Project goal](https://rust-lang.github.io/rust-project-goals/2026/aarch64_pointer_authentication_pauthtest.html) and [tracking issue](rust-lang/goals#618) * Clang's implementation of [ASTContext::encodeTypeForFunctionPointerAuth](https://clang.llvm.org/doxygen/ASTContext_8cpp.html#abb1375e068e807917527842d05cadea3) * LLVM's [SpiHash](https://github.com/llvm/llvm-project/blob/main/third-party/siphash/include/siphash/SipHash.h)
…=davidtwco [PAC] Encoder and hash (1/8) This patch implements Rust's equivalent of Clang's function pointer type discriminator computation used for pointer authentication. Compatibility with Clang is a primary design goal. For a given extern "C" function type, the discriminator produced by Rust must match the value computed by Clang so that function pointers can be exchanged safely between Rust and C code while preserving pointer authentication semantics. The implementation mirrors Clang's behavior in ASTContext::encodeTypeForFunctionPointerAuth, ensuring that identical C-compatible function types produce identical discriminators. See: https://clang.llvm.org/doxygen/ASTContext_8cpp.html#abb1375e068e807917527842d05cadea3. --- This is part 1 of a sequence of 8 PRs that together implement support for function pointer type discrimination: 1. [Encoder and hash](rust-lang#159071) 2. [FnAbi, llvm.ptrauth.resign and Session API change](rust-lang#159074) 3. [FPTR_TYPE_DISCR in ABI Version](rust-lang#159075) 4. [Static allocs](rust-lang#159081) 5. [Transmutes](rust-lang#159082) 6. [Propagate discriminator logic through remaining get_fn_ptr calls sites](rust-lang#159084) 7. [Minicore updates to support fn ptr type discriminator tests](rust-lang#159086) 8. [Fn ptr type discrimination tests](rust-lang#159087) --- Useful links: * Previous PAC work: * `pauthtest` introduction: rust-lang#155722 * Library support follow up: rust-lang#156548 * Config follow up: rust-lang#156712 * [Project goal](https://rust-lang.github.io/rust-project-goals/2026/aarch64_pointer_authentication_pauthtest.html) and [tracking issue](rust-lang/goals#618) * Clang's implementation of [ASTContext::encodeTypeForFunctionPointerAuth](https://clang.llvm.org/doxygen/ASTContext_8cpp.html#abb1375e068e807917527842d05cadea3) * LLVM's [SpiHash](https://github.com/llvm/llvm-project/blob/main/third-party/siphash/include/siphash/SipHash.h)
Rollup merge of #159071 - jchlanda:jakub/pac_ty_disc_PR_1, r=davidtwco [PAC] Encoder and hash (1/8) This patch implements Rust's equivalent of Clang's function pointer type discriminator computation used for pointer authentication. Compatibility with Clang is a primary design goal. For a given extern "C" function type, the discriminator produced by Rust must match the value computed by Clang so that function pointers can be exchanged safely between Rust and C code while preserving pointer authentication semantics. The implementation mirrors Clang's behavior in ASTContext::encodeTypeForFunctionPointerAuth, ensuring that identical C-compatible function types produce identical discriminators. See: https://clang.llvm.org/doxygen/ASTContext_8cpp.html#abb1375e068e807917527842d05cadea3. --- This is part 1 of a sequence of 8 PRs that together implement support for function pointer type discrimination: 1. [Encoder and hash](#159071) 2. [FnAbi, llvm.ptrauth.resign and Session API change](#159074) 3. [FPTR_TYPE_DISCR in ABI Version](#159075) 4. [Static allocs](#159081) 5. [Transmutes](#159082) 6. [Propagate discriminator logic through remaining get_fn_ptr calls sites](#159084) 7. [Minicore updates to support fn ptr type discriminator tests](#159086) 8. [Fn ptr type discrimination tests](#159087) --- Useful links: * Previous PAC work: * `pauthtest` introduction: #155722 * Library support follow up: #156548 * Config follow up: #156712 * [Project goal](https://rust-lang.github.io/rust-project-goals/2026/aarch64_pointer_authentication_pauthtest.html) and [tracking issue](rust-lang/goals#618) * Clang's implementation of [ASTContext::encodeTypeForFunctionPointerAuth](https://clang.llvm.org/doxygen/ASTContext_8cpp.html#abb1375e068e807917527842d05cadea3) * LLVM's [SpiHash](https://github.com/llvm/llvm-project/blob/main/third-party/siphash/include/siphash/SipHash.h)
[PAC] Encoder and hash (1/8) This patch implements Rust's equivalent of Clang's function pointer type discriminator computation used for pointer authentication. Compatibility with Clang is a primary design goal. For a given extern "C" function type, the discriminator produced by Rust must match the value computed by Clang so that function pointers can be exchanged safely between Rust and C code while preserving pointer authentication semantics. The implementation mirrors Clang's behavior in ASTContext::encodeTypeForFunctionPointerAuth, ensuring that identical C-compatible function types produce identical discriminators. See: https://clang.llvm.org/doxygen/ASTContext_8cpp.html#abb1375e068e807917527842d05cadea3. --- This is part 1 of a sequence of 8 PRs that together implement support for function pointer type discrimination: 1. [Encoder and hash](rust-lang/rust#159071) 2. [FnAbi, llvm.ptrauth.resign and Session API change](rust-lang/rust#159074) 3. [FPTR_TYPE_DISCR in ABI Version](rust-lang/rust#159075) 4. [Static allocs](rust-lang/rust#159081) 5. [Transmutes](rust-lang/rust#159082) 6. [Propagate discriminator logic through remaining get_fn_ptr calls sites](rust-lang/rust#159084) 7. [Minicore updates to support fn ptr type discriminator tests](rust-lang/rust#159086) 8. [Fn ptr type discrimination tests](rust-lang/rust#159087) --- Useful links: * Previous PAC work: * `pauthtest` introduction: rust-lang/rust#155722 * Library support follow up: rust-lang/rust#156548 * Config follow up: rust-lang/rust#156712 * [Project goal](https://rust-lang.github.io/rust-project-goals/2026/aarch64_pointer_authentication_pauthtest.html) and [tracking issue](rust-lang/goals#618) * Clang's implementation of [ASTContext::encodeTypeForFunctionPointerAuth](https://clang.llvm.org/doxygen/ASTContext_8cpp.html#abb1375e068e807917527842d05cadea3) * LLVM's [SpiHash](https://github.com/llvm/llvm-project/blob/main/third-party/siphash/include/siphash/SipHash.h)
…=davidtwco [PAC] FnAbi, llvm.ptrauth.resign and Session API change (2/8) This patch introduces the following: * Extends `FnAbi` (`callconv`) with a `ptrauth_type_discriminator` field. This field is only used when emitting pointer authentication call bundles. It is stored in `FnAbi` because the call site is not guaranteed to have access to an `Instance`, so the discriminator cannot always be computed on demand. * Adds support for `llvm.ptrauth.resign`. This intrinsic will be used when support for semantic transmute is added. * Performs a minor API redesign as groundwork for allowing call sites to modify schemas in place. The use of an extended `FnAbi` is dictated by the need to issue a ptrauth bundle for [call-like instructions](https://github.com/rust-lang/rust/blob/main/compiler/rustc_codegen_llvm/src/builder.rs#L1477). At that point, we only have access to the `FnAbi` struct (`Instance` is not guaranteed to be available). Fundamentally, the discriminator originates from the source-level function type. Deriving it at the codegen stage would introduce a layering violation: it would require relying on `FnAbi`'s `ArgAbi` (for both return values and arguments) to preserve source-level type information. This is not a guarantee provided by these abstractions (and in code comments), as `FnAbi` represents a lowered calling convention rather than the original function signature. Computing the discriminator at this stage would therefore create a hard dependency on type information being available where it is not intended to be preserved. Carrying the value explicitly avoids reconstructing source-level information from lowered ABI data and keeps the abstraction boundaries intact. --- This is part 2 of a sequence of 8 PRs that together implement support for function pointer type discrimination: 1. [Encoder and hash](rust-lang#159071) 2. [FnAbi, llvm.ptrauth.resign and Session API change](rust-lang#159074) 3. [FPTR_TYPE_DISCR in ABI Version](rust-lang#159075) 4. [Static allocs](rust-lang#159081) 5. [Transmutes](rust-lang#159082) 6. [Propagate discriminator logic through remaining get_fn_ptr calls sites](rust-lang#159084) 7. [Minicore updates to support fn ptr type discriminator tests](rust-lang#159086) 8. [Fn ptr type discrimination tests](rust-lang#159087) --- Useful links: * Previous PAC work: * `pauthtest` introduction: rust-lang#155722 * Library support follow up: rust-lang#156548 * Config follow up: rust-lang#156712 * [Project goal](https://rust-lang.github.io/rust-project-goals/2026/aarch64_pointer_authentication_pauthtest.html) and [tracking issue](rust-lang/goals#618) * Clang's implementation of [ASTContext::encodeTypeForFunctionPointerAuth](https://clang.llvm.org/doxygen/ASTContext_8cpp.html#abb1375e068e807917527842d05cadea3) * LLVM's [SpiHash](https://github.com/llvm/llvm-project/blob/main/third-party/siphash/include/siphash/SipHash.h)
View all comments
This is a follow up to #155722, adding library support for the target.