From: jsg Date: Mon, 20 Nov 2023 01:35:21 +0000 (+0000) Subject: only enable bti and pac by default on arm64 X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c88b740367380f418758d21aa27d6ab66319461d;p=openbsd only enable bti and pac by default on arm64 before this change, clang on armv7 defined __ARM_FEATURE_BTI_DEFAULT and __ARM_FEATURE_PAC_DEFAULT which broke the build of llvm libunwind ok kettenis@ deraadt@ --- diff --git a/gnu/llvm/clang/lib/Driver/ToolChains/Clang.cpp b/gnu/llvm/clang/lib/Driver/ToolChains/Clang.cpp index 28feeed46eb..1d073428fe5 100644 --- a/gnu/llvm/clang/lib/Driver/ToolChains/Clang.cpp +++ b/gnu/llvm/clang/lib/Driver/ToolChains/Clang.cpp @@ -1572,7 +1572,7 @@ static void CollectARMPACBTIOptions(const ToolChain &TC, const ArgList &Args, options::OPT_mbranch_protection_EQ) : Args.getLastArg(options::OPT_mbranch_protection_EQ); if (!A) { - if (Triple.isOSOpenBSD()) { + if (Triple.isOSOpenBSD() && isAArch64) { CmdArgs.push_back("-msign-return-address=non-leaf"); CmdArgs.push_back("-msign-return-address-key=a_key"); CmdArgs.push_back("-mbranch-target-enforce"); @@ -1594,7 +1594,7 @@ static void CollectARMPACBTIOptions(const ToolChain &TC, const ArgList &Args, D.Diag(diag::err_drv_unsupported_option_argument) << A->getSpelling() << Scope; Key = "a_key"; - if (Triple.isOSOpenBSD()) + if (Triple.isOSOpenBSD() && isAArch64) IndirectBranches = true; else IndirectBranches = false;