From: kettenis Date: Thu, 20 Jul 2023 20:32:11 +0000 (+0000) Subject: Make sure -msign-return-address doesn't disable BTI support. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=309cb3b632080200b5db8d61adfd31e2c2914cfb;p=openbsd Make sure -msign-return-address doesn't disable BTI support. ok deraadt@ --- diff --git a/gnu/llvm/clang/lib/Driver/ToolChains/Clang.cpp b/gnu/llvm/clang/lib/Driver/ToolChains/Clang.cpp index ddc77ec4534..7d448c0ff14 100644 --- a/gnu/llvm/clang/lib/Driver/ToolChains/Clang.cpp +++ b/gnu/llvm/clang/lib/Driver/ToolChains/Clang.cpp @@ -1800,7 +1800,10 @@ void Clang::AddAArch64TargetArgs(const ArgList &Args, D.Diag(diag::err_invalid_branch_protection) << Scope << A->getAsString(Args); Key = "a_key"; - IndirectBranches = false; + if (Triple.isOSOpenBSD()) + IndirectBranches = true; + else + IndirectBranches = false; } else { StringRef Err; llvm::AArch64::ParsedBranchProtection PBP;