mirror of
https://github.com/RPCS3/llvm.git
synced 2025-03-01 07:09:02 +00:00
Fix check-llvm on kernel 4.9+ with asan or msan
Summary: Before https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=v4.9.46&id=84638335900f1995495838fe1bd4870c43ec1f67 test worked because memory allocated with mmap was not counted against RLIMIT_DATA. Reviewers: eugenis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D37366 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312303 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
59cb965ee9
commit
fe70e7d53a
@ -50,10 +50,10 @@ static cl::opt<unsigned> TimeoutValue(
|
|||||||
cl::desc("Number of seconds program is allowed to run before it "
|
cl::desc("Number of seconds program is allowed to run before it "
|
||||||
"is killed (default is 300s), 0 disables timeout"));
|
"is killed (default is 300s), 0 disables timeout"));
|
||||||
|
|
||||||
static cl::opt<int>
|
static cl::opt<int> MemoryLimit(
|
||||||
MemoryLimit("mlimit", cl::init(-1), cl::value_desc("MBytes"),
|
"mlimit", cl::init(-1), cl::value_desc("MBytes"),
|
||||||
cl::desc("Maximum amount of memory to use. 0 disables check."
|
cl::desc("Maximum amount of memory to use. 0 disables check. Defaults to "
|
||||||
" Defaults to 400MB (800MB under valgrind)."));
|
"400MB (800MB under valgrind, 0 with sanitizers)."));
|
||||||
|
|
||||||
static cl::opt<bool>
|
static cl::opt<bool>
|
||||||
UseValgrind("enable-valgrind",
|
UseValgrind("enable-valgrind",
|
||||||
@ -169,6 +169,12 @@ int main(int argc, char **argv) {
|
|||||||
MemoryLimit = 800;
|
MemoryLimit = 800;
|
||||||
else
|
else
|
||||||
MemoryLimit = 400;
|
MemoryLimit = 400;
|
||||||
|
#if (LLVM_ADDRESS_SANITIZER_BUILD || LLVM_MEMORY_SANITIZER_BUILD || \
|
||||||
|
LLVM_THREAD_SANITIZER_BUILD)
|
||||||
|
// Starting from kernel 4.9 memory allocated with mmap is counted against
|
||||||
|
// RLIMIT_DATA. Sanitizers need to allocate tens of terabytes for shadow.
|
||||||
|
MemoryLimit = 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
BugDriver D(argv[0], FindBugs, TimeoutValue, MemoryLimit, UseValgrind,
|
BugDriver D(argv[0], FindBugs, TimeoutValue, MemoryLimit, UseValgrind,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user