Update NSPR to 4.20

This commit is contained in:
wolfbeast 2018-12-15 01:40:18 +01:00 committed by Roy Tam
commit d5f6e64f43
17 changed files with 198 additions and 14 deletions

View file

@ -1 +0,0 @@
NSPR_4_19_RTM

2
nsprpub/configure vendored
View file

@ -2488,7 +2488,7 @@ test -n "$target_alias" &&
program_prefix=${target_alias}-
MOD_MAJOR_VERSION=4
MOD_MINOR_VERSION=19
MOD_MINOR_VERSION=20
MOD_PATCH_VERSION=0
NSPR_MODNAME=nspr20
_HAVE_PTHREADS=

View file

@ -15,7 +15,7 @@ dnl ========================================================
dnl = Defaults
dnl ========================================================
MOD_MAJOR_VERSION=4
MOD_MINOR_VERSION=19
MOD_MINOR_VERSION=20
MOD_PATCH_VERSION=0
NSPR_MODNAME=nspr20
_HAVE_PTHREADS=
@ -2106,6 +2106,10 @@ tools are selected during the Xcode/Developer Tools installation.])
AC_DEFINE(_AMD64_)
USE_64=1
;;
aarch64)
AC_DEFINE(_ARM64_)
USE_64=1
;;
ia64)
AC_DEFINE(_IA64_)
USE_64=1

View file

