Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 1 | From 04e8a611e958f0da1ccac61acae3a6f1a5168b20 Mon Sep 17 00:00:00 2001 |
| 2 | From: Hongxu Jia <hongxu.jia@windriver.com> |
| 3 | Date: Fri, 13 Jul 2018 18:08:14 +0800 |
| 4 | Subject: [PATCH] support musl |
| 5 | |
| 6 | Upstream-Status: Pending |
| 7 | |
| 8 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
| 9 | --- |
| 10 | memory/jemalloc/src/src/pages.c | 1 - |
| 11 | memory/mozjemalloc/jemalloc.c | 7 +++---- |
| 12 | mozglue/misc/TimeStamp_darwin.cpp | 1 - |
| 13 | mozglue/misc/TimeStamp_posix.cpp | 1 - |
| 14 | nsprpub/pr/src/misc/prsystem.c | 1 - |
| 15 | python/psutil/psutil/_psutil_bsd.c | 1 - |
| 16 | python/psutil/psutil/_psutil_osx.c | 1 - |
| 17 | python/psutil/psutil/arch/bsd/process_info.c | 1 - |
| 18 | python/psutil/psutil/arch/osx/process_info.c | 1 - |
| 19 | 9 files changed, 3 insertions(+), 12 deletions(-) |
| 20 | |
| 21 | diff --git a/memory/jemalloc/src/src/pages.c b/memory/jemalloc/src/src/pages.c |
| 22 | index 647952a..7b964c8 100644 |
| 23 | --- a/memory/jemalloc/src/src/pages.c |
| 24 | +++ b/memory/jemalloc/src/src/pages.c |
| 25 | @@ -2,7 +2,6 @@ |
| 26 | #include "jemalloc/internal/jemalloc_internal.h" |
| 27 | |
| 28 | #ifdef JEMALLOC_SYSCTL_VM_OVERCOMMIT |
| 29 | -#include <sys/sysctl.h> |
| 30 | #endif |
| 31 | |
| 32 | /******************************************************************************/ |
| 33 | diff --git a/memory/mozjemalloc/jemalloc.c b/memory/mozjemalloc/jemalloc.c |
| 34 | index 5d4d83a..c618de9 100644 |
| 35 | --- a/memory/mozjemalloc/jemalloc.c |
| 36 | +++ b/memory/mozjemalloc/jemalloc.c |
| 37 | @@ -332,7 +332,6 @@ __FBSDID("$FreeBSD: head/lib/libc/stdlib/malloc.c 180599 2008-07-18 19:35:44Z ja |
| 38 | #include <sys/time.h> |
| 39 | #include <sys/types.h> |
| 40 | #if !defined(MOZ_MEMORY_SOLARIS) && !defined(MOZ_MEMORY_ANDROID) |
| 41 | -#include <sys/sysctl.h> |
| 42 | #endif |
| 43 | #include <sys/uio.h> |
| 44 | #ifndef MOZ_MEMORY |
| 45 | @@ -674,7 +673,7 @@ static bool malloc_initialized = false; |
| 46 | #elif defined(MOZ_MEMORY_DARWIN) |
| 47 | static malloc_mutex_t init_lock = {OS_SPINLOCK_INIT}; |
| 48 | #elif defined(MOZ_MEMORY_LINUX) && !defined(MOZ_MEMORY_ANDROID) |
| 49 | -static malloc_mutex_t init_lock = PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP; |
| 50 | +static malloc_mutex_t init_lock = PTHREAD_MUTEX_INITIALIZER; |
| 51 | #elif defined(MOZ_MEMORY) |
| 52 | static malloc_mutex_t init_lock = PTHREAD_MUTEX_INITIALIZER; |
| 53 | #else |
| 54 | @@ -1644,7 +1643,7 @@ malloc_mutex_init(malloc_mutex_t *mutex) |
| 55 | pthread_mutexattr_t attr; |
| 56 | if (pthread_mutexattr_init(&attr) != 0) |
| 57 | return (true); |
| 58 | - pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ADAPTIVE_NP); |
| 59 | + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_STALLED); |
| 60 | if (pthread_mutex_init(mutex, &attr) != 0) { |
| 61 | pthread_mutexattr_destroy(&attr); |
| 62 | return (true); |
| 63 | @@ -1709,7 +1708,7 @@ malloc_spin_init(malloc_spinlock_t *lock) |
| 64 | pthread_mutexattr_t attr; |
| 65 | if (pthread_mutexattr_init(&attr) != 0) |
| 66 | return (true); |
| 67 | - pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ADAPTIVE_NP); |
| 68 | + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_STALLED); |
| 69 | if (pthread_mutex_init(lock, &attr) != 0) { |
| 70 | pthread_mutexattr_destroy(&attr); |
| 71 | return (true); |
| 72 | diff --git a/mozglue/misc/TimeStamp_darwin.cpp b/mozglue/misc/TimeStamp_darwin.cpp |
| 73 | index f30bc98..3998c9c 100644 |
| 74 | --- a/mozglue/misc/TimeStamp_darwin.cpp |
| 75 | +++ b/mozglue/misc/TimeStamp_darwin.cpp |
| 76 | @@ -18,7 +18,6 @@ |
| 77 | |
| 78 | #include <mach/mach_time.h> |
| 79 | #include <sys/time.h> |
| 80 | -#include <sys/sysctl.h> |
| 81 | #include <time.h> |
| 82 | #include <unistd.h> |
| 83 | |
| 84 | diff --git a/mozglue/misc/TimeStamp_posix.cpp b/mozglue/misc/TimeStamp_posix.cpp |
| 85 | index 05dedde..d9e30f2 100644 |
| 86 | --- a/mozglue/misc/TimeStamp_posix.cpp |
| 87 | +++ b/mozglue/misc/TimeStamp_posix.cpp |
| 88 | @@ -21,7 +21,6 @@ |
| 89 | #if defined(__DragonFly__) || defined(__FreeBSD__) \ |
| 90 | || defined(__NetBSD__) || defined(__OpenBSD__) |
| 91 | #include <sys/param.h> |
| 92 | -#include <sys/sysctl.h> |
| 93 | #endif |
| 94 | |
| 95 | #if defined(__DragonFly__) || defined(__FreeBSD__) |
| 96 | diff --git a/nsprpub/pr/src/misc/prsystem.c b/nsprpub/pr/src/misc/prsystem.c |
| 97 | index eba85fb..54b57bb 100644 |
| 98 | --- a/nsprpub/pr/src/misc/prsystem.c |
| 99 | +++ b/nsprpub/pr/src/misc/prsystem.c |
| 100 | @@ -27,7 +27,6 @@ |
| 101 | || defined(OPENBSD) || defined(DRAGONFLY) || defined(DARWIN) |
| 102 | #define _PR_HAVE_SYSCTL |
| 103 | #include <sys/param.h> |
| 104 | -#include <sys/sysctl.h> |
| 105 | #endif |
| 106 | |
| 107 | #if defined(DARWIN) |
| 108 | diff --git a/python/psutil/psutil/_psutil_bsd.c b/python/psutil/psutil/_psutil_bsd.c |
| 109 | index 7b6e561..0a91262 100644 |
| 110 | --- a/python/psutil/psutil/_psutil_bsd.c |
| 111 | +++ b/python/psutil/psutil/_psutil_bsd.c |
| 112 | @@ -16,7 +16,6 @@ |
| 113 | #include <fcntl.h> |
| 114 | #include <paths.h> |
| 115 | #include <sys/types.h> |
| 116 | -#include <sys/sysctl.h> |
| 117 | #include <sys/param.h> |
| 118 | #include <sys/user.h> |
| 119 | #include <sys/proc.h> |
| 120 | diff --git a/python/psutil/psutil/_psutil_osx.c b/python/psutil/psutil/_psutil_osx.c |
| 121 | index 3ebf8ff..b3910ba 100644 |
| 122 | --- a/python/psutil/psutil/_psutil_osx.c |
| 123 | +++ b/python/psutil/psutil/_psutil_osx.c |
| 124 | @@ -13,7 +13,6 @@ |
| 125 | #include <stdlib.h> |
| 126 | #include <stdio.h> |
| 127 | #include <utmpx.h> |
| 128 | -#include <sys/sysctl.h> |
| 129 | #include <sys/vmmeter.h> |
| 130 | #include <libproc.h> |
| 131 | #include <sys/proc_info.h> |
| 132 | diff --git a/python/psutil/psutil/arch/bsd/process_info.c b/python/psutil/psutil/arch/bsd/process_info.c |
| 133 | index 4d73924..46f288d 100644 |
| 134 | --- a/python/psutil/psutil/arch/bsd/process_info.c |
| 135 | +++ b/python/psutil/psutil/arch/bsd/process_info.c |
| 136 | @@ -15,7 +15,6 @@ |
| 137 | #include <stdio.h> |
| 138 | #include <string.h> |
| 139 | #include <sys/types.h> |
| 140 | -#include <sys/sysctl.h> |
| 141 | #include <sys/param.h> |
| 142 | #include <sys/user.h> |
| 143 | #include <sys/proc.h> |
| 144 | diff --git a/python/psutil/psutil/arch/osx/process_info.c b/python/psutil/psutil/arch/osx/process_info.c |
| 145 | index b6dd5bb..62a838f 100644 |
| 146 | --- a/python/psutil/psutil/arch/osx/process_info.c |
| 147 | +++ b/python/psutil/psutil/arch/osx/process_info.c |
| 148 | @@ -16,7 +16,6 @@ |
| 149 | #include <stdlib.h> |
| 150 | #include <stdio.h> |
| 151 | #include <signal.h> |
| 152 | -#include <sys/sysctl.h> |
| 153 | #include <libproc.h> |
| 154 | |
| 155 | #include "process_info.h" |
| 156 | -- |
| 157 | 2.7.4 |
| 158 | |