Skip to content

Commit f3b8972

Browse files
brad0tstellar
authored andcommitted
[Driver][OpenBSD] Disable unwind tables on Arm
Arm is not quite ready for unwinding yet. (cherry picked from commit 9abeb80)
1 parent fe5c24e commit f3b8972

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
@@ -342,3 +342,12 @@ Tool *OpenBSD::buildAssembler() const {
342342
Tool *OpenBSD::buildLinker() const { return new tools::openbsd::Linker(*this); }
343343

344344
bool OpenBSD::HasNativeLLVMSupport() const { return true; }
345+
346+
bool OpenBSD::IsUnwindTablesDefault(const ArgList &Args) const {
347+
switch (getArch()) {
348+
case llvm::Triple::arm:
349+
return false;
350+
default:
351+
return true;
352+
}
353+
}

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
@@ -124,7 +124,8 @@
124124

125125
// Check that unwind tables are enabled
126126
// RUN: %clang -target arm-unknown-openbsd -### -S %s 2>&1 | \
127-
// RUN: FileCheck -check-prefix=UNWIND-TABLES %s
127+
// RUN: FileCheck -check-prefix=NO-UNWIND-TABLES %s
128128
// RUN: %clang -target mips64-unknown-openbsd -### -S %s 2>&1 | \
129129
// RUN: FileCheck -check-prefix=UNWIND-TABLES %s
130130
// UNWIND-TABLES: "-funwind-tables=2"
131+
// NO-UNWIND-TABLES-NOT: "-funwind-tables=2"

0 commit comments

Comments
 (0)