Bug 1350291, uplift NSPR_4_15_BETA, r=franziskus

This commit is contained in:
Kai Engert 2017-03-24 14:58:00 +01:00
Родитель 5538389cd0
Коммит dde6d304aa
15 изменённых файлов: 191 добавлений и 64 удалений

Просмотреть файл

@ -1 +1 @@
NSPR_4_14_RTM
NSPR_4_15_BETA1

Просмотреть файл

@ -10,4 +10,3 @@
*/
#error "Do not include this header file."

40
nsprpub/configure поставляемый
Просмотреть файл

@ -2488,7 +2488,7 @@ test -n "$target_alias" &&
program_prefix=${target_alias}-
MOD_MAJOR_VERSION=4
MOD_MINOR_VERSION=14
MOD_MINOR_VERSION=15
MOD_PATCH_VERSION=0
NSPR_MODNAME=nspr20
_HAVE_PTHREADS=
@ -5424,6 +5424,40 @@ $as_echo "no" >&6; }
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pragma diagnostic" >&5
$as_echo_n "checking for pragma diagnostic... " >&6; }
if test "$GNU_CC" = "1"; then
cat >dummy-hello.c <<EOF
#ifdef _PR_HAS_PRAGMA_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif
int main() {
char *dummy = "";
return 0;
}
EOF
${CC} -Werror=unused-but-set-variable -S dummy-hello.c -o dummy-hello.s 2>&5
if test $? != 0; then
${CC} -Werror=unused-but-set-variable -D_PR_HAS_PRAGMA_DIAGNOSTIC -S dummy-hello.c -o dummy-hello.s 2>&5
if test $? = 0; then
CFLAGS="$CFLAGS -D_PR_HAS_PRAGMA_DIAGNOSTIC=1"
_res=yes
else
_res=no
fi
else
_res=no
fi
rm -f dummy-hello.c dummy-hello.s
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_res" >&5
$as_echo "$_res" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
_SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction"
@ -6524,6 +6558,8 @@ fi
$as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
$as_echo "#define HAVE_POINTER_LOCALTIME_R 1" >>confdefs.h
AS='$(CC) -x assembler-with-cpp'
CFLAGS="$CFLAGS -Wall -fno-common"
case "${target_cpu}" in
@ -6975,6 +7011,8 @@ tools are selected during the Xcode/Developer Tools installation." "$LINENO" 5
$as_echo "#define HAVE_FCNTL_FILE_LOCKING 1" >>confdefs.h
$as_echo "#define HAVE_POINTER_LOCALTIME_R 1" >>confdefs.h
case "${target}" in
*-android*|*-linuxandroid*)
OS_TARGET=Android

Просмотреть файл

@ -15,7 +15,7 @@ dnl ========================================================
dnl = Defaults
dnl ========================================================
MOD_MAJOR_VERSION=4
MOD_MINOR_VERSION=14
MOD_MINOR_VERSION=15
MOD_PATCH_VERSION=0
NSPR_MODNAME=nspr20
_HAVE_PTHREADS=
@ -715,6 +715,40 @@ else
AC_MSG_RESULT([no])
fi
dnl ========================================================
dnl Check for pragma diagnostic
dnl ========================================================
AC_MSG_CHECKING([for pragma diagnostic])
if test "$GNU_CC" = "1"; then
cat >dummy-hello.c <<EOF
#ifdef _PR_HAS_PRAGMA_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif
int main() {
char *dummy = "";
return 0;
}
EOF
${CC} -Werror=unused-but-set-variable -S dummy-hello.c -o dummy-hello.s 2>&5
if test $? != 0; then
${CC} -Werror=unused-but-set-variable -D_PR_HAS_PRAGMA_DIAGNOSTIC -S dummy-hello.c -o dummy-hello.s 2>&5
if test $? = 0; then
CFLAGS="$CFLAGS -D_PR_HAS_PRAGMA_DIAGNOSTIC=1"
_res=yes
else
_res=no
fi
else
_res=no
fi
rm -f dummy-hello.c dummy-hello.s
AC_MSG_RESULT([$_res])
else
AC_MSG_RESULT([no])
fi
dnl ========================================================
dnl Profile guided optimization
dnl ========================================================
@ -1349,6 +1383,7 @@ case "$target" in
AC_DEFINE(DARWIN)
AC_DEFINE(HAVE_BSD_FLOCK)
AC_DEFINE(HAVE_SOCKLEN_T)
AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
AS='$(CC) -x assembler-with-cpp'
CFLAGS="$CFLAGS -Wall -fno-common"
case "${target_cpu}" in
@ -1789,6 +1824,7 @@ tools are selected during the Xcode/Developer Tools installation.])
AC_DEFINE(XP_UNIX)
AC_DEFINE(_GNU_SOURCE)
AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
case "${target}" in
*-android*|*-linuxandroid*)
OS_TARGET=Android

