Skip to content

Commit 9abeb80

Browse files
committed
[Driver][OpenBSD] Disable unwind tables on Arm
Arm is not quite ready for unwinding yet.
1 parent c310143 commit 9abeb80

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

clang/lib/Driver/ToolChains/OpenBSD.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,3 +345,12 @@ Tool *OpenBSD::buildAssembler() const {
345345
Tool *OpenBSD::buildLinker() const { return new tools::openbsd::Linker(*this); }
346346

347347
bool OpenBSD::HasNativeLLVMSupport() const { return true; }
348+
349+
bool OpenBSD::IsUnwindTablesDefault(const ArgList &Args) const {
350+
switch (getArch()) {
351+
case llvm::Triple::arm:
352+
return false;
353+
default:
354+
return true;
355+
}
356+
}

clang/lib/Driver/ToolChains/OpenBSD.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,7 @@ 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-
}
85+
bool IsUnwindTablesDefault(const llvm::opt::ArgList &Args) const override;
8886

8987
LangOptions::StackProtectorMode
9088
GetDefaultStackProtectorLevel(bool KernelOrKext) const override {

clang/test/Driver/openbsd.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@
121121

122122
// Check that unwind tables are enabled
123123
// RUN: %clang -target arm-unknown-openbsd -### -S %s 2>&1 | \
124-
// RUN: FileCheck -check-prefix=UNWIND-TABLES %s
124+
// RUN: FileCheck -check-prefix=NO-UNWIND-TABLES %s
125125
// RUN: %clang -target mips64-unknown-openbsd -### -S %s 2>&1 | \
126126
// RUN: FileCheck -check-prefix=UNWIND-TABLES %s
127127
// UNWIND-TABLES: "-funwind-tables=2"
128+
// NO-UNWIND-TABLES-NOT: "-funwind-tables=2"

0 commit comments

Comments
 (0)