Skip to content

Commit

Permalink
Don't link NetBSD programs with -ldl in linkXRayRuntimeDeps
Browse files Browse the repository at this point in the history
Summary:
There is no such library on NetBSD, the corresponding functions like dlopen(3) are in libc.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, vitalybuka, eugenis

Reviewed By: vitalybuka

Subscribers: dberris, llvm-commits, #sanitizers

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D41021

llvm-svn: 320220
  • Loading branch information
krytarowski committed Dec 9, 2017
1 parent 3d3f91e commit 62d421f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clang/lib/Driver/ToolChains/Gnu.cpp
Expand Up @@ -244,7 +244,8 @@ static void linkXRayRuntimeDeps(const ToolChain &TC, const ArgList &Args,
CmdArgs.push_back("-lrt");
CmdArgs.push_back("-lm");

if (TC.getTriple().getOS() != llvm::Triple::FreeBSD)
if (TC.getTriple().getOS() != llvm::Triple::FreeBSD &&
TC.getTriple().getOS() != llvm::Triple::NetBSD)
CmdArgs.push_back("-ldl");
}

Expand Down

0 comments on commit 62d421f

Please sign in to comment.