Brought the NSPRPUB_PRE_4_2_CLIENT_BRANCH in synch with the NSPR trunk. NSPRPUB_PRE_4_2_CLIENT_BRANCH
authorwtc%netscape.com
Tue, 07 Jan 2003 15:30:26 +0000
branchNSPRPUB_PRE_4_2_CLIENT_BRANCH
changeset 2630 e911dc208f84c02d69567e87839e614cf8a4a4e4
parent 2628 8989926541e7723847fd9f3195939ac6fedf5655
child 2631 f8b7b93c32979a79dd7fb124b1e893fcbc1aceb5
push idunknown
push userunknown
push dateunknown
Brought the NSPRPUB_PRE_4_2_CLIENT_BRANCH in synch with the NSPR trunk.
Makefile.in
admin/repackage.sh
config/autoconf.mk.in
config/module.df
config/rules.mk
configure
configure.in
lib/ds/Makefile.in
lib/libc/src/Makefile.in
pr/include/md/_pth.h
pr/include/prcountr.h
pr/include/prinit.h
pr/include/private/primpl.h
pr/include/prolock.h
pr/include/prtrace.h
pr/src/Makefile.in
pr/src/io/prio.c
pr/src/io/prprf.c
pr/src/md/mac/macio.c
pr/src/md/unix/Makefile.in
pr/src/misc/Makefile.in
pr/src/misc/pralarm.c
pr/src/misc/prcountr.c
pr/src/misc/prdtoa.c
pr/src/misc/prnetdb.c
pr/src/misc/prolock.c
pr/src/misc/prtrace.c
pr/src/pthreads/ptio.c
pr/src/threads/prcthr.c
pr/tests/vercheck.c
--- a/Makefile.in
+++ b/Makefile.in
@@ -137,10 +137,14 @@ endif
 	chmod 664 $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/imports.df; \
 	cd $(OBJDIR_NAME); \
 	cp -f mdbinary.jar $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME); \
 	chmod 664 $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME)/mdbinary.jar; \
 	cd include; \
 	cp -f mdheader.jar $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME); \
 	chmod 664 $(MDIST)/$(MOD_NAME)/$(BUILD_NUMBER)/$(RELEASE_OBJDIR_NAME)/mdheader.jar
 
+solarispkg:
+	@echo Making Solaris packages.
+	$(MAKE) -C pkg/solaris publish
+
 depend:
 	@echo "NSPR20 has no dependencies.  Skipped."
--- a/admin/repackage.sh
+++ b/admin/repackage.sh
@@ -55,20 +55,20 @@
 # 
 # 
 # 
 # 
 # ------------------------------------------------------------------
 #
 # These variables should be modified for each NSPR release.
 #
-FROMTOP=/share/builds/components/nspr20/v4.2.1
-TOTOP=./v4.2.1
-NSPRDIR=nspr-4.2.1
-SOURCETAG=NSPR_4_2_1_RELEASE
+FROMTOP=/share/builds/components/nspr20/v4.3
+TOTOP=./v4.3
+NSPRDIR=nspr-4.3
+SOURCETAG=NSPR_4_3_RELEASE
 
 #
 # enumerate Unix object directories on /s/b/c
 UNIX_OBJDIRS="
 AIX4.3_64_DBG.OBJ
 AIX4.3_64_OPT.OBJ
 AIX4.3_DBG.OBJ
 AIX4.3_OPT.OBJ
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -100,14 +100,13 @@ OS_TARGET	= @OS_TARGET@
 OS_ARCH		= @OS_ARCH@
 OS_RELEASE	= @OS_RELEASE@
 OS_TEST		= @OS_TEST@
 
 NOSUCHFILE	= @NOSUCHFILE@
 AIX_LINK_OPTS	= @AIX_LINK_OPTS@
 MOZ_OBJFORMAT	= @MOZ_OBJFORMAT@
 ULTRASPARC_LIBRARY = @ULTRASPARC_LIBRARY@
-ULTRASPARC_FILTER_LIBRARY = @ULTRASPARC_FILTER_LIBRARY@
 
 OBJECT_MODE	= @OBJECT_MODE@
 ifdef OBJECT_MODE
 export OBJECT_MODE
 endif
--- a/config/module.df
+++ b/config/module.df
@@ -31,10 +31,12 @@
 # GPL.
 # 
 
 # 
 # Module description file
 #
 # A module is also called a component or a subsystem.
 
-MOD_NAME = nspr20
-MOD_VERSION = 4
+MOD_NAME = $(NSPR_MODNAME)
+MOD_VERSION = $(MOD_MAJOR_VERSION)
+MOD_MINOR = $(MOD_MINOR_VERSION)
+MOD_PATCH = $(MOD_REVISION_VERSION)
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -164,16 +164,20 @@ ifeq ($(OS_ARCH),OpenVMS)
 ALL_TRASH		+= $(wildcard *.c*_defines)
 ifdef SHARED_LIBRARY
 VMS_SYMVEC_FILE		= $(SHARED_LIBRARY:.$(DLL_SUFFIX)=_symvec.opt)
 VMS_SYMVEC_FILE_MODULE	= $(srcdir)/$(LIBRARY_NAME)_symvec.opt
 ALL_TRASH		+= $(VMS_SYMVEC_FILE)
 endif
 endif
 
+ifndef RELEASE_LIBS_DEST
+RELEASE_LIBS_DEST	= $(RELEASE_LIB_DIR)
+endif
+
 ifdef DIRS
 LOOP_OVER_DIRS		=					\
 	@for d in $(DIRS); do					\
 		if test -d $$d; then				\
 			set -e;					\
 			echo "cd $$d; $(MAKE) $@";		\
 			$(MAKE) -C $$d $@;			\
 			set +e;					\
@@ -213,17 +217,17 @@ distclean::
 real_install:: $(RELEASE_BINS) $(RELEASE_HEADERS) $(RELEASE_LIBS)
 ifdef RELEASE_BINS
 	$(NSINSTALL) -t -m 0755 $(RELEASE_BINS) $(DESTDIR)$(bindir)
 endif
 ifdef RELEASE_HEADERS
 	$(NSINSTALL) -t -m 0644 $(RELEASE_HEADERS) $(DESTDIR)$(includedir)/$(include_subdir)
 endif
 ifdef RELEASE_LIBS
-	$(NSINSTALL) -t -m 0755 $(RELEASE_LIBS) $(DESTDIR)$(libdir)
+	$(NSINSTALL) -t -m 0755 $(RELEASE_LIBS) $(DESTDIR)$(libdir)/$(lib_subdir)
 endif
 	+$(LOOP_OVER_DIRS)
 
 release:: export
 ifdef RELEASE_BINS
 	@echo "Copying executable programs and scripts to release directory"
 	@if test -z "$(BUILD_NUMBER)"; then \
 		echo "BUILD_NUMBER must be defined"; \
@@ -242,23 +246,23 @@ endif
 ifdef RELEASE_LIBS
 	@echo "Copying libraries to release directory"
 	@if test -z "$(BUILD_NUMBER)"; then \
 		echo "BUILD_NUMBER must be defined"; \
 		false; \
 	else \
 		true; \
 	fi
-	@if test ! -d $(RELEASE_LIB_DIR); then \
-		rm -rf $(RELEASE_LIB_DIR); \
-		$(NSINSTALL) -D $(RELEASE_LIB_DIR);\
+	@if test ! -d $(RELEASE_LIBS_DEST); then \
+		rm -rf $(RELEASE_LIBS_DEST); \
+		$(NSINSTALL) -D $(RELEASE_LIBS_DEST);\
 	else \
 		true; \
 	fi
-	cp $(RELEASE_LIBS) $(RELEASE_LIB_DIR)
+	cp $(RELEASE_LIBS) $(RELEASE_LIBS_DEST)
 endif
 ifdef RELEASE_HEADERS
 	@echo "Copying header files to release directory"
 	@if test -z "$(BUILD_NUMBER)"; then \
 		echo "BUILD_NUMBER must be defined"; \
 		false; \
 	else \
 		true; \
@@ -306,17 +310,17 @@ else
 endif
 	$(RANLIB) $@
 
 ifeq ($(OS_TARGET), OS2)
 $(IMPORT_LIBRARY): $(SHARED_LIBRARY)
 	$(IMPLIB) $@ $(SHARED_LIBRARY).def
 endif
     
-$(SHARED_LIBRARY): $(OBJS)
+$(SHARED_LIBRARY): $(OBJS) $(MAPFILE)
 	@$(MAKE_OBJDIR)
 	rm -f $@
 ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1)
 	echo "#!" > $(OBJDIR)/lib$(LIBRARY_NAME)_syms
 	nm -B -C -g $(OBJS) \
 		| awk '/ [T,D] / {print $$3}' \
 		| sed -e 's/^\.//' \
 		| sort -u >> $(OBJDIR)/lib$(LIBRARY_NAME)_syms
@@ -359,16 +363,23 @@ ifeq ($(OS_TARGET),OS2)
 	$(RC) -DOS2 -r $< $@
 else
 # The resource compiler does not understand the -U option.
 	$(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
 endif
 	@echo $(RES) finished
 endif
 
+$(MAPFILE): $(LIBRARY_NAME).def
+	@$(MAKE_OBJDIR)
+ifeq ($(OS_ARCH),SunOS)
+	grep -v ';-' $< | \
+	sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
+endif
+
 $(OBJDIR)/%.$(OBJ_SUFFIX): %.cpp
 	@$(MAKE_OBJDIR)
 ifeq ($(OS_ARCH), WINNT)
 	$(CCC) -Fo$@ -c $(CCCFLAGS) $<
 else
 ifeq ($(MOZ_OS2_TOOLS),VACPP)
 	$(CCC) -Fo$@ -c $(CCCFLAGS) $<
 else
--- a/configure
+++ b/configure
@@ -675,17 +675,17 @@ echo "$ac_t""$build" 1>&6
 
 test "$host_alias" != "$target_alias" &&
   test "$program_prefix$program_suffix$program_transform_name" = \
     NONENONEs,x,x, &&
   program_prefix=${target_alias}-
 
 
 MOD_MAJOR_VERSION=4
-MOD_MINOR_VERSION=2
+MOD_MINOR_VERSION=3
 MOD_REVISION_VERSION=0
 NSPR_MODNAME=nspr20
 _HAVE_PTHREADS=
 USE_PTHREADS=
 USE_USER_PTHREADS=
 USE_NSPR_THREADS=
 USE_N32=
 USE_64=
@@ -2986,17 +2986,17 @@ EOF
 #define AIX_TIMERS 1
 EOF
 
         cat >> confdefs.h <<\EOF
 #define _PR_HAVE_OFF64_T 1
 EOF
 
         cat >> confdefs.h <<\EOF
-#define AIX4_3 1
+#define AIX4_3_PLUS 1
 EOF
 
         cat >> confdefs.h <<\EOF
 #define HAVE_SOCKLEN_T 1
 EOF
 
         cat >> confdefs.h <<\EOF
 #define HAVE_FCNTL_FILE_LOCKING 1
@@ -3010,16 +3010,20 @@ EOF
 #define AIX_TIMERS 1
 EOF
 
         cat >> confdefs.h <<\EOF
 #define _PR_HAVE_OFF64_T 1
 EOF
 
         cat >> confdefs.h <<\EOF
+#define AIX4_3_PLUS 1
+EOF
+
+        cat >> confdefs.h <<\EOF
 #define HAVE_SOCKLEN_T 1
 EOF
 
         cat >> confdefs.h <<\EOF
 #define HAVE_FCNTL_FILE_LOCKING 1
 EOF
 
         USE_IPV6=1
@@ -3065,36 +3069,36 @@ EOF
     PR_MD_ARCH_DIR=beos
     RESOLVE_LINK_SYMBOLS=1
     case "${target_cpu}" in
     i?86)
         _OPTIMIZE_FLAGS=-O2
         _DEBUG_FLAGS='-gdwarf-2 -O0'
         MKSHLIB='$(CCC) $(DSO_LDOPTS) -o $@'
         echo $ac_n "checking for gethostbyaddr in -lbind""... $ac_c" 1>&6
-echo "configure:3074: checking for gethostbyaddr in -lbind" >&5
+echo "configure:3078: checking for gethostbyaddr in -lbind" >&5
 ac_lib_var=`echo bind'_'gethostbyaddr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
 LIBS="-lbind  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3082 "configure"
+#line 3086 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
 char gethostbyaddr();
 
 int main() {
 gethostbyaddr()
 ; return 0; }
 EOF
-if { (eval echo configure:3093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=no"
 fi
@@ -3801,17 +3805,16 @@ EOF
 
     if test -n "$GNU_CC"; then
         cat >> confdefs.h <<\EOF
 #define NONAMELESSUNION 1
 EOF
 
         MKSHLIB='$(DLLTOOL) --as=$(AS) -k --dllname $*.dll --output-lib $@'
     else
-        topsrcdir=$srcdir
         CYGWIN_WRAPPER='sh $(topsrcdir)/build/cygwin-wrapper'
         CC='$(CYGWIN_WRAPPER) cl'
         CXX='$(CYGWIN_WRAPPER) cl'
         LD=link
         AR='lib -NOLOGO -OUT:"$@"'
         AR_FLAGS=
         RANLIB='echo not_ranlib'
         STRIP='echo not_strip'
@@ -4227,27 +4230,27 @@ EOF
     if test -z "$GNU_CC"; then
         CC="$CC -std1 -ieee_with_inexact"
         if test "$OS_RELEASE" != "V2.0"; then
             CC="$CC -readonly_strings"
         fi
         _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000"
         ac_safe=`echo "machine/builtins.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for machine/builtins.h""... $ac_c" 1>&6
-echo "configure:4236: checking for machine/builtins.h" >&5
+echo "configure:4239: checking for machine/builtins.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4241 "configure"
+#line 4244 "configure"
 #include "confdefs.h"
 #include <machine/builtins.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4246: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4249: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
   eval "ac_cv_header_$ac_safe=yes"
 else
   echo "$ac_err" >&5
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
@@ -4473,17 +4476,18 @@ EOF
 
     if test -n "$USE_64"; then
         MDCPUCFG_H=_solaris64.cfg
     else
         MDCPUCFG_H=_solaris32.cfg
     fi
     PR_MD_CSRCS=solaris.c
     LD=/usr/ccs/bin/ld
-    DSO_LDOPTS='-G -h $(notdir $@)'
+    DSO_LDOPTS='-G -h $(notdir $@) -z combreloc -z defs'
+    RESOLVE_LINK_SYMBOLS=1
     if test -n "$GNU_CC"; then
         DSO_CFLAGS=-fPIC
     else
         DSO_CFLAGS=-KPIC
     fi
     if test -z "$GNU_AS"; then
         ASFLAGS="$ASFLAGS -Wa,-P"
     fi
@@ -4561,19 +4565,17 @@ EOF
 
         fi
         ;;
     esac
     if test "$OS_TEST" = "sun4u"; then
         # 64-bit Solaris requires SPARC V9 architecture, so the following
         # is not needed.
         if test -z "$USE_64"; then
-            ULTRASPARC_LIBRARY=ultrasparc
-            ULTRASPARC_FILTER_LIBRARY=libatomic.so
-            DSO_LDOPTS="$DSO_LDOPTS -f "'$(ULTRASPARC_FILTER_LIBRARY)'
+            ULTRASPARC_LIBRARY=nspr_flt
         fi
     fi
     # Purify requires that binaries linked against nspr also
     # be linked against -lrt (or -lposix4) so add it to OS_LIBS
     _rev=`uname -r`
     _librt=`echo $_rev 5.6 | awk '{ if ($1 > $2) print "-lrt"; else print "-lposix4" }'`
     OS_LIBS="$OS_LIBS $_librt"
     ;;
