summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--base/process_util_linux.cc14
-rw-r--r--build/build_config.h4
2 files changed, 15 insertions, 3 deletions
diff --git a/base/process_util_linux.cc b/base/process_util_linux.cc
index 2c2824f..898c172 100644
--- a/base/process_util_linux.cc
+++ b/base/process_util_linux.cc
@@ -745,10 +745,11 @@ void OnNoMemory() {
} // namespace
-#if !defined(OS_ANDROID) && !defined(USE_TCMALLOC) && \
- !defined(ADDRESS_SANITIZER) && !defined(MEMORY_SANITIZER) && \
+#if !defined(ADDRESS_SANITIZER) && !defined(MEMORY_SANITIZER) && \
!defined(THREAD_SANITIZER)
+#if defined(LIBC_GLIBC) && !defined(USE_TCMALLOC)
+
extern "C" {
void* __libc_malloc(size_t size);
void* __libc_realloc(void* ptr, size_t size);
@@ -826,7 +827,14 @@ int posix_memalign(void** ptr, size_t alignment, size_t size) {
}
} // extern C
-#endif // ANDROID, TCMALLOC, *_SANITIZER
+
+#else
+
+// TODO(mostynb@opera.com): dlsym dance
+
+#endif // LIBC_GLIBC && !USE_TCMALLOC
+
+#endif // !*_SANITIZER
void EnableTerminationOnHeapCorruption() {
// On Linux, there nothing to do AFAIK.
diff --git a/build/build_config.h b/build/build_config.h
index ea5da2c..3ea3ddc 100644
--- a/build/build_config.h
+++ b/build/build_config.h
@@ -34,6 +34,10 @@
#if !defined(TOOLKIT_VIEWS) && defined(USE_X11)
#define TOOLKIT_GTK
#endif
+#if defined(__GLIBC__) && !defined(__UCLIBC__)
+// we really are using glibc, not uClibc pretending to be glibc
+#define LIBC_GLIBC
+#endif
#elif defined(_WIN32)
#define OS_WIN 1
#define TOOLKIT_VIEWS 1