Skip to content

Commit

Permalink
Bug 639191: update NSPR to NSPR_4_8_8_BETA2. Include fixes
Browse files Browse the repository at this point in the history
for bug 546535, bug 587426, bug 622425, bug 624868,
bug 626035 (attachment 504094 only), bug 626309, bug 627299,
bug 629653, bug 635667.
  • Loading branch information
wantehchang committed Mar 26, 2011
1 parent eb31aa5 commit c8af169
Show file tree
Hide file tree
Showing 19 changed files with 475 additions and 318 deletions.
2 changes: 1 addition & 1 deletion nsprpub/TAG-INFO
Original file line number Diff line number Diff line change
@@ -1 +1 @@
NSPR_4_8_7_RTM
NSPR_4_8_8_BETA2
8 changes: 4 additions & 4 deletions nsprpub/admin/repackage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@
#
# ------------------------------------------------------------------

FROMTOP=/share/builds/components/nspr20/v4.8.7
TOTOP=./v4.8.7
NSPRDIR=nspr-4.8.7
SOURCETAG=NSPR_4_8_7_RTM
FROMTOP=/share/builds/components/nspr20/v4.8.8
TOTOP=./v4.8.8
NSPRDIR=nspr-4.8.8
SOURCETAG=NSPR_4_8_8_RTM

#
# enumerate Unix object directories on /s/b/c
Expand Down
1 change: 0 additions & 1 deletion nsprpub/config/prdepend.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,3 @@
*/

#error "Do not include this header file."

16 changes: 8 additions & 8 deletions nsprpub/configure
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ ac_help="$ac_help
ac_help="$ac_help
--disable-os2-high-mem Disable high-memory support on OS/2"
ac_help="$ac_help
--enable-thumb2 Enable Thumb2 instruction set"
--enable-thumb2 Enable Thumb-2 instruction set"
ac_help="$ac_help
--with-symbian-sdk=SYMBIAN_SDK_DIR
The path to the Symbian SDK"
Expand Down Expand Up @@ -713,7 +713,7 @@ test "$host_alias" != "$target_alias" &&