@@ -4745,22 +4747,22 @@ EOF
 
     ;;
    
 esac
 
 if test -z "$SKIP_LIBRARY_CHECKS"; then
 
 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
-echo "configure:4754: checking for dlopen" >&5
+echo "configure:4756: checking for dlopen" >&5
 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4759 "configure"
+#line 4761 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dlopen(); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
 char dlopen();
@@ -4773,17 +4775,17 @@ int main() {
 #if defined (__stub_dlopen) || defined (__stub___dlopen)
 choke me
 #else
 dlopen();
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:4782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_dlopen=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   eval "ac_cv_func_dlopen=no"
 fi
@@ -4792,36 +4794,36 @@ fi
 
 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   :
 else
   echo "$ac_t""no" 1>&6
 
     echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:4801: checking for dlopen in -ldl" >&5
+echo "configure:4803: checking for dlopen in -ldl" >&5
 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4809 "configure"
+#line 4811 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
 char dlopen();
 
 int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:4820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=no"
 fi
@@ -4839,23 +4841,23 @@ fi
 
 fi
 
 
 
 
 if test $ac_cv_prog_gcc = yes; then
     echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:4848: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:4850: checking whether ${CC-cc} needs -traditional" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
     ac_pattern="Autoconf.*'x'"
   cat > conftest.$ac_ext <<EOF
-#line 4854 "configure"
+#line 4856 "configure"
 #include "confdefs.h"
 #include <sgtty.h>
 Autoconf TIOCGETP
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   egrep "$ac_pattern" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_prog_gcc_traditional=yes
@@ -4863,17 +4865,17 @@ else
   rm -rf conftest*
   ac_cv_prog_gcc_traditional=no
 fi
 rm -f conftest*
 
 
   if test $ac_cv_prog_gcc_traditional = no; then
     cat > conftest.$ac_ext <<EOF
-#line 4872 "configure"
+#line 4874 "configure"
 #include "confdefs.h"
 #include <termio.h>
 Autoconf TCGETA
 EOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   egrep "$ac_pattern" >/dev/null 2>&1; then
   rm -rf conftest*
   ac_cv_prog_gcc_traditional=yes
@@ -4887,22 +4889,22 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional
   if test $ac_cv_prog_gcc_traditional = yes; then
     CC="$CC -traditional"
   fi
 fi
 
 for ac_func in lchown strerror
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4896: checking for $ac_func" >&5
+echo "configure:4898: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4901 "configure"
+#line 4903 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
 #include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
 char $ac_func();
@@ -4915,17 +4917,17 @@ int main() {
 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
 $ac_func();
 #endif
 
 ; return 0; }
 EOF
-if { (eval echo configure:4924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
   echo "configure: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=no"
 fi
@@ -4954,17 +4956,17 @@ if test "${enable_strip+set}" = set; the
 fi
 
 
 case "${target_os}" in
 hpux*)
 if test -z "$GNU_CC"; then
 
     echo $ac_n "checking for +Olit support""... $ac_c" 1>&6
-echo "configure:4963: checking for +Olit support" >&5
+echo "configure:4965: checking for +Olit support" >&5
 if eval "test \"`echo '$''{'ac_cv_hpux_usable_olit_option'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
                   ac_cv_hpux_usable_olit_option=no
         rm -f conftest*
         echo 'int main() { return 0; }' | cat > conftest.c
         ${CC-cc} ${CFLAGS} +Olit=all -o conftest conftest.c > conftest.out 2>&1
         if test $? -eq 0; then
@@ -4988,17 +4990,17 @@ echo "$ac_t""$ac_cv_hpux_usable_olit_opt
 fi
 ;;
 esac
 
 
 
 
 echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
-echo "configure:4997: checking for pthread_create in -lpthreads" >&5
+echo "configure:4999: checking for pthread_create in -lpthreads" >&5
 echo "
     #include <pthread.h> 
     void *foo(void *v) { return v; } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
@@ -5010,17 +5012,17 @@ echo "
     rm -f dummy.c dummy${ac_exeext} ;
     if test "$_res" = "0"; then
         echo "$ac_t""yes" 1>&6
         _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads"
     else
         echo "$ac_t""no" 1>&6
         
 echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:5019: checking for pthread_create in -lpthread" >&5
+echo "configure:5021: checking for pthread_create in -lpthread" >&5
 echo "
     #include <pthread.h> 
     void *foo(void *v) { return v; } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
@@ -5032,17 +5034,17 @@ echo "
     rm -f dummy.c dummy${ac_exeext} ;
     if test "$_res" = "0"; then
         echo "$ac_t""yes" 1>&6
         _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread"
     else
         echo "$ac_t""no" 1>&6
         
 echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
-echo "configure:5041: checking for pthread_create in -lc_r" >&5
+echo "configure:5043: checking for pthread_create in -lc_r" >&5
 echo "
     #include <pthread.h> 
     void *foo(void *v) { return v; } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
@@ -5054,17 +5056,17 @@ echo "
     rm -f dummy.c dummy${ac_exeext} ;
     if test "$_res" = "0"; then
         echo "$ac_t""yes" 1>&6
         _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r"
     else
         echo "$ac_t""no" 1>&6
         
 echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6
-echo "configure:5063: checking for pthread_create in -lc" >&5
+echo "configure:5065: checking for pthread_create in -lc" >&5
 echo "
     #include <pthread.h> 
     void *foo(void *v) { return v; } 
     int main() { 
         pthread_t t;
         if (!pthread_create(&t, 0, &foo, 0)) {
             pthread_join(t, 0);
         }
@@ -5206,17 +5208,17 @@ EOF
     fi
 fi
 
 
 if test -n "$USE_PTHREADS"; then
       rm -f conftest*
    ac_cv_have_dash_pthread=no
    echo $ac_n "checking whether ${CC-cc} accepts -pthread""... $ac_c" 1>&6
-echo "configure:5215: checking whether ${CC-cc} accepts -pthread" >&5
+echo "configure:5217: checking whether ${CC-cc} accepts -pthread" >&5
    echo 'int main() { return 0; }' | cat > conftest.c
    ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
    if test $? -eq 0; then
 	if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
 	    ac_cv_have_dash_pthread=yes
 		case "$target_os" in
 	    freebsd*)
 # Freebsd doesn't use -pthread for compiles, it uses them for linking
@@ -5229,17 +5231,17 @@ echo "configure:5215: checking whether $
 	fi
     fi
     rm -f conftest*
     echo "$ac_t""$ac_cv_have_dash_pthread" 1>&6
 
 			    ac_cv_have_dash_pthreads=no
     if test "$ac_cv_have_dash_pthread" = "no"; then
 	    echo $ac_n "checking whether ${CC-cc} accepts -pthreads""... $ac_c" 1>&6
-echo "configure:5238: checking whether ${CC-cc} accepts -pthreads" >&5
+echo "configure:5240: checking whether ${CC-cc} accepts -pthreads" >&5
     	echo 'int main() { return 0; }' | cat > conftest.c
 	    ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
     	if test $? -eq 0; then
 	    	if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
 			    ac_cv_have_dash_pthreads=yes
 			    CFLAGS="$CFLAGS -pthreads"
 			    CXXFLAGS="$CXXFLAGS -pthreads"
 		    fi
@@ -5329,16 +5331,30 @@ EOF
         fi
         if test -n "$USE_PTHREADS"; then
             cat >> confdefs.h <<\EOF
 #define _PR_HAVE_THREADSAFE_GETHOST 1
 EOF
 
         fi
         ;;
+    *)
+        if test -z "$USE_NSPR_THREADS"; then
+            cat >> confdefs.h <<\EOF
+#define HAVE_POINTER_LOCALTIME_R 1
+EOF
+
+        fi
+        if test -n "$USE_PTHREADS"; then
+            cat >> confdefs.h <<\EOF
+#define _PR_HAVE_THREADSAFE_GETHOST 1
+EOF
+
+        fi
+        ;;
     esac
     ;;
 *-bsdi*)
     if test -n "$USE_PTHREADS"; then
         cat >> confdefs.h <<\EOF
 #define _PR_NEED_PTHREAD_INIT 1
 EOF
 
@@ -5600,30 +5616,32 @@ RELEASE_OBJDIR_NAME="${OS_CONFIG}${CPU_A
 
 
 
 
 
 
 
 
-
 MAKEFILES="
 Makefile 
 config/Makefile
 config/autoconf.mk
 config/nsprincl.mk
 config/nsprincl.sh
 config/nspr-config
 lib/Makefile 
 lib/ds/Makefile 
 lib/libc/Makefile 
 lib/libc/include/Makefile 
 lib/libc/src/Makefile 
 lib/tests/Makefile
+pkg/solaris/Makefile
+pkg/solaris/SUNWpr/Makefile
+pkg/solaris/SUNWprx/Makefile
 pr/Makefile 
 pr/include/Makefile 
 pr/include/md/Makefile 
 pr/include/obsolete/Makefile 
 pr/include/private/Makefile 
 pr/src/Makefile 
 pr/src/io/Makefile 
 pr/src/linking/Makefile 
@@ -5645,16 +5663,20 @@ elif test -n "$USE_PTHREADS"; then
 elif test -n "$USE_BTHREADS"; then
     MAKEFILES="$MAKEFILES pr/src/bthreads/Makefile"
 fi
 
 if test -n "$USE_CPLUS"; then
     MAKEFILES="$MAKEFILES pr/src/cplus/Makefile pr/src/cplus/tests/Makefile"
 fi
 
+if test ! -d pkg; then
+    mkdir pkg
+fi
+
 trap '' 1 2 15
 cat > confcache <<\EOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
 # scripts and configure runs.  It is not useful on other systems.
 # If it contains results you don't want to keep, you may remove or edit it.
 #
 # By default, configure uses ./config.cache as the cache file,
@@ -5873,17 +5895,16 @@ s%@ASFLAGS@%$ASFLAGS%g
 s%@FILTER@%$FILTER%g
 s%@IMPLIB@%$IMPLIB%g
 s%@OS_LIBS@%$OS_LIBS%g
 s%@RESOLVE_LINK_SYMBOLS@%$RESOLVE_LINK_SYMBOLS%g
 s%@AIX_LINK_OPTS@%$AIX_LINK_OPTS%g
 s%@NOSUCHFILE@%$NOSUCHFILE%g
 s%@MOZ_OBJFORMAT@%$MOZ_OBJFORMAT%g
 s%@ULTRASPARC_LIBRARY@%$ULTRASPARC_LIBRARY%g
-s%@ULTRASPARC_FILTER_LIBRARY@%$ULTRASPARC_FILTER_LIBRARY%g
 s%@OBJDIR@%$OBJDIR%g
 s%@OBJDIR_NAME@%$OBJDIR_NAME%g
 s%@RELEASE_OBJDIR_NAME@%$RELEASE_OBJDIR_NAME%g
 s%@NSINSTALL@%$NSINSTALL%g
 s%@OPTIMIZER@%$OPTIMIZER%g
 s%@RC@%$RC%g
 s%@DLLFLAGS@%$DLLFLAGS%g
 s%@EXEFLAGS@%$EXEFLAGS%g
--- a/configure.in
+++ b/configure.in
@@ -38,17 +38,17 @@ AC_INIT(config/libc_r.h)
 
 AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
 AC_CANONICAL_SYSTEM
 
 dnl ========================================================
 dnl = Defaults
 dnl ========================================================
 MOD_MAJOR_VERSION=4
-MOD_MINOR_VERSION=2
+MOD_MINOR_VERSION=3
 MOD_REVISION_VERSION=0
 NSPR_MODNAME=nspr20
 _HAVE_PTHREADS=
 USE_PTHREADS=
 USE_USER_PTHREADS=
 USE_NSPR_THREADS=
 USE_N32=
 USE_64=
@@ -723,25 +723,26 @@ case "$target" in
     aix4.2*)
         AC_DEFINE(AIX_TIMERS)
         AC_DEFINE(_PR_HAVE_OFF64_T)
         AIX_LINK_OPTS='-brtl -bnso -berok'
         ;;
     aix4.3*)
         AC_DEFINE(AIX_TIMERS)
         AC_DEFINE(_PR_HAVE_OFF64_T)
-        AC_DEFINE(AIX4_3)
+        AC_DEFINE(AIX4_3_PLUS)
         AC_DEFINE(HAVE_SOCKLEN_T)
         AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
         USE_IPV6=1
         AIX_LINK_OPTS='-brtl -bnso -berok'
         ;;
     *)
         AC_DEFINE(AIX_TIMERS)
         AC_DEFINE(_PR_HAVE_OFF64_T)
+        AC_DEFINE(AIX4_3_PLUS)
         AC_DEFINE(HAVE_SOCKLEN_T)
         AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
         USE_IPV6=1
         AIX_LINK_OPTS='-brtl -bnso -berok'
         ;;
     esac
     CFLAGS="$CFLAGS -qro -qroconst"
     if echo "$CC" | grep -c xlC_r; then
@@ -1216,17 +1217,16 @@ case "$target" in
     PR_MD_ARCH_DIR=windows
     RESOLVE_LINK_SYMBOLS=1
     NSINSTALL='$(CYGWIN_WRAPPER) nsinstall'
 
     if test -n "$GNU_CC"; then
         AC_DEFINE(NONAMELESSUNION)
         MKSHLIB='$(DLLTOOL) --as=$(AS) -k --dllname $*.dll --output-lib $@'
     else
-        topsrcdir=$srcdir
         CYGWIN_WRAPPER='sh $(topsrcdir)/build/cygwin-wrapper'
         CC='$(CYGWIN_WRAPPER) cl'
         CXX='$(CYGWIN_WRAPPER) cl'
         LD=link
         AR='lib -NOLOGO -OUT:"$@"'
         AR_FLAGS=
         RANLIB='echo not_ranlib'
         STRIP='echo not_strip'
@@ -1625,17 +1625,18 @@ mips-sony-newsos*)
     AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
     if test -n "$USE_64"; then
         MDCPUCFG_H=_solaris64.cfg
     else
         MDCPUCFG_H=_solaris32.cfg
     fi
     PR_MD_CSRCS=solaris.c
     LD=/usr/ccs/bin/ld
-    DSO_LDOPTS='-G -h $(notdir $@)'
+    DSO_LDOPTS='-G -h $(notdir $@) -z combreloc -z defs'
+    RESOLVE_LINK_SYMBOLS=1
     if test -n "$GNU_CC"; then
         DSO_CFLAGS=-fPIC
     else
         DSO_CFLAGS=-KPIC
     fi
     if test -z "$GNU_AS"; then
         ASFLAGS="$ASFLAGS -Wa,-P"
     fi
@@ -1695,19 +1696,17 @@ mips-sony-newsos*)
             AC_DEFINE(_LARGEFILE64_SOURCE)
         fi
         ;;
     esac
     if test "$OS_TEST" = "sun4u"; then
         # 64-bit Solaris requires SPARC V9 architecture, so the following
         # is not needed.
         if test -z "$USE_64"; then
-            ULTRASPARC_LIBRARY=ultrasparc
-            ULTRASPARC_FILTER_LIBRARY=libatomic.so
-            DSO_LDOPTS="$DSO_LDOPTS -f "'$(ULTRASPARC_FILTER_LIBRARY)'
+            ULTRASPARC_LIBRARY=nspr_flt
         fi
     fi
     # Purify requires that binaries linked against nspr also
     # be linked against -lrt (or -lposix4) so add it to OS_LIBS
     _rev=`uname -r`
     _librt=`echo $_rev 5.6 | awk '{ if ($1 > $2) print "-lrt"; else print "-lposix4" }'`
     OS_LIBS="$OS_LIBS $_librt"
     ;;
