Check AArch64 branch-protection earlier in the pipeline.
As suggested in #93516.
This commit is contained in:
@@ -3,10 +3,10 @@ use crate::code_stats::CodeStats;
|
||||
pub use crate::code_stats::{DataTypeKind, FieldInfo, SizeKind, VariantInfo};
|
||||
use crate::config::{self, CrateType, InstrumentCoverage, OptLevel, OutputType, SwitchWithOptPath};
|
||||
use crate::errors::{
|
||||
CannotEnableCrtStaticLinux, CannotMixAndMatchSanitizers, LinkerPluginToWindowsNotSupported,
|
||||
NotCircumventFeature, ProfileSampleUseFileDoesNotExist, ProfileUseFileDoesNotExist,
|
||||
SanitizerCfiEnabled, SanitizerNotSupported, SanitizersNotSupported, SkippingConstChecks,
|
||||
SplitDebugInfoUnstablePlatform, StackProtectorNotSupportedForTarget,
|
||||
BranchProtectionRequiresAArch64, CannotEnableCrtStaticLinux, CannotMixAndMatchSanitizers,
|
||||
LinkerPluginToWindowsNotSupported, NotCircumventFeature, ProfileSampleUseFileDoesNotExist,
|
||||
ProfileUseFileDoesNotExist, SanitizerCfiEnabled, SanitizerNotSupported, SanitizersNotSupported,
|
||||
SkippingConstChecks, SplitDebugInfoUnstablePlatform, StackProtectorNotSupportedForTarget,
|
||||
TargetRequiresUnwindTables, UnleashedFeatureHelp, UnstableVirtualFunctionElimination,
|
||||
UnsupportedDwarfVersion,
|
||||
};
|
||||
@@ -1542,6 +1542,10 @@ fn validate_commandline_args_with_session_available(sess: &Session) {
|
||||
}
|
||||
}
|
||||
|
||||
if sess.opts.unstable_opts.branch_protection.is_some() && sess.target.arch != "aarch64" {
|
||||
sess.emit_err(BranchProtectionRequiresAArch64);
|
||||
}
|
||||
|
||||
if let Some(dwarf_version) = sess.opts.unstable_opts.dwarf_version {
|
||||
if dwarf_version > 5 {
|
||||
sess.emit_err(UnsupportedDwarfVersion { dwarf_version });
|
||||
|
||||
Reference in New Issue
Block a user