[compiler-rt] r265378 - [tsan] Fix freebsd build.

Yabin Cui via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 4 22:37:49 PDT 2016


Author: yabinc
Date: Tue Apr  5 00:37:48 2016
New Revision: 265378

URL: http://llvm.org/viewvc/llvm-project?rev=265378&view=rev
Log:
[tsan] Fix freebsd build.

Summary:
Freebsd doesn't have <sys/personality.h>, so call personality() only in
SANITIZER_LINUX.

Reviewers: llvm-commits, dvyukov, zatrazz, rengolin, beanz

Subscribers: beanz, emaste

Differential Revision: http://reviews.llvm.org/D18785

Modified:
    compiler-rt/trunk/lib/tsan/rtl/tsan_platform_linux.cc

Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_platform_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_platform_linux.cc?rev=265378&r1=265377&r2=265378&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_platform_linux.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_platform_linux.cc Tue Apr  5 00:37:48 2016
@@ -36,7 +36,9 @@
 #include <string.h>
 #include <stdarg.h>
 #include <sys/mman.h>
+#if SANITIZER_LINUX
 #include <sys/personality.h>
+#endif
 #include <sys/syscall.h>
 #include <sys/socket.h>
 #include <sys/time.h>
@@ -292,7 +294,7 @@ void InitializePlatform() {
       SetAddressSpaceUnlimited();
       reexec = true;
     }
-#if defined(__aarch64__)
+#if SANITIZER_LINUX && defined(__aarch64__)
     // After patch "arm64: mm: support ARCH_MMAP_RND_BITS." is introduced in
     // linux kernel, the random gap between stack and mapped area is increased
     // from 128M to 36G on 39-bit aarch64. As it is almost impossible to cover




More information about the llvm-commits mailing list