@@ -2172,16 +2171,24 @@ case "$target" in
     aix4.3*)
         if test -z "$USE_NSPR_THREADS"; then
             AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
         fi
         if test -n "$USE_PTHREADS"; then
             AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
         fi
         ;;
+    *)
+        if test -z "$USE_NSPR_THREADS"; then
+            AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
+        fi
+        if test -n "$USE_PTHREADS"; then
+            AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
+        fi
+        ;;
     esac
     ;;
 *-bsdi*)
     if test -n "$USE_PTHREADS"; then
         AC_DEFINE(_PR_NEED_PTHREAD_INIT)
     fi
     ;;
 *-freebsd*)
@@ -2377,17 +2384,16 @@ AC_SUBST(FILTER)
 AC_SUBST(IMPLIB)
 
 AC_SUBST(OS_LIBS)
 AC_SUBST(RESOLVE_LINK_SYMBOLS)
 AC_SUBST(AIX_LINK_OPTS)
 AC_SUBST(NOSUCHFILE)
 AC_SUBST(MOZ_OBJFORMAT)
 AC_SUBST(ULTRASPARC_LIBRARY)
-AC_SUBST(ULTRASPARC_FILTER_LIBRARY)
 
 AC_SUBST(OBJDIR)
 AC_SUBST(OBJDIR_NAME)
 AC_SUBST(RELEASE_OBJDIR_NAME)
 AC_SUBST(NSINSTALL)
 AC_SUBST(OPTIMIZER)
 AC_SUBST(RC)
 AC_SUBST(DLLFLAGS)
@@ -2406,16 +2412,19 @@ config/nsprincl.mk
 config/nsprincl.sh
 config/nspr-config
 lib/Makefile 
 lib/ds/Makefile 
 lib/libc/Makefile 
 lib/libc/include/Makefile 
 lib/libc/src/Makefile 
 lib/tests/Makefile
+pkg/solaris/Makefile
+pkg/solaris/SUNWpr/Makefile
+pkg/solaris/SUNWprx/Makefile
 pr/Makefile 
 pr/include/Makefile 
 pr/include/md/Makefile 
 pr/include/obsolete/Makefile 
 pr/include/private/Makefile 
 pr/src/Makefile 
 pr/src/io/Makefile 
 pr/src/linking/Makefile 
@@ -2440,9 +2449,15 @@ elif test -n "$USE_PTHREADS"; then
 elif test -n "$USE_BTHREADS"; then
     MAKEFILES="$MAKEFILES pr/src/bthreads/Makefile"
 fi
 
 if test -n "$USE_CPLUS"; then
     MAKEFILES="$MAKEFILES pr/src/cplus/Makefile pr/src/cplus/tests/Makefile"
 fi
 
+dnl There is no pkg/Makefile.in, so AC_OUTPUT won't create the pkg directory
+dnl for us.
+if test ! -d pkg; then
+    mkdir pkg
+fi
+
 AC_OUTPUT([$MAKEFILES], [chmod +x config/nspr-config])
--- a/lib/ds/Makefile.in
+++ b/lib/ds/Makefile.in
@@ -72,16 +72,23 @@ else
 OS_LIBS = -lc_r
 endif
 endif
 
 ifeq ($(OS_ARCH),IRIX)
 OS_LIBS = -lc
 endif
 
+ifeq ($(OS_ARCH),SunOS)
+OS_LIBS = -lc
+MAPFILE = $(OBJDIR)/pldsmap.sun
+GARBAGE += $(MAPFILE)
+MKSHLIB += -M $(MAPFILE)
+endif
+
 EXTRA_LIBS = $(LIBNSPR)
 
 # On NCR and SCOOS, we can't link with extra libraries when
 # we build a shared library.  If we do so, the linker doesn't
 # complain, but we would run into weird problems at run-time.
 # Therefore on these platforms, we link just the .o files.
 ifeq ($(OS_ARCH),NCR)
 EXTRA_LIBS =
--- a/lib/libc/src/Makefile.in
+++ b/lib/libc/src/Makefile.in
@@ -81,16 +81,23 @@ else
 OS_LIBS = -lc_r
 endif
 endif
 
 ifeq ($(OS_ARCH),IRIX)
 OS_LIBS = -lc
 endif
 
+ifeq ($(OS_ARCH),SunOS)
+OS_LIBS = -lc
+MAPFILE = $(OBJDIR)/plcmap.sun
+GARBAGE += $(MAPFILE)
+MKSHLIB += -M $(MAPFILE)
+endif
+
 EXTRA_LIBS = $(LIBNSPR)
 
 # On NCR and SCOOS, we can't link with extra libraries when
 # we build a shared library.  If we do so, the linker doesn't
 # complain, but we would run into weird problems at run-time.
 # Therefore on these platforms, we link just the .o files.
 ifeq ($(OS_ARCH),NCR)
 EXTRA_LIBS =
--- a/pr/include/md/_pth.h
+++ b/pr/include/md/_pth.h
@@ -183,17 +183,17 @@
 #else
 #define PT_TRYLOCK_SUCCESS 0
 #define PT_TRYLOCK_BUSY    EBUSY
 #endif
 
 /*
  * These platforms don't have sigtimedwait()
  */
-#if (defined(AIX) && !defined(AIX4_3)) || defined(LINUX) \
+#if (defined(AIX) && !defined(AIX4_3_PLUS)) || defined(LINUX) \
 	|| defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
 	|| defined(BSDI) || defined(VMS) || defined(UNIXWARE) \
 	|| defined(DARWIN)
 #define PT_NO_SIGTIMEDWAIT
 #endif
 
 /*
  * These platforms don't have pthread_kill()
--- a/pr/include/prcountr.h
+++ b/pr/include/prcountr.h
@@ -111,17 +111,16 @@ PR_BEGIN_EXTERN_C
 **
 */
 typedef void *  PRCounterHandle;
 
 #define PRCOUNTER_NAME_MAX 31
 #define PRCOUNTER_DESC_MAX 255
 
 
-#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 
 /* -----------------------------------------------------------------------
 ** FUNCTION: PR_DEFINE_COUNTER() -- Define a PRCounterHandle
 ** 
 ** DESCRIPTION: PR_DEFINE_COUNTER() is used to define a counter
 ** handle.
 ** 
 */
@@ -130,18 +129,22 @@ typedef void *  PRCounterHandle;
 /* -----------------------------------------------------------------------
 ** FUNCTION: PR_INIT_COUNTER_HANDLE() -- Set the value of a PRCounterHandle
 ** 
 ** DESCRIPTION: 
 ** PR_INIT_COUNTER_HANDLE() sets the value of a PRCounterHandle
 ** to value.
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #define PR_INIT_COUNTER_HANDLE(handle,value)\
     (handle) = (PRCounterHandle)(value)
+#else
+#define PR_INIT_COUNTER_HANDLE(handle,value)
+#endif
 
 /* -----------------------------------------------------------------------
 ** FUNCTION: PR_CreateCounter() -- Create a counter
 ** 
 ** DESCRIPTION: PR_CreateCounter() creates a counter object and
 ** initializes it to zero.
 ** 
 ** The macro form takes as its first argument the name of the
@@ -162,18 +165,22 @@ typedef void *  PRCounterHandle;
 ** OUTPUTS:
 ** 
 ** RETURNS:
 **  PRCounterHandle.
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #define PR_CREATE_COUNTER(handle,qName,rName,description)\
    (handle) = PR_CreateCounter((qName),(rName),(description))
+#else
+#define PR_CREATE_COUNTER(handle,qName,rName,description)
+#endif
 
 NSPR_API(PRCounterHandle) 
 	PR_CreateCounter( 
 		const char *qName, 
     	const char *rName, 
         const char *description 
 );
 
@@ -189,17 +196,21 @@ NSPR_API(PRCounterHandle)
 ** OUTPUTS: 
 **  The counter is destroyed.
 ** 
 ** RETURNS: void
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #define PR_DESTROY_COUNTER(handle) PR_DestroyCounter((handle))
+#else
+#define PR_DESTROY_COUNTER(handle)
+#endif
 
 NSPR_API(void) 
 	PR_DestroyCounter( 
 		PRCounterHandle handle 
 );
 
 
 /* -----------------------------------------------------------------------
@@ -217,18 +228,22 @@ NSPR_API(void)
 ** OUTPUTS:
 ** 
 ** RETURNS: 
 **  PRCounterHandle or PRCounterError.
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #define PR_GET_COUNTER_HANDLE_FROM_NAME(handle,qName,rName)\
     (handle) = PR_GetCounterHandleFromName((qName),(rName))
+#else
+#define PR_GET_COUNTER_HANDLE_FROM_NAME(handle,qName,rName)
+#endif
 
 NSPR_API(PRCounterHandle) 
 	PR_GetCounterHandleFromName( 
     	const char *qName, 
     	const char *rName 
 );
 
 /* -----------------------------------------------------------------------
@@ -246,18 +261,22 @@ NSPR_API(PRCounterHandle)
 ** OUTPUTS: Pointers to the Counter Feature's copies of the names
 ** used when the counters were created.
 ** 
 ** RETURNS: void
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #define PR_GET_COUNTER_NAME_FROM_HANDLE(handle,qName,rName,description)\
     PR_GetCounterNameFromHandle((handle),(qName),(rName),(description))
+#else
+#define PR_GET_COUNTER_NAME_FROM_HANDLE(handle,qName,rName,description )
+#endif
 
 NSPR_API(void) 
 	PR_GetCounterNameFromHandle( 
     	PRCounterHandle handle,  
 	    const char **qName, 
 	    const char **rName, 
 		const char **description 
 );
@@ -274,17 +293,21 @@ NSPR_API(void)
 ** 
 ** OUTPUTS: The counter is incrementd.
 ** 
 ** RETURNS: void
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #define PR_INCREMENT_COUNTER(handle) PR_IncrementCounter(handle)
+#else
+#define PR_INCREMENT_COUNTER(handle)
+#endif
 
 NSPR_API(void) 
 	PR_IncrementCounter( 
 		PRCounterHandle handle
 );
 
 
 /* -----------------------------------------------------------------------
@@ -299,17 +322,21 @@ NSPR_API(void)
 ** 
 ** OUTPUTS: the counter is decremented.
 ** 
 ** RETURNS: void
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #define PR_DECREMENT_COUNTER(handle) PR_DecrementCounter(handle)
+#else
+#define PR_DECREMENT_COUNTER(handle)
+#endif
 
 NSPR_API(void) 
 	PR_DecrementCounter( 
 		PRCounterHandle handle
 );
 
 /* -----------------------------------------------------------------------
 ** FUNCTION: PR_AddToCounter() -- Add a value to a counter.
@@ -323,18 +350,22 @@ NSPR_API(void)
 ** 
 ** OUTPUTS: new value for counter.
 ** 
 ** RETURNS: void
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #define PR_ADD_TO_COUNTER(handle,value)\
     PR_AddToCounter((handle),(value))
+#else
+#define PR_ADD_TO_COUNTER(handle,value)
+#endif
 
 NSPR_API(void) 
 	PR_AddToCounter( 
     	PRCounterHandle handle, 
 	    PRUint32 value 
 );
 
 
@@ -353,18 +384,22 @@ NSPR_API(void)
 ** 
 ** OUTPUTS: new value for counter
 ** 
 ** RETURNS: void
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #define PR_SUBTRACT_FROM_COUNTER(handle,value)\
     PR_SubtractFromCounter((handle),(value))
+#else
+#define PR_SUBTRACT_FROM_COUNTER(handle,value)
+#endif
 
 NSPR_API(void) 
 	PR_SubtractFromCounter( 
     	PRCounterHandle handle, 
 	    PRUint32 value 
 );
 
 
@@ -379,18 +414,22 @@ NSPR_API(void)
 ** 
 ** OUTPUTS:
 ** 
 ** RETURNS: The value of the referenced counter
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #define PR_GET_COUNTER(counter,handle)\
     (counter) = PR_GetCounter((handle))
+#else
+#define PR_GET_COUNTER(counter,handle) 0
+#endif
 
 NSPR_API(PRUint32) 
 	PR_GetCounter( 
 		PRCounterHandle handle 
 );
 
 /* -----------------------------------------------------------------------
 ** FUNCTION: PR_SetCounter() -- Replace the content of counter
@@ -407,17 +446,21 @@ NSPR_API(PRUint32)
 ** 
 ** OUTPUTS:
 ** 
 ** RETURNS: void
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #define PR_SET_COUNTER(handle,value) PR_SetCounter((handle),(value))
+#else
+#define PR_SET_COUNTER(handle,value)
+#endif
 
 NSPR_API(void) 
 	PR_SetCounter( 
 		PRCounterHandle handle, 
 		PRUint32 value 
 );
 
 
@@ -445,18 +488,22 @@ NSPR_API(void)
 **  A concurrent PR_CreateCounter() or PR_DestroyCounter() may
 ** cause unpredictable results.
 ** 
 ** A PRCounterHandle returned from this function may only be used
 ** in another PR_FindNextCounterQname() function call; other
 ** operations may cause unpredictable results.
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #define PR_FIND_NEXT_COUNTER_QNAME(next,handle)\
     (next) = PR_FindNextCounterQname((handle))
+#else
+#define PR_FIND_NEXT_COUNTER_QNAME(next,handle) NULL
+#endif
 
 NSPR_API(PRCounterHandle) 
 	PR_FindNextCounterQname( 
         PRCounterHandle handle
 );
 
 /* -----------------------------------------------------------------------
 ** FUNCTION: PR_FindNextCounterRname() -- Retreive the next RName counter
@@ -484,45 +531,24 @@ NSPR_API(PRCounterHandle)
 **  A concurrent PR_CreateCounter() or PR_DestroyCounter() may
 ** cause unpredictable results.
 ** 
 ** A PRCounterHandle returned from this function may only be used
 ** in another PR_FindNextCounterRname() function call; other
 ** operations may cause unpredictable results.
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #define PR_FIND_NEXT_COUNTER_RNAME(next,rhandle,qhandle)\
     (next) = PR_FindNextCounterRname((rhandle),(qhandle))
+#else
+#define PR_FIND_NEXT_COUNTER_RNAME(next,rhandle,qhandle)
+#endif
 
 NSPR_API(PRCounterHandle) 
 	PR_FindNextCounterRname( 
         PRCounterHandle rhandle,
         PRCounterHandle qhandle
 );
 
-
-#else /* ( !(defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)) */
-/*
-** When counters are not compiled in, provide macros that 
-** evaluate to No-Ops.
-**
-*/
-
-#define PR_DEFINE_COUNTER(name) PRCounterHandle name
-#define PR_INIT_COUNTER_HANDLE(handle,value)
-#define PR_CREATE_COUNTER(handle,qName,rName,description)
-#define PR_DESTROY_COUNTER(handle)
-#define PR_GET_COUNTER_HANDLE_FROM_NAME(handle,qName,rName)
-#define PR_GET_COUNTER_NAME_FROM_HANDLE(handle,qName,rName,description )
-#define PR_INCREMENT_COUNTER(handle)
-#define PR_DECREMENT_COUNTER(handle)
-#define PR_ADD_TO_COUNTER(handle,value)
-#define PR_SUBTRACT_FROM_COUNTER(handle,value)
-#define PR_GET_COUNTER(counter,handle) 0
-#define PR_SET_COUNTER(handle,value)
-#define PR_FIND_NEXT_COUNTER_QNAME(next,handle) NULL
-#define PR_FIND_NEXT_COUNTER_RNAME(next,rhandle,qhandle)
-
-#endif /* ( !(defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)) */
-
 PR_END_EXTERN_C
 
 #endif /* prcountr_h___ */