Просмотреть файл

@ -74,6 +74,10 @@ static char sccsid[] = "@(#)NSPR " PR_VERSION _DEBUG_STRING
#endif /* XP_UNIX */
#ifdef _PR_HAS_PRAGMA_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif
PR_IMPLEMENT(const PRVersionDescription*) libVersionPoint()
{
#ifdef XP_UNIX
@ -88,6 +92,9 @@ PR_IMPLEMENT(const PRVersionDescription*) libVersionPoint()
#endif
return &VERSION_DESC_NAME;
} /* versionEntryPointType */
#ifdef _PR_HAS_PRAGMA_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
/* plvrsion.c */

Просмотреть файл

@ -74,6 +74,10 @@ static char sccsid[] = "@(#)NSPR " PR_VERSION _DEBUG_STRING
#endif /* XP_UNIX */
#ifdef _PR_HAS_PRAGMA_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif
PR_IMPLEMENT(const PRVersionDescription*) libVersionPoint()
{
#ifdef XP_UNIX
@ -88,6 +92,9 @@ PR_IMPLEMENT(const PRVersionDescription*) libVersionPoint()
#endif
return &VERSION_DESC_NAME;
} /* versionEntryPointType */
#ifdef _PR_HAS_PRAGMA_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
/* plvrsion.c */

Просмотреть файл

@ -74,6 +74,10 @@ static char sccsid[] = "@(#)NSPR " PR_VERSION _DEBUG_STRING
#endif /* XP_UNIX */
#ifdef _PR_HAS_PRAGMA_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif
PR_IMPLEMENT(const PRVersionDescription*) libVersionPoint()
{
#ifdef XP_UNIX
@ -88,6 +92,9 @@ PR_IMPLEMENT(const PRVersionDescription*) libVersionPoint()
#endif
return &VERSION_DESC_NAME;
} /* versionEntryPointType */
#ifdef _PR_HAS_PRAGMA_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
/* plvrsion.c */

Просмотреть файл

@ -31,11 +31,11 @@ PR_BEGIN_EXTERN_C
** The format of the version string is
** "<major version>.<minor version>[.<patch level>] [<Beta>]"
*/
#define PR_VERSION "4.14"
#define PR_VERSION "4.15 Beta"
#define PR_VMAJOR 4
#define PR_VMINOR 14
#define PR_VMINOR 15
#define PR_VPATCH 0
#define PR_BETA PR_FALSE
#define PR_BETA PR_TRUE
/*
** PRVersionCheck

Просмотреть файл

@ -652,9 +652,11 @@ retry:
if ((NULL != names) && (identity < length))
{
/* what we did is still okay */
memcpy(
names, identity_cache.name,
identity_cache.length * sizeof(char*));
if (identity_cache.length != 0) {
memcpy(
names, identity_cache.name,
identity_cache.length * sizeof(char*));
}
old = identity_cache.name;
identity_cache.name = names;
identity_cache.length = length;

Просмотреть файл

@ -177,19 +177,21 @@ pr_inet_aton(const char *cp, PRUint32 *addr)
case 2: /*%< a.b -- 8.24 bits */
if (val > 0xffffffU)
return (0);
val |= parts[0] << 24;
val |= (unsigned int)parts[0] << 24;
break;
case 3: /*%< a.b.c -- 8.8.16 bits */
if (val > 0xffffU)
return (0);
val |= (parts[0] << 24) | (parts[1] << 16);
val |= ((unsigned int)parts[0] << 24) | ((unsigned int)parts[1] << 16);
break;
case 4: /*%< a.b.c.d -- 8.8.8.8 bits */
if (val > 0xffU)
return (0);
val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
val |= ((unsigned int)parts[0] << 24) |
((unsigned int)parts[1] << 16) |
((unsigned int)parts[2] << 8);
break;
}
*addr = PR_htonl(val);

Просмотреть файл

