Author: Brad Smith Date: 2022-04-01T21:46:01-07:00 New Revision: f3b89727716a99a48b61a0c94025e35d363ececc
URL: https://github.com/llvm/llvm-project/commit/f3b89727716a99a48b61a0c94025e35d363ececc DIFF: https://github.com/llvm/llvm-project/commit/f3b89727716a99a48b61a0c94025e35d363ececc.diff LOG: [Driver][OpenBSD] Disable unwind tables on Arm Arm is not quite ready for unwinding yet. (cherry picked from commit 9abeb80e80d0f2e9dd7603491d33fa0683a33ac1) Added: Modified: clang/lib/Driver/ToolChains/OpenBSD.cpp clang/lib/Driver/ToolChains/OpenBSD.h clang/test/Driver/openbsd.c Removed: ################################################################################ diff --git a/clang/lib/Driver/ToolChains/OpenBSD.cpp b/clang/lib/Driver/ToolChains/OpenBSD.cpp index bcd54bedfa897..86a10ce4b0e75 100644 --- a/clang/lib/Driver/ToolChains/OpenBSD.cpp +++ b/clang/lib/Driver/ToolChains/OpenBSD.cpp @@ -342,3 +342,12 @@ Tool *OpenBSD::buildAssembler() const { Tool *OpenBSD::buildLinker() const { return new tools::openbsd::Linker(*this); } bool OpenBSD::HasNativeLLVMSupport() const { return true; } + +bool OpenBSD::IsUnwindTablesDefault(const ArgList &Args) const { + switch (getArch()) { + case llvm::Triple::arm: + return false; + default: + return true; + } +} diff --git a/clang/lib/Driver/ToolChains/OpenBSD.h b/clang/lib/Driver/ToolChains/OpenBSD.h index 9d668711b91b3..2d4c4e34520b7 100644 --- a/clang/lib/Driver/ToolChains/OpenBSD.h +++ b/clang/lib/Driver/ToolChains/OpenBSD.h @@ -82,9 +82,7 @@ class LLVM_LIBRARY_VISIBILITY OpenBSD : public Generic_ELF { std::string getCompilerRT(const llvm::opt::ArgList &Args, StringRef Component, FileType Type = ToolChain::FT_Static) const override; - bool IsUnwindTablesDefault(const llvm::opt::ArgList &Args) const override { - return true; - } + bool IsUnwindTablesDefault(const llvm::opt::ArgList &Args) const override; LangOptions::StackProtectorMode GetDefaultStackProtectorLevel(bool KernelOrKext) const override { diff --git a/clang/test/Driver/openbsd.c b/clang/test/Driver/openbsd.c index e46de575aec09..8d91ce0e53e53 100644 --- a/clang/test/Driver/openbsd.c +++ b/clang/test/Driver/openbsd.c @@ -124,7 +124,8 @@ // Check that unwind tables are enabled // RUN: %clang -target arm-unknown-openbsd -### -S %s 2>&1 | \ -// RUN: FileCheck -check-prefix=UNWIND-TABLES %s +// RUN: FileCheck -check-prefix=NO-UNWIND-TABLES %s // RUN: %clang -target mips64-unknown-openbsd -### -S %s 2>&1 | \ // RUN: FileCheck -check-prefix=UNWIND-TABLES %s // UNWIND-TABLES: "-funwind-tables=2" +// NO-UNWIND-TABLES-NOT: "-funwind-tables=2" _______________________________________________ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