--- a/pr/include/prinit.h
+++ b/pr/include/prinit.h
@@ -55,21 +55,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.2.1"
+#define PR_VERSION  "4.3 Beta"
 #define PR_VMAJOR   4
-#define PR_VMINOR   2
-#define PR_VPATCH   1
-#define PR_BETA     PR_FALSE
+#define PR_VMINOR   3
+#define PR_VPATCH   0
+#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/pr/include/private/primpl.h
+++ b/pr/include/private/primpl.h
@@ -214,32 +214,27 @@ typedef struct PTDebug
 {
     PRTime timeStarted;
     PRUintn locks_created, locks_destroyed;
     PRUintn locks_acquired, locks_released;
     PRUintn cvars_created, cvars_destroyed;
     PRUintn cvars_notified, delayed_cv_deletes;
 } PTDebug;
 
-NSPR_API(void) PT_GetStats(PTDebug* here);
-NSPR_API(void) PT_FPrintStats(PRFileDesc *fd, const char *msg);
-
 #else
 
 typedef PRUintn PTDebug;
-#define PT_GetStats(_p)
-#define PT_FPrintStats(_fd, _msg)
 
 #endif /* defined(DEBUG) */
 
+NSPR_API(void) PT_FPrintStats(PRFileDesc *fd, const char *msg);
+
 #else /* defined(_PR_PTHREADS) */
 
-typedef PRUintn PTDebug;
-#define PT_GetStats(_p)
-#define PT_FPrintStats(_fd, _msg)
+NSPR_API(void) PT_FPrintStats(PRFileDesc *fd, const char *msg);
 
 /*
 ** This section is contains those parts needed to implement NSPR on
 ** platforms in general. One would assume that the pthreads implementation
 ** included lots of the same types, at least conceptually.
 */
 
 /*
--- a/pr/include/prolock.h
+++ b/pr/include/prolock.h
@@ -34,18 +34,16 @@
 
 #ifndef prolock_h___
 #define prolock_h___
 
 #include "prtypes.h"
 
 PR_BEGIN_EXTERN_C
 
-#if defined(DEBUG) || defined(FORCE_NSPR_ORDERED_LOCKS)
-
 /*
 ** A locking mechanism, built on the existing PRLock definiion,
 ** is provided that will permit applications to define a Lock
 ** Hierarchy (or Lock Ordering) schema. An application designed
 ** using the Ordered Lock functions will terminate with a
 ** diagnostic message when a lock inversion condition is
 ** detected. 
 ** 
@@ -75,17 +73,28 @@ PR_BEGIN_EXTERN_C
 */
 
 /*
 ** Opaque type for ordered lock.
 ** ... Don't even think of looking in here.
 **
 */
 
+#if defined(DEBUG) || defined(FORCE_NSPR_ORDERED_LOCKS)
 typedef void * PROrderedLock;
+#else
+/*
+** Map PROrderedLock and methods onto PRLock when ordered locking
+** is not compiled in.
+**  
+*/
+#include <prlock.h>
+
+typedef PRLock PROrderedLock;
+#endif
 
 /* -----------------------------------------------------------------------
 ** FUNCTION: PR_CreateOrderedLock() -- Create an Ordered Lock
 ** 
 ** DESCRIPTION: PR_CreateOrderedLock() creates an ordered lock.
 ** 
 ** INPUTS:
 **  order: user defined order of this lock.
@@ -93,18 +102,22 @@ typedef void * PROrderedLock;
 ** 
 ** OUTPUTS: returned
 ** 
 ** RETURNS: PR_OrderedLock pointer
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_ORDERED_LOCKS)
 #define PR_CREATE_ORDERED_LOCK(order,name)\
     PR_CreateOrderedLock((order),(name))
+#else
+#define PR_CREATE_ORDERED_LOCK(order) PR_NewLock()
+#endif
 
 NSPR_API(PROrderedLock *) 
     PR_CreateOrderedLock( 
         PRInt32 order,
         const char *name
 );
 
 /* -----------------------------------------------------------------------
@@ -117,17 +130,21 @@ NSPR_API(PROrderedLock *)
 ** 
 ** OUTPUTS: the lock is destroyed
 ** 
 ** RETURNS: void
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_ORDERED_LOCKS)
 #define PR_DESTROY_ORDERED_LOCK(lock) PR_DestroyOrderedLock((lock))
+#else
+#define PR_DESTROY_ORDERED_LOCK(lock) PR_DestroyLock((lock))
+#endif
 
 NSPR_API(void) 
     PR_DestroyOrderedLock( 
         PROrderedLock *lock 
 );
 
 /* -----------------------------------------------------------------------
 ** FUNCTION: PR_LockOrderedLock() -- Lock an ordered lock
@@ -141,17 +158,21 @@ NSPR_API(void)
 ** 
 ** OUTPUTS: The lock is held or the fucntion asserts.
 ** 
 ** RETURNS: void
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_ORDERED_LOCKS)
 #define PR_LOCK_ORDERED_LOCK(lock) PR_LockOrderedLock((lock))
+#else
+#define PR_LOCK_ORDERED_LOCK(lock) PR_Lock((lock))
+#endif
 
 NSPR_API(void) 
     PR_LockOrderedLock( 
         PROrderedLock *lock 
 );
 
 /* -----------------------------------------------------------------------
 ** FUNCTION: PR_UnlockOrderedLock() -- unlock and Ordered Lock
@@ -165,48 +186,22 @@ NSPR_API(void)
 ** 
 ** RETURNS:
 **  PR_SUCCESS
 **  PR_FAILURE
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined(DEBUG) || defined(FORCE_NSPR_ORDERED_LOCKS)
 #define PR_UNLOCK_ORDERED_LOCK(lock) PR_UnlockOrderedLock((lock))
+#else
+#define PR_UNLOCK_ORDERED_LOCK(lock) PR_Unlock((lock))
+#endif
 
 NSPR_API(PRStatus) 
     PR_UnlockOrderedLock( 
         PROrderedLock *lock 
 );
 
-#else /* !(defined(DEBUG) || defined(FORCE_NSPR_ORDERED_LOCKS)) */
-/*
-** Map PROrderedLock and methods onto PRLock when ordered locking
-** is not compiled in.
-**  
-*/
-#include <prlock.h>
-
-typedef PRLock PROrderedLock;
-
-#define PR_CREATE_ORDERED_LOCK(order) PR_NewLock()
-#define PR_DESTROY_ORDERED_LOCK(lock) PR_DestroyLock((lock))
-#define PR_LOCK_ORDERED_LOCK(lock) PR_Lock((lock))
-#define PR_UNLOCK_ORDERED_LOCK(lock) PR_Unlock((lock))
-
-#endif /* !(defined(DEBUG) || defined(FORCE_NSPR_ORDERED_LOCKS)) */
-
 PR_END_EXTERN_C
 
 #endif /* prolock_h___ */
-
-
-
-
-
-
-
-
-
-
-
-
-
--- a/pr/include/prtrace.h
+++ b/pr/include/prtrace.h
@@ -98,17 +98,16 @@ PR_BEGIN_EXTERN_C
 
 /*
 ** Opaque type for the trace handle 
 ** ... Don't even think about looking in here.
 **
 */
 typedef void *  PRTraceHandle;
 
-#if defined (DEBUG) || defined (FORCE_NSPR_TRACE)
 /*
 ** PRTraceEntry -- A trace entry in the in-memory trace buffer
 ** looks like this.
 **
 */
 typedef struct PRTraceEntry
 {
     PRThread        *thread;        /* The thread creating the trace entry */
@@ -148,18 +147,22 @@ typedef enum PRTraceOption
 /* -----------------------------------------------------------------------
 ** FUNCTION: PR_INIT_TRACE_HANDLE() -- Set the value of a PRTraceHandle
 ** 
 ** DESCRIPTION: 
 ** PR_INIT_TRACE_HANDLE() sets the value of a PRTraceHandle
 ** to value. e.g. PR_INIT_TRACE_HANDLE( myHandle, NULL );
 ** 
 */
+#if defined (DEBUG) || defined (FORCE_NSPR_TRACE)
 #define PR_INIT_TRACE_HANDLE(handle,value)\
     (handle) = (PRCounterHandle)(value)
+#else
+#define PR_INIT_TRACE_HANDLE(handle,value)
+#endif
 
 
 /* -----------------------------------------------------------------------
 ** FUNCTION: PR_CreateTrace() -- Create a trace handle
 ** 
 ** DESCRIPTION:
 **  PR_CreateTrace() creates a new trace handle. Tracing is
 **  enabled for this handle when it is created. The trace handle
@@ -187,18 +190,22 @@ typedef enum PRTraceOption
 **  qName is limited to 31 characters.
 **  rName is limited to 31 characters.
 **  description is limited to 255 characters.
 ** 
 */
 #define PRTRACE_NAME_MAX 31
 #define PRTRACE_DESC_MAX 255
 
+#if defined (DEBUG) || defined (FORCE_NSPR_TRACE)
 #define PR_CREATE_TRACE(handle,qName,rName,description)\
     (handle) = PR_CreateTrace((qName),(rName),(description))
+#else
+#define PR_CREATE_TRACE(handle,qName,rName,description)
+#endif
 
 NSPR_API(PRTraceHandle)
 	PR_CreateTrace( 
     	const char *qName,          /* QName for this trace handle */
 	    const char *rName,          /* RName for this trace handle */
 	    const char *description     /* description for this trace handle */
 );
 
@@ -217,18 +224,22 @@ NSPR_API(PRTraceHandle)
 **  The trace handle is unregistered.
 **  The QName, RName and description are removed.
 ** 
 ** RETURNS: void
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined (DEBUG) || defined (FORCE_NSPR_TRACE)
 #define PR_DESTROY_TRACE(handle)\
     PR_DestroyTrace((handle))
+#else
+#define PR_DESTROY_TRACE(handle)
+#endif
 
 NSPR_API(void) 
 	PR_DestroyTrace( 
 		PRTraceHandle handle    /* Handle to be destroyed */
 );
 
 
 /* -----------------------------------------------------------------------
@@ -254,18 +265,22 @@ NSPR_API(void)
 **  A PRTraceEntry is (conditionally) formatted in the in-memory
 ** trace buffer.
 ** 
 ** RETURNS: void.
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined (DEBUG) || defined (FORCE_NSPR_TRACE)
 #define PR_TRACE(handle,ud0,ud1,ud2,ud3,ud4,ud5,ud6,ud7)\
     PR_Trace((handle),(ud0),(ud1),(ud2),(ud3),(ud4),(ud5),(ud6),(ud7))
+#else
+#define PR_TRACE(handle,ud0,ud1,ud2,ud3,ud4,ud5,ud6,ud7)
+#endif
 
 NSPR_API(void) 
 	PR_Trace( 
     	PRTraceHandle handle,       /* use this trace handle */
 	    PRUint32    userData0,      /* User supplied data word 0 */
 	    PRUint32    userData1,      /* User supplied data word 1 */
 	    PRUint32    userData2,      /* User supplied data word 2 */
 	    PRUint32    userData3,      /* User supplied data word 3 */
@@ -337,18 +352,22 @@ NSPR_API(void)
 ** OUTPUTS:
 **  The operation of the Trace Facility may be changed.
 ** 
 ** RETURNS: void
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined (DEBUG) || defined (FORCE_NSPR_TRACE)
 #define PR_SET_TRACE_OPTION(command,value)\
     PR_SetTraceOption((command),(value))
+#else
+#define PR_SET_TRACE_OPTION(command,value)
+#endif
 
 NSPR_API(void) 
 	PR_SetTraceOption( 
 	    PRTraceOption command,  /* One of the enumerated values */
 	    void *value             /* command value or NULL */
 );
 
 
@@ -371,18 +390,22 @@ NSPR_API(void)
 ** OUTPUTS:
 **  dependent on command.
 ** 
 ** RETURNS: void
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined (DEBUG) || defined (FORCE_NSPR_TRACE)
 #define PR_GET_TRACE_OPTION(command,value)\
     PR_GetTraceOption((command),(value))
+#else
+#define PR_GET_TRACE_OPTION(command,value)
+#endif
 
 NSPR_API(void) 
 	PR_GetTraceOption( 
     	PRTraceOption command,  /* One of the enumerated values */
 	    void *value             /* command value or NULL */
 );
 
 /* -----------------------------------------------------------------------
@@ -403,18 +426,22 @@ NSPR_API(void)
 ** 
 ** RETURNS: 
 **  PRTraceHandle associated with qName and rName or NULL when
 ** there is no match.
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined (DEBUG) || defined (FORCE_NSPR_TRACE)
 #define PR_GET_TRACE_HANDLE_FROM_NAME(handle,qName,rName)\
     (handle) = PR_GetTraceHandleFromName((qName),(rName))
+#else
+#define PR_GET_TRACE_HANDLE_FROM_NAME(handle,qName,rName)
+#endif
 
 NSPR_API(PRTraceHandle) 
 	PR_GetTraceHandleFromName( 
     	const char *qName,      /* QName search argument */
         const char *rName       /* RName search argument */
 );
 
 /* -----------------------------------------------------------------------
@@ -431,18 +458,22 @@ NSPR_API(PRTraceHandle)
 ** rName and description. ... Don't mess with these values.
 ** They're mine.
 ** 
 ** RETURNS: void
 ** 
 ** RESTRICTIONS:
 ** 
 */
+#if defined (DEBUG) || defined (FORCE_NSPR_TRACE)
 #define PR_GET_TRACE_NAME_FROM_HANDLE(handle,qName,rName,description)\
     PR_GetTraceNameFromHandle((handle),(qName),(rName),(description))
+#else
+#define PR_GET_TRACE_NAME_FROM_HANDLE(handle,qName,rName,description)
+#endif
 
 NSPR_API(void) 
 	PR_GetTraceNameFromHandle( 
     	PRTraceHandle handle,       /* handle as search argument */
 	    const char **qName,         /* pointer to associated QName */
 	    const char **rName,         /* pointer to associated RName */
     	const char **description    /* pointer to associated description */
 );
@@ -469,18 +500,22 @@ NSPR_API(void)
 **  PRTraceHandle or NULL when there are no trace handles.
 ** 
 ** RESTRICTIONS:
 **  Iterating thru the trace handles via FindFirst/FindNext
 ** should be done under protection of the trace handle lock.
 ** See: PR_SetTraceOption( PRLockTraceHandles ).
 ** 
 */
+#if defined (DEBUG) || defined (FORCE_NSPR_TRACE)
 #define PR_FIND_NEXT_TRACE_QNAME(next,handle)\
     (next) = PR_FindNextTraceQname((handle))
+#else
+#define PR_FIND_NEXT_TRACE_QNAME(next,handle)
+#endif
 
 NSPR_API(PRTraceHandle) 
 	PR_FindNextTraceQname( 
         PRTraceHandle handle
 );
 
 
 /* -----------------------------------------------------------------------
@@ -507,18 +542,22 @@ NSPR_API(PRTraceHandle)
 **  PRTraceHandle or NULL when there are no trace handles.
 ** 
 ** RESTRICTIONS:
 **  Iterating thru the trace handles via FindNext should be done
 ** under protection of the trace handle lock. See: (
 ** PR_SetTraceOption( PRLockTraceHandles ).
 ** 
 */
