[llvm-branch-commits] [clang] a2398c5 - [Driver][OpenBSD] Enable unwind tables on all architectures

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Feb 28 10:54:50 PST 2022


Author: Todd Mortimer
Date: 2022-02-28T10:50:51-08:00
New Revision: a2398c560144fbf30058c97c93492023d5c50cad

URL: https://github.com/llvm/llvm-project/commit/a2398c560144fbf30058c97c93492023d5c50cad
DIFF: https://github.com/llvm/llvm-project/commit/a2398c560144fbf30058c97c93492023d5c50cad.diff

LOG: [Driver][OpenBSD] Enable unwind tables on all architectures

(cherry picked from commit bcbb03754ef19a8682635ab83fe5283db27b94f5)

Added: 
    

Modified: 
    clang/lib/Driver/ToolChains/OpenBSD.h
    clang/test/Driver/openbsd.c

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/OpenBSD.h b/clang/lib/Driver/ToolChains/OpenBSD.h
index 95c10cc62316e..9d668711b91b3 100644
--- a/clang/lib/Driver/ToolChains/OpenBSD.h
+++ b/clang/lib/Driver/ToolChains/OpenBSD.h
@@ -82,6 +82,10 @@ 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;
+  }
+
   LangOptions::StackProtectorMode
   GetDefaultStackProtectorLevel(bool KernelOrKext) const override {
     return LangOptions::SSPStrong;

diff  --git a/clang/test/Driver/openbsd.c b/clang/test/Driver/openbsd.c
index d6d5ae994e67e..e46de575aec09 100644
--- a/clang/test/Driver/openbsd.c
+++ b/clang/test/Driver/openbsd.c
@@ -121,3 +121,10 @@
 // RUN: %clang -target powerpc-unknown-openbsd -### -c %s 2>&1 \
 // RUN:   | FileCheck -check-prefix=CHECK-POWERPC-SECUREPLT %s
 // CHECK-POWERPC-SECUREPLT: "-target-feature" "+secure-plt"
+
+// Check that unwind tables are enabled
+// RUN: %clang -target arm-unknown-openbsd -### -S %s 2>&1 | \
+// RUN: FileCheck -check-prefix=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"


        


More information about the llvm-branch-commits mailing list