From: kettenis Date: Mon, 17 Apr 2023 18:10:26 +0000 (+0000) Subject: Make -mbranch-protection=bti the default on OpenBSD. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=990129f49dcc7205208dec5e29b252be8659896d;p=openbsd Make -mbranch-protection=bti the default on OpenBSD. ok deraadt@ --- 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=