@ -95,13 +95,24 @@ struct PLArenaPool {
#if defined(PL_SANITIZE_ADDRESS)
#if defined(_MSC_VER)
/* We can't use dllimport due to DLL linkage mismatch with
* sanitizer/asan_interface.h.
*/
#define PL_ASAN_VISIBILITY(type_) type_
#else
#define PL_ASAN_VISIBILITY(type_) PR_IMPORT(type_)
#endif
/* These definitions are usually provided through the
* sanitizer/asan_interface.h header installed by ASan.
* See https://github.com/google/sanitizers/wiki/AddressSanitizerManualPoisoning
*/
PR_IMPORT(void) __asan_poison_memory_region(void const volatile *addr, size_t size);
PR_IMPORT(void) __asan_unpoison_memory_region(void const volatile *addr, size_t size);
PL_ASAN_VISIBILITY(void) __asan_poison_memory_region(
void const volatile *addr, size_t size);
PL_ASAN_VISIBILITY(void) __asan_unpoison_memory_region(
void const volatile *addr, size_t size);
#define PL_MAKE_MEM_NOACCESS(addr, size) \
__asan_poison_memory_region((addr), (size))

View file

@ -1020,6 +1020,98 @@
#define PR_BYTES_PER_WORD_LOG2 2
#define PR_BYTES_PER_DWORD_LOG2 3
#elif defined(__riscv) && (__riscv_xlen == 32)
#undef IS_BIG_ENDIAN
#define IS_LITTLE_ENDIAN 1
#undef IS_64
#define PR_BYTES_PER_BYTE 1
#define PR_BYTES_PER_SHORT 2
#define PR_BYTES_PER_INT 4
#define PR_BYTES_PER_INT64 8
#define PR_BYTES_PER_LONG 4
#define PR_BYTES_PER_FLOAT 4
#define PR_BYTES_PER_DOUBLE 8
#define PR_BYTES_PER_WORD 4
#define PR_BYTES_PER_DWORD 8
#define PR_BITS_PER_BYTE 8
#define PR_BITS_PER_SHORT 16
#define PR_BITS_PER_INT 32
#define PR_BITS_PER_INT64 64
#define PR_BITS_PER_LONG 32
#define PR_BITS_PER_FLOAT 32
#define PR_BITS_PER_DOUBLE 64
#define PR_BITS_PER_WORD 32
#define PR_BITS_PER_BYTE_LOG2 3
#define PR_BITS_PER_SHORT_LOG2 4
#define PR_BITS_PER_INT_LOG2 5
#define PR_BITS_PER_INT64_LOG2 6
#define PR_BITS_PER_LONG_LOG2 5
#define PR_BITS_PER_FLOAT_LOG2 5
#define PR_BITS_PER_DOUBLE_LOG2 6
#define PR_BITS_PER_WORD_LOG2 5
#define PR_ALIGN_OF_SHORT 2
#define PR_ALIGN_OF_INT 4
#define PR_ALIGN_OF_LONG 4
#define PR_ALIGN_OF_INT64 8
#define PR_ALIGN_OF_FLOAT 4
#define PR_ALIGN_OF_DOUBLE 8
#define PR_ALIGN_OF_POINTER 4
#define PR_ALIGN_OF_WORD 4
#define PR_BYTES_PER_WORD_LOG2 2
#define PR_BYTES_PER_DWORD_LOG2 3
#elif defined(__riscv) && (__riscv_xlen == 64)
#undef IS_BIG_ENDIAN
#define IS_LITTLE_ENDIAN 1
#define IS_64
#define PR_BYTES_PER_BYTE 1
#define PR_BYTES_PER_SHORT 2
#define PR_BYTES_PER_INT 4
#define PR_BYTES_PER_INT64 8
#define PR_BYTES_PER_LONG 8
#define PR_BYTES_PER_FLOAT 4
#define PR_BYTES_PER_DOUBLE 8
#define PR_BYTES_PER_WORD 8
#define PR_BYTES_PER_DWORD 8
#define PR_BITS_PER_BYTE 8
#define PR_BITS_PER_SHORT 16
#define PR_BITS_PER_INT 32
#define PR_BITS_PER_INT64 64
#define PR_BITS_PER_LONG 64
#define PR_BITS_PER_FLOAT 32
#define PR_BITS_PER_DOUBLE 64
#define PR_BITS_PER_WORD 64
#define PR_BITS_PER_BYTE_LOG2 3
#define PR_BITS_PER_SHORT_LOG2 4
#define PR_BITS_PER_INT_LOG2 5
#define PR_BITS_PER_INT64_LOG2 6
#define PR_BITS_PER_LONG_LOG2 6
#define PR_BITS_PER_FLOAT_LOG2 5
#define PR_BITS_PER_DOUBLE_LOG2 6
#define PR_BITS_PER_WORD_LOG2 6
#define PR_ALIGN_OF_SHORT 2
#define PR_ALIGN_OF_INT 4
#define PR_ALIGN_OF_LONG 8
#define PR_ALIGN_OF_INT64 8
#define PR_ALIGN_OF_FLOAT 4
#define PR_ALIGN_OF_DOUBLE 8
#define PR_ALIGN_OF_POINTER 8
#define PR_ALIGN_OF_WORD 8
#define PR_BYTES_PER_WORD_LOG2 3
#define PR_BYTES_PER_DWORD_LOG2 3
#else
#error "Unknown CPU architecture"

View file

@ -57,6 +57,10 @@
#define _PR_SI_ARCHITECTURE "m32r"
#elif defined(__or1k__)
#define _PR_SI_ARCHITECTURE "or1k"
#elif defined(__riscv) && (__riscv_xlen == 32)
#define _PR_SI_ARCHITECTURE "riscv32"
#elif defined(__riscv) && (__riscv_xlen == 64)
#define _PR_SI_ARCHITECTURE "riscv64"
#else
#error "Unknown CPU architecture"
#endif

View file

@ -214,6 +214,55 @@
#define PR_BYTES_PER_WORD_LOG2 2
#define PR_BYTES_PER_DWORD_LOG2 3
#elif defined(_M_ARM64) || defined(_ARM64_)
#define IS_LITTLE_ENDIAN 1
#undef IS_BIG_ENDIAN
#define IS_64
#define PR_BYTES_PER_BYTE 1
#define PR_BYTES_PER_SHORT 2
#define PR_BYTES_PER_INT 4
#define PR_BYTES_PER_INT64 8
#define PR_BYTES_PER_LONG 4
#define PR_BYTES_PER_FLOAT 4
#define PR_BYTES_PER_WORD 8
#define PR_BYTES_PER_DWORD 8
#define PR_BYTES_PER_DOUBLE 8
#define PR_BITS_PER_BYTE 8
#define PR_BITS_PER_SHORT 16
#define PR_BITS_PER_INT 32
#define PR_BITS_PER_INT64 64
#define PR_BITS_PER_LONG 32
#define PR_BITS_PER_FLOAT 32
#define PR_BITS_PER_WORD 64
#define PR_BITS_PER_DWORD 64
#define PR_BITS_PER_DOUBLE 64
#define PR_BITS_PER_BYTE_LOG2 3
#define PR_BITS_PER_SHORT_LOG2 4
#define PR_BITS_PER_INT_LOG2 5
#define PR_BITS_PER_INT64_LOG2 6
#define PR_BITS_PER_LONG_LOG2 5
#define PR_BITS_PER_FLOAT_LOG2 5
#define PR_BITS_PER_WORD_LOG2 6
#define PR_BITS_PER_DWORD_LOG2 6
#define PR_BITS_PER_DOUBLE_LOG2 6
#define PR_ALIGN_OF_SHORT 2
#define PR_ALIGN_OF_INT 4
#define PR_ALIGN_OF_LONG 4
#define PR_ALIGN_OF_INT64 8
#define PR_ALIGN_OF_FLOAT 4
#define PR_ALIGN_OF_WORD 8
#define PR_ALIGN_OF_DWORD 8
#define PR_ALIGN_OF_DOUBLE 8
#define PR_ALIGN_OF_POINTER 8
#define PR_BYTES_PER_WORD_LOG2 3
#define PR_BYTES_PER_DWORD_LOG2 3
#else /* defined(_M_IX86) || defined(_X86_) */
#error unknown processor architecture

View file

@ -26,6 +26,8 @@
#define _PR_SI_ARCHITECTURE "ia64"
#elif defined(_M_ARM) || defined(_ARM_)
#define _PR_SI_ARCHITECTURE "arm"
#elif defined(_M_ARM64)
#define _PR_SI_ARCHITECTURE "aarch64"
#else
#error unknown processor architecture
#endif

View file

@ -31,9 +31,9 @@ PR_BEGIN_EXTERN_C
** The format of the version string is
** "<major version>.<minor version>[.<patch level>] [<Beta>]"
*/
#define PR_VERSION "4.19"
#define PR_VERSION "4.20"
#define PR_VMAJOR 4
#define PR_VMINOR 19
#define PR_VMINOR 20
#define PR_VPATCH 0
#define PR_BETA PR_FALSE

View file

@ -7,6 +7,10 @@
#include <string.h>
#if defined(LINUX)
#include <sys/un.h>
#endif
/*
* On Unix, the error code for gethostbyname() and gethostbyaddr()
* is returned in the global variable h_errno, instead of the usual
@ -1366,7 +1370,17 @@ PRUintn _PR_NetAddrSize(const PRNetAddr* addr)
#endif
#if defined(XP_UNIX) || defined(XP_OS2)
else if (AF_UNIX == addr->raw.family)
addrsize = sizeof(addr->local);
{
#if defined(LINUX)
if (addr->local.path[0] == 0)
/* abstract socket address is supported on Linux only */
addrsize = strnlen(addr->local.path + 1,
sizeof(addr->local.path)) +
offsetof(struct sockaddr_un, sun_path) + 1;
else
#endif
addrsize = sizeof(addr->local);
}
#endif
else addrsize = 0;

