[llvm-commits] [compiler-rt] r147647 - in /compiler-rt/trunk/lib/asan: asan_allocator.cc asan_internal.h asan_linux.cc asan_mac.cc asan_rtl.cc
Kostya Serebryany
kcc at google.com
Thu Jan 5 18:12:25 PST 2012
Author: kcc
Date: Thu Jan 5 20:12:25 2012
New Revision: 147647
URL: http://llvm.org/viewvc/llvm-project?rev=147647&view=rev
Log:
[asan] move more stuff to OS-specific files
Modified:
compiler-rt/trunk/lib/asan/asan_allocator.cc
compiler-rt/trunk/lib/asan/asan_internal.h
compiler-rt/trunk/lib/asan/asan_linux.cc
compiler-rt/trunk/lib/asan/asan_mac.cc
compiler-rt/trunk/lib/asan/asan_rtl.cc
Modified: compiler-rt/trunk/lib/asan/asan_allocator.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_allocator.cc?rev=147647&r1=147646&r2=147647&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_allocator.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_allocator.cc Thu Jan 5 20:12:25 2012
@@ -35,10 +35,6 @@
#include "asan_thread.h"
#include "asan_thread_registry.h"
-#include <stdint.h>
-#include <string.h>
-#include <unistd.h>
-
namespace __asan {
#define REDZONE FLAG_redzone
Modified: compiler-rt/trunk/lib/asan/asan_internal.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_internal.h?rev=147647&r1=147646&r2=147647&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_internal.h (original)
+++ compiler-rt/trunk/lib/asan/asan_internal.h Thu Jan 5 20:12:25 2012
@@ -99,6 +99,8 @@
void *AsanMmapSomewhereOrDie(size_t size, const char *where);
void AsanUnmapOrDie(void *ptr, size_t size);
+void AsanDisableCoreDumper();
+
ssize_t AsanRead(int fd, void *buf, size_t count);
ssize_t AsanWrite(int fd, const void *buf, size_t count);
int AsanClose(int fd);
Modified: compiler-rt/trunk/lib/asan/asan_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_linux.cc?rev=147647&r1=147646&r2=147647&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_linux.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_linux.cc Thu Jan 5 20:12:25 2012
@@ -244,6 +244,12 @@
CHECK(AddrIsInStack((uintptr_t)&attr));
}
+void AsanDisableCoreDumper() {
+ struct rlimit nocore;
+ nocore.rlim_cur = 0;
+ nocore.rlim_max = 0;
+ setrlimit(RLIMIT_CORE, &nocore);
+}
} // namespace __asan
Modified: compiler-rt/trunk/lib/asan/asan_mac.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_mac.cc?rev=147647&r1=147646&r2=147647&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_mac.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_mac.cc Thu Jan 5 20:12:25 2012
@@ -22,6 +22,7 @@
#include "asan_thread_registry.h"
#include <sys/mman.h>
+#include <sys/resource.h>
#include <pthread.h>
#include <fcntl.h>
#include <unistd.h>
@@ -113,6 +114,13 @@
CHECK(AddrIsInStack((uintptr_t)&local));
}
+void AsanDisableCoreDumper() {
+ struct rlimit nocore;
+ nocore.rlim_cur = 0;
+ nocore.rlim_max = 0;
+ setrlimit(RLIMIT_CORE, &nocore);
+}
+
// Support for the following functions from libdispatch on Mac OS:
// dispatch_async_f()
// dispatch_async()
Modified: compiler-rt/trunk/lib/asan/asan_rtl.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_rtl.cc?rev=147647&r1=147646&r2=147647&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_rtl.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_rtl.cc Thu Jan 5 20:12:25 2012
@@ -26,7 +26,6 @@
#include <new>
#include <dlfcn.h>
-#include <execinfo.h>
#include <fcntl.h>
#include <pthread.h>
#include <signal.h>
@@ -40,9 +39,6 @@
#ifndef ANDROID
#include <sys/ucontext.h>
#endif
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <unistd.h>
// must not include <setjmp.h> on Linux
namespace __asan {
@@ -775,10 +771,7 @@
if (__WORDSIZE == 64) {
// Disable core dumper -- it makes little sense to dump 16T+ core.
- struct rlimit nocore;
- nocore.rlim_cur = 0;
- nocore.rlim_max = 0;
- setrlimit(RLIMIT_CORE, &nocore);
+ AsanDisableCoreDumper();
}
{
More information about the llvm-commits
mailing list