Skip to content

Commit a2398c5

Browse files
mordaktstellar
authored andcommitted
[Driver][OpenBSD] Enable unwind tables on all architectures
(cherry picked from commit bcbb037)
1 parent aadd03a commit a2398c5

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

clang/lib/Driver/ToolChains/OpenBSD.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ class LLVM_LIBRARY_VISIBILITY OpenBSD : public Generic_ELF {
8282
std::string getCompilerRT(const llvm::opt::ArgList &Args, StringRef Component,
8383
FileType Type = ToolChain::FT_Static) const override;
8484

85+
bool IsUnwindTablesDefault(const llvm::opt::ArgList &Args) const override {
86+
return true;
87+
}
88+
8589
LangOptions::StackProtectorMode
8690
GetDefaultStackProtectorLevel(bool KernelOrKext) const override {
8791
return LangOptions::SSPStrong;

clang/test/Driver/openbsd.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,10 @@
121121
// RUN: %clang -target powerpc-unknown-openbsd -### -c %s 2>&1 \
122122
// RUN: | FileCheck -check-prefix=CHECK-POWERPC-SECUREPLT %s
123123
// CHECK-POWERPC-SECUREPLT: "-target-feature" "+secure-plt"
124+
125+
// Check that unwind tables are enabled
126+
// RUN: %clang -target arm-unknown-openbsd -### -S %s 2>&1 | \
127+
// RUN: FileCheck -check-prefix=UNWIND-TABLES %s
128+
// RUN: %clang -target mips64-unknown-openbsd -### -S %s 2>&1 | \
129+
// RUN: FileCheck -check-prefix=UNWIND-TABLES %s
130+
// UNWIND-TABLES: "-funwind-tables=2"

0 commit comments

Comments
 (0)