+#if defined (DEBUG) || defined (FORCE_NSPR_TRACE)
 #define PR_FIND_NEXT_TRACE_RNAME(next,rhandle,qhandle)\
     (next) = PR_FindNextTraceRname((rhandle),(qhandle))
+#else
+#define PR_FIND_NEXT_TRACE_RNAME(next,rhandle,qhandle)
+#endif
 
 NSPR_API(PRTraceHandle) 
 	PR_FindNextTraceRname( 
         PRTraceHandle rhandle,
         PRTraceHandle qhandle
 );
 
 /* -----------------------------------------------------------------------
@@ -559,18 +598,22 @@ NSPR_API(PRTraceHandle)
 ** 
 ** RESTRICTIONS:
 ** Only one thread can call PR_RecordTraceEntries() within a
 ** process.
 ** 
 ** On error, PR_RecordTraceEntries() may return prematurely.
 ** 
 */
+#if defined (DEBUG) || defined (FORCE_NSPR_TRACE)
 #define PR_RECORD_TRACE_ENTRIES()\
 	PR_RecordTraceEntries()
+#else
+#define PR_RECORD_TRACE_ENTRIES()
+#endif
     
 NSPR_API(void)
 	PR_RecordTraceEntries(
         void 
 );
 
 /* -----------------------------------------------------------------------
 ** FUNCTION: PR_GetTraceEntries() -- Retreive trace entries from
@@ -607,45 +650,26 @@ NSPR_API(void)
 ** 
 ** RESTRICTIONS:
 ** This is a real performance pig. The copy out operation is bad
 ** enough, but depending on then frequency of calls to the
 ** function, serious performance impact to the operating
 ** application may be realized. ... YMMV.
 ** 
 */
+#if defined (DEBUG) || defined (FORCE_NSPR_TRACE)
 #define PR_GET_TRACE_ENTRIES(buffer,count,found)\
         PR_GetTraceEntries((buffer),(count),(found))
-
+#else
+#define PR_GET_TRACE_ENTRIES(buffer,count,found)
+#endif
 
 NSPR_API(PRIntn)
     PR_GetTraceEntries(
         PRTraceEntry    *buffer,    /* where to write output */
         PRInt32         count,      /* number to get */
         PRInt32         *found      /* number you got */
 );
 
-#else /* !(defined (DEBUG) || defined (FORCE_NSPR_TRACE)) */
-/*
-** Define the Trace Facility macros as No-Ops for when the trace
-** facility is to be compiled-out of the application.
-**
-*/
-#define PR_DEFINE_TRACE(name) PRTraceHandle name
-#define PR_INIT_TRACE_HANDLE(handle,value)
-#define PR_CREATE_TRACE(handle,qName,rName,description)
-#define PR_DESTROY_TRACE(handle)
-#define PR_TRACE(handle,ud0,ud1,ud2,ud3,ud4,ud5,ud6,ud7)
-#define PR_SET_TRACE_OPTION(command,value)
-#define PR_GET_TRACE_OPTION(command,value)
-#define PR_GET_TRACE_HANDLE_FROM_NAME(handle,qName,rName)
-#define PR_GET_TRACE_NAME_FROM_HANDLE(handle,qName,rName,description)
-#define PR_FIND_NEXT_TRACE_QNAME(next,handle)
-#define PR_FIND_NEXT_TRACE_RNAME(next,rhandle,qhandle)
-#define PR_GET_TRACE_ENTRIES(buffer,count,found)
-#define PR_RECORD_TRACE_ENTRIES()
-
-#endif /* !(defined (DEBUG) || defined (FORCE_NSPR_TRACE)) */
-
 PR_END_EXTERN_C
 
 #endif /* prtrace_h___ */
 
--- a/pr/src/Makefile.in
+++ b/pr/src/Makefile.in
@@ -64,36 +64,51 @@ endif
 #
 # Define platform-dependent OS_LIBS
 #
 
 ifeq ($(OS_ARCH),SunOS)
 ifeq ($(OS_RELEASE),4.1.3_U1)
 OS_LIBS			= -lm
 else	# 4.1.3_U1
-
+MAPFILE = $(OBJDIR)/nsprmap.sun
+GARBAGE += $(MAPFILE)
+MKSHLIB += -M $(MAPFILE)
+#
+# A "cpu" subdirectory will be created in this directory if NSDISTMODE
+# is not "copy".  (See the comments in pr/src/md/unix/Makefile.in for
+# the reason.)  This needs to be removed, too.
+#
+ifneq ($(NSDISTMODE),copy)
+GARBAGE += cpu
+endif
 #
 # In Solaris 2.6 or earlier, -lrt is called -lposix4.
 # 
 LIBRT_TEST=$(firstword $(sort 5.7 $(OS_RELEASE)))
 ifeq (5.7, $(LIBRT_TEST))
 LIBRT=-lrt
 else
 LIBRT=-lposix4
 endif
 
 ifdef USE_PTHREADS
-OS_LIBS			= -lpthread -lthread ${LIBRT} -lsocket -lnsl -ldl
+OS_LIBS			= -lpthread -lthread ${LIBRT} -lsocket -lnsl -ldl -lc
 else
 ifdef LOCAL_THREADS_ONLY
-OS_LIBS			= -lsocket -lnsl -ldl
+OS_LIBS			= -lsocket -lnsl -ldl -lc
 else
-OS_LIBS			= -lthread ${LIBRT} -lsocket -lnsl -ldl
+OS_LIBS			= -lthread ${LIBRT} -lsocket -lnsl -ldl -lc
 endif	# LOCAL_THREADS_ONLY
 endif	# USE_PTHREADS
+ifeq ($(OS_TEST),sun4u)
+ifndef USE_64
+DSO_LDOPTS	+= -f \$$ORIGIN/cpu/\$$ISALIST/lib$(ULTRASPARC_LIBRARY)$(LIBRARY_VERSION).so
+endif
+endif	# sun4u
 endif	# 4.1.3_U1
 endif	# SunOS
 
 ifeq ($(OS_ARCH), IRIX)
 ifeq ($(USE_PTHREADS), 1)
 OS_LIBS = -lpthread
 endif
 OS_LIBS += -lc
--- a/pr/src/io/prio.c
+++ b/pr/src/io/prio.c
@@ -183,8 +183,17 @@ PR_IMPLEMENT(PRStatus) PR_SetFDInheritab
 #else
 #ifdef XP_MAC
 #pragma unused (fd, inheritable)
 #endif
     PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
     return PR_FAILURE;
 #endif
 }
