void-packages/srcpkgs/thunderbird/patches/fix-musl-memory.patch

39 lines
1.6 KiB
Diff

fix for musl libc.
--- mozilla/memory/mozjemalloc/jemalloc.c.orig 2015-09-28 14:41:00.000000000 +0200
+++ mozilla/memory/mozjemalloc/jemalloc.c 2015-10-09 07:24:21.161462303 +0200
@@ -325,7 +325,7 @@
#endif
#include <sys/time.h>
#include <sys/types.h>
-#if !defined(MOZ_MEMORY_SOLARIS) && !defined(MOZ_MEMORY_ANDROID)
+#if !defined(MOZ_MEMORY_SOLARIS) && !defined(MOZ_MEMORY_ANDROID) && defined(__GLIBC__)
#include <sys/sysctl.h>
#endif
#include <sys/uio.h>
@@ -664,7 +664,7 @@
/* No init lock for Windows. */
#elif defined(MOZ_MEMORY_DARWIN)
static malloc_mutex_t init_lock = {OS_SPINLOCK_INIT};
-#elif defined(MOZ_MEMORY_LINUX) && !defined(MOZ_MEMORY_ANDROID)
+#elif defined(MOZ_MEMORY_LINUX) && defined(__GLIBC__) && !defined(MOZ_MEMORY_ANDROID)
static malloc_mutex_t init_lock = PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP;
#elif defined(MOZ_MEMORY)
static malloc_mutex_t init_lock = PTHREAD_MUTEX_INITIALIZER;
@@ -1636,7 +1636,7 @@
return (true);
#elif defined(MOZ_MEMORY_DARWIN)
mutex->lock = OS_SPINLOCK_INIT;
-#elif defined(MOZ_MEMORY_LINUX) && !defined(MOZ_MEMORY_ANDROID)
+#elif defined(MOZ_MEMORY_LINUX) && defined(__GLIBC__) && !defined(MOZ_MEMORY_ANDROID)
pthread_mutexattr_t attr;
if (pthread_mutexattr_init(&attr) != 0)
return (true);
@@ -1698,7 +1698,7 @@
return (true);
#elif defined(MOZ_MEMORY_DARWIN)
lock->lock = OS_SPINLOCK_INIT;
-#elif defined(MOZ_MEMORY_LINUX) && !defined(MOZ_MEMORY_ANDROID)
+#elif defined(MOZ_MEMORY_LINUX) && defined(__GLIBC__) && !defined(MOZ_MEMORY_ANDROID)
pthread_mutexattr_t attr;
if (pthread_mutexattr_init(&attr) != 0)
return (true);