Skip to content

[WIP] Introduce aarch64-unknown-linux-pauthtest target#154759

Draft
jchlanda wants to merge 41 commits intorust-lang:mainfrom
jchlanda:jakub/pauthtest
Draft

[WIP] Introduce aarch64-unknown-linux-pauthtest target#154759
jchlanda wants to merge 41 commits intorust-lang:mainfrom
jchlanda:jakub/pauthtest

Conversation

@jchlanda
Copy link
Copy Markdown

@jchlanda jchlanda commented Apr 3, 2026

View all comments

This PR introduces aarch64-unknown-linux-pauthtest target. The target enables
Pointer Authentication Code (PAC) support in Rust on AArch64 ELF based Linux
systems using a pauthtest ABI (provided by LLVM) and pauthtest-enabled sysroot
with custom musl, serving as a reference libc implementation.

Supported features include:

  • authenticating signed function pointers for extern "C" function calls
    (corresponds to -fptrauth-calls included in pauthtest ABI as defined in
    LLVM)
  • signing return address before spilling to stack and authenticating return
    address after restoring from stack for non-leaf functions (corresponds to
    -fptrauth-returns)
  • trapping if authentication failure is detected and FPAC feature is not present
    (corresponds to -fptrauth-auth-traps)
  • signing of init/fini array entries with the signing schema used for pauthtest
    ABI (corresponding to -fptrauth-init-fini,
    -fptrauth-init-fini-address-discrimination)
  • non-ABI-affecting indirect control flow hardening features included in
    pauthtest ABI (corresponding to -faarch64-jump-table-hardening,
    -fptrauth-indirect-gotos)
  • signed ELF GOT entries (gated behind -Z ptrauth-elf-got, off by default)

Existing compiler support, such as enabling branch authentication instructions
(i.e.: -Z branch-protection) provide limited functionality, mainly signing
return addresses (pac-ret). The new target goes further by enabling ABI-level
pointer authentication support.

Please note that efforts were made to split the work into individual commits
that encapsulate different areas of the code; however, the commits are not
atomic and cannot be built or tested in isolation.

Useful links:

@rustbot rustbot added A-compiletest Area: The compiletest test runner A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc O-unix Operating system: Unix-like S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Apr 3, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@jchlanda jchlanda force-pushed the jakub/pauthtest branch 3 times, most recently from 0db30a1 to 5bc3e48 Compare April 7, 2026 14:02
@rust-log-analyzer

This comment has been minimized.

Comment on lines +1837 to +1842
if (!C)
return Ptr;
if (!C->getType()->isPointerTy())
return Ptr;
if (isa<UndefValue>(C) || isa<ConstantPointerNull>(C))
return Ptr;
Copy link
Copy Markdown

@kovdan01 kovdan01 Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

View changes since the review

Do we expect values non-conforming to these conditions being passed to this function? Locally, I've commented out these lines, and nothing seems to be broken.

So, can we safely convert these to assertions? Or, maybe, some checks which would be present in release mode as well (and would panic when mismatch is detected)? Please just explain which contract do we have, who is responsible for these checks and whether the checks need to be just assertions or if we need to make them panicking or smth.

If there's a reason why we need to keep the current behavior, it's totally fine. But if so, can we somehow rename the function? Now it's name might make one think that we always wrap the underlying constant pointer value to ptrauth constant. But we also have this chunk of logic returning the exact input value w/o any change, and this is not clear from the function name.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair.
With it now being wrapped in const_ptr_auth and only two call sites we can't violate the contract.
However it is still a symbol that can be accessed freely. I'm going to change it to asserts.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Just in case it was already intended to be changed to asserts - the checks are still present and nothing was changed. Are you about to submit this update or was there a reason why we want to keep the actual checks?

@rust-log-analyzer

This comment has been minimized.

@jchlanda
Copy link
Copy Markdown
Author

Sure, I'll follow up on that. I don't expect all that subset to pass though.

I suppose that it's worth at least identifying where the root cause of the issue is: frontend or backend. Like, are IRs generated for aarch64-unknown-linux-musl and aarch64-unknown-linux-pauthtest different (so we generate them differently on Rust side and probably we should generate them identically), or are IRs identical and we for some reason behave differently on LLVM side.

If it's a frontend issue, it's actually probably worth fixing in the scope of this PR (unless it's terribly complex and time-consuming). If this is a backend issue, we'll fix that separately in LLVM

Looks like there is no bug in there, it's an expected behaviour. I'm guessing that when you compiled for musl it went with a +v8a. However when targeting pauthtest we request v8.3a, which includes support for lse. See: https://github.com/llvm/llvm-project/blob/8e2a5e37eaf638c536dd71cb685843e8cb2aed2c/llvm/lib/Target/AArch64/AArch64Features.td#L964. bl __aarch64_cas4_relax - which is what the test checks against - is a software fallback, whereas on new enough HW we get a corresponding instruction: cas w8, w9, [x0].

You can verify that by either changing the arch to v3.8a or explicitly enabling lse.

Will disable the test and add a comment.

@kovdan01
Copy link
Copy Markdown

Will disable the test and add a comment.

What I'm worried about is that in compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_pauthtest.rs we have features: "+v8.3a,+outline-atomics,+pauth". So we explicitly request +outline-atomics (the same is done for the musl target, so it looks totally OK for pauthtest target).

And my understanding was that if we add +outline-atomics, we must indeed outline them no matter if we actually support them or not. But I might be wrong and I'd just like to hear your thoughts on this

Comment thread compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_pauthtest.rs Outdated
@rust-log-analyzer

This comment has been minimized.

in Rust can be found at
[#148640](https://github.com/rust-lang/rust/issues/148640).

Existing compiler options such as `-mbranch-protection` provide limited pointer
Copy link
Copy Markdown

@kovdan01 kovdan01 Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

View changes since the review

Is it -mbranch-protection for Rust? My understanding was that it's -Z branch-protection (while its indeed -mbranch-protection for clang). See also src/doc/unstable-book/src/compiler-flags/branch-protection.md.

Also, I'm not sure if it's worth talking about BTI - I doubt that anyone would mess BTI with pauthtest. But for pac-ret and pauthtest - it's non-obvious for new-comers because both these are based on the same PAC extension for aarch64 CPUs

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reworded.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved, thanks

Clang-based toolchain. In this case, no wrapper script is required,
`<toolchain_root>/bin/aarch64-linux-pauthtest-clang` can be used directly.

## Building the target
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the second one, both paragraphs should belong to the same header.

Is this update already present in this PR? Like, I'm still seeing the same header at lines 94 and 173.

`aarch64-unknown-linux-pauthtest` target enabled.

For a comprehensive example of how to interact between C and Rust programs
withing the testing framework please consult
Copy link
Copy Markdown

@kovdan01 kovdan01 Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved, thanks

* non-ABI-affecting indirect control flow hardening features included in
pauthtest ABI (corresponding to `-faarch64-jump-table-hardening`,
`-fptrauth-indirect-gotos`)
* signed ELF GOT entries (gated behind `-Z ptrauth-elf-got` off by default)
Copy link
Copy Markdown

@kovdan01 kovdan01 Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

View changes since the review

Nit: probably a comma missed before 'off'?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved, thanks

Copy link
Copy Markdown

@kovdan01 kovdan01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jchlanda Regarding test failures you've mentioned today - it looks like that for tests we need to manually specify additional compile args, otherwise stage1-tools-bin/compiletest uses the defaults.

Particularly, when running ./x test, it looks like we need to add --test-args --target-rustcflags --test-args "-Clink-arg=-Wl,--dynamic-linker=/path/to/aarch64-unknown-linux-pauthtest/usr/lib/libc.so".

This way of handling the issue is described in src/doc/rustc/src/platform-support/fuchsia.md

View changes since this review

@jchlanda
Copy link
Copy Markdown
Author

jchlanda commented Apr 15, 2026

Particularly, when running ./x test, it looks like we need to add --test-args --target-rustcflags --test-args "-Clink-arg=-Wl,--dynamic-linker=/path/to/aarch64-unknown-linux-pauthtest/usr/lib/libc.so".

Thank you @kovdan01. This indeed helps with a group of tests, but, still when we are in subprocess scenarios I see failures. I'll DM you.


* `Cargo.toml`

```markdown
Copy link
Copy Markdown

@kovdan01 kovdan01 Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be toml instead of markdown?

View changes since the review

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved, thanks

* `c_src/plugin.c`

```c
#include <stdio.h>
Copy link
Copy Markdown

@kovdan01 kovdan01 Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, gone

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved, thanks

## Cross-compilation toolchains and C code

This target supports interoperability with C code. Use the PAC-enabled LLVM
sysroot, described in building the sysroot section of this document. C code must
Copy link
Copy Markdown

@kovdan01 kovdan01 Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

described in building the sysroot section of this document

The section is now gone, could you please change wording here to reflect the current state of the document?

View changes since the review

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, changed to: building the toolchain

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved, thanks

Comment thread compiler/rustc_codegen_llvm/src/base.rs Outdated
// PAuth core info section of the resulting ELF, which the linker uses to enforce
// binary compatibility.
//
// We intentionally do not emit this flags now, since only a subset of pointer
Copy link
Copy Markdown

@kovdan01 kovdan01 Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: this->these

View changes since the review

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved, thanks

Comment thread compiler/rustc_codegen_llvm/src/base.rs Outdated
// binary compatibility.
//
// We intentionally do not emit this flags now, since only a subset of pointer
// authentication features is currently supported. By default, the absence of this
Copy link
Copy Markdown

@kovdan01 kovdan01 Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "subset of features included in pauthtest ABI" would be more clear?

View changes since the review

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved, thanks

Comment thread compiler/rustc_codegen_llvm/src/base.rs Outdated
// Please note, that this would cause compatibility issues when linking against
// fully PAuth-enabled C/C++ binaries.
//
// Link to PAuth core info:
Copy link
Copy Markdown

@kovdan01 kovdan01 Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: maybe "... info documentation:"? Or just "see also:"

I'm not a language expert, but I suppose this is not a link to the (platform, version) tuple (which is the definition of pauth core info) :)

View changes since the review

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"documentation" added

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved, thanks

Comment thread compiler/rustc_codegen_llvm/src/base.rs Outdated
// authentication features is currently supported. By default, the absence of this
// info is treated as compatible with any binary.
//
// Please note, that this would cause compatibility issues when linking against
Copy link
Copy Markdown

@kovdan01 kovdan01 Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose it's worth rephrasing this highlighting the following details:

  1. When talking about "compatibility issues", we are talking about runtime crashes due to auth failures while silently compiling and linking w/o problems
  2. I would not generalize this to "fully pauth-enabled c/c++ binaries". We are OK with interop when only pointers signed using supported ptrauth feature subset are crossing c/rust boundary (at this point, meaning only free function pointers signed w/o type discrimination). So we need to highlight that if pointers signed with other features cross c/rust or cxx/rust boundary, we result in runtime failures. Maybe even provide a list of such pointers: member function pointers, virtual function pointers, virtual table pointers, maybe smth else I forgot to mention (free function pointers with non-zero discr are technically not a part of pauthtest ABI, so not mentioning here)

View changes since the review

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, tried to incorporate this.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

                // (for example member function pointers, virtual function pointers, virtual table
                // pointers).

Probably "for example, signing of C++ member ..."

* the call is performed indirectly via a signed pointer,
* the `ptrauth` operand bundle enforces authentication at call time.

## Cross-compilation
Copy link
Copy Markdown

@kovdan01 kovdan01 Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no other targets which define both "Cross-compilation" and "Cross-compilation toolchains and C code" sections. Probably we should stick to the TEMPLATE.md and only leave the latter section, moving contents from here if needed.

View changes since the review

must be consistent across Rust and C components. The target only supports
dynamic linking with the custom interpreter.

## Limitation
Copy link
Copy Markdown

@kovdan01 kovdan01 Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: probably an empty line after this would make things more consistent across the file

View changes since the review


* `src/main.rs`

```rust,ignore (rustc will have no core crate for pauthtest)
Copy link
Copy Markdown

@kovdan01 kovdan01 Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this ignore (rustc will have no core crate for pauthtest) mean and which purpose does it serve?

View changes since the review


* `build.rs`

```rust,no_run
Copy link
Copy Markdown

@kovdan01 kovdan01 Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does no_run mean? I'm just not very familiar with this stuff, my understanding was it's just used for syntax highlighting

View changes since the review

```toml
[package]
name = "rust_c_indirect"
version = "0.1.0"
Copy link
Copy Markdown

@kovdan01 kovdan01 Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understand from rust docs, version and edition are not mandatory. Could these be removed?

View changes since the review

must be compiled with the pauthtest aware compiler. Mixed Rust/C programs are
supported and tested (e.g. quicksort examples). Pointer authentication semantics
must be consistent across Rust and C components. The target only supports
dynamic linking with the custom interpreter.
Copy link
Copy Markdown

@kovdan01 kovdan01 Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose that info about support only for dynamic linking should be somewhere in the overall target description, probably close to the top of the document - it's not cross-compilation specific, it's just a very important piece of info.

And I would also not say "custom interpreter" - it's not clear what does it mean. Maybe smth like "... dynamic linking with a pauthtest-enabled dynamic linker serving as ELF interpreter capable of resolving pauth relocations and respecting pauthtest ABI nuances" (maybe it could be somehow rephrased shorter, I'm just trying to make it clear which kind of "custom" dynamic loader we need)

View changes since the review

must be consistent across Rust and C components. The target only supports
dynamic linking with the custom interpreter.

## Limitation
Copy link
Copy Markdown

@kovdan01 kovdan01 Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably worth to make this plural, not singular, and add info about C++ interop and other currently unsupported pauthtest ABI features. It looks like that from the current version of the doc it's not very clear that these would be "by design" broken with runtime auth failures.

View changes since the review

named for convenience):

```sh
x.py test --target aarch64-unknown-linux-pauthtest --force-rerun \
Copy link
Copy Markdown

@kovdan01 kovdan01 Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it work this way or do we need to add --test-arg ... stuff I've mentioned previously in my comments to make rust test runner propagate correct dyn linker for rustc calls?

View changes since the review

* UI error reporting (pauthtest does not support `+crt-static`)
* crt-static-pauthtest.rs

All tests from `assembly-llvm`, `codegen-llvm`, `codegen-units`, `coverage`,
Copy link
Copy Markdown

@kovdan01 kovdan01 Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is library (core, alloc, std) missed here?

View changes since the review

The following categories are supported (all present in tree):
* Assembly tests
* targets-aarch64_unknown_linux_pauthtest.rs
* LLVM IR/codegen tests
Copy link
Copy Markdown

@kovdan01 kovdan01 Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The extern-weak test looks missing in this list

View changes since the review

* UI error reporting (pauthtest does not support `+crt-static`)
* crt-static-pauthtest.rs

All tests from `assembly-llvm`, `codegen-llvm`, `codegen-units`, `coverage`,
Copy link
Copy Markdown

@kovdan01 kovdan01 Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for mentioning extra coverage here! BTW, it actually looks like that while some test suites like mir-opt, incremental, crashes indeed execute for the pauthtest target, some other ones are not (at least for me some suites show things like Testing stage1 with compiletest suite=XXX mode=XXX (x86_64-unknown-linux-gnu)

These are the suites which seem to only be tested against host (even though I'm running ./x test with explicit pauthtest target specified):

  • coverage-run-rustdoc
  • pretty
  • rustdoc-html
  • rustdoc-js
  • rustdoc-js-std
  • rustdoc-json
  • rustdoc-ui
  • ui-fulldeps

I might be running tests somehow incorrectly and maybe you actually observe them really running and passing for the pauthtest target. But if not and they only run for the host target - worth excluding from the list

View changes since the review

Comment thread library/unwind/src/lib.rs Outdated
// is provided by libunwind.
#[cfg(target_env = "pauthtest")]
cfg_select! {
target_feature = "crt-static" => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved, thanks

// and we tend to encounter interesting bugs in AArch64 unwinding code if we do not
frame_pointer: FramePointer::NonLeaf,
mcount: "\u{1}_mcount".into(),
..base::linux::opts()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved, thanks - looks reasonable, thanks for explanation.

Comment thread compiler/rustc_codegen_llvm/src/base.rs Outdated
}

if cx.sess().target.env == Env::Pauthtest {
// FIXME(jchlanda): In LLVM/Clang, there also `aarch64-elf-pauthabi-platform` and
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved, thanks

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved, thanks

## Cross-compilation toolchains and C code

This target supports interoperability with C code. Use the PAC-enabled LLVM
sysroot, described in building the sysroot section of this document. C code must
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved, thanks

Comment thread compiler/rustc_codegen_llvm/src/base.rs Outdated
// PAuth core info section of the resulting ELF, which the linker uses to enforce
// binary compatibility.
//
// We intentionally do not emit this flags now, since only a subset of pointer
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved, thanks

Comment thread compiler/rustc_codegen_llvm/src/base.rs Outdated
// binary compatibility.
//
// We intentionally do not emit this flags now, since only a subset of pointer
// authentication features is currently supported. By default, the absence of this
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved, thanks

Comment thread compiler/rustc_codegen_llvm/src/base.rs Outdated
// Please note, that this would cause compatibility issues when linking against
// fully PAuth-enabled C/C++ binaries.
//
// Link to PAuth core info:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved, thanks

Comment thread compiler/rustc_codegen_llvm/src/base.rs Outdated
// authentication features is currently supported. By default, the absence of this
// info is treated as compatible with any binary.
//
// Please note, that this would cause compatibility issues when linking against
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

                // (for example member function pointers, virtual function pointers, virtual table
                // pointers).

Probably "for example, signing of C++ member ..."


#[inline]
pub(crate) fn pauth_fn_attrs() -> &'static [&'static str] {
// FIXME(jchlanda) This is not an exhaustive list of all `pauthtest`-related attributes, but
Copy link
Copy Markdown

@asl asl Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// FIXME(jchlanda) This is not an exhaustive list of all `pauthtest`-related attributes, but
// FIXME(jchlanda) This is not an exhaustive list of all `ptrauth`-related attributes, but

View changes since the review

let address_space = cx.tcx.global_alloc(prov.alloc_id()).address_space(cx);

llvals.push(cx.scalar_to_backend(
// For aarch64-unknown-linux-pauthtest function pointers stored in init/fini arrays need
Copy link
Copy Markdown

@asl asl Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather say something like "Under pointer authentication function pointers stored in init/fini arrays need special handling"

View changes since the review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-compiletest Area: The compiletest test runner A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs A-test-infra-minicore Area: `minicore` test auxiliary and `//@ add-core-stubs` A-testsuite Area: The testsuite used to check the correctness of rustc O-unix Operating system: Unix-like S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants