r323022 - Link sanitized programs on NetBSD with -lkvm

Kamil Rytarowski via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 19 17:03:45 PST 2018

Author: kamil
Date: Fri Jan 19 17:03:45 2018
New Revision: 323022

URL: http://llvm.org/viewvc/llvm-project?rev=323022&view=rev
Link sanitized programs on NetBSD with -lkvm

kvm - kernel memory interface

The kvm(3) functions like kvm_open(), kvm_getargv() or kvm_getenvv()
are used in programs that can request information about a kernel and
its processes. The LLVM sanitizers will make use of them on NetBSD.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, vitalybuka, dvyukov

Reviewed By: vitalybuka

Subscribers: llvm-commits, cfe-commits, #sanitizers

Tags: #sanitizers

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


Modified: cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp?rev=323022&r1=323021&r2=323022&view=diff
--- cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp Fri Jan 19 17:03:45 2018
@@ -555,6 +555,9 @@ void tools::linkSanitizerRuntimeDeps(con
   // Required for backtrace on some OSes
   if (TC.getTriple().getOS() == llvm::Triple::NetBSD)
+  // Required for kvm (kernel memory interface) on some OSes
+  if (TC.getTriple().getOS() == llvm::Triple::NetBSD)
+    CmdArgs.push_back("-lkvm");
 static void

More information about the cfe-commits mailing list