summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Unix/Program.inc
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2013-02-04 07:03:24 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2013-02-04 07:03:24 +0000
commit1f5a71492de40dcb9d150815c84506842b3d17b8 (patch)
tree1bf83d476fc486d013493fe1e19e0dfc423c9fce /llvm/lib/Support/Unix/Program.inc
parent2811f8ac2828dbc96839f6404142a6513a4e4153 (diff)
downloadbcm5719-llvm-1f5a71492de40dcb9d150815c84506842b3d17b8.tar.gz
bcm5719-llvm-1f5a71492de40dcb9d150815c84506842b3d17b8.zip
More MSan/ASan annotations.
This change lets us bootstrap LLVM/Clang under ASan and MSan. It contains fixes for 2 issues: - X86JIT reads return address from stack, which MSan does not know is initialized. - bugpoint tests run binaries with RLIMIT_AS. This does not work with certain Sanitizers. We are no longer including config.h in Compiler.h with this change. llvm-svn: 174306
Diffstat (limited to 'llvm/lib/Support/Unix/Program.inc')
-rw-r--r--llvm/lib/Support/Unix/Program.inc5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Support/Unix/Program.inc b/llvm/lib/Support/Unix/Program.inc
index c384316e209..117151c91d8 100644
--- a/llvm/lib/Support/Unix/Program.inc
+++ b/llvm/lib/Support/Unix/Program.inc
@@ -17,6 +17,7 @@
//===----------------------------------------------------------------------===//
#include "Unix.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/FileSystem.h"
#include <llvm/Config/config.h>
#if HAVE_SYS_STAT_H
@@ -164,12 +165,16 @@ static void SetMemoryLimits (unsigned size)
setrlimit (RLIMIT_RSS, &r);
#endif
#ifdef RLIMIT_AS // e.g. NetBSD doesn't have it.
+ // Don't set virtual memory limit if built with any Sanitizer. They need 80Tb
+ // of virtual memory for shadow memory mapping.
+#if !LLVM_MEMORY_SANITIZER_BUILD && !LLVM_ADDRESS_SANITIZER_BUILD
// Virtual memory.
getrlimit (RLIMIT_AS, &r);
r.rlim_cur = limit;
setrlimit (RLIMIT_AS, &r);
#endif
#endif
+#endif
}
bool
OpenPOWER on IntegriCloud