+
+/*
+** This function only has a useful implementation in the debug build of
+** the pthreads version.
+*/
+PR_IMPLEMENT(void) PT_FPrintStats(PRFileDesc *debug_out, const char *msg)
+{
+    /* do nothing */
+}  /* PT_FPrintStats */
--- a/pr/src/io/prprf.c
+++ b/pr/src/io/prprf.c
@@ -84,70 +84,67 @@ struct SprintfStateStr {
 /*
 ** Numbered Arguement State
 */
 struct NumArgState{
     int	    type;		/* type of the current ap                    */
     va_list ap;			/* point to the corresponding position on ap */
 };
 
-static PRBool  l10n_debug_init = PR_FALSE;
-static PRBool  l10n_debug = PR_FALSE;
-
 #define NAS_DEFAULT_NUM 20  /* default number of NumberedArgumentState array */
 
 
 #define TYPE_INT16	0
 #define TYPE_UINT16	1
 #define TYPE_INTN	2
 #define TYPE_UINTN	3
 #define TYPE_INT32	4
 #define TYPE_UINT32	5
 #define TYPE_INT64	6
 #define TYPE_UINT64	7
 #define TYPE_STRING	8
 #define TYPE_DOUBLE	9
 #define TYPE_INTSTR	10
 #define TYPE_UNKNOWN	20
 
-#define _LEFT		0x1
-#define _SIGNED		0x2
-#define _SPACED		0x4
-#define _ZEROS		0x8
-#define _NEG		0x10
+#define FLAG_LEFT	0x1
+#define FLAG_SIGNED	0x2
+#define FLAG_SPACED	0x4
+#define FLAG_ZEROS	0x8
+#define FLAG_NEG	0x10
 
 /*
 ** Fill into the buffer using the data in src
 */
 static int fill2(SprintfState *ss, const char *src, int srclen, int width,
 		int flags)
 {
     char space = ' ';
     int rv;
 
     width -= srclen;
-    if ((width > 0) && ((flags & _LEFT) == 0)) {	/* Right adjusting */
-	if (flags & _ZEROS) {
+    if ((width > 0) && ((flags & FLAG_LEFT) == 0)) {	/* Right adjusting */
+	if (flags & FLAG_ZEROS) {
 	    space = '0';
 	}
 	while (--width >= 0) {
 	    rv = (*ss->stuff)(ss, &space, 1);
 	    if (rv < 0) {
 		return rv;
 	    }
 	}
     }
 
     /* Copy out the source data */
     rv = (*ss->stuff)(ss, src, srclen);
     if (rv < 0) {
 	return rv;
     }
 
-    if ((width > 0) && ((flags & _LEFT) != 0)) {	/* Left adjusting */
+    if ((width > 0) && ((flags & FLAG_LEFT) != 0)) {	/* Left adjusting */
 	while (--width >= 0) {
 	    rv = (*ss->stuff)(ss, &space, 1);
 	    if (rv < 0) {
 		return rv;
 	    }
 	}
     }
     return 0;
@@ -164,44 +161,44 @@ static int fill_n(SprintfState *ss, cons
     int signwidth = 0;
     int leftspaces = 0;
     int rightspaces = 0;
     int cvtwidth;
     int rv;
     char sign;
 
     if ((type & 1) == 0) {
-	if (flags & _NEG) {
+	if (flags & FLAG_NEG) {
 	    sign = '-';
 	    signwidth = 1;
-	} else if (flags & _SIGNED) {
+	} else if (flags & FLAG_SIGNED) {
 	    sign = '+';
 	    signwidth = 1;
-	} else if (flags & _SPACED) {
+	} else if (flags & FLAG_SPACED) {
 	    sign = ' ';
 	    signwidth = 1;
 	}
     }
     cvtwidth = signwidth + srclen;
 
     if (prec > 0) {
 	if (prec > srclen) {
 	    precwidth = prec - srclen;		/* Need zero filling */
 	    cvtwidth += precwidth;
 	}
     }
 
-    if ((flags & _ZEROS) && (prec < 0)) {
+    if ((flags & FLAG_ZEROS) && (prec < 0)) {
 	if (width > cvtwidth) {
 	    zerowidth = width - cvtwidth;	/* Zero filling */
 	    cvtwidth += zerowidth;
 	}
     }
 
-    if (flags & _LEFT) {
+    if (flags & FLAG_LEFT) {
 	if (width > cvtwidth) {
 	    /* Space filling on the right (i.e. left adjusting) */
 	    rightspaces = width - cvtwidth;
 	}
     } else {
 	if (width > cvtwidth) {
 	    /* Space filling on the left (i.e. right adjusting) */
 	    leftspaces = width - cvtwidth;
@@ -407,30 +404,16 @@ static struct NumArgState* BuildArgArray
 {
     int number = 0, cn = 0, i;
     const char* p;
     char  c;
     struct NumArgState* nas;
     
 
     /*
-    ** set the l10n_debug flag
-    ** this routine should be executed only once
-    ** 'cause getenv does take time
-    */
-    if( !l10n_debug_init ){
-	l10n_debug_init = PR_TRUE;
-	p = getenv( "NETSCAPE_LOCALIZATION_DEBUG" );
-	if( ( p != NULL ) && ( *p == '1' ) ){
-	    l10n_debug = PR_TRUE;
-	}
-    }
-
-
-    /*
     **	first pass:
     **	detemine how many legal % I have got, then allocate space
     */
 
     p = fmt;
     *rv = 0;
     i = 0;
     while( ( c = *p++ ) != 0 ){
@@ -439,50 +422,42 @@ static struct NumArgState* BuildArgArray
 	if( ( c = *p++ ) == '%' )	/* skip %% case */
 	    continue;
 
 	while( c != 0 ){
 	    if( c > '9' || c < '0' ){
 		if( c == '$' ){		/* numbered argument csae */
 		    if( i > 0 ){
 			*rv = -1;
-			if( l10n_debug )
-			    printf( "either no *OR* all arguments are numbered \"%s\"\n", fmt );
 			return NULL;
 		    }
 		    number++;
-		    break;
-
 		} else{			/* non-numbered argument case */
 		    if( number > 0 ){
-			if( l10n_debug )
-			    printf( "either no *OR* all arguments are numbered \"%s\"\n", fmt );
 			*rv = -1;
 			return NULL;
 		    }
 		    i = 1;
-		    break;
 		}
+		break;
 	    }
 
 	    c = *p++;
 	}
     }
 
     if( number == 0 ){
 	return NULL;
     }
 
     
     if( number > NAS_DEFAULT_NUM ){
 	nas = (struct NumArgState*)PR_MALLOC( number * sizeof( struct NumArgState ) );
 	if( !nas ){
 	    *rv = -1;
-	    if( l10n_debug )
-		printf( "PR_MALLOC() error for \"%s\"\n", fmt );
 	    return NULL;
 	}
     } else {
 	nas = nasArray;
     }
 
     for( i = 0; i < number; i++ ){
 	nas[i].type = TYPE_UNKNOWN;
@@ -503,54 +478,48 @@ static struct NumArgState* BuildArgArray
 	cn = 0;
 	while( c && c != '$' ){	    /* should imporve error check later */
 	    cn = cn*10 + c - '0';
 	    c = *p++;
 	}
 
 	if( !c || cn < 1 || cn > number ){
 	    *rv = -1;
-	    if( l10n_debug )
-		printf( "invalid argument number (valid range [1, %d]), \"%s\"\n", number, fmt );
 	    break;
         }
 
 	/* nas[cn] starts from 0, and make sure nas[cn].type is not assigned */
         cn--;
 	if( nas[cn].type != TYPE_UNKNOWN )
 	    continue;
 
         c = *p++;
 
         /* width */
         if (c == '*') {
 	    /* not supported feature, for the argument is not numbered */
 	    *rv = -1;
-	    if( l10n_debug )
-		printf( "* width specifier not support for numbered arguments \"%s\"\n", fmt );
 	    break;
-	} else {
-	    while ((c >= '0') && (c <= '9')) {
-	        c = *p++;
-	    }
+	}
+
+	while ((c >= '0') && (c <= '9')) {
+	    c = *p++;
 	}
 
 	/* precision */
 	if (c == '.') {
 	    c = *p++;
 	    if (c == '*') {
 	        /* not supported feature, for the argument is not numbered */
-		if( l10n_debug )
-		    printf( "* precision specifier not support for numbered arguments \"%s\"\n", fmt );
 	        *rv = -1;
 	        break;
-	    } else {
-	        while ((c >= '0') && (c <= '9')) {
-		    c = *p++;
-		}
+	    }
+
+	    while ((c >= '0') && (c <= '9')) {
+		c = *p++;
 	    }
 	}
 
 	/* size */
 	nas[cn].type = TYPE_INTN;
 	if (c == 'h') {
 	    nas[cn].type = TYPE_INT16;
 	    c = *p++;
@@ -617,18 +586,16 @@ static struct NumArgState* BuildArgArray
 	default:
 	    PR_ASSERT(0);
 	    nas[ cn ].type = TYPE_UNKNOWN;
 	    break;
 	}
 
 	/* get a legal para. */
 	if( nas[ cn ].type == TYPE_UNKNOWN ){
-	    if( l10n_debug )
-		printf( "unknown type \"%s\"\n", fmt );
 	    *rv = -1;
 	    break;
 	}
     }
 
 
     /*
     ** third pass
@@ -752,18 +719,16 @@ static int dosprintf(SprintfState *ss, c
 	    /* the fmt contains the Numbered Arguments feature */
 	    i = 0;
 	    while( c && c != '$' ){	    /* should imporve error check later */
 		i = ( i * 10 ) + ( c - '0' );
 		c = *fmt++;
 	    }
 
 	    if( nas[i-1].type == TYPE_UNKNOWN ){
-		if( l10n_debug )
-		    printf( "numbered argument type unknown\n" );
 		if( nas && ( nas != nasArray ) )
 		    PR_DELETE( nas );
 		return -1;
 	    }
 
 	    ap = nas[i-1].ap;
 	    dolPt = fmt;
 	    c = *fmt++;
@@ -772,24 +737,24 @@ static int dosprintf(SprintfState *ss, c
 	/*
 	 * Examine optional flags.  Note that we do not implement the
 	 * '#' flag of sprintf().  The ANSI C spec. of the '#' flag is
 	 * somewhat ambiguous and not ideal, which is perhaps why
 	 * the various sprintf() implementations are inconsistent
 	 * on this feature.
 	 */
 	while ((c == '-') || (c == '+') || (c == ' ') || (c == '0')) {
-	    if (c == '-') flags |= _LEFT;
-	    if (c == '+') flags |= _SIGNED;
-	    if (c == ' ') flags |= _SPACED;
-	    if (c == '0') flags |= _ZEROS;
+	    if (c == '-') flags |= FLAG_LEFT;
+	    if (c == '+') flags |= FLAG_SIGNED;
+	    if (c == ' ') flags |= FLAG_SPACED;
+	    if (c == '0') flags |= FLAG_ZEROS;
 	    c = *fmt++;
 	}
-	if (flags & _SIGNED) flags &= ~_SPACED;
-	if (flags & _LEFT) flags &= ~_ZEROS;
+	if (flags & FLAG_SIGNED) flags &= ~FLAG_SPACED;
+	if (flags & FLAG_LEFT) flags &= ~FLAG_ZEROS;
 
 	/* width */
 	if (c == '*') {
 	    c = *fmt++;
 	    width = va_arg(ap, int);
 	} else {
 	    width = 0;
 	    while ((c >= '0') && (c <= '9')) {
@@ -861,54 +826,54 @@ static int dosprintf(SprintfState *ss, c
 	    goto fetch_and_convert;
 
 	  fetch_and_convert:
 	    switch (type) {
 	      case TYPE_INT16:
 		u.l = va_arg(ap, int);
 		if (u.l < 0) {
 		    u.l = -u.l;
-		    flags |= _NEG;
+		    flags |= FLAG_NEG;
 		}
 		goto do_long;
 	      case TYPE_UINT16:
 		u.l = va_arg(ap, int) & 0xffff;
 		goto do_long;
 	      case TYPE_INTN:
 		u.l = va_arg(ap, int);
 		if (u.l < 0) {
 		    u.l = -u.l;
-		    flags |= _NEG;
+		    flags |= FLAG_NEG;
 		}
 		goto do_long;
 	      case TYPE_UINTN:
 		u.l = (long)va_arg(ap, unsigned int);
 		goto do_long;
 
 	      case TYPE_INT32:
 		u.l = va_arg(ap, PRInt32);
 		if (u.l < 0) {
 		    u.l = -u.l;
-		    flags |= _NEG;
+		    flags |= FLAG_NEG;
 		}
 		goto do_long;
 	      case TYPE_UINT32:
 		u.l = (long)va_arg(ap, PRUint32);
 	      do_long:
 		rv = cvt_l(ss, u.l, width, prec, radix, type, flags, hexp);
 		if (rv < 0) {
 		    return rv;
 		}
 		break;
 
 	      case TYPE_INT64:
 		u.ll = va_arg(ap, PRInt64);
 		if (!LL_GE_ZERO(u.ll)) {
 		    LL_NEG(u.ll, u.ll);
-		    flags |= _NEG;
+		    flags |= FLAG_NEG;
 		}
 		goto do_longlong;
 	      case TYPE_UINT64:
 		u.ll = va_arg(ap, PRUint64);
 	      do_longlong:
 		rv = cvt_ll(ss, u.ll, width, prec, radix, type, flags, hexp);
 		if (rv < 0) {
 		    return rv;
@@ -934,29 +899,29 @@ static int dosprintf(SprintfState *ss, c
 
 	    if (rv < 0) {
 		return rv;
 	    }
 	    break;
 
 	  case 'c':
 	    u.ch = va_arg(ap, int);
-            if ((flags & _LEFT) == 0) {
+            if ((flags & FLAG_LEFT) == 0) {
                 while (width-- > 1) {
                     rv = (*ss->stuff)(ss, " ", 1);
                     if (rv < 0) {
                         return rv;
                     }
                 }
             }
 	    rv = (*ss->stuff)(ss, &u.ch, 1);
 	    if (rv < 0) {
 		return rv;
 	    }
-            if (flags & _LEFT) {
+            if (flags & FLAG_LEFT) {
                 while (width-- > 1) {
                     rv = (*ss->stuff)(ss, " ", 1);
                     if (rv < 0) {
                         return rv;
                     }
                 }
             }
 	    break;
--- a/pr/src/md/mac/macio.c
+++ b/pr/src/md/mac/macio.c
@@ -1291,17 +1291,19 @@ ConvertUnixPathToMacPath(const char *uni
 	else {
 		// WeĠre root-relative.  This is either a special Unix directory, or a 
 		// full path (which weĠll support on the Mac since they might be generated).
 		// This is not condoning the use of full-paths on the Macintosh for file 
 		// specification.
 		
 		FSSpec		foundSpec;
 		short		pathBufferSize;
+#if DEBUG	
 		char		*temp;
+#endif
 		int		tempLen;
 
 		// Are we dealing with the temp folder?
 		if ((strncmp(unixPath, "/usr/tmp", strlen("/usr/tmp")) == 0) || 
 			((strncmp(unixPath, "/tmp", strlen("/tmp")) == 0))) {
 		    CInfoPBRec pb;
 
 			unixPath = PL_strchr(unixPath, PR_DIRECTORY_SEPARATOR);
--- a/pr/src/md/unix/Makefile.in
+++ b/pr/src/md/unix/Makefile.in
@@ -71,16 +71,18 @@ ifeq ($(OS_ARCH),SunOS)
 			ULTRASPARC_ASOBJS = $(addprefix $(OBJDIR)/,$(ULTRASPARC_ASFILES:.s=.$(OBJ_SUFFIX)))
 		else
 			LIBRARY_NAME = $(ULTRASPARC_LIBRARY)
 			LIBRARY_VERSION = $(MOD_MAJOR_VERSION)
 			ULTRASPARC_ASFILES = os_SunOS_ultrasparc.s
 			ULTRASPARC_ASOBJS = $(addprefix $(OBJDIR)/,$(ULTRASPARC_ASFILES:.s=.$(OBJ_SUFFIX)))
 			TARGETS		+= $(ULTRASPARC_ASOBJS) $(SHARED_LIBRARY)
 			RELEASE_LIBS = $(SHARED_LIBRARY)
+			RELEASE_LIBS_DEST = $(RELEASE_LIB_DIR)/cpu/sparcv8plus
+			lib_subdir = cpu/sparcv8plus
 		endif
 		endif
 	endif
 endif
 
 INCLUDES = -I$(dist_includedir) -I$(topsrcdir)/pr/include -I$(topsrcdir)/pr/include/private
 
 DEFINES	+= -D_NSPR_BUILD_
@@ -93,18 +95,28 @@ ifeq ($(OS_ARCH),SunOS)
 ifneq ($(OS_RELEASE),4.1.3_U1)
 ifeq ($(OS_TEST),sun4u)
 
 ifdef USE_64
 $(ULTRASPARC_ASOBJS): $(ULTRASPARC_ASFILES)
 	/usr/ccs/bin/as -o $@ -K PIC -P -D_ASM -D__STDC__=0 -xarch=v9 $<
 else
 $(SHARED_LIBRARY): $(ULTRASPARC_ASOBJS)
-	$(LD) -G -z text -o $@ $(ULTRASPARC_ASOBJS)
-	$(INSTALL) -m 444 $@ $(dist_libdir)
+	$(LD) -G -z text -z endfiltee -o $@ $(ULTRASPARC_ASOBJS)
+	$(INSTALL) -m 444 $@ $(dist_libdir)/cpu/sparcv8plus
+#
+# The -f $(ORIGIN)/... linker flag uses the real file, after symbolic links
+# are resolved, as the origin.  If NSDISTMODE is not "copy", libnspr4.so
+# will be installed as a symbolic link in $(dist_libdir), pointing to the
+# real libnspr4.so file in pr/src.  Therefore we need to install an
+# additional copy of libnspr_flt4.so in pr/src/cpu/sparcv8plus.
+#
+ifneq ($(NSDISTMODE),copy)
+	$(INSTALL) -m 444 $@ ../../cpu/sparcv8plus
+endif
 
 $(ULTRASPARC_ASOBJS): $(ULTRASPARC_ASFILES)
 	/usr/ccs/bin/as -o $@ -K PIC -P -D_ASM -D__STDC__=0 -xarch=v8plus $<
 
 clean::
 	rm -rf $(ULTRASPARC_ASOBJS)
 endif
 
--- a/pr/src/misc/Makefile.in
+++ b/pr/src/misc/Makefile.in
@@ -77,24 +77,16 @@ TARGETS	= $(OBJS)
 INCLUDES = -I$(dist_includedir) -I$(topsrcdir)/pr/include -I$(topsrcdir)/pr/include/private
 
 DEFINES	+= -D_NSPR_BUILD_
 
 RELEASE_BINS = $(srcdir)/compile-et.pl $(srcdir)/prerr.properties
 
 include $(topsrcdir)/config/rules.mk
 
-# An AIX Optimization bug causes PR_dtoa() to produce wrong result.
-# This suppresses optimization for this single compilation unit.
-ifeq ($(OS_ARCH), AIX)
-$(OBJDIR)/prdtoa.o: prdtoa.c
-	@$(MAKE_OBJDIR)
-	$(CC) -o $@ -c $(filter-out -O, $(CFLAGS)) $<
-endif
-
 #
 # Generate prerr.h, prerr.c, and prerr.properties from prerr.et.
 #
 build_prerr:
 	cd $(srcdir); $(PERL) compile-et.pl prerr.et
 
 export:: $(TARGETS)
 
--- a/pr/src/misc/pralarm.c
+++ b/pr/src/misc/pralarm.c
@@ -111,17 +111,17 @@ static PRIntervalTime pr_PredictNextNoti
     PRIntervalTime delta;
     PRFloat64 baseRate = (PRFloat64)id->period / (PRFloat64)id->rate;
     PRFloat64 offsetFromEpoch = (PRFloat64)id->accumulator * baseRate;
 
     id->accumulator += 1;  /* every call advances to next period */
     id->lastNotify = id->nextNotify;  /* just keeping track of things */
     id->nextNotify = (PRIntervalTime)(offsetFromEpoch + 0.5);
 
-    delta = id->nextNotify - id->nextNotify;
+    delta = id->nextNotify - id->lastNotify;
     return delta;
 }  /* pr_PredictNextNotifyTime */
 
 static void PR_CALLBACK pr_alarmNotifier(void *arg)
 {
     /*
      * This is the root of the notifier thread. There is one such thread
      * for each PRAlarm. It may service an arbitrary (though assumed to be
--- a/pr/src/misc/prcountr.c
+++ b/pr/src/misc/prcountr.c
@@ -63,17 +63,16 @@
 ** individual counters. Candidates are: the global lock; a lock
 ** per RName structure; Atomic operations (Note that there are
 ** not adaquate atomic operations (yet) to achieve this goal). At
 ** this writing (6/19/98) , the update of the counter variable in
 ** a QName structure is unprotected.
 **
 */
 
-#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #include "prcountr.h"
 #include "prclist.h"
 #include "prlock.h"
 #include "prlog.h"
 #include "prmem.h"
 #include <string.h>
 
 /*
@@ -497,19 +496,8 @@ PR_IMPLEMENT(PRCounterHandle)
     else
         rnp = (RName *)PR_NEXT_LINK( &rnp->link );
 
     PR_LOG( lm, PR_LOG_DEBUG, ("PR_Counter: FindNextRname: Rhandle: %p, QHandle: %p, Returns: %p", 
         rhandle, qhandle, rnp ));
 
     return((PRCounterHandle)rnp);
 } /*  end PR_FindNextCounterRname() */
-
-
-#else  /* !(defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)) */
-/*
-** NSPR Counters are not defined in this case
-**
-**
-*/
-/* Some compilers don't like an empty compilation unit. */
-static int dummy = 0;
-#endif /* defined(DEBUG) || defined(FORCE_NSPR_COUNTERS) */
--- a/pr/src/misc/prdtoa.c
+++ b/pr/src/misc/prdtoa.c
@@ -118,16 +118,21 @@
  * #define KR_headers for old-style C function headers.
  * #define Bad_float_h if your system lacks a float.h or if it does not
  *	define some or all of DBL_DIG, DBL_MAX_10_EXP, DBL_MAX_EXP,
  *	FLT_RADIX, FLT_ROUNDS, and DBL_MAX.
  * #define MALLOC your_malloc, where your_malloc(n) acts like malloc(n)
  *	if memory is available and otherwise does something you deem
  *	appropriate.  If MALLOC is undefined, malloc will be invoked
  *	directly -- and assumed always to succeed.
+ * #define YES_ALIAS to permit aliasing certain double values with
+ *	arrays of unsigned Longs.  This leads to slightly better code with
+ *	some compilers and was always used prior to 19990916, but it
+ *	is not strictly legal and can cause trouble with aggressively
+ *	optimizing compilers (e.g., gcc 2.95.1 under -O2).
  */
 #if  defined(IS_LITTLE_ENDIAN)
 #define IEEE_8087
 #else
 #define IEEE_MC68k
 #endif
 
 #ifndef Long
@@ -221,23 +226,37 @@ extern void *MALLOC(size_t);
 #else
 #define Sign_Extend(a,b) /*no-op*/
 #endif
 
 #if defined(IEEE_8087) + defined(IEEE_MC68k) + defined(VAX) + defined(IBM)	!= 1
 Exactly one of IEEE_8087, IEEE_MC68k, VAX, or IBM should be defined.
 #endif
 
+typedef union { double d; unsigned Long L[2]; } U;
+
+#ifdef YES_ALIAS
+#define dval(x) x
 #ifdef IEEE_8087
 #define word0(x) ((unsigned Long *)&x)[1]
 #define word1(x) ((unsigned Long *)&x)[0]
 #else
 #define word0(x) ((unsigned Long *)&x)[0]
 #define word1(x) ((unsigned Long *)&x)[1]
 #endif
+#else
+#ifdef IEEE_8087
+#define word0(x) ((U*)&x)->L[1]
+#define word1(x) ((U*)&x)->L[0]
+#else
+#define word0(x) ((U*)&x)->L[0]
+#define word1(x) ((U*)&x)->L[1]
+#endif
+#define dval(x) ((U*)&x)->d
+#endif
 
 /* The following definition of Storeinc is appropriate for MIPS processors.
  * An alternative that might be better on some machines is
  * #define Storeinc(a,b,c) (*a++ = b << 16 | c & 0xffff)
  */
 #if defined(IEEE_8087) + defined(VAX)
 #define Storeinc(a,b,c) (((unsigned short *)a)[1] = (unsigned short)b, \
 ((unsigned short *)a)[0] = (unsigned short)c, a++)
@@ -909,17 +928,17 @@ static double ulp(double x)
 		}
 		else {
 			word0(a) = 0;
 			L -= Exp_shift;
 			word1(a) = L >= 31 ? 1 : 1 << (31 - L);
 		}
 	}
 #endif
-	return a;
+	return dval(a);
 }
 
 static double
 b2d
 #ifdef KR_headers
 (a, e) Bigint *a; PRInt32 *e;
 #else
 (Bigint *a, PRInt32 *e)
@@ -979,17 +998,17 @@ b2d
 ret_d:
 #ifdef VAX
 	word0(d) = d0 >> 16 | d0 << 16;
 	word1(d) = d1 >> 16 | d1 << 16;
 #else
 #undef d0
 #undef d1
 #endif
-	return d;
+	return dval(d);
 }
 
 static Bigint *
 d2b
 #ifdef KR_headers
 (d, e, bits) double d; PRInt32 *e, *bits;
 #else
 (double d, PRInt32 *e, PRInt32 *bits)
@@ -1122,44 +1141,44 @@ ratio
 (a, b) Bigint *a, *b;
 #else
 (Bigint *a, Bigint *b)
 #endif
 {
 	double da, db;
 	PRInt32 k, ka, kb;
 
-	da = b2d(a, &ka);
-	db = b2d(b, &kb);
+	dval(da) = b2d(a, &ka);
+	dval(db) = b2d(b, &kb);
 #ifdef Pack_32
 	k = ka - kb + 32*(a->wds - b->wds);
 #else
 	k = ka - kb + 16*(a->wds - b->wds);
 #endif
 #ifdef IBM
 	if (k > 0) {
 		word0(da) += (k >> 2)*Exp_msk1;
 		if (k &= 3)
-			da *= 1 << k;
+			dval(da) *= 1 << k;
 	}
 	else {
 		k = -k;
 		word0(db) += (k >> 2)*Exp_msk1;
 		if (k &= 3)
-			db *= 1 << k;
+			dval(db) *= 1 << k;
 	}
 #else
 	if (k > 0)
 		word0(da) += k*Exp_msk1;
 	else {
 		k = -k;
 		word0(db) += k*Exp_msk1;
 	}
 #endif
-	return da / db;
+	return dval(da) / dval(db);
 }
 
 static CONST double
 tens[] = {
 	1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9,
 	1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19,
 	1e20, 1e21, 1e22
 #ifdef VAX
@@ -1214,17 +1233,17 @@ PR_strtod(CONST char *s00, char **se)
 	Long L;
 	unsigned Long y, z;
 	Bigint *bb, *bb1, *bd, *bd0, *bs, *delta;
 
 
 	if (!_pr_initialized) _PR_ImplicitInitialization();
 
 	sign = nz0 = nz = 0;
-	rv = 0.;
+	dval(rv) = 0.;
 	for(s = s00;;s++) switch(*s) {
 	case '-':
 		sign = 1;
 		/* no break */
 	case '+':
 		if (*++s)
 			goto break2;
 		/* no break */
@@ -1336,80 +1355,80 @@ dig_done:
 	/* Now we have nd0 digits, starting at s0, followed by a
 	 * decimal point, followed by nd-nd0 digits.  The number we're
 	 * after is the integer represented by those digits times
 	 * 10**e */
 
 	if (!nd0)
 		nd0 = nd;
 	k = nd < DBL_DIG + 1 ? nd : DBL_DIG + 1;
-	rv = y;
+	dval(rv) = y;
 	if (k > 9)
-		rv = tens[k - 9] * rv + z;
+		dval(rv) = tens[k - 9] * dval(rv) + z;
 	bd0 = 0;
 	if (nd <= DBL_DIG
 #ifndef RND_PRODQUOT
 		&& FLT_ROUNDS == 1
 #endif
 		) {
 		if (!e)
 			goto ret;
 		if (e > 0) {
 			if (e <= Ten_pmax) {
 #ifdef VAX
 				goto vax_ovfl_check;
 #else
-				/* rv = */ rounded_product(rv, tens[e]);
+				/* rv = */ rounded_product(dval(rv), tens[e]);
 				goto ret;
 #endif
 			}
 			i = DBL_DIG - nd;
 			if (e <= Ten_pmax + i) {
 				/* A fancier test would sometimes let us do
 				 * this for larger i values.
 				 */
 				e -= i;
-				rv *= tens[i];
+				dval(rv) *= tens[i];
 #ifdef VAX
 				/* VAX exponent range is so narrow we must
 				 * worry about overflow here...
 				 */
 			vax_ovfl_check:
 				word0(rv) -= P*Exp_msk1;
-				/* rv = */ rounded_product(rv, tens[e]);
+				/* rv = */ rounded_product(dval(rv), tens[e]);
 				if ((word0(rv) & Exp_mask)
 					> Exp_msk1*(DBL_MAX_EXP+Bias-1-P))
 					goto ovfl;
 				word0(rv) += P*Exp_msk1;
 #else
-				/* rv = */ rounded_product(rv, tens[e]);
+				/* rv = */ rounded_product(dval(rv), tens[e]);
 #endif
 				goto ret;
 			}
 		}
 #ifndef Inaccurate_Divide
 		else if (e >= -Ten_pmax) {
-			/* rv = */ rounded_quotient(rv, tens[-e]);
+			/* rv = */ rounded_quotient(dval(rv), tens[-e]);
 			goto ret;
 		}
 #endif
 	}
 	e1 += nd - k;
 
 	/* Get starting approximation = rv * 10**e1 */
 
 	if (e1 > 0) {
 		if ((i = e1 & 15) != 0)
-			rv *= tens[i];
+			dval(rv) *= tens[i];
 		if (e1 &= ~15) {
 			if (e1 > DBL_MAX_10_EXP) {
 			ovfl:
 				PR_SetError(PR_RANGE_ERROR, 0);
 #ifdef __STDC__
-				rv = HUGE_VAL;
+				dval(rv) = HUGE_VAL;
 #else
 				/* Can't trust HUGE_VAL */
 #ifdef IEEE_Arith
 				word0(rv) = Exp_mask;
 				word1(rv) = 0;
 #else
 				word0(rv) = Big0;
 				word1(rv) = Big1;
@@ -1417,20 +1436,20 @@ dig_done:
 #endif
 				if (bd0)
 					goto retfree;
 				goto ret;
 			}
 			if (e1 >>= 4) {
 				for(j = 0; e1 > 1; j++, e1 >>= 1)
 					if (e1 & 1)
-						rv *= bigtens[j];
+						dval(rv) *= bigtens[j];
 				/* The last multiplication could overflow. */
 				word0(rv) -= P*Exp_msk1;
-				rv *= bigtens[j];
+				dval(rv) *= bigtens[j];
 				if ((z = word0(rv) & Exp_mask)
 					> Exp_msk1*(DBL_MAX_EXP+Bias-P))
 					goto ovfl;
 				if (z > Exp_msk1*(DBL_MAX_EXP+Bias-1-P)) {
 					/* set to largest number */
 					/* (Can't trust DBL_MAX) */
 					word0(rv) = Big0;
 					word1(rv) = Big1;
@@ -1439,33 +1458,33 @@ dig_done:
 					word0(rv) += P*Exp_msk1;
 			}
 
 		}
 	}
 	else if (e1 < 0) {
 		e1 = -e1;
 		if ((i = e1 & 15) != 0)
-			rv /= tens[i];
+			dval(rv) /= tens[i];
 		if (e1 &= ~15) {
 			e1 >>= 4;
 			if (e1 >= 1 << n_bigtens)
 				goto undfl;
 			for(j = 0; e1 > 1; j++, e1 >>= 1)
 				if (e1 & 1)
-					rv *= tinytens[j];
+					dval(rv) *= tinytens[j];
 			/* The last multiplication could underflow. */
-			rv0 = rv;
-			rv *= tinytens[j];
-			if (!rv) {
-				rv = 2.*rv0;
-				rv *= tinytens[j];
-				if (!rv) {
+			dval(rv0) = dval(rv);
+			dval(rv) *= tinytens[j];
+			if (!dval(rv)) {
+				dval(rv) = 2.*dval(rv0);
+				dval(rv) *= tinytens[j];
+				if (!dval(rv)) {
 				undfl:
-					rv = 0.;
+					dval(rv) = 0.;
 					PR_SetError(PR_RANGE_ERROR, 0);
 					if (bd0)
 						goto retfree;
 					goto ret;
 				}
 				word0(rv) = Tiny0;
 				word1(rv) = Tiny1;
 				/* The refinement below will clean
@@ -1479,17 +1498,17 @@ dig_done:
 
 	/* Put digits into bd: true value = bd * 10^e */
 
 	bd0 = s2b(s0, nd0, nd, y);
 
 	for(;;) {
 		bd = Balloc(bd0->k);
 		Bcopy(bd, bd0);
-		bb = d2b(rv, &bbe, &bbbits);	/* rv = bb * 2^bbe */
+		bb = d2b(dval(rv), &bbe, &bbbits);	/* rv = bb * 2^bbe */
 		bs = i2b(1);
 
 		if (e >= 0) {
 			bb2 = bb5 = 0;
 			bd2 = bd5 = e;
 		}
 		else {
 			bb2 = bb5 = -e;
@@ -1591,22 +1610,22 @@ dig_done:
 				break;
 #endif
 			}
 #ifndef ROUND_BIASED
 			if (!(word1(rv) & LSB))
 				break;
 #endif
 			if (dsign)
-				rv += ulp(rv);
+				dval(rv) += ulp(dval(rv));
 #ifndef ROUND_BIASED
 			else {
-				rv -= ulp(rv);
+				dval(rv) -= ulp(dval(rv));
 #ifndef Sudden_Underflow
-				if (!rv)
+				if (!dval(rv))
 					goto undfl;
 #endif
 			}
 #endif
 			break;
 		}
 		if ((aadj = ratio(delta, bs)) <= 2.) {
 			if (dsign)
@@ -1647,38 +1666,38 @@ dig_done:
 				aadj1 += 0.5;
 #endif
 		}
 		y = word0(rv) & Exp_mask;
 
 		/* Check for overflow */
 
 		if (y == Exp_msk1*(DBL_MAX_EXP+Bias-1)) {
-			rv0 = rv;
+			dval(rv0) = dval(rv);
 			word0(rv) -= P*Exp_msk1;
-			adj = aadj1 * ulp(rv);
-			rv += adj;
+			adj = aadj1 * ulp(dval(rv));
+			dval(rv) += adj;
 			if ((word0(rv) & Exp_mask) >=
 				Exp_msk1*(DBL_MAX_EXP+Bias-P)) {
 				if (word0(rv0) == Big0 && word1(rv0) == Big1)
 					goto ovfl;
 				word0(rv) = Big0;
 				word1(rv) = Big1;
 				goto cont;
 			}
 			else
 				word0(rv) += P*Exp_msk1;
 		}
 		else {
 #ifdef Sudden_Underflow
 			if ((word0(rv) & Exp_mask) <= P*Exp_msk1) {
-				rv0 = rv;
+				dval(rv0) = dval(rv);
 				word0(rv) += P*Exp_msk1;
-				adj = aadj1 * ulp(rv);
-				rv += adj;
+				adj = aadj1 * ulp(dval(rv));
+				dval(rv) += adj;
 #ifdef IBM
 				if ((word0(rv) & Exp_mask) <  P*Exp_msk1)
 #else
 					if ((word0(rv) & Exp_mask) <= P*Exp_msk1)
 #endif
 						{
 							if (word0(rv0) == Tiny0
 								&& word1(rv0) == Tiny1)
@@ -1686,34 +1705,34 @@ dig_done:
 							word0(rv) = Tiny0;
 							word1(rv) = Tiny1;
 							goto cont;
 						}
 					else
 						word0(rv) -= P*Exp_msk1;
 			}
 			else {
-				adj = aadj1 * ulp(rv);
-				rv += adj;
+				adj = aadj1 * ulp(dval(rv));
+				dval(rv) += adj;
 			}
 #else
 			/* Compute adj so that the IEEE rounding rules will
 			 * correctly round rv + adj in some half-way cases.
 			 * If rv * ulp(rv) is denormalized (i.e.,
 			 * y <= (P-1)*Exp_msk1), we must adjust aadj to avoid
 			 * trouble from bits lost to denormalization;
 			 * example: 1.2e-307 .
 			 */
 			if (y <= (P-1)*Exp_msk1 && aadj >= 1.) {
 				aadj1 = (double)(PRInt32)(aadj + 0.5);
 				if (!dsign)
 					aadj1 = -aadj1;
 			}
-			adj = aadj1 * ulp(rv);
-			rv += adj;
+			adj = aadj1 * ulp(dval(rv));
+			dval(rv) += adj;
 #endif
 		}
 		z = word0(rv) & Exp_mask;
 		if (y == z) {
 			/* Can we stop now? */
 			L = (Long) aadj;
 			aadj -= L;
 			/* The tolerances below are conservative. */
@@ -1734,17 +1753,17 @@ retfree:
 	Bfree(bb);
 	Bfree(bd);
 	Bfree(bs);
 	Bfree(bd0);
 	Bfree(delta);
 ret:
 	if (se)
 		*se = (char *)s;
-	return sign ? -rv : rv;
+	return sign ? -dval(rv) : dval(rv);
 }
 
 static PRInt32
 quorem(Bigint *b, Bigint *S)
 {
 	PRInt32 n;
 	Long borrow, y;
 	unsigned Long carry, q, ys;
@@ -1967,44 +1986,44 @@ PR_dtoa(PRFloat64 d, int mode, int ndigi
 #endif
 					buf + 3;
 					PR_ASSERT(**rve == '\0');
 				}
 				return PR_SUCCESS;
 			}
 #endif
 #ifdef IBM
-	d += 0; /* normalize */
+	dval(d) += 0; /* normalize */
 #endif
-	if (!d) {
+	if (!dval(d)) {
 		*decpt = 1;
 		if (bufsize < 2) {
 			PR_SetError(PR_BUFFER_OVERFLOW_ERROR, 0);
 			return PR_FAILURE;
 		}
 		buf[0] = '0'; buf[1] = '\0';  /* copy "0" to buffer */
 		if (rve) {
 			*rve = buf + 1;
 			PR_ASSERT(**rve == '\0');
 		}
 		return PR_SUCCESS;
 	}
 
-	b = d2b(d, &be, &bbits);
+	b = d2b(dval(d), &be, &bbits);
 #ifdef Sudden_Underflow
 	i = (PRInt32)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1));
 #else
 	if ((i = (PRInt32)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1))) != 0) {
 #endif
-		d2 = d;
+		dval(d2) = dval(d);
 		word0(d2) &= Frac_mask1;
 		word0(d2) |= Exp_11;
 #ifdef IBM
 		if (j = 11 - hi0bits(word0(d2) & Frac_mask))
-			d2 /= 1 << j;
+			dval(d2) /= 1 << j;
 #endif
 
 		/* log(x)	~=~ log(1.5) + (x-1.5)/1.5
 		 * log10(x)	 =  log(x) / log(10)
 		 *		~=~ log(1.5)/log(10) + (x-1.5)/(1.5*log(10))
 		 * log10(d) = (i-Bias)*log(2)/log(10) + log10(d2)
 		 *
 		 * This suggests computing an approximation k to log10(d) by
@@ -2033,29 +2052,29 @@ PR_dtoa(PRFloat64 d, int mode, int ndigi
 		denorm = 0;
 	}
 	else {
 		/* d is denormalized */
 
 		i = bbits + be + (Bias + (P-1) - 1);
 		x = i > 32  ? word0(d) << (64 - i) | word1(d) >> (i - 32)
 			: word1(d) << (32 - i);
-		d2 = x;
+		dval(d2) = x;
 		word0(d2) -= 31*Exp_msk1; /* adjust exponent */
 		i -= (Bias + (P-1) - 1) + 1;
 		denorm = 1;
 	}
 #endif
-	ds = (d2-1.5)*0.289529654602168 + 0.1760912590558 + i*0.301029995663981;
+	ds = (dval(d2)-1.5)*0.289529654602168 + 0.1760912590558 + i*0.301029995663981;
 	k = (PRInt32)ds;
 	if (ds < 0. && ds != k)
 		k--;	/* want k = floor(ds) */
 	k_check = 1;
 	if (k >= 0 && k <= Ten_pmax) {
-		if (d < tens[k])
+		if (dval(d) < tens[k])
 			k--;
 		k_check = 0;
 	}
 	j = bbits - i - 1;
 	if (j >= 0) {
 		b2 = 0;
 		s2 = j;
 	}
@@ -2112,149 +2131,149 @@ PR_dtoa(PRFloat64 d, int mode, int ndigi
 	result = Balloc(result_k);
 	s = s0 = (char *)result;
 
 	if (ilim >= 0 && ilim <= Quick_max && try_quick) {
 
 		/* Try to get by with floating-point arithmetic. */
 
 		i = 0;
-		d2 = d;
+		dval(d2) = dval(d);
 		k0 = k;
 		ilim0 = ilim;
 		ieps = 2; /* conservative */
 		if (k > 0) {
 			ds = tens[k&0xf];
 			j = k >> 4;
 			if (j & Bletch) {
 				/* prevent overflows */
 				j &= Bletch - 1;
-				d /= bigtens[n_bigtens-1];
+				dval(d) /= bigtens[n_bigtens-1];
 				ieps++;
 			}
 			for(; j; j >>= 1, i++)
 				if (j & 1) {
 					ieps++;
 					ds *= bigtens[i];
 				}
-			d /= ds;
+			dval(d) /= ds;
 		}
 		else if ((j1 = -k) != 0) {
-			d *= tens[j1 & 0xf];
+			dval(d) *= tens[j1 & 0xf];
 			for(j = j1 >> 4; j; j >>= 1, i++)
 				if (j & 1) {
 					ieps++;
-					d *= bigtens[i];
+					dval(d) *= bigtens[i];
 				}
 		}
-		if (k_check && d < 1. && ilim > 0) {
+		if (k_check && dval(d) < 1. && ilim > 0) {
 			if (ilim1 <= 0)
 				goto fast_failed;
 			ilim = ilim1;
 			k--;
-			d *= 10.;
+			dval(d) *= 10.;
 			ieps++;
 		}
-		eps = ieps*d + 7.;
+		dval(eps) = ieps*dval(d) + 7.;
 		word0(eps) -= (P-1)*Exp_msk1;
 		if (ilim == 0) {
 			S = mhi = 0;
-			d -= 5.;
-			if (d > eps)
+			dval(d) -= 5.;
+			if (dval(d) > dval(eps))
 				goto one_digit;
-			if (d < -eps)
+			if (dval(d) < -dval(eps))
 				goto no_digits;
 			goto fast_failed;
 		}
 #ifndef No_leftright
 		if (leftright) {
 			/* Use Steele & White method of only
 			 * generating digits needed.
 			 */
-			eps = 0.5/tens[ilim-1] - eps;
+			dval(eps) = 0.5/tens[ilim-1] - dval(eps);
 			for(i = 0;;) {
-				L = (Long) d;
-				d -= L;
+				L = (Long) (dval(d));
+				dval(d) -= L;
 				*s++ = '0' + (PRInt32)L;
-				if (d < eps)
+				if (dval(d) < dval(eps))
 					goto ret1;
-				if (1. - d < eps)
+				if (1. - dval(d) < dval(eps))
 					goto bump_up;
 				if (++i >= ilim)
 					break;
-				eps *= 10.;
-				d *= 10.;
+				dval(eps) *= 10.;
+				dval(d) *= 10.;
 			}
 		}
 		else {
 #endif
 			/* Generate ilim digits, then fix them up. */
-			eps *= tens[ilim-1];
-			for(i = 1;; i++, d *= 10.) {
-				L = (Long) d;
-				d -= L;
+			dval(eps) *= tens[ilim-1];
+			for(i = 1;; i++, dval(d) *= 10.) {
+				L = (Long) (dval(d));
+				dval(d) -= L;
 				*s++ = '0' + (PRInt32)L;
 				if (i == ilim) {
-					if (d > 0.5 + eps)
+					if (dval(d) > 0.5 + dval(eps))
 						goto bump_up;
-					else if (d < 0.5 - eps) {
+					else if (dval(d) < 0.5 - dval(eps)) {
 						while(*--s == '0'){} /* just count -- nothing to execute */
 						s++;
 						goto ret1;
 					}
 					break;
 				}
 			}
 #ifndef No_leftright
 		}
 #endif
 	fast_failed:
 		s = s0;
-		d = d2;
+		dval(d) = dval(d2);
 		k = k0;
 		ilim = ilim0;
 	}
 
 	/* Do we have a "small" integer? */
 
 	if (be >= 0 && k <= Int_max) {
 		/* Yes. */
 		ds = tens[k];
 		if (ndigits < 0 && ilim <= 0) {
 			S = mhi = 0;
-			if (ilim < 0 || d <= 5*ds)
+			if (ilim < 0 || dval(d) <= 5*ds)
 				goto no_digits;
 			goto one_digit;
 		}
 		for(i = 1;; i++) {
-			L = (Long) (d / ds);
-			d -= L*ds;
+			L = (Long) (dval(d) / ds);
+			dval(d) -= L*ds;
 #ifdef Check_FLT_ROUNDS
 			/* If FLT_ROUNDS == 2, L will usually be high by 1 */
-			if (d < 0) {
+			if (dval(d) < 0) {
 				L--;
-				d += ds;
+				dval(d) += ds;
 			}
 #endif
 			*s++ = '0' + (PRInt32)L;
 			if (i == ilim) {
-				d += d;
-				if ((d > ds) || (d == ds && L & 1)) {
+				dval(d) += dval(d);
+				if ((dval(d) > ds) || (dval(d) == ds && L & 1)) {
 				bump_up:
 					while(*--s == '9')
 						if (s == s0) {
 							k++;
 							*s = '0';
 							break;
 						}
 					++*s++;
 				}
 				break;
 			}
-			if (!(d *= 10.))
+			if (!(dval(d) *= 10.))
 				break;
 		}
 		goto ret1;
 	}
 
 	m2 = b2;
 	m5 = b5;
 	mhi = mlo = 0;
@@ -2529,17 +2548,17 @@ PR_cnvtf(char *buf,int bufsz, int prcsn,
 
 	/* If anything fails, we store an empty string in 'buf' */
 	num = (char*)PR_MALLOC(bufsz);
 	if (num == NULL) {
 		buf[0] = '\0';
 		return;
 	}
 	/* XXX Why use mode 1? */
-	if (PR_dtoa(fval,1,prcsn,&decpt,&sign,&endnum,num,bufsz)
+	if (PR_dtoa(dval(fval),1,prcsn,&decpt,&sign,&endnum,num,bufsz)
 			== PR_FAILURE) {
 		buf[0] = '\0';
 		goto done;
 	}
 	numdigits = endnum - num;
 	nump = num;
 
 	if (sign &&
--- a/pr/src/misc/prnetdb.c
+++ b/pr/src/misc/prnetdb.c
@@ -93,17 +93,17 @@ PRLock *_pr_dnsLock = NULL;
 #if defined(SOLARIS) || (defined(BSDI) && defined(_REENTRANT)) \
 	|| (defined(LINUX) && defined(_REENTRANT) \
         && !(defined(__GLIBC__) && __GLIBC__ >= 2))
 #define _PR_HAVE_GETPROTO_R
 #define _PR_HAVE_GETPROTO_R_POINTER
 #endif
 
 #if defined(OSF1) \
-        || defined(AIX4_3) || (defined(AIX) && defined(_THREAD_SAFE)) \
+        || defined(AIX4_3_PLUS) || (defined(AIX) && defined(_THREAD_SAFE)) \
 	|| (defined(HPUX10_10) && defined(_REENTRANT)) \
         || (defined(HPUX10_20) && defined(_REENTRANT))
 #define _PR_HAVE_GETPROTO_R
 #define _PR_HAVE_GETPROTO_R_INT
 #endif
 
 #if (defined(LINUX) && defined(__GLIBC__) && __GLIBC__ >= 2)
 #define _PR_HAVE_GETPROTO_R
--- a/pr/src/misc/prolock.c
+++ b/pr/src/misc/prolock.c
@@ -33,17 +33,16 @@
  */
 
 /*
 **  prolock.c -- NSPR Ordered Lock
 ** 
 **  Implement the API defined in prolock.h
 ** 
 */
-#if defined(DEBUG) || defined(FORCE_NSPR_COUNTERS)
 #include "prolock.h"
 #include "prlog.h"
 #include "prerror.h"
 
 PR_IMPLEMENT(PROrderedLock *) 
     PR_CreateOrderedLock( 
         PRInt32 order,
         const char *name
@@ -91,18 +90,8 @@ PR_IMPLEMENT(PRStatus)
 {
 #ifdef XP_MAC
 #pragma unused( lock )
 #endif
     PR_ASSERT(!"Not implemented"); /* Not implemented yet */
     PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
     return PR_FAILURE;
 } /*  end PR_UnlockOrderedLock() */
-
-#else /* ! defined(FORCE_NSPR_ORDERED_LOCK) */
-/*
-** NSPR Ordered Lock is not defined when !DEBUG and !FORCE_NSPR_ORDERED_LOCK
-**  
-*/
-
-/* Some compilers don't like an empty compilation unit. */
-static int dummy = 0;
-#endif /* defined(FORCE_NSPR_ORDERED_LOCK */
--- a/pr/src/misc/prtrace.c
+++ b/pr/src/misc/prtrace.c
@@ -36,17 +36,16 @@
 ** prtrace.c -- NSPR Trace Instrumentation
 **
 ** Implement the API defined in prtrace.h
 **
 **
 **
 */
 
-#if defined (DEBUG) || defined (FORCE_NSPR_TRACE)
 #include <string.h>
 #include "prtrace.h"
 #include "prclist.h"
 #include "prlock.h"
 #include "prcvar.h"
 #include "prio.h"
 #include "prlog.h"
 #include "prenv.h"
@@ -912,19 +911,9 @@ PR_IMPLEMENT(PRIntn)
     *found = copied;
     rc = ( fetchLostData == PR_TRUE )? 1 : 0;
     fetchLostData = PR_FALSE;
 
     PR_Unlock( traceLock );
     return rc;
 } /* end PR_GetTraceEntries() */
 
-#else /* !defined(FORCE_NSPR_TRACE) */
-/*
-** The trace facility is not defined when !DEBUG and !FORCE_NSPR_TRACE
-**
-*/
-
-/* Some compilers don't like an empty compilation unit. */
-static int dummy = 0;
-#endif /* defined(FORCE_NSPR_TRACE) */
-
 /* end prtrace.c */
--- a/pr/src/pthreads/ptio.c
+++ b/pr/src/pthreads/ptio.c
@@ -367,25 +367,23 @@ struct pt_Continuation
     PRIntn syserrno;                        /* in case it failed, why (errno) */
     pr_ContuationStatus status;             /* the status of the operation */
 };
 
 #if defined(DEBUG)
 
 PTDebug pt_debug;  /* this is shared between several modules */
 
-PR_IMPLEMENT(void) PT_GetStats(PTDebug* here) { *here = pt_debug; }
-
 PR_IMPLEMENT(void) PT_FPrintStats(PRFileDesc *debug_out, const char *msg)
 {
     PTDebug stats;
     char buffer[100];
     PRExplodedTime tod;
     PRInt64 elapsed, aMil;
-    PT_GetStats(&stats);  /* a copy */
+    stats = pt_debug;  /* a copy */
     PR_ExplodeTime(stats.timeStarted, PR_LocalTimeParameters, &tod);
     (void)PR_FormatTime(buffer, sizeof(buffer), "%T", &tod);
 
     LL_SUB(elapsed, PR_Now(), stats.timeStarted);
     LL_I2L(aMil, 1000000);
     LL_DIV(elapsed, elapsed, aMil);
     
     if (NULL != msg) PR_fprintf(debug_out, "%s", msg);
@@ -400,16 +398,23 @@ PR_IMPLEMENT(void) PT_FPrintStats(PRFile
     PR_fprintf(
         debug_out, "\tcvars [created: %u, destroyed: %u]\n",
         stats.cvars_created, stats.cvars_destroyed);
     PR_fprintf(
         debug_out, "\tcvars [notified: %u, delayed_delete: %u]\n",
         stats.cvars_notified, stats.delayed_cv_deletes);
 }  /* PT_FPrintStats */
 
+#else
+
+PR_IMPLEMENT(void) PT_FPrintStats(PRFileDesc *debug_out, const char *msg)
+{
+    /* do nothing */
+}  /* PT_FPrintStats */
+
 #endif  /* DEBUG */
 
 #if defined(_PR_POLL_WITH_SELECT)
 /*
  * OSF1 and HPUX report the POLLHUP event for a socket when the
  * shutdown(SHUT_WR) operation is called for the remote end, even though
  * the socket is still writeable. Use select(), instead of poll(), to
  * workaround this problem.
--- a/pr/src/threads/prcthr.c
+++ b/pr/src/threads/prcthr.c
@@ -50,18 +50,16 @@ extern PRLock *_pr_sleeplock;  /* alloca
 ** Routines common to both native and user threads.
 **
 **
 ** Clean up a thread object, releasing all of the attached data. Do not
 ** free the object itself (it may not have been malloc'd)
 */
 void _PR_CleanupThread(PRThread *thread)
 {
-    PRUintn i;
-
     /* Free up per-thread-data */
     _PR_DestroyThreadPrivate(thread);
 
     /* Free any thread dump procs */
     if (thread->dumpArg) {
         PR_DELETE(thread->dumpArg);
     }
     thread->dump = 0;
--- a/pr/tests/vercheck.c
+++ b/pr/tests/vercheck.c
@@ -44,38 +44,39 @@
  */
 
 #include "prinit.h"
 
 #include <stdio.h>
 #include <stdlib.h>
 
 /*
- * This release (4.2.1) is backward compatible with the
- * 4.0.x, 4.1.x, and 4.2 releases.  It, of course, is compatible
+ * This release (4.3) is backward compatible with the
+ * 4.0.x, 4.1.x, and 4.2.x releases.  It, of course, is compatible
  * with itself.
  */
 static char *compatible_version[] = {
-    "4.0", "4.0.1", "4.1", "4.1.1", "4.1.2", "4.1.3", "4.2", PR_VERSION
+    "4.0", "4.0.1", "4.1", "4.1.1", "4.1.2", "4.1.3",
+    "4.2", "4.2.1", "4.2.2", 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.2.2", "4.2.3",
-    "4.3", "4.3.1",
+    "4.3.3",
+    "4.4", "4.4.1",
     "10.0", "11.1", "12.14.20"
 };
 
 int main()
 {
     int idx;
     int num_compatible = sizeof(compatible_version) / sizeof(char *);
     int num_incompatible = sizeof(incompatible_version) / sizeof(char *);