[PATCH] D27902: Fix build breakage on FreeBSD after rL289878/rL289881

Dimitry Andric via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 18 13:07:42 PST 2016


dim updated this revision to Diff 81889.
dim added a comment.

Updated to cover some more cases:

- Don't declare `struct_utmp_sz` on macOS and FreeBSD
- Don't intercept utmp functions on FreeBSD either


https://reviews.llvm.org/D27902

Files:
  lib/sanitizer_common/sanitizer_platform_interceptors.h
  lib/sanitizer_common/sanitizer_platform_limits_posix.cc
  lib/sanitizer_common/sanitizer_platform_limits_posix.h


Index: lib/sanitizer_common/sanitizer_platform_limits_posix.h
===================================================================
--- lib/sanitizer_common/sanitizer_platform_limits_posix.h
+++ lib/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -862,7 +862,9 @@
   extern int shmctl_shm_stat;
 #endif
 
+#if !SANITIZER_MAC && !SANITIZER_FREEBSD
   extern unsigned struct_utmp_sz;
+#endif
 #if !SANITIZER_ANDROID
   extern unsigned struct_utmpx_sz;
 #endif
Index: lib/sanitizer_common/sanitizer_platform_limits_posix.cc
===================================================================
--- lib/sanitizer_common/sanitizer_platform_limits_posix.cc
+++ lib/sanitizer_common/sanitizer_platform_limits_posix.cc
@@ -51,7 +51,7 @@
 #include <termios.h>
 #include <time.h>
 #include <wchar.h>
-#if !SANITIZER_MAC
+#if !SANITIZER_MAC && !SANITIZER_FREEBSD
 #include <utmp.h>
 #endif
 
@@ -288,7 +288,7 @@
   int shmctl_shm_stat = (int)SHM_STAT;
 #endif
 
-#if !SANITIZER_MAC
+#if !SANITIZER_MAC && !SANITIZER_FREEBSD
   unsigned struct_utmp_sz = sizeof(struct utmp);
 #endif
 #if !SANITIZER_ANDROID
Index: lib/sanitizer_common/sanitizer_platform_interceptors.h
===================================================================
--- lib/sanitizer_common/sanitizer_platform_interceptors.h
+++ lib/sanitizer_common/sanitizer_platform_interceptors.h
@@ -313,7 +313,7 @@
 #define SANITIZER_INTERCEPT___LXSTAT SANITIZER_INTERCEPT___XSTAT
 #define SANITIZER_INTERCEPT___LXSTAT64 SI_LINUX_NOT_ANDROID
 
-#define SANITIZER_INTERCEPT_UTMP SI_NOT_WINDOWS && !SI_MAC
+#define SANITIZER_INTERCEPT_UTMP SI_NOT_WINDOWS && !SI_MAC && !SI_FREEBSD
 #define SANITIZER_INTERCEPT_UTMPX SI_LINUX_NOT_ANDROID || SI_MAC || SI_FREEBSD
 
 #endif  // #ifndef SANITIZER_PLATFORM_INTERCEPTORS_H


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27902.81889.patch
Type: text/x-patch
Size: 1765 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161218/9962bb4d/attachment.bin>


More information about the llvm-commits mailing list