0004-fix-building-with-musl.patch 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. From 0c9e8f586ba52a9aef5ed298e8315b2598b8fb72 Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Sat, 25 May 2019 16:54:45 -0700
  4. Subject: [PATCH] fix building with musl
  5. The MIPS specific header <sgidefs.h> is not provided by musl
  6. linux kernel headers provide <asm/sgidefs.h> which has same definitions
  7. Upstream-Status: Pending
  8. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  9. Signed-off-by: Adam Duskett <aduskett@gmail.com>
  10. ---
  11. ---
  12. js/src/jsmath.cpp | 2 +-
  13. memory/build/Mutex.h | 4 ++--
  14. mozglue/misc/TimeStamp_darwin.cpp | 1 -
  15. mozglue/misc/TimeStamp_posix.cpp | 1 -
  16. nsprpub/pr/src/misc/prsystem.c | 1 -
  17. third_party/python/psutil/psutil/_psutil_bsd.c | 1 -
  18. third_party/python/psutil/psutil/_psutil_osx.c | 1 -
  19. third_party/python/psutil/psutil/arch/osx/process_info.c | 1 -
  20. 8 files changed, 3 insertions(+), 9 deletions(-)
  21. diff --git a/js/src/jsmath.cpp b/js/src/jsmath.cpp
  22. index a28968be..8facaa81 100644
  23. --- a/js/src/jsmath.cpp
  24. +++ b/js/src/jsmath.cpp
  25. @@ -71,7 +71,7 @@
  26. #elif defined(__s390__)
  27. #define GETRANDOM_NR 349
  28. #elif defined(__mips__)
  29. -#include <sgidefs.h>
  30. +#include <asm/sgidefs.h>
  31. #if _MIPS_SIM == _MIPS_SIM_ABI32
  32. #define GETRANDOM_NR 4353
  33. #elif _MIPS_SIM == _MIPS_SIM_ABI64
  34. diff --git a/memory/build/Mutex.h b/memory/build/Mutex.h
  35. index cb8b1e7d..7b9eb1de 100644
  36. --- a/memory/build/Mutex.h
  37. +++ b/memory/build/Mutex.h
  38. @@ -42,7 +42,7 @@ struct Mutex {
  39. if (pthread_mutexattr_init(&attr) != 0) {
  40. return false;
  41. }
  42. - pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ADAPTIVE_NP);
  43. + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_STALLED);
  44. if (pthread_mutex_init(&mMutex, &attr) != 0) {
  45. pthread_mutexattr_destroy(&attr);
  46. return false;
  47. @@ -102,7 +102,7 @@ typedef Mutex StaticMutex;
  48. #if defined(XP_DARWIN)
  49. #define STATIC_MUTEX_INIT OS_SPINLOCK_INIT
  50. -#elif defined(XP_LINUX) && !defined(ANDROID)
  51. +#elif defined(XP_LINUX) && !defined(ANDROID) && defined(__GLIBC__)
  52. #define STATIC_MUTEX_INIT PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
  53. #else
  54. #define STATIC_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER
  55. diff --git a/mozglue/misc/TimeStamp_darwin.cpp b/mozglue/misc/TimeStamp_darwin.cpp
  56. index d2abe9a5..d065649c 100644
  57. --- a/mozglue/misc/TimeStamp_darwin.cpp
  58. +++ b/mozglue/misc/TimeStamp_darwin.cpp
  59. @@ -19,7 +19,6 @@
  60. #include <mach/mach_time.h>
  61. #include <sys/time.h>
  62. -#include <sys/sysctl.h>
  63. #include <time.h>
  64. #include <unistd.h>
  65. diff --git a/mozglue/misc/TimeStamp_posix.cpp b/mozglue/misc/TimeStamp_posix.cpp
  66. index 86c7609a..a37bd93a 100644
  67. --- a/mozglue/misc/TimeStamp_posix.cpp
  68. +++ b/mozglue/misc/TimeStamp_posix.cpp
  69. @@ -21,7 +21,6 @@
  70. #if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || \
  71. defined(__OpenBSD__)
  72. #include <sys/param.h>
  73. -#include <sys/sysctl.h>
  74. #endif
  75. #if defined(__DragonFly__) || defined(__FreeBSD__)
  76. diff --git a/nsprpub/pr/src/misc/prsystem.c b/nsprpub/pr/src/misc/prsystem.c
  77. index eba85fb0..54b57bb9 100644
  78. --- a/nsprpub/pr/src/misc/prsystem.c
  79. +++ b/nsprpub/pr/src/misc/prsystem.c
  80. @@ -27,7 +27,6 @@
  81. || defined(OPENBSD) || defined(DRAGONFLY) || defined(DARWIN)
  82. #define _PR_HAVE_SYSCTL
  83. #include <sys/param.h>
  84. -#include <sys/sysctl.h>
  85. #endif
  86. #if defined(DARWIN)
  87. diff --git a/third_party/python/psutil/psutil/_psutil_bsd.c b/third_party/python/psutil/psutil/_psutil_bsd.c
  88. index 9a2ed04b..9e0d34cb 100644
  89. --- a/third_party/python/psutil/psutil/_psutil_bsd.c
  90. +++ b/third_party/python/psutil/psutil/_psutil_bsd.c
  91. @@ -29,7 +29,6 @@
  92. #include <paths.h>
  93. #include <sys/types.h>
  94. #include <sys/param.h>
  95. -#include <sys/sysctl.h>
  96. #include <sys/user.h>
  97. #include <sys/proc.h>
  98. #include <sys/file.h>
  99. diff --git a/third_party/python/psutil/psutil/_psutil_osx.c b/third_party/python/psutil/psutil/_psutil_osx.c
  100. index 55dd64ca..ec356339 100644
  101. --- a/third_party/python/psutil/psutil/_psutil_osx.c
  102. +++ b/third_party/python/psutil/psutil/_psutil_osx.c
  103. @@ -13,7 +13,6 @@
  104. #include <stdlib.h>
  105. #include <stdio.h>
  106. #include <utmpx.h>
  107. -#include <sys/sysctl.h>
  108. #include <sys/vmmeter.h>
  109. #include <libproc.h>
  110. #include <sys/proc_info.h>
  111. diff --git a/third_party/python/psutil/psutil/arch/osx/process_info.c b/third_party/python/psutil/psutil/arch/osx/process_info.c
  112. index 40c79a2c..8de0dcbd 100644
  113. --- a/third_party/python/psutil/psutil/arch/osx/process_info.c
  114. +++ b/third_party/python/psutil/psutil/arch/osx/process_info.c
  115. @@ -16,7 +16,6 @@
  116. #include <stdlib.h>
  117. #include <stdio.h>
  118. #include <signal.h>
  119. -#include <sys/sysctl.h>
  120. #include <libproc.h>
  121. #include "process_info.h"
  122. --
  123. 2.23.0