@ -1405,7 +1405,7 @@ PR_IMPLEMENT(PRStatus) PR_InitializeNetAddr(
PRStatus rv = PR_SUCCESS;
if (!_pr_initialized) _PR_ImplicitInitialization();
if (val != PR_IpAddrNull) memset(addr, 0, sizeof(addr->inet));
if (val != PR_IpAddrNull) memset(addr, 0, sizeof(*addr));
addr->inet.family = AF_INET;
addr->inet.port = htons(port);
switch (val)
@ -1777,18 +1777,12 @@ PR_IMPLEMENT(PRUint64) PR_ntohll(PRUint64 n)
#ifdef IS_BIG_ENDIAN
return n;
#else
PRUint64 tmp;
PRUint32 hi, lo;
LL_L2UI(lo, n);
LL_SHR(tmp, n, 32);
LL_L2UI(hi, tmp);
lo = (PRUint32)n;
hi = (PRUint32)(n >> 32);
hi = PR_ntohl(hi);
lo = PR_ntohl(lo);
LL_UI2L(n, lo);
LL_SHL(n, n, 32);
LL_UI2L(tmp, hi);
LL_ADD(n, n, tmp);
return n;
return ((PRUint64)lo << 32) + (PRUint64)hi;
#endif
} /* ntohll */
@ -1797,18 +1791,12 @@ PR_IMPLEMENT(PRUint64) PR_htonll(PRUint64 n)
#ifdef IS_BIG_ENDIAN
return n;
#else
PRUint64 tmp;
PRUint32 hi, lo;
LL_L2UI(lo, n);
LL_SHR(tmp, n, 32);
LL_L2UI(hi, tmp);
lo = (PRUint32)n;
hi = (PRUint32)(n >> 32);
hi = htonl(hi);
lo = htonl(lo);
LL_UI2L(n, lo);
LL_SHL(n, n, 32);
LL_UI2L(tmp, hi);
LL_ADD(n, n, tmp);
return n;
return ((PRUint64)lo << 32) + (PRUint64)hi;
#endif
} /* htonll */

Просмотреть файл