MOD_MAJOR_VERSION=4
MOD_MINOR_VERSION=8
MOD_PATCH_VERSION=7
MOD_PATCH_VERSION=8
NSPR_MODNAME=nspr20
_HAVE_PTHREADS=
USE_PTHREADS=
Expand Down Expand Up @@ -3101,8 +3101,8 @@ if test -n "$MOZ_THUMB2"; then
case "$target_cpu" in
arm*)
if test "$GNU_CC"; then
CFLAGS="$CFLAGS -march=armv7-a -mthumb -Wa, -march=armv7-a -Wa, -mthumb"
CXXFLAGS="$CXXFLAGS -march=armv7-a -mthumb -Wa, -march=armv7-a -Wa, -mthumb"
CFLAGS="$CFLAGS -march=armv7-a -mthumb"
CXXFLAGS="$CXXFLAGS -march=armv7-a -mthumb"
ASFLAGS="$ASFLAGS -march=armv7-a -mthumb"
else
{ echo "configure: error: --enable-thumb2 is not supported for non-GNU toolchains" 1>&2; exit 1; }
Expand All @@ -3113,11 +3113,11 @@ if test -n "$MOZ_THUMB2"; then
;;
esac
else
case "$target_cpu" in
arm*)
case "$target" in
arm-android-eabi)
if test "$GNU_CC"; then
CFLAGS="$CFLAGS -march=armv5te -mthumb-interwork -Wa, -march=armv5te -Wa, -mthumb-interwork"
CXXFLAGS="$CXXFLAGS -march=armv5te -mthumb-interwork -Wa, -march=armv5te -Wa, -mthumb-interwork"
CFLAGS="$CFLAGS -march=armv5te -mthumb-interwork"
CXXFLAGS="$CXXFLAGS -march=armv5te -mthumb-interwork"
ASFLAGS="$ASFLAGS -march=armv5te -mthumb-interwork"
fi
;;
Expand Down
16 changes: 8 additions & 8 deletions nsprpub/configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ dnl = Defaults
dnl ========================================================
MOD_MAJOR_VERSION=4
MOD_MINOR_VERSION=8
MOD_PATCH_VERSION=7
MOD_PATCH_VERSION=8
NSPR_MODNAME=nspr20
_HAVE_PTHREADS=
USE_PTHREADS=
Expand Down Expand Up @@ -916,7 +916,7 @@ dnl ========================================================
dnl = Enable building the Thumb2 instruction set
dnl ========================================================
AC_ARG_ENABLE(thumb2,
[ --enable-thumb2 Enable Thumb2 instruction set],
[ --enable-thumb2 Enable Thumb-2 instruction set],
[ if test "$enableval" = "yes"; then
MOZ_THUMB2=1,
fi ])
Expand All @@ -925,8 +925,8 @@ if test -n "$MOZ_THUMB2"; then
case "$target_cpu" in
arm*)
if test "$GNU_CC"; then
CFLAGS="$CFLAGS -march=armv7-a -mthumb -Wa, -march=armv7-a -Wa, -mthumb"
CXXFLAGS="$CXXFLAGS -march=armv7-a -mthumb -Wa, -march=armv7-a -Wa, -mthumb"
CFLAGS="$CFLAGS -march=armv7-a -mthumb"
CXXFLAGS="$CXXFLAGS -march=armv7-a -mthumb"
ASFLAGS="$ASFLAGS -march=armv7-a -mthumb"
else
AC_MSG_ERROR([--enable-thumb2 is not supported for non-GNU toolchains])
Expand All @@ -937,11 +937,11 @@ if test -n "$MOZ_THUMB2"; then
;;
esac
else
case "$target_cpu" in
arm*)
case "$target" in
arm-android-eabi)
if test "$GNU_CC"; then
CFLAGS="$CFLAGS -march=armv5te -mthumb-interwork -Wa, -march=armv5te -Wa, -mthumb-interwork"
CXXFLAGS="$CXXFLAGS -march=armv5te -mthumb-interwork -Wa, -march=armv5te -Wa, -mthumb-interwork"
CFLAGS="$CFLAGS -march=armv5te -mthumb-interwork"
CXXFLAGS="$CXXFLAGS -march=armv5te -mthumb-interwork"
ASFLAGS="$ASFLAGS -march=armv5te -mthumb-interwork"
fi
;;
Expand Down
4 changes: 2 additions & 2 deletions nsprpub/lib/ds/plarena.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ PR_IMPLEMENT(void) PL_ArenaRelease(PLArenaPool *pool, char *mark)
{
PLArena *a;

for (a = pool->first.next; a; a = a->next) {
if (PR_UPTRDIFF(mark, a->base) < PR_UPTRDIFF(a->avail, a->base)) {
for (a = &pool->first; a; a = a->next) {
if (PR_UPTRDIFF(mark, a->base) <= PR_UPTRDIFF(a->avail, a->base)) {
a->avail = (PRUword)PL_ARENA_ALIGN(pool, mark);
FreeArenaList(pool, a, PR_FALSE);
return;
Expand Down
24 changes: 24 additions & 0 deletions nsprpub/pr/include/md/_hpux.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,30 @@ extern PRInt32 _PR_ia64_AtomicSet(PRInt32 *val, PRInt32 newval);
#define _PR_HAVE_INET_NTOP
#else
#define _PR_INET6_PROBE

/* for HP-UX 11.11 without IPv6 */
#ifndef AF_INET6
#define AF_INET6 22
#define AI_CANONNAME 2
#define AI_NUMERICHOST 4
#define AI_NUMERICSERV 8
#define AI_V4MAPPED 0x00000010
#define AI_ADDRCONFIG 0x00000040
#define AI_ALL 0x00000020
#define AI_DEFAULT (AI_V4MAPPED|AI_ADDRCONFIG)
#define NI_NUMERICHOST 2
struct addrinfo {
int ai_flags; /* AI_PASSIVE, AI_CANONNAME */
int ai_family; /* PF_xxx */
int ai_socktype; /* SOCK_xxx */
int ai_protocol; /* IPPROTO_xxx for IPv4 and IPv6 */
socklen_t ai_addrlen; /* length of ai_addr */
char *ai_canonname; /* canonical name for host */
struct sockaddr *ai_addr; /* binary address */
struct addrinfo *ai_next; /* next structure in linked list */
};
#endif /* for HP-UX 11.11 without IPv6 */

#define _PR_HAVE_MD_SOCKADDR_IN6
/* isomorphic to struct in6_addr on HP-UX B.11.23 */
struct _md_in6_addr {
Expand Down
45 changes: 45 additions & 0 deletions nsprpub/pr/include/md/_linux.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,51 @@
#define PR_BYTES_PER_WORD_LOG2 2
#define PR_BYTES_PER_DWORD_LOG2 3

#elif defined(__m32r__)

#undef IS_LITTLE_ENDIAN
#define IS_BIG_ENDIAN 1

#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 4
#define PR_ALIGN_OF_FLOAT 4
#define PR_ALIGN_OF_DOUBLE 4
#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

#else

#error "Unknown CPU architecture"
Expand Down
33 changes: 30 additions & 3 deletions nsprpub/pr/include/md/_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
#define _PR_SI_ARCHITECTURE "sh"
#elif defined(__avr32__)
#define _PR_SI_ARCHITECTURE "avr32"
#elif defined(__m32r__)
#define _PR_SI_ARCHITECTURE "m32r"
#else
#error "Unknown CPU architecture"
#endif
Expand Down Expand Up @@ -216,7 +218,18 @@ extern PRInt32 _PR_ppc_AtomicSet(PRInt32 *val, PRInt32 newval);
})
#endif

#if defined(__arm__) && defined(_PR_ARM_KUSER)
#if defined(__arm__)
#if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
/* Use GCC built-in functions */
#define _PR_HAVE_ATOMIC_OPS
#define _MD_INIT_ATOMIC()

#define _MD_ATOMIC_INCREMENT(ptr) __sync_add_and_fetch(ptr, 1)
#define _MD_ATOMIC_DECREMENT(ptr) __sync_sub_and_fetch(ptr, 1)
#define _MD_ATOMIC_SET(ptr, nv) __sync_lock_test_and_set(ptr, nv)
#define _MD_ATOMIC_ADD(ptr, i) __sync_add_and_fetch(ptr, i)

#elif defined(_PR_ARM_KUSER)
#define _PR_HAVE_ATOMIC_OPS
#define _MD_INIT_ATOMIC()

Expand Down Expand Up @@ -259,16 +272,18 @@ static inline PRInt32 _MD_ATOMIC_SET(PRInt32 *ptr, PRInt32 nv)
return ov;
}
#endif
#endif /* __arm__ */

#define USE_SETJMP
#if defined(__GLIBC__) && __GLIBC__ >= 2
#if (defined(__GLIBC__) && __GLIBC__ >= 2) || defined(ANDROID)
#define _PR_POLL_AVAILABLE
#endif
#undef _PR_USE_POLL
#define _PR_STAT_HAS_ONLY_ST_ATIME
#if defined(__alpha) || defined(__ia64__)
#define _PR_HAVE_LARGE_OFF_T
#elif (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1)
#elif (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) \
|| defined(ANDROID)
#define _PR_HAVE_OFF64_T
#else
#define _PR_NO_LARGE_FILES
Expand Down Expand Up @@ -459,6 +474,18 @@ extern void _MD_CleanupBeforeExit(void);
#error "SH/Linux pre-glibc2 not supported yet"
#endif /* defined(__GLIBC__) && __GLIBC__ >= 2 */

#elif defined(__m32r__)
/* Linux/M32R */
#if defined(__GLIBC__) && __GLIBC__ >= 2
#define _MD_GET_SP(_t) (_t)->md.context[0].__jmpbuf[0].__regs[JB_SP]
#define _MD_SET_FP(_t, val) ((_t)->md.context[0].__jmpbuf[0].__regs[JB_FP] = (val))
#define _MD_GET_SP_PTR(_t) &(_MD_GET_SP(_t))
#define _MD_GET_FP_PTR(_t) (&(_t)->md.context[0].__jmpbuf[0].__regs[JB_FP])
#define _MD_SP_TYPE __ptr_t
#else
#error "Linux/M32R pre-glibc2 not supported yet"
#endif /* defined(__GLIBC__) && __GLIBC__ >= 2 */

#else

#error "Unknown CPU architecture"
Expand Down
2 changes: 2 additions & 0 deletions nsprpub/pr/include/pratom.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ long __cdecl _InterlockedExchangeAdd(long volatile *Addend, long Value);
defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)) || \
defined(__ia64__) || defined(__x86_64__) || \
(defined(__powerpc__) && !defined(__powerpc64__)) || \
(defined(__arm__) && \
defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)) || \
defined(__alpha))))

/*
Expand Down
6 changes: 3 additions & 3 deletions nsprpub/pr/include/prinit.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ PR_BEGIN_EXTERN_C
** The format of the version string is
** "<major version>.<minor version>[.<patch level>] [<Beta>]"
*/
#define PR_VERSION "4.8.7"
#define PR_VERSION "4.8.8 Beta"
#define PR_VMAJOR 4
#define PR_VMINOR 8
#define PR_VPATCH 7
#define PR_BETA PR_FALSE
#define PR_VPATCH 8
#define PR_BETA PR_TRUE

/*
** PRVersionCheck
Expand Down
Loading

0 comments on commit c8af169

Please sign in to comment.