1
Fork 0

Auto merge of #88354 - Jmc18134:hint-space-pauth-opt, r=nagisa

Add codegen option for branch protection and pointer authentication on AArch64

The branch-protection codegen option enables the use of hint-space pointer
authentication code for AArch64 targets.
This commit is contained in:
bors 2021-12-29 22:35:11 +00:00
commit d331cb710f
13 changed files with 202 additions and 6 deletions

View file

@ -843,6 +843,30 @@ impl Passes {
}
}
#[derive(Clone, Copy, Hash, Debug, PartialEq)]
pub enum PAuthKey {
A,
B,
}
#[derive(Clone, Copy, Hash, Debug, PartialEq)]
pub struct PacRet {
pub leaf: bool,
pub key: PAuthKey,
}
#[derive(Clone, Copy, Hash, Debug, PartialEq)]
pub struct BranchProtection {
pub bti: bool,
pub pac_ret: Option<PacRet>,
}
impl Default for BranchProtection {
fn default() -> Self {
BranchProtection { bti: false, pac_ret: None }
}
}
pub const fn default_lib_output() -> CrateType {
CrateType::Rlib
}
@ -2497,9 +2521,9 @@ impl PpMode {
crate mod dep_tracking {
use super::LdImpl;
use super::{
CFGuard, CrateType, DebugInfo, ErrorOutputType, InstrumentCoverage, LinkerPluginLto,
LocationDetail, LtoCli, OptLevel, OutputType, OutputTypes, Passes, SourceFileHashAlgorithm,
SwitchWithOptPath, SymbolManglingVersion, TrimmedDefPaths,
BranchProtection, CFGuard, CrateType, DebugInfo, ErrorOutputType, InstrumentCoverage,
LinkerPluginLto, LocationDetail, LtoCli, OptLevel, OutputType, OutputTypes, Passes,
SourceFileHashAlgorithm, SwitchWithOptPath, SymbolManglingVersion, TrimmedDefPaths,
};
use crate::lint;
use crate::options::WasiExecModel;
@ -2593,6 +2617,7 @@ crate mod dep_tracking {
OutputType,
RealFileName,
LocationDetail,
BranchProtection,
);
impl<T1, T2> DepTrackingHash for (T1, T2)