Skip to content

Commit b42d57a

Browse files
committed
[clang][Driver][OpenBSD] libcxx also requires pthread
1 parent b0186c2 commit b42d57a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

clang/lib/Driver/ToolChains/OpenBSD.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ void OpenBSD::AddCXXStdlibLibArgs(const ArgList &Args,
296296

297297
CmdArgs.push_back(Profiling ? "-lc++_p" : "-lc++");
298298
CmdArgs.push_back(Profiling ? "-lc++abi_p" : "-lc++abi");
299+
CmdArgs.push_back(Profiling ? "-lpthread_p" : "-lpthread");
299300
}
300301

301302
std::string OpenBSD::getCompilerRT(const ArgList &Args,

clang/test/Driver/openbsd.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// RUN: | FileCheck --check-prefix=CHECK-CXX %s
77
// RUN: %clangxx %s -### -o %t.o -target arm-unknown-openbsd 2>&1 \
88
// RUN: | FileCheck --check-prefix=CHECK-CXX %s
9-
// CHECK-CXX: "-lc++" "-lc++abi" "-lm"
9+
// CHECK-CXX: "-lc++" "-lc++abi" "-lpthread" "-lm"
1010

1111
// RUN: %clangxx %s -### -pg -o %t.o -target amd64-pc-openbsd 2>&1 \
1212
// RUN: | FileCheck --check-prefix=CHECK-PG-CXX %s
@@ -16,4 +16,4 @@
1616
// RUN: | FileCheck --check-prefix=CHECK-PG-CXX %s
1717
// RUN: %clangxx %s -### -pg -o %t.o -target arm-unknown-openbsd 2>&1 \
1818
// RUN: | FileCheck --check-prefix=CHECK-PG-CXX %s
19-
// CHECK-PG-CXX: "-lc++_p" "-lc++abi_p" "-lm_p"
19+
// CHECK-PG-CXX: "-lc++_p" "-lc++abi_p" "-lpthread_p" "-lm_p"

0 commit comments

Comments
 (0)