@ -495,6 +495,20 @@ PR_NormalizeTime(PRExplodedTime *time, PRTimeParamFn params)
#define MT_safe_localtime localtime_r
#elif defined(_MSC_VER)
/* Visual C++ has had localtime_s() since Visual C++ 2005. */
static struct tm *MT_safe_localtime(const time_t *clock, struct tm *result)
{
errno_t err = localtime_s(result, clock);
if (err != 0) {
errno = err;
return NULL;
}
return result;
}
#else
#define HAVE_LOCALTIME_MONITOR 1 /* We use 'monitor' to serialize our calls
@ -580,6 +594,7 @@ PR_LocalTimeParameters(const PRExplodedTime *gmt)
PRTimeParameters retVal;
struct tm localTime;
struct tm *localTimeResult;
time_t secs;
PRTime secs64;
PRInt64 usecPerSec;
@ -606,7 +621,12 @@ PR_LocalTimeParameters(const PRExplodedTime *gmt)
*/
secs = 86400L;
(void) MT_safe_localtime(&secs, &localTime);
localTimeResult = MT_safe_localtime(&secs, &localTime);
PR_ASSERT(localTimeResult != NULL);
if (localTimeResult == NULL) {
/* Shouldn't happen. Use safe fallback for optimized builds. */
return PR_GMTParameters(gmt);
}
/* GMT is 00:00:00, 2nd of Jan. */
@ -957,6 +977,7 @@ PR_ParseTimeStringToExplodedTime(
int hour = -1;
int min = -1;
int sec = -1;
struct tm *localTimeResult;
const char *rest = string;
@ -1618,7 +1639,11 @@ PR_ParseTimeStringToExplodedTime(
zone_offset for the date we are parsing is the same as
the zone offset on 00:00:00 2 Jan 1970 GMT. */
secs = 86400;
(void) MT_safe_localtime(&secs, &localTime);
localTimeResult = MT_safe_localtime(&secs, &localTime);
PR_ASSERT(localTimeResult != NULL);
if (localTimeResult == NULL) {
return PR_FAILURE;
}
zone_offset = localTime.tm_min
+ 60 * localTime.tm_hour
+ 1440 * (localTime.tm_mday - 2);

Просмотреть файл

@ -74,6 +74,10 @@ static char sccsid[] = "@(#)NSPR " PR_VERSION _DEBUG_STRING
#endif /* XP_UNIX */
#ifdef _PR_HAS_PRAGMA_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif
PR_IMPLEMENT(const PRVersionDescription*) libVersionPoint(void)
{
#ifdef XP_UNIX
@ -88,6 +92,9 @@ PR_IMPLEMENT(const PRVersionDescription*) libVersionPoint(void)
#endif
return &VERSION_DESC_NAME;
} /* versionEntryPointType */
#ifdef _PR_HAS_PRAGMA_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
/* prvrsion.c */

Просмотреть файл

@ -1542,23 +1542,26 @@ static PRStatus pt_Connect(
pt_SockLen addr_len;
const PRNetAddr *addrp = addr;
#if defined(_PR_HAVE_SOCKADDR_LEN) || defined(_PR_INET6)
PRUint16 md_af = addr->raw.family;
PRNetAddr addrCopy;
#endif
#ifdef _PR_HAVE_SOCKADDR_LEN
PRUint16 md_af = addr->raw.family;
#endif
if (pt_TestAbort()) return PR_FAILURE;
PR_ASSERT(IsValidNetAddr(addr) == PR_TRUE);
addr_len = PR_NETADDR_SIZE(addr);
#if defined(_PR_INET6)
if (addr->raw.family == PR_AF_INET6) {
md_af = AF_INET6;
#ifndef _PR_HAVE_SOCKADDR_LEN
addrCopy = *addr;
addrCopy.raw.family = AF_INET6;
addrp = &addrCopy;
#ifdef _PR_INET6
if (addr->raw.family == PR_AF_INET6) {
#ifdef _PR_HAVE_SOCKADDR_LEN
md_af = AF_INET6;
#else
addrCopy = *addr;
addrCopy.raw.family = AF_INET6;
addrp = &addrCopy;
#endif
}
}
#endif
#ifdef _PR_HAVE_SOCKADDR_LEN
@ -1732,9 +1735,11 @@ static PRStatus pt_Bind(PRFileDesc *fd, const PRNetAddr *addr)
pt_SockLen addr_len;
const PRNetAddr *addrp = addr;
#if defined(_PR_HAVE_SOCKADDR_LEN) || defined(_PR_INET6)
PRUint16 md_af = addr->raw.family;
PRNetAddr addrCopy;
#endif
#ifdef _PR_HAVE_SOCKADDR_LEN
PRUint16 md_af = addr->raw.family;
#endif
if (pt_TestAbort()) return PR_FAILURE;
@ -1749,15 +1754,16 @@ static PRStatus pt_Bind(PRFileDesc *fd, const PRNetAddr *addr)
}
}
#if defined(_PR_INET6)
if (addr->raw.family == PR_AF_INET6) {
md_af = AF_INET6;
#ifndef _PR_HAVE_SOCKADDR_LEN
addrCopy = *addr;
addrCopy.raw.family = AF_INET6;
addrp = &addrCopy;
#ifdef _PR_INET6
if (addr->raw.family == PR_AF_INET6) {
#ifdef _PR_HAVE_SOCKADDR_LEN
md_af = AF_INET6;
#else
addrCopy = *addr;
addrCopy.raw.family = AF_INET6;
addrp = &addrCopy;
#endif
}
}
#endif
addr_len = PR_NETADDR_SIZE(addr);
@ -1989,22 +1995,25 @@ static PRInt32 pt_SendTo(
pt_SockLen addr_len;
const PRNetAddr *addrp = addr;
#if defined(_PR_HAVE_SOCKADDR_LEN) || defined(_PR_INET6)
PRUint16 md_af = addr->raw.family;
PRNetAddr addrCopy;
#endif
#ifdef _PR_HAVE_SOCKADDR_LEN
PRUint16 md_af = addr->raw.family;
#endif
if (pt_TestAbort()) return bytes;
PR_ASSERT(IsValidNetAddr(addr) == PR_TRUE);
#if defined(_PR_INET6)
if (addr->raw.family == PR_AF_INET6) {
md_af = AF_INET6;
#ifndef _PR_HAVE_SOCKADDR_LEN
addrCopy = *addr;
addrCopy.raw.family = AF_INET6;
addrp = &addrCopy;
#ifdef _PR_INET6
if (addr->raw.family == PR_AF_INET6) {
#ifdef _PR_HAVE_SOCKADDR_LEN
md_af = AF_INET6;
#else
addrCopy = *addr;
addrCopy.raw.family = AF_INET6;
addrp = &addrCopy;
#endif
}
}
#endif
addr_len = PR_NETADDR_SIZE(addr);

Просмотреть файл

@ -39,7 +39,7 @@ static char *compatible_version[] = {
"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.10.10", "4.11", "4.12", "4.13", "4.14"
PR_VERSION
};
@ -55,8 +55,8 @@ static char *incompatible_version[] = {
"3.0", "3.0.1",
"3.1", "3.1.1", "3.1.2", "3.1.3",
"3.5", "3.5.1",
"4.14.1",
"4.15", "4.15.1",
"4.15.1",
"4.16", "4.16.1",
"10.0", "11.1", "12.14.20"
};