From 309cb3b632080200b5db8d61adfd31e2c2914cfb Mon Sep 17 00:00:00 2001 From: kettenis Date: Thu, 20 Jul 2023 20:32:11 +0000 Subject: [PATCH] Make sure -msign-return-address doesn't disable BTI support. ok deraadt@ --- gnu/llvm/clang/lib/Driver/ToolChains/Clang.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.20.1