File tree 1 file changed +7
-3
lines changed
compiler/rustc_codegen_llvm/src
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -274,9 +274,8 @@ pub unsafe fn create_module<'ll>(
274
274
}
275
275
}
276
276
277
- // AArch64-only options (checked in rustc_session).
278
- if sess. target . arch == "aarch64" {
279
- if let Some ( BranchProtection { bti, pac_ret } ) = sess. opts . unstable_opts . branch_protection {
277
+ if let Some ( BranchProtection { bti, pac_ret } ) = sess. opts . unstable_opts . branch_protection {
278
+ if sess. target . arch == "aarch64" {
280
279
llvm:: LLVMRustAddModuleFlag (
281
280
llmod,
282
281
llvm:: LLVMModFlagBehavior :: Error ,
@@ -302,6 +301,11 @@ pub unsafe fn create_module<'ll>(
302
301
"sign-return-address-with-bkey\0 " . as_ptr ( ) . cast ( ) ,
303
302
u32:: from ( pac_opts. key == PAuthKey :: B ) ,
304
303
) ;
304
+ } else {
305
+ bug ! (
306
+ "branch-protection used on non-AArch64 target; \
307
+ this should be checked in rustc_session."
308
+ ) ;
305
309
}
306
310
}
307
311
You can’t perform that action at this time.
0 commit comments