Bug 1432480, Land NSPR 4.19 into FF 60, r=me
authorKai Engert <kaie@kuix.de>
Fri, 23 Feb 2018 18:00:02 +0100
changeset 405099 7887449c528ac16d50cd245c4eee7ffb0373ac4d
parent 405098 2d8a49c03cad4956348e3dc91518159b50858c2e
child 405100 b0484c90364e7534e48527f1d66fc2c136549766
push id33502
push userarchaeopteryx@coole-files.de
push dateSat, 24 Feb 2018 00:59:26 +0000
treeherdermozilla-central@1056e048072c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1432480
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1432480, Land NSPR 4.19 into FF 60, r=me UPGRADE_NSPR_RELEASE
nsprpub/TAG-INFO
nsprpub/config/prdepend.h
nsprpub/configure
nsprpub/configure.in
nsprpub/pr/include/prinit.h
nsprpub/pr/src/md/unix/unix.c
nsprpub/pr/src/pthreads/ptthread.c
nsprpub/pr/tests/prfz.c
nsprpub/pr/tests/vercheck.c
--- a/nsprpub/TAG-INFO
+++ b/nsprpub/TAG-INFO
@@ -1,1 +1,1 @@
-NSPR_4_18_RTM
+NSPR_4_19_BETA1
--- a/nsprpub/config/prdepend.h
+++ b/nsprpub/config/prdepend.h
@@ -5,9 +5,8 @@
 
 /*
  * A dummy header file that is a dependency for all the object files.
  * Used to force a full recompilation of NSPR in Mozilla's Tinderbox
  * depend builds.  See comments in rules.mk.
  */
 
 #error "Do not include this header file."
