[PATCH] D42017: Link sanitized programs on NetBSD with -lkvm

Kamil Rytarowski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 12 16:08:56 PST 2018


krytarowski created this revision.
krytarowski added reviewers: joerg, vitalybuka, dvyukov.
krytarowski added a project: Sanitizers.
Herald added a subscriber: llvm-commits.

kvm - kernel memory interface

This set of functions is defined in the libkvm library.

The kvm(3) functions are used in programs that can request information
transparently either from alive kernel or a dead one. This library is used
in the NetBSD userland programs like ps(1), w(1) or who(1).

Inteceptors for the kvm(3) functions require programs linked with -lkvm,
even if they don't use the features as we leak dlerror(3) for unknown
symbols.

Sponsored by <The NetBSD Foundation>


Repository:
  rL LLVM

https://reviews.llvm.org/D42017

Files:
  lib/Driver/ToolChains/CommonArgs.cpp


Index: lib/Driver/ToolChains/CommonArgs.cpp
===================================================================
--- lib/Driver/ToolChains/CommonArgs.cpp
+++ lib/Driver/ToolChains/CommonArgs.cpp
@@ -555,6 +555,9 @@
   // Required for backtrace on some OSes
   if (TC.getTriple().getOS() == llvm::Triple::NetBSD)
     CmdArgs.push_back("-lexecinfo");
+  // Required for kvm (kernel memory interface) on some OSes
+  if (TC.getTriple().getOS() == llvm::Triple::NetBSD)
+    CmdArgs.push_back("-lkvm");
 }
 
 static void


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42017.129724.patch
Type: text/x-patch
Size: 517 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180113/b2073bd9/attachment.bin>


More information about the cfe-commits mailing list