File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
compiler/rustc_codegen_llvm/src Expand file tree Collapse file tree 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>(
274274 }
275275 }
276276
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" {
280279 llvm:: LLVMRustAddModuleFlag (
281280 llmod,
282281 llvm:: LLVMModFlagBehavior :: Error ,
@@ -302,6 +301,11 @@ pub unsafe fn create_module<'ll>(
302301 "sign-return-address-with-bkey\0 " . as_ptr ( ) . cast ( ) ,
303302 u32:: from ( pac_opts. key == PAuthKey :: B ) ,
304303 ) ;
304+ } else {
305+ bug ! (
306+ "branch-protection used on non-AArch64 target; \
307+ this should be checked in rustc_session."
308+ ) ;
305309 }
306310 }
307311
You can’t perform that action at this time.
0 commit comments