View file

@ -1750,7 +1750,12 @@ static PRStatus pt_Bind(PRFileDesc *fd, const PRNetAddr *addr)
if (addr->raw.family == AF_UNIX)
{
/* Disallow relative pathnames */
if (addr->local.path[0] != '/')
if (addr->local.path[0] != '/'
#if defined(LINUX)
/* Linux has abstract socket address support */
&& addr->local.path[0] != 0
#endif
)
{
PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
return PR_FAILURE;

View file

@ -911,7 +911,8 @@ PR_IMPLEMENT(PRStatus) PR_DeleteSemaphore(const char *name)
* From the semctl(2) man page in glibc 2.0
*/
#if (defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)) \
|| defined(FREEBSD) || defined(OPENBSD) || defined(BSDI) \
|| (defined(FREEBSD) && __FreeBSD_version < 1200059) \
|| defined(OPENBSD) || defined(BSDI) \
|| defined(DARWIN) || defined(SYMBIAN)
/* union semun is defined by including <sys/sem.h> */
#else

View file

@ -18,6 +18,7 @@ include $(topsrcdir)/config/config.mk
DIRS = dll
CSRCS = \
abstract.c \
accept.c \
acceptread.c \
acceptreademu.c \

View file

@ -241,6 +241,7 @@ $prog = shift; # Program to test
# MAIN ---------------
@progs = (
"abstract",
"accept",
"acceptread",
"acceptreademu",

View file

@ -71,6 +71,7 @@ LOGFILE=${NSPR_TEST_LOGFILE:-$NULL_DEVICE}
#
TESTS="
abstract
accept
acceptread
acceptreademu

View file

@ -40,7 +40,7 @@ static char *compatible_version[] = {
"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.18",
"4.16", "4.17", "4.18", "4.19",
PR_VERSION
};
@ -56,8 +56,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.19.1",
"4.20", "4.20.1",
"4.20.1",
"4.21", "4.21.1",
"10.0", "11.1", "12.14.20"
};

View file

@ -48,7 +48,7 @@ dnl ========================================================
MOZJPEG=62
MOZPNG=10625
NSPR_VERSION=4
NSPR_MINVER=4.19
NSPR_MINVER=4.20
NSS_VERSION=3
dnl Set the minimum version of toolkit libs used by mozilla