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"


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to