Make sure -msign-return-address doesn't disable BTI support.
authorkettenis <kettenis@openbsd.org>
Thu, 20 Jul 2023 20:32:11 +0000 (20:32 +0000)
committerkettenis <kettenis@openbsd.org>
Thu, 20 Jul 2023 20:32:11 +0000 (20:32 +0000)
ok deraadt@

gnu/llvm/clang/lib/Driver/ToolChains/Clang.cpp

index ddc77ec..7d448c0 100644 (file)
@@ -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;