summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2024-04-03 21:47:31 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2024-04-03 21:47:31 +0000
commit5a256db0584a29140a81ea762d92fbac94d13f62 (patch)
tree438e5477fd7338b3c6d9362002d363ec86dd4964 /lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
parentbef3835f1933c1bda155bb899b024967b0270b32 (diff)
Enable PAC in addition to BTI on arm64 such that JIT code matches the
default branch protection provided by our base compiler. ok jsg@
Diffstat (limited to 'lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp')
-rw-r--r--lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index a1caece3e..b50a17427 100644
--- a/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/lib/mesa/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -636,10 +636,12 @@ lp_set_module_stack_alignment_override(LLVMModuleRef MRef, unsigned align)
}
extern "C" void
-lp_set_module_branch_target_enforcement(LLVMModuleRef MRef)
+lp_set_module_branch_protection(LLVMModuleRef MRef)
{
+ /* Enable standard (bti+pac-ret) branch protection */
llvm::Module *M = llvm::unwrap(MRef);
M->addModuleFlag(llvm::Module::Override, "branch-target-enforcement", 1);
+ M->addModuleFlag(llvm::Module::Override, "sign-return-address", 1);
}
using namespace llvm;