-
--- a/nsprpub/configure
+++ b/nsprpub/configure
@@ -2483,17 +2483,17 @@ case $target_os in *\ *) target_os=`echo
 # The aliases save the names the user supplied, while $host etc.
 # will get canonicalized.
 test -n "$target_alias" &&
   test "$program_prefix$program_suffix$program_transform_name" = \
     NONENONEs,x,x, &&
   program_prefix=${target_alias}-
 
 MOD_MAJOR_VERSION=4
-MOD_MINOR_VERSION=18
+MOD_MINOR_VERSION=19
 MOD_PATCH_VERSION=0
 NSPR_MODNAME=nspr20
 _HAVE_PTHREADS=
 USE_PTHREADS=
 USE_USER_PTHREADS=
 USE_NSPR_THREADS=
 USE_N32=
 USE_X32=
--- a/nsprpub/configure.in
+++ b/nsprpub/configure.in
@@ -10,17 +10,17 @@ AC_CONFIG_SRCDIR([pr/include/nspr.h])
 
 AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
 AC_CANONICAL_TARGET
 
 dnl ========================================================
 dnl = Defaults
 dnl ========================================================
 MOD_MAJOR_VERSION=4
-MOD_MINOR_VERSION=18
+MOD_MINOR_VERSION=19
 MOD_PATCH_VERSION=0
 NSPR_MODNAME=nspr20
 _HAVE_PTHREADS=
 USE_PTHREADS=
 USE_USER_PTHREADS=
 USE_NSPR_THREADS=
 USE_N32=
 USE_X32=
--- a/nsprpub/pr/include/prinit.h
+++ b/nsprpub/pr/include/prinit.h
@@ -26,21 +26,21 @@ PR_BEGIN_EXTERN_C
 /*
 ** NSPR's version is used to determine the likelihood that the version you
 ** used to build your component is anywhere close to being compatible with
 ** what is in the underlying library.
 **
 ** The format of the version string is
 **     "<major version>.<minor version>[.<patch level>] [<Beta>]"
 */
-#define PR_VERSION  "4.18"
+#define PR_VERSION  "4.19 Beta"
 #define PR_VMAJOR   4
-#define PR_VMINOR   18
+#define PR_VMINOR   19
 #define PR_VPATCH   0
-#define PR_BETA     PR_FALSE
+#define PR_BETA     PR_TRUE
 
 /*
 ** PRVersionCheck
 **
 ** The basic signature of the function that is called to provide version
 ** checking. The result will be a boolean that indicates the likelihood
 ** that the underling library will perform as the caller expects.
 **
--- a/nsprpub/pr/src/md/unix/unix.c
+++ b/nsprpub/pr/src/md/unix/unix.c
@@ -2708,18 +2708,23 @@ static void* _MD_Unix_mmap64(
     void *addr, PRSize len, PRIntn prot, PRIntn flags,
     PRIntn fildes, PRInt64 offset)
 {
     PR_SetError(PR_FILE_TOO_BIG_ERROR, 0);
     return NULL;
 }  /* _MD_Unix_mmap64 */
 #endif /* defined(_PR_NO_LARGE_FILES) || defined(SOLARIS2_5) */
 
-/* Android <= 19 doesn't have mmap64. */
-#if defined(ANDROID) && __ANDROID_API__ <= 19
+/* NDK non-unified headers for API < 21 don't have mmap64. However,
+ * NDK unified headers do provide mmap64 for all API versions when building
+ * with clang. Therefore, we should provide mmap64 here for API < 21 if we're
+ * not using clang or if we're using non-unified headers. We check for
+ * non-unified headers by the lack of __ANDROID_API_L__ macro. */
+#if defined(ANDROID) && __ANDROID_API__ < 21 && \
+    (!defined(__clang__) || !defined(__ANDROID_API_L__))
 PR_IMPORT(void) *__mmap2(void *, size_t, int, int, int, size_t);
 
 #define ANDROID_PAGE_SIZE 4096
 
 static void *
 mmap64(void *addr, size_t len, int prot, int flags, int fd, loff_t offset)
 {
     if (offset & (ANDROID_PAGE_SIZE - 1)) {
@@ -2779,28 +2784,34 @@ static void _PR_InitIOV(void)
     }
 #elif defined(_PR_NO_LARGE_FILES)
     _md_iovector._open64 = open;
     _md_iovector._mmap64 = _MD_Unix_mmap64;
     _md_iovector._fstat64 = fstat;
     _md_iovector._stat64 = stat;
     _md_iovector._lseek64 = _MD_Unix_lseek64;
 #elif defined(_PR_HAVE_OFF64_T)
-#if defined(IRIX5_3) || defined(ANDROID)
+#if defined(IRIX5_3) || (defined(ANDROID) && __ANDROID_API__ < 21)
     /*
-     * Android doesn't have open64.  We pass the O_LARGEFILE flag to open
+     * Android < 21 doesn't have open64.  We pass the O_LARGEFILE flag to open
      * in _MD_open.
      */
     _md_iovector._open64 = open;
 #else
     _md_iovector._open64 = open64;
 #endif
     _md_iovector._mmap64 = mmap64;
+#if (defined(ANDROID) && __ANDROID_API__ < 21)
+    /* Same as the open64 case for Android. */
+    _md_iovector._fstat64 = fstat;
+    _md_iovector._stat64 = stat;
+#else
     _md_iovector._fstat64 = fstat64;
     _md_iovector._stat64 = stat64;
+#endif
     _md_iovector._lseek64 = lseek64;
 #elif defined(_PR_HAVE_LARGE_OFF_T)
     _md_iovector._open64 = open;
     _md_iovector._mmap64 = mmap;
 #if defined(OSF1) && defined(__GNUC__)
     _md_iovector._fstat64 = fstat_forwarder;
     _md_iovector._stat64 = stat_forwarder;
 #else
--- a/nsprpub/pr/src/pthreads/ptthread.c
+++ b/nsprpub/pr/src/pthreads/ptthread.c
@@ -973,17 +973,33 @@ void _PR_InitThreads(
     PR_ASSERT(0 == rv);
 }  /* _PR_InitThreads */
 
 #ifdef __GNUC__
 /*
  * GCC supports the constructor and destructor attributes as of
  * version 2.5.
  */
+#if defined(DARWIN)
+/*
+ * The dynamic linker on OSX doesn't execute __attribute__((destructor))
+ * destructors in the right order wrt non-__attribute((destructor)) destructors
+ * in other libraries. So use atexit() instead, which does.
+ * See https://bugzilla.mozilla.org/show_bug.cgi?id=1399746#c99
+ */
+static void _PR_Fini(void);
+
+__attribute__ ((constructor))
+static void _register_PR_Fini() {
+  atexit(_PR_Fini);
+}
+#else
 static void _PR_Fini(void) __attribute__ ((destructor));
+#endif
+
 #elif defined(__SUNPRO_C)
 /*
  * Sun Studio compiler
  */
 #pragma fini(_PR_Fini)
 static void _PR_Fini(void);
 #elif defined(HPUX)
 /*
--- a/nsprpub/pr/tests/prfz.c
+++ b/nsprpub/pr/tests/prfz.c
@@ -5,16 +5,17 @@
 /*
  * This is a simple test of the PR_fprintf() function for size_t formats.
  */
 
 #include "prprf.h"
 #include <sys/types.h>
 #include <limits.h>
 #include <string.h>
+#include <stdint.h>
 
 int
 main(int argc, char **argv)
 {
     char buffer[128];
 
     size_t  unsigned_small  = 266;
 #ifdef XP_UNIX
--- a/nsprpub/pr/tests/vercheck.c
+++ b/nsprpub/pr/tests/vercheck.c
@@ -35,34 +35,34 @@ static char *compatible_version[] = {
     "4.7.6",
     "4.8", "4.8.1", "4.8.2", "4.8.3", "4.8.4", "4.8.5",
     "4.8.6", "4.8.7", "4.8.8", "4.8.9",
     "4.9", "4.9.1", "4.9.2", "4.9.3", "4.9.4", "4.9.5",
     "4.9.6",
     "4.10", "4.10.1", "4.10.2", "4.10.3", "4.10.4",
     "4.10.5", "4.10.6", "4.10.7", "4.10.8", "4.10.9",
     "4.10.10", "4.11", "4.12", "4.13", "4.14", "4.15",
-    "4.16", "4.17",
+    "4.16", "4.17", "4.18",
     PR_VERSION
 };
 
 /*
  * This release is not backward compatible with the old
  * NSPR 2.1 and 3.x releases.
  *
  * Any release is incompatible with future releases and
  * patches.
  */
 static char *incompatible_version[] = {
     "2.1 19980529",
     "3.0", "3.0.1",
     "3.1", "3.1.1", "3.1.2", "3.1.3",
     "3.5", "3.5.1",
-    "4.18.1",
-    "4.19", "4.19.1",
+    "4.19.1",
+    "4.20", "4.20.1",
     "10.0", "11.1", "12.14.20"
 };
 
 int main(int argc, char **argv)
 {
     int idx;
     int num_compatible = sizeof(compatible_version) / sizeof(char *);
     int num_incompatible = sizeof(incompatible_version) / sizeof(char *);