[clang] bcbb037 - [Driver][OpenBSD] Enable unwind tables on all architectures

Brad Smith via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 27 16:46:31 PST 2022


Author: Todd Mortimer
Date: 2022-02-27T19:43:49-05:00
New Revision: bcbb03754ef19a8682635ab83fe5283db27b94f5

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

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

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 95c10cc62316..9d668711b91b 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 04a46f2862e7..9a811c193232 100644
--- a/clang/test/Driver/openbsd.c
+++ b/clang/test/Driver/openbsd.c
@@ -118,3 +118,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 cfe-commits mailing list