arm64e: align Apple ptrauth lowering and visionOS bootstrap#1
Closed
cypherair wants to merge 12 commits into
Closed
arm64e: align Apple ptrauth lowering and visionOS bootstrap#1cypherair wants to merge 12 commits into
cypherair wants to merge 12 commits into
Conversation
69d37a5 to
4c64408
Compare
f6a3139 to
ce8da68
Compare
ce8da68 to
944ca39
Compare
Owner
Author
|
Superseded for current upstream-prep work by #3.\n\nWe are intentionally keeping and this draft PR as the historical spike snapshot, while the rebased prep work now continues on . |
Owner
Author
|
Superseded for current upstream-prep work by #3. We are intentionally keeping |
This file contains hidden or 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
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.
Summary
LLVMConstantPtrAuthinvoke, which fixes the__rust_try/ TLS patharm64e-apple-visionostarget while the current stage0 compiler still does not list it__rust_tryindirect invoke loweringLatest update
LLVMConstantPtrAuthaddress-discriminator operand used for arm64e function pointers as dataptr nullinstead ofi64 0, which is required by the LLVM verifier on both LLVM 21 and LLVM 22-Zverify-llvm-ircoverage to the arm64efnptr-dataandinvokecodegen tests so this class of bug is caught locally instead of only in external LLVM CIRoot cause
GitHub's
aarch64-gnu-llvm-21-1job was failing on the new arm64e function-pointer-as-data tests with:signed ptrauth constant address discriminator must be a pointerThe bug was in the Rust-side
LLVMConstantPtrAuthconstruction for data-side function pointers: we were passing the address discriminator as an integer zero instead of a pointer-typed null value. The printed LLVM IR looked reasonable enough that the default localcodegen-llvmpath did not catch it, but explicit-Zverify-llvm-irreproduces the same verifier failure locally. This follow-up fixes the operand shape and makes the tests verify the LLVM IR explicitly.Notes
llvm.ptrauthstorage model more closelyarm64e-apple-visionosremains a downstream-only experiment target on this branchValidation
python x.py check compiler/rustc_codegen_ssa compiler/rustc_codegen_llvm --stage 1python x.py test --stage 1 tests/codegen-llvm/arm64e-apple-ptrauth-fnptr-data.rs tests/codegen-llvm/arm64e-apple-ptrauth-invoke.rsbuild/aarch64-apple-darwin/stage1/bin/rustc tests/codegen-llvm/arm64e-apple-ptrauth-fnptr-data.rs --target arm64e-apple-darwin -Copt-level=0 --emit llvm-ir -Zverify-llvm-ir ...build/aarch64-apple-darwin/stage1/bin/rustc tests/codegen-llvm/arm64e-apple-ptrauth-invoke.rs --target arm64e-apple-darwin -Copt-level=0 -Cpanic=unwind --emit llvm-ir -Zverify-llvm-ir ...python x.py test src/tools/tidy tidyselftest --stage 1