diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2023-04-17 18:10:27 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2023-04-17 18:10:27 +0000 |
commit | ba677e47735cbb8befe80c4eac15f76b354fcab8 (patch) | |
tree | 64803d77466202ff7d739d316c8fd867636c8134 | |
parent | d0d4e57162aa996e7de3d543d7583501b6ea0c24 (diff) |
Make -mbranch-protection=bti the default on OpenBSD.
ok deraadt@
-rw-r--r-- | gnu/llvm/clang/lib/Driver/ToolChains/Clang.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gnu/llvm/clang/lib/Driver/ToolChains/Clang.cpp b/gnu/llvm/clang/lib/Driver/ToolChains/Clang.cpp index c2519ca57a3..67d4c1daa78 100644 --- a/gnu/llvm/clang/lib/Driver/ToolChains/Clang.cpp +++ b/gnu/llvm/clang/lib/Driver/ToolChains/Clang.cpp @@ -1818,6 +1818,9 @@ void Clang::AddAArch64TargetArgs(const ArgList &Args, Args.MakeArgString(Twine("-msign-return-address-key=") + Key)); if (IndirectBranches) CmdArgs.push_back("-mbranch-target-enforce"); + } else { + if (Triple.isOSOpenBSD()) + CmdArgs.push_back("-mbranch-target-enforce"); } // Handle -msve_vector_bits=<bits> |