Skip to content

Commit e21475e

Browse files
committedDec 19, 2017
Teach clang/NetBSD about additional dependencies for sanitizers
Summary: Sanitizers on NetBSD require additional linkage: - libutil for forkpty(3) - libexecinfo for backtrace(3) Sponsored by <The NetBSD Foundation> Reviewers: joerg, eugenis, vitalybuka, kcc Reviewed By: eugenis Subscribers: #sanitizers, cfe-commits Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D41054 llvm-svn: 321060
1 parent 13142b1 commit e21475e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎clang/lib/Driver/ToolChains/CommonArgs.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,12 @@ void tools::linkSanitizerRuntimeDeps(const ToolChain &TC,
549549
TC.getTriple().getOS() != llvm::Triple::NetBSD &&
550550
TC.getTriple().getOS() != llvm::Triple::RTEMS)
551551
CmdArgs.push_back("-ldl");
552+
// Required for forkpty on some OSes
553+
if (TC.getTriple().getOS() == llvm::Triple::NetBSD)
554+
CmdArgs.push_back("-lutil");
555+
// Required for backtrace on some OSes
556+
if (TC.getTriple().getOS() == llvm::Triple::NetBSD)
557+
CmdArgs.push_back("-lexecinfo");
552558
}
553559

554560
static void

0 commit comments

Comments
 (0)
Please sign in to comment.