[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

llvm-svn: 265378
This commit is contained in:
Yabin Cui 2016-04-05 05:37:48 +00:00
parent 583b1a8a1b
commit c7db569cc1
1 changed files with 3 additions and 1 deletions

View File

@ -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