[PATCH] D43893: [1/3] OpenBSD Ubsan support / interception

David CARLIER via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 28 12:50:21 PST 2018


devnexen created this revision.
devnexen added reviewers: krytarowski, vitalybuka, visa.
Herald added subscribers: Sanitizers, llvm-commits, fedor.sergeev, srhines.

Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D43893

Files:
  lib/interception/interception.h
  lib/interception/interception_linux.cc
  lib/interception/interception_linux.h


Index: lib/interception/interception_linux.h
===================================================================
--- lib/interception/interception_linux.h
+++ lib/interception/interception_linux.h
@@ -13,7 +13,7 @@
 //===----------------------------------------------------------------------===//
 
 #if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD || \
-    SANITIZER_SOLARIS
+    SANITIZER_OPENBSD || SANITIZER_SOLARIS
 
 #if !defined(INCLUDED_FROM_INTERCEPTION_LIB)
 # error "interception_linux.h should be included from interception library only"
@@ -35,8 +35,8 @@
       (::__interception::uptr) & (func),                                   \
       (::__interception::uptr) & WRAP(func))
 
-// Android and Solaris do not have dlvsym
-#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS
+// Android,  Solaris and OpenBSD do not have dlvsym
+#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && !SANITIZER_OPENBSD
 #define INTERCEPT_FUNCTION_VER_LINUX_OR_FREEBSD(func, symver) \
   (::__interception::real_##func = (func##_f)(                \
        unsigned long)::__interception::GetFuncAddrVer(#func, symver))
@@ -47,4 +47,4 @@
 
 #endif  // INTERCEPTION_LINUX_H
 #endif  // SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD ||
-        // SANITIZER_SOLARIS
+        // SANITIZER_OPENBSD || SANITIZER_SOLARIS
Index: lib/interception/interception_linux.cc
===================================================================
--- lib/interception/interception_linux.cc
+++ lib/interception/interception_linux.cc
@@ -15,7 +15,7 @@
 #include "interception.h"
 
 #if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD || \
-    SANITIZER_SOLARIS
+    SANITIZER_OPENBSD || SANITIZER_SOLARIS
 
 #include <dlfcn.h>   // for dlsym() and dlvsym()
 
@@ -43,13 +43,13 @@
 }
 
 // Android and Solaris do not have dlvsym
-#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS
+#if !SANITIZER_ANDROID && !SANITIZER_SOLARIS && !SANITIZER_OPENBSD
 void *GetFuncAddrVer(const char *func_name, const char *ver) {
   return dlvsym(RTLD_NEXT, func_name, ver);
 }
 #endif  // !SANITIZER_ANDROID
 
 }  // namespace __interception
 
 #endif  // SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD ||
-        // SANITIZER_SOLARIS
+        // SANITIZER_OPENBSD || SANITIZER_SOLARIS
Index: lib/interception/interception.h
===================================================================
--- lib/interception/interception.h
+++ lib/interception/interception.h
@@ -18,8 +18,8 @@
 #include "sanitizer_common/sanitizer_internal_defs.h"
 
 #if !SANITIZER_LINUX && !SANITIZER_FREEBSD && !SANITIZER_MAC && \
-    !SANITIZER_NETBSD && !SANITIZER_WINDOWS && !SANITIZER_FUCHSIA && \
-    !SANITIZER_SOLARIS
+    !SANITIZER_NETBSD && !SANITIZER_OPENBSD && !SANITIZER_WINDOWS && \
+    !SANITIZER_FUCHSIA && SANITIZER_SOLARIS
 # error "Interception doesn't work on this operating system."
 #endif
 
@@ -266,7 +266,7 @@
 #define INCLUDED_FROM_INTERCEPTION_LIB
 
 #if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD || \
-    SANITIZER_SOLARIS
+    SANITIZER_OPENBSD || SANITIZER_SOLARIS
 
 # include "interception_linux.h"
 # define INTERCEPT_FUNCTION(func) INTERCEPT_FUNCTION_LINUX_OR_FREEBSD(func)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43893.136365.patch
Type: text/x-patch
Size: 3189 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180228/6c4ff8c9/attachment.bin>


More information about the llvm-commits mailing list