Bug 804806: Update NSPR to NSPR_4_9_4_BETA2.
authorWan-Teh Chang <wtc@google.com>
Wed, 14 Nov 2012 05:59:06 -0800
changeset 113227 c44db6486c0d64bcabaa679196838e86b85edcd2
parent 113226 ee43eefa90eaa4b5981ee1017864ffe4110cd5df
child 113228 5a76abc509c7390370e091e04f5a2a5805f25e5f
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
bugs804806
milestone19.0a1
Bug 804806: Update NSPR to NSPR_4_9_4_BETA2.
nsprpub/TAG-INFO
nsprpub/config/Makefile.in
nsprpub/config/nsinstall.c
nsprpub/config/prdepend.h
nsprpub/lib/ds/Makefile.in
nsprpub/lib/libc/src/Makefile.in
nsprpub/lib/prstreams/Makefile.in
nsprpub/lib/prstreams/tests/testprstrm/Makefile.in
nsprpub/lib/tests/Makefile.in
nsprpub/pr/include/gencfg.c
nsprpub/pr/include/md/_unixos.h
nsprpub/pr/include/private/primpl.h
nsprpub/pr/src/Makefile.in
nsprpub/pr/src/cplus/tests/Makefile.in
nsprpub/pr/src/io/Makefile.in
nsprpub/pr/src/io/prfile.c
nsprpub/pr/src/io/prmapopt.c
nsprpub/pr/src/linking/Makefile.in
nsprpub/pr/src/linking/prlink.c
nsprpub/pr/src/malloc/Makefile.in
nsprpub/pr/src/md/beos/beos_errors.c
nsprpub/pr/src/md/prosdep.c
nsprpub/pr/src/md/unix/Makefile.in
nsprpub/pr/src/md/unix/os_ReliantUNIX.s
nsprpub/pr/src/md/unix/unix.c
nsprpub/pr/src/md/unix/unix_errors.c
nsprpub/pr/src/md/unix/uxproces.c
nsprpub/pr/src/md/unix/uxrng.c
nsprpub/pr/src/md/unix/uxwrap.c
nsprpub/pr/src/misc/prtime.c
nsprpub/pr/src/pthreads/Makefile.in
nsprpub/pr/src/pthreads/ptio.c
nsprpub/pr/src/threads/combined/Makefile.in
nsprpub/pr/tests/Makefile.in
nsprpub/pr/tests/dll/Makefile.in
nsprpub/tools/Makefile.in
--- a/nsprpub/TAG-INFO
+++ b/nsprpub/TAG-INFO
@@ -1,1 +1,1 @@
-NSPR_4_9_4_BETA1
+NSPR_4_9_4_BETA2
--- a/nsprpub/config/Makefile.in
+++ b/nsprpub/config/Makefile.in
@@ -39,17 +39,17 @@ ifeq (,$(CROSS_COMPILE)$(filter-out WINN
 PROG_SUFFIX = .exe
 else
 PROG_SUFFIX =
 endif
 
 # Temporary workaround to disable the generation of
 # library build time because now.c uses the 'long long'
 # data type that's not available on some platforms.
-ifeq (,$(filter-out NEC NEXTSTEP QNX SCOOS UNIXWARE,$(OS_ARCH)))
+ifeq (,$(filter-out QNX SCOOS UNIXWARE,$(OS_ARCH)))
 DEFINES += -DOMIT_LIB_BUILD_TIME
 endif
 
 ifeq ($(OS_ARCH), IRIX)
     ifeq ($(basename $(OS_RELEASE)),6)
         ifndef NS_USE_GCC
             ifeq ($(USE_N32),1)
                 XLDOPTS += -n32 -Wl,-woff,85
--- a/nsprpub/config/nsinstall.c
+++ b/nsprpub/config/nsinstall.c
@@ -33,58 +33,30 @@
 #if defined(BEOS)
 #undef HAVE_FCHMOD
 #endif
 
 /*
  * Does getcwd() take NULL as the first argument and malloc
  * the result buffer?
  */
-#if !defined(DARWIN) && !defined(NEXTSTEP)
+#if !defined(DARWIN)
 #define GETCWD_CAN_MALLOC
 #endif
 
-#ifdef NEXTSTEP
-#include <bsd/libc.h>
-
-/*
-** balazs.pataki@sztaki.hu: The getcwd is broken in NEXTSTEP (returns 0),
-** when called on a mounted fs. Did anyone notice this? Here's an ugly
-** workaround ...
-*/
-#define getcwd(b,s)   my_getcwd(b,s)
-
-static char *
-my_getcwd (char *buf, size_t size)
-{
-    FILE *pwd = popen("pwd", "r");
-    char *result = fgets(buf, size, pwd);
-
-    if (result) {
-        buf[strlen(buf)-1] = '\0';
-    }
-    pclose (pwd);
-    return buf;
-}
-#endif /* NEXTSTEP */
-
 #if defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) 
 #include <getopt.h>
 #endif
 
-#if defined(SCO) || defined(UNIXWARE) || defined(SNI) || defined(NCR) || defined(NEC) || defined(NEXTSTEP)
+#if defined(SCO) || defined(UNIXWARE)
 #if !defined(S_ISLNK) && defined(S_IFLNK)
 #define S_ISLNK(a)	(((a) & S_IFMT) == S_IFLNK)
 #endif
 #endif
 
-#if defined(SNI)
-extern int fchmod(int fildes, mode_t mode);
-#endif
-
 #ifdef QNX
 #define d_ino d_stat.st_ino
 #endif
 
 static void
 usage(void)
 {
     fprintf(stderr,
--- a/nsprpub/config/prdepend.h
+++ b/nsprpub/config/prdepend.h
@@ -5,8 +5,9 @@
 
 /*
  * A dummy header file that is a dependency for all the object files.
  * Used to force a full recompilation of NSPR in Mozilla's Tinderbox
  * depend builds.  See comments in rules.mk.
  */
 
 #error "Do not include this header file."
+
--- a/nsprpub/lib/ds/Makefile.in
+++ b/nsprpub/lib/ds/Makefile.in
@@ -68,23 +68,20 @@ endif
 ifeq ($(OS_ARCH),OS2)
 MAPFILE = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).def
 GARBAGE += $(MAPFILE)
 MKSHLIB += $(MAPFILE)
 endif
 
 EXTRA_LIBS = $(LIBNSPR)
 
-# On NCR and SCOOS, we can't link with extra libraries when
+# On 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 =
-endif
 ifeq ($(OS_ARCH),SCOOS)
 EXTRA_LIBS =
 endif
 
 ifdef RESOLVE_LINK_SYMBOLS
 EXTRA_LIBS += $(OS_LIBS)
 endif
 
--- a/nsprpub/lib/libc/src/Makefile.in
+++ b/nsprpub/lib/libc/src/Makefile.in
@@ -77,23 +77,20 @@ endif
 ifeq ($(OS_ARCH),OS2)
 MAPFILE = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).def
 GARBAGE += $(MAPFILE)
 MKSHLIB += $(MAPFILE)
 endif
 
 EXTRA_LIBS = $(LIBNSPR)
 
-# On NCR and SCOOS, we can't link with extra libraries when
+# On 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 =
-endif
 ifeq ($(OS_ARCH),SCOOS)
 EXTRA_LIBS =
 endif
 
 ifdef RESOLVE_LINK_SYMBOLS
 EXTRA_LIBS += $(OS_LIBS)
 endif
 
--- a/nsprpub/lib/prstreams/Makefile.in
+++ b/nsprpub/lib/prstreams/Makefile.in
@@ -72,23 +72,20 @@ ifeq ($(OS_ARCH),BeOS)
 endif
 
 ifeq ($(OS_ARCH), UNIXWARE)
     OS_LIBS += -lC
 endif
 
 EXTRA_LIBS = $(LIBNSPR)
 
-# On NCR and SCOOS, we can't link with extra libraries when
+# On 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 object files.
-ifeq ($(OS_ARCH),NCR)
-    EXTRA_LIBS =
-endif
 ifeq ($(OS_ARCH),SCOOS)
     EXTRA_LIBS =
 endif
 
 ifdef RESOLVE_LINK_SYMBOLS
 EXTRA_LIBS += $(OS_LIBS)
 endif
 
--- a/nsprpub/lib/prstreams/tests/testprstrm/Makefile.in
+++ b/nsprpub/lib/prstreams/tests/testprstrm/Makefile.in
@@ -78,48 +78,28 @@ LIBPRSTRMS = -lprstrms$(MOD_MAJOR_VERSIO
 else
 LDOPTS += -brtl
 EXTRA_LIBS = -ldl
 endif
 endif
 
 # Solaris
 ifeq ($(OS_ARCH), SunOS)
-ifneq ($(OS_RELEASE), 4.1.3_U1)
 ifdef NS_USE_GCC
 LDOPTS += -Xlinker -R -Xlinker $(PWD)/$(dist_libdir)
 else
 LDOPTS += -R $(PWD)/$(dist_libdir)
 # CC on SunOS 5.5.x needs to link with -lpthread even though we already
 # linked with this system library when we built libnspr.so.
 ifdef USE_PTHREADS
 EXTRA_LIBS = -lpthread
 endif # USE_PTHREADS
 endif # NS_USE_GCC
-endif # 4.1.3_U1
 endif # SunOS
 
-ifeq ($(OS_ARCH), NCR)
-# XXX: We see some strange problems when we link with libnspr.so.
-# So for now we use static libraries on NCR.  The shared library
-# stuff below is commented out.
-LIBPR = $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).a
-LIBPRSTRMS = $(dist_libdir)/libprstrms$(MOD_MAJOR_VERSION).a
-EXTRA_LIBS = -lsocket -lnsl -ldl
-
-# NCR needs to link against -lsocket -lnsl (and -lc, which is linked
-# implicitly by $(CC)) again even though we already linked with these
-# system libraries when we built libnspr.so.
-#EXTRA_LIBS = -lsocket -lnsl
-# This hardcodes in the executable programs the directory to find
-# libnspr.so etc. at program startup.  Equivalent to the -R or -rpath 
-# option for ld on other platforms.
-#export LD_RUN_PATH = $(PWD)/$(dist_libdir)
-endif
-
 ifeq ($(OS_ARCH), SCOOS)
 # SCO Unix needs to link against -lsocket again even though we
 # already linked with these system libraries when we built libnspr.so.
 EXTRA_LIBS = -lsocket
 # This hardcodes in the executable programs the directory to find
 # libnspr.so etc. at program startup.  Equivalent to the -R or -rpath
 # option for ld on other platforms.
 export LD_RUN_PATH = $(PWD)/$(dist_libdir)
--- a/nsprpub/lib/tests/Makefile.in
+++ b/nsprpub/lib/tests/Makefile.in
@@ -97,44 +97,31 @@ endif
 ifeq ($(OS_ARCH),AIX)
 LDOPTS += -blibpath:$(PWD)/$(dist_libdir):/usr/lib:/lib
 LIBPR = -lnspr$(MOD_MAJOR_VERSION)_shr
 LIBPLC = -lplc$(MOD_MAJOR_VERSION)_shr
 endif
 
 # Solaris
 ifeq ($(OS_ARCH), SunOS)
-ifneq ($(OS_RELEASE), 4.1.3_U1)
 ifdef NS_USE_GCC
 LDOPTS += -Xlinker -R -Xlinker $(PWD)/$(dist_libdir)
 else
 LDOPTS += -R $(PWD)/$(dist_libdir)
 endif
-endif
 
 # SunOS 5.5 needs to link with -lpthread, even though we already
 # linked with this system library when we built libnspr.so.
 ifeq ($(OS_RELEASE), 5.5)
 ifdef USE_PTHREADS
 EXTRA_LIBS = -lpthread
 endif
 endif
 endif # SunOS
 
-ifeq ($(OS_ARCH), NCR)
-# NCR needs to link against -lsocket -lnsl (and -lc, which is linked
-# implicitly by $(CC)) again even though we already linked with these
-# system libraries when we built libnspr.so.
-EXTRA_LIBS = -lsocket -lnsl
-# This hardcodes in the executable programs the directory to find
-# libnspr.so etc. at program startup.  Equivalent to the -R or -rpath
-# option for ld on other platforms.
-export LD_RUN_PATH = $(PWD)/$(dist_libdir)
-endif
-
 #####################################################
 #
 # The rules
 #
 #####################################################
 
 include $(topsrcdir)/config/rules.mk
 
--- a/nsprpub/pr/include/gencfg.c
+++ b/nsprpub/pr/include/gencfg.c
@@ -7,25 +7,19 @@
 
 #if defined(sgi)
 #ifndef IRIX
 	error - IRIX is not defined
 #endif
 #endif
 
 #if defined(__sun)
-#if defined(__svr4) || defined(__svr4__) || defined(__SVR4)
 #ifndef SOLARIS
 	error - SOLARIS is not defined
 #endif
-#else
-#ifndef SUNOS4
-	error - SUNOS4 is not defined
-#endif
-#endif
 #endif
 
 #if defined(__hpux)
 #ifndef HPUX
 	error - HPUX is not defined
 #endif
 #endif
 
@@ -65,34 +59,28 @@
 #endif
 
 #if defined(__APPLE__)
 #ifndef DARWIN
       error - DARWIN is not defined
 #endif
 #endif
 
-#if defined(__NeXT__)
-#ifndef NEXTSTEP
-      error - NEXTSTEP is not defined
-#endif
-#endif
-
 /************************************************************************/
 
 /* Generate cpucfg.h */
 
 #ifdef XP_PC
 #ifdef WIN32
 #define INT64	_PRInt64
 #else
 #define INT64	long
 #endif
 #else
-#if defined(HPUX) || defined(NECSVR4) || defined(SCO) || defined(UNIXWARE) || defined (NCR)
+#if defined(HPUX) || defined(SCO) || defined(UNIXWARE)
 #define INT64	long
 #else
 #define INT64	long long
 #endif
 #endif
 
 struct align_short {
     char c;
--- a/nsprpub/pr/include/md/_unixos.h
+++ b/nsprpub/pr/include/md/_unixos.h
@@ -10,17 +10,17 @@
  * If FD_SETSIZE is not defined on the command line, set the default value
  * before include select.h
  */
 /*
  * Linux: FD_SETSIZE is defined in /usr/include/sys/select.h and should
  * not be redefined.
  */
 #if !defined(LINUX) && !defined(__GNU__) && !defined(__GLIBC__) \
-    && !defined(DARWIN) && !defined(NEXTSTEP)
+    && !defined(DARWIN)
 #ifndef FD_SETSIZE
 #define FD_SETSIZE  4096
 #endif
 #endif
 
 #include <unistd.h>
 #include <stddef.h>
 #include <sys/stat.h>
@@ -142,17 +142,17 @@ extern void _MD_unix_init_running_cpu(st
 ** work - it just means that we don't really have a functional
 ** redzone.
 */
 #include <sys/mman.h>
 #ifndef PROT_NONE
 #define PROT_NONE 0x0
 #endif
 
-#if defined(DEBUG) && !defined(DARWIN) && !defined(NEXTSTEP)
+#if defined(DEBUG) && !defined(DARWIN)
 #if !defined(SOLARIS)	
 #include <string.h>  /* for memset() */
 #define _MD_INIT_STACK(ts,REDZONE)					\
     PR_BEGIN_MACRO                 					\
 	(void) mprotect((void*)ts->seg->vaddr, REDZONE, PROT_NONE);	\
 	(void) mprotect((void*) ((char*)ts->seg->vaddr + REDZONE + ts->stackSize),\
 			REDZONE, PROT_NONE);				\
     /*									\
--- a/nsprpub/pr/include/private/primpl.h
+++ b/nsprpub/pr/include/private/primpl.h
@@ -1821,17 +1821,16 @@ extern void _PR_InitZones(void);
 extern void _PR_DestroyZones(void);
 #endif
 
 /* Overriding malloc, free, etc. */
 #if !defined(_PR_NO_PREEMPT) && defined(XP_UNIX) \
         && !defined(_PR_PTHREADS) && !defined(_PR_GLOBAL_THREADS_ONLY) \
         && !defined(PURIFY) \
         && !defined(DARWIN) \
-        && !defined(NEXTSTEP) \
         && !defined(QNX) \
         && !(defined (UNIXWARE) && defined (USE_SVR4_THREADS))
 #define _PR_OVERRIDE_MALLOC
 #endif
 
 /*************************************************************************
 * External machine-dependent code provided by each OS.                     *                                                                     *
 *************************************************************************/
--- a/nsprpub/pr/src/Makefile.in
+++ b/nsprpub/pr/src/Makefile.in
@@ -28,19 +28,16 @@ ifeq ($(USE_CPLUS), 1)
 	DIRS += cplus
 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)
 ifdef NS_USE_GCC
 ifdef GCC_USE_GNU_LD
 MKSHLIB += -Wl,--version-script,$(MAPFILE)
 else
 MKSHLIB += -Wl,-M,$(MAPFILE)
 endif
@@ -62,17 +59,16 @@ OS_LIBS			= -lpthread ${LIBRT} -lsocket 
 else
 OS_LIBS			= -lsocket -lnsl -ldl -lc
 endif	# USE_PTHREADS
 ifeq ($(CPU_ARCH),sparc)
 ifndef USE_64
 DSO_LDOPTS	+= -Wl,-f,\$$ORIGIN/cpu/\$$ISALIST/lib$(ULTRASPARC_LIBRARY)$(LIBRARY_VERSION).so
 endif
 endif	# sparc
-endif	# 4.1.3_U1
 endif	# SunOS
 
 ifeq ($(OS_ARCH), IRIX)
 ifeq ($(USE_PTHREADS), 1)
 OS_LIBS = -lpthread
 endif
 OS_LIBS += -lc
 endif
@@ -158,20 +154,16 @@ DSO_LDOPTS	+= +I PR_HPUX10xInit
 endif
 endif
 endif
 
 ifeq ($(OS_ARCH),UNIXWARE)
 OS_LIBS		= -lsocket -lc
 endif
 
-ifeq ($(OS_ARCH),NEWS-OS)
-OS_LIBS		= -lsocket -lnsl -lgen -lresolv
-endif
-
 ifeq ($(OS_ARCH),WINNT)
 ifdef NS_USE_GCC
 OS_LIBS		= -ladvapi32 -lwsock32 -lwinmm
 else
 OS_LIBS		= advapi32.lib wsock32.lib winmm.lib
 endif
 endif
 
--- a/nsprpub/pr/src/cplus/tests/Makefile.in
+++ b/nsprpub/pr/src/cplus/tests/Makefile.in
@@ -64,22 +64,20 @@ ifeq ($(OS_ARCH), IRIX)
                 LDOPTS += -Wl,-woff,85
             endif
         endif
     endif
 endif
 
 # Solaris
 ifeq ($(OS_ARCH), SunOS)
-    ifneq ($(OS_RELEASE), 4.1.3_U1)
-        ifdef NS_USE_GCC
-            LDOPTS += -Xlinker -R -Xlinker $(PWD)/$(dist_libdir)
-        else
-            LDOPTS += -R $(PWD)/$(dist_libdir)
-        endif
+    ifdef NS_USE_GCC
+        LDOPTS += -Xlinker -R -Xlinker $(PWD)/$(dist_libdir)
+    else
+        LDOPTS += -R $(PWD)/$(dist_libdir)
     endif
 
 # SunOS 5.5 needs to link with -lpthread, even though we already
 # linked with this system library when we built libnspr.so.
     ifeq ($(OS_RELEASE), 5.5)
         ifdef USE_PTHREADS
             EXTRA_LIBS = -lpthread
         endif
@@ -131,34 +129,16 @@ ifeq ($(OS_ARCH), Linux)
     else
         LDOPTS += -Xlinker -rpath $(PWD)/$(dist_libdir)
         ifeq ($(USE_PTHREADS),1)
             EXTRA_LIBS = -lpthread
         endif
     endif
 endif
 
-ifeq ($(OS_ARCH), NCR)
-# XXX: We see some strange problems when we link with libnspr.so.
-# So for now we use static libraries on NCR.  The shared library
-# stuff below is commented out.
-LIBPR = $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).a
-LIBPL = $(dist_libdir)/libplc$(MOD_MAJOR_VERSION).a
-EXTRA_LIBS = -lsocket -lnsl -ldl
-
-# NCR needs to link against -lsocket -lnsl (and -lc, which is linked
-# implicitly by $(CC)) again even though we already linked with these
-# system libraries when we built libnspr.so.
-#EXTRA_LIBS = -lsocket -lnsl
-# This hardcodes in the executable programs the directory to find
-# libnspr.so etc. at program startup.  Equivalent to the -R or -rpath 
-# option for ld on other platforms.
-#export LD_RUN_PATH = $(PWD)/$(dist_libdir)
-endif
-
 ifeq ($(OS_ARCH), SCO_SV)
 # SCO Unix needs to link against -lsocket again even though we
 # already linked with these system libraries when we built libnspr.so.
 EXTRA_LIBS = -lsocket
 # This hardcodes in the executable programs the directory to find
 # libnspr.so etc. at program startup.  Equivalent to the -R or -rpath
 # option for ld on other platforms.
 export LD_RUN_PATH = $(PWD)/$(dist_libdir)
--- a/nsprpub/pr/src/io/Makefile.in
+++ b/nsprpub/pr/src/io/Makefile.in
@@ -9,23 +9,16 @@ MOD_DEPTH	= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(MOD_DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/config.mk
 
-# Disable optimization of the nspr on SunOS4.1.3
-ifeq ($(OS_ARCH),SunOS)
-ifeq ($(OS_RELEASE),4.1.3_U1)
-OPTIMIZER =
-endif
-endif
-
 CSRCS = \
     prfdcach.c \
     prmwait.c \
     priometh.c \
     pripv6.c \
 	prmapopt.c \
     prlayer.c \
     prlog.c \
--- a/nsprpub/pr/src/io/prfile.c
+++ b/nsprpub/pr/src/io/prfile.c
@@ -360,26 +360,26 @@ PR_IMPLEMENT(PRFileDesc*) PR_OpenFile(
             _PR_MD_INIT_FD_INHERITABLE(fd, PR_FALSE);
         }
     }
     return fd;
 }
 
 PR_IMPLEMENT(PRInt32) PR_GetSysfdTableMax(void)
 {
-#if defined(XP_UNIX) && !defined(AIX) && !defined(NEXTSTEP) && !defined(QNX)
+#if defined(XP_UNIX) && !defined(AIX) && !defined(QNX)
     struct rlimit rlim;
 
     if ( getrlimit(RLIMIT_NOFILE, &rlim) < 0) {
        /* XXX need to call PR_SetError() */
        return -1;
     }
 
     return rlim.rlim_max;
-#elif defined(AIX) || defined(NEXTSTEP) || defined(QNX)
+#elif defined(AIX) || defined(QNX)
     return sysconf(_SC_OPEN_MAX);
 #elif defined(WIN32)
     /*
      * There is a systemwide limit of 65536 user handles.
      */
     return 16384;
 #elif defined (WIN16)
     return FOPEN_MAX;
@@ -393,17 +393,17 @@ PR_IMPLEMENT(PRInt32) PR_GetSysfdTableMa
    return -1;
 #else
     write me;
 #endif
 }
 
 PR_IMPLEMENT(PRInt32) PR_SetSysfdTableSize(int table_size)
 {
-#if defined(XP_UNIX) && !defined(AIX) && !defined(NEXTSTEP) && !defined(QNX)
+#if defined(XP_UNIX) && !defined(AIX) && !defined(QNX)
     struct rlimit rlim;
     PRInt32 tableMax = PR_GetSysfdTableMax();
 
     if (tableMax < 0) 
         return -1;
 
     if (tableMax > FD_SETSIZE)
         tableMax = FD_SETSIZE;
@@ -428,17 +428,17 @@ PR_IMPLEMENT(PRInt32) PR_SetSysfdTableSi
       APIRET rc = NO_ERROR;
       rc = DosSetMaxFH(table_size);
       if (rc == NO_ERROR)
         return table_size;
       else
         return -1;
     } 
     return tableMax;
-#elif defined(AIX) || defined(NEXTSTEP) || defined(QNX) \
+#elif defined(AIX) || defined(QNX) \
         || defined(WIN32) || defined(WIN16) || defined(XP_BEOS)
     PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
     return -1;
 #else
     write me;
 #endif
 }
 
--- a/nsprpub/pr/src/io/prmapopt.c
+++ b/nsprpub/pr/src/io/prmapopt.c
@@ -28,21 +28,16 @@
 #endif
 #ifndef IP_TOS
 #define IP_TOS 8
 #endif
 #endif
 
 #include "primpl.h"
 
-#if defined(NEXTSTEP)
-/* NEXTSTEP is special: this must come before netinet/tcp.h. */
-#include <netinet/in_systm.h>  /* n_short, n_long, n_time */
-#endif
-
 #ifdef HAVE_NETINET_TCP_H
 #include <netinet/tcp.h>  /* TCP_NODELAY, TCP_MAXSEG */
 #endif
 
 #ifndef _PR_PTHREADS
 
 PRStatus PR_CALLBACK _PR_SocketGetSocketOption(PRFileDesc *fd, PRSocketOptionData *data)
 {
@@ -354,25 +349,19 @@ PRStatus PR_CALLBACK _PR_SocketSetSocket
  * appropriate header files.  Then any undefined socket options
  * are really missing.
  */
 
 #if !defined(SO_LINGER)
 #error "SO_LINGER is not defined"
 #endif
 
-/*
- * Some platforms, such as NCR 2.03, don't have TCP_NODELAY defined
- * in <netinet/tcp.h>
- */
-#if !defined(NCR)
 #if !defined(TCP_NODELAY)
 #error "TCP_NODELAY is not defined"
 #endif
-#endif
 
 /*
  * Make sure the value of _PR_NO_SUCH_SOCKOPT is not
  * a valid socket option.
  */
 #define _PR_NO_SUCH_SOCKOPT -1
 
 #ifndef SO_KEEPALIVE
--- a/nsprpub/pr/src/linking/Makefile.in
+++ b/nsprpub/pr/src/linking/Makefile.in
@@ -10,23 +10,16 @@ MOD_DEPTH	= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(MOD_DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/config.mk
 
-# Disable optimization of the nspr on SunOS4.1.3
-ifeq ($(OS_ARCH),SunOS)
-ifeq ($(OS_RELEASE),4.1.3_U1)
-OPTIMIZER =
-endif
-endif
-
 CSRCS =           \
 	prlink.c   \
 	$(NULL)
 
 TARGETS	= $(OBJS)
 
 INCLUDES = -I$(dist_includedir) -I$(topsrcdir)/pr/include -I$(topsrcdir)/pr/include/private
 
--- a/nsprpub/pr/src/linking/prlink.c
+++ b/nsprpub/pr/src/linking/prlink.c
@@ -49,18 +49,18 @@
 #endif
 #endif /* XP_UNIX */
 
 #define _PR_DEFAULT_LD_FLAGS PR_LD_LAZY
 
 /*
  * On these platforms, symbols have a leading '_'.
  */
-#if defined(SUNOS4) || (defined(DARWIN) && defined(USE_MACH_DYLD)) \
-    || defined(NEXTSTEP) || defined(XP_OS2) \
+#if (defined(DARWIN) && defined(USE_MACH_DYLD)) \
+    || defined(XP_OS2) \
     || ((defined(OPENBSD) || defined(NETBSD)) && !defined(__ELF__))
 #define NEED_LEADING_UNDERSCORE
 #endif
 
 #define PR_LD_PATHW 0x8000  /* for PR_LibSpec_PathnameU */
 
 /************************************************************************/
 
--- a/nsprpub/pr/src/malloc/Makefile.in
+++ b/nsprpub/pr/src/malloc/Makefile.in
@@ -9,23 +9,16 @@ MOD_DEPTH	= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(MOD_DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/config.mk
 
-# Disable optimization of the nspr on SunOS4.1.3
-ifeq ($(OS_ARCH),SunOS)
-ifeq ($(OS_RELEASE),4.1.3_U1)
-OPTIMIZER =
-endif
-endif
-
 TARGETS	= $(OBJS)
 
 INCLUDES = -I$(dist_includedir) -I$(topsrcdir)/pr/include -I$(topsrcdir)/pr/include/private
 
 DEFINES += -D_NSPR_BUILD_
 
 CSRCS = prmalloc.c prmem.c
 
--- a/nsprpub/pr/src/md/beos/beos_errors.c
+++ b/nsprpub/pr/src/md/beos/beos_errors.c
@@ -984,17 +984,17 @@ void _MD_unix_map_connect_error(int err)
 			break;
 		case EINTR:
 			PR_SetError(PR_PENDING_INTERRUPT_ERROR, err);
 			break;
 		case EINVAL:
 			PR_SetError(PR_INVALID_ARGUMENT_ERROR, err);
 			break;
 		case EIO:
-#if defined(UNIXWARE) || defined(SNI) || defined(NEC)
+#if defined(UNIXWARE)
 			/*
 			 * On some platforms, if we connect to a port on
 			 * the local host (the loopback address) that no
 			 * process is listening on, we get EIO instead
 			 * of ECONNREFUSED.
 			 */
 			PR_SetError(PR_CONNECT_REFUSED_ERROR, err);
 #else
--- a/nsprpub/pr/src/md/prosdep.c
+++ b/nsprpub/pr/src/md/prosdep.c
@@ -23,20 +23,20 @@ PRInt32 _pr_pageSize;
 ** Get system page size
 */
 static void GetPageSize(void)
 {
 	PRInt32 pageSize;
 
     /* Get page size */
 #ifdef XP_UNIX
-#if defined SUNOS4 || defined BSDI || defined AIX \
+#if defined BSDI || defined AIX \
         || defined LINUX || defined __GNU__ || defined __GLIBC__ \
         || defined FREEBSD || defined NETBSD || defined OPENBSD \
-        || defined DARWIN || defined NEXTSTEP || defined SYMBIAN
+        || defined DARWIN || defined SYMBIAN
     _pr_pageSize = getpagesize();
 #elif defined(HPUX)
     /* I have no idea. Don't get me started. --Rob */
     _pr_pageSize = sysconf(_SC_PAGE_SIZE);
 #else
     _pr_pageSize = sysconf(_SC_PAGESIZE);
 #endif
 #endif /* XP_UNIX */
--- a/nsprpub/pr/src/md/unix/Makefile.in
+++ b/nsprpub/pr/src/md/unix/Makefile.in
@@ -31,45 +31,42 @@ CSRCS += pthreads_user.c
 endif
 
 CSRCS += $(PR_MD_CSRCS)
 ASFILES += $(PR_MD_ASFILES)
 
 TARGETS = $(OBJS)
 
 ifeq ($(OS_ARCH),SunOS)
-	ifneq ($(OS_RELEASE),4.1.3_U1)
-		ifeq ($(CPU_ARCH),sparc)
+	ifeq ($(CPU_ARCH),sparc)
 		ifdef USE_64
 			ULTRASPARC_ASFILES = os_SunOS_sparcv9.s
 			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_
 
 include $(topsrcdir)/config/rules.mk
 
 export:: $(TARGETS)
 
 ifeq ($(OS_ARCH),SunOS)
-ifneq ($(OS_RELEASE),4.1.3_U1)
 ifeq ($(CPU_ARCH),sparc)
 
 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 -z endfiltee -o $@ $(ULTRASPARC_ASOBJS)
@@ -95,9 +92,8 @@ endif
 	/usr/ccs/bin/as -o $@ -K PIC -P -D_ASM -D__STDC__=0 -xarch=v8plus $<
 
 clean::
 	rm -rf $(ULTRASPARC_ASOBJS)
 endif
 
 endif
 endif
-endif
deleted file mode 100644
--- a/nsprpub/pr/src/md/unix/os_ReliantUNIX.s
+++ /dev/null
@@ -1,96 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* We want position independent code */
-#define PIC
-
-#include <sys/asm.h>
-#include <sys/regdef.h>
-#include <sys/syscall.h>
-
-	.file 1 "os_ReliantUNIX.s"
-	.option pic2
-	.text
-
-	.align	2
-	.globl	getcxt
-	.ent	getcxt
-getcxt:
-	.frame	sp,0,$31		# vars= 0, regs= 0/0, args= 0, extra= 0
-	# saved integer regs
-	sw	ra,180(a0)	# gpregs[CXT_EPC]
-	sw	gp,152(a0)	# gpregs[CXT_GP]
-	sw	sp,156(a0)	# gpregs[CXT_SP]
-	sw	s8,160(a0)	# gpregs[CXT_S8]
-	sw	s0,104(a0)	# gpregs[CXT_S0]
-	sw	s1,108(a0)	# gpregs[CXT_S1]
-	sw	s2,112(a0)	# gpregs[CXT_S2]
-	sw	s3,116(a0)	# gpregs[CXT_S3]
-	sw	s4,120(a0)	# gpregs[CXT_S4]
-	sw	s5,124(a0)	# gpregs[CXT_S5]
-	sw	s6,128(a0)	# gpregs[CXT_S6]
-	sw	s7,132(a0)	# gpregs[CXT_S7]
-	# csr
-	cfc1	v0,$31
-	# saved float regs
-	s.d	$f20,264(a0)	# fpregs.fp_r.fp_dregs[10]
-	s.d	$f22,272(a0)	# fpregs.fp_r.fp_dregs[11]
-	s.d	$f24,280(a0)	# fpregs.fp_r.fp_dregs[12]
-	s.d	$f26,288(a0)	# fpregs.fp_r.fp_dregs[13]
-	s.d	$f28,296(a0)	# fpregs.fp_r.fp_dregs[14]
-	s.d	$f30,304(a0)	# fpregs.fp_r.fp_dregs[15]
-	sw	v0,312(a0)	# fpregs.fp_csr
-
-	# give no illusions about the contents
-	li	v0,0x0c		# UC_CPU | UC_MAU
-	sw	v0,0(a0)	# uc_flags
-
-	move	v0,zero
-	j	ra
-	.end	getcxt
-
-	.align	2
-	.globl	setcxt
-	.ent	setcxt
-setcxt:
-	.frame	sp,0,$31		# vars= 0, regs= 0/0, args= 0, extra= 0
-	lw	v0,312(a0)	# fpregs.fp_csr
-	li	v1,0xfffc0fff	# mask out exception cause bits
-	and	v0,v0,v1
-	# saved integer regs
-	lw	t9,180(a0)	# gpregs[CXT_EPC]
-	lw	ra,180(a0)	# gpregs[CXT_EPC]
-	lw	gp,152(a0)	# gpregs[CXT_GP]
-	lw	sp,156(a0)	# gpregs[CXT_SP]
-	ctc1	v0,$31		# fp_csr
-	lw	s8,160(a0)	# gpregs[CXT_S8]
-	lw	s0,104(a0)	# gpregs[CXT_S0]
-	lw	s1,108(a0)	# gpregs[CXT_S1]
-	lw	s2,112(a0)	# gpregs[CXT_S2]
-	lw	s3,116(a0)	# gpregs[CXT_S3]
-	lw	s4,120(a0)	# gpregs[CXT_S4]
-	lw	s5,124(a0)	# gpregs[CXT_S5]
-	lw	s6,128(a0)	# gpregs[CXT_S6]
-	lw	s7,132(a0)	# gpregs[CXT_S7]
-	# saved float regs
-	l.d	$f20,264(a0)	# fpregs.fp_r.fp_dregs[10]
-	l.d	$f22,272(a0)	# fpregs.fp_r.fp_dregs[11]
-	l.d	$f24,280(a0)	# fpregs.fp_r.fp_dregs[12]
-	l.d	$f26,288(a0)	# fpregs.fp_r.fp_dregs[13]
-	l.d	$f28,296(a0)	# fpregs.fp_r.fp_dregs[14]
-	l.d	$f30,304(a0)	# fpregs.fp_r.fp_dregs[15]
-
-	# load these, too
-	# they were not saved, but maybe the user modified them...
-	lw	v0,48(a0)
-	lw	v1,52(a0)
-	lw	a1,60(a0)
-	lw	a2,64(a0)
-	lw	a3,68(a0)
-	lw	a0,56(a0)	# there is no way back
-
-	j	ra
-
-	.end	setcxt
--- a/nsprpub/pr/src/md/unix/unix.c
+++ b/nsprpub/pr/src/md/unix/unix.c
@@ -17,37 +17,36 @@
 #include <unistd.h>
 #include <sys/utsname.h>
 
 #ifdef _PR_POLL_AVAILABLE
 #include <poll.h>
 #endif
 
 /* To get FIONREAD */
-#if defined(NCR) || defined(UNIXWARE) || defined(NEC) || defined(SNI) \
-        || defined(SONY)
+#if defined(UNIXWARE)
 #include <sys/filio.h>
 #endif
 
 #if defined(NTO)
 #include <sys/statvfs.h>
 #endif
 
 /*
  * Make sure _PRSockLen_t is 32-bit, because we will cast a PRUint32* or
  * PRInt32* pointer to a _PRSockLen_t* pointer.
  */
 #if defined(HAVE_SOCKLEN_T) \
     || (defined(__GLIBC__) && __GLIBC__ >= 2)
 #define _PRSockLen_t socklen_t
 #elif defined(IRIX) || defined(HPUX) || defined(OSF1) || defined(SOLARIS) \
-    || defined(AIX4_1) || defined(LINUX) || defined(SONY) \
-    || defined(BSDI) || defined(SCO) || defined(NEC) || defined(SNI) \
-    || defined(SUNOS4) || defined(NCR) || defined(DARWIN) \
-    || defined(NEXTSTEP) || defined(QNX)
+    || defined(AIX4_1) || defined(LINUX) \
+    || defined(BSDI) || defined(SCO) \
+    || defined(DARWIN) \
+    || defined(QNX)
 #define _PRSockLen_t int
 #elif (defined(AIX) && !defined(AIX4_1)) || defined(FREEBSD) \
     || defined(NETBSD) || defined(OPENBSD) || defined(UNIXWARE) \
     || defined(DGUX) || defined(NTO) || defined(RISCOS)
 #define _PRSockLen_t size_t
 #else
 #error "Cannot determine architecture"
 #endif
@@ -763,17 +762,17 @@ PRInt32 _MD_recv(PRFileDesc *fd, void *b
     PRInt32 rv, err;
     PRThread *me = _PR_MD_CURRENT_THREAD();
 
 /*
  * Many OS's (Solaris, Unixware) have a broken recv which won't read
  * from socketpairs.  As long as we don't use flags on socketpairs, this
  * is a decent fix. - mikep
  */
-#if defined(UNIXWARE) || defined(SOLARIS) || defined(NCR)
+#if defined(UNIXWARE) || defined(SOLARIS)
     while ((rv = read(osfd,buf,amount)) == -1) {
 #else
     while ((rv = recv(osfd,buf,amount,flags)) == -1) {
 #endif
         err = _MD_ERRNO();
         if ((err == EAGAIN) || (err == EWOULDBLOCK)) {
             if (fd->secret->nonblocking) {
                 break;
@@ -2172,21 +2171,17 @@ void _MD_MakeNonblock(PRFileDesc *fd)
     flags = fcntl(osfd, F_GETFL, 0);
 
     /*
      * Use O_NONBLOCK (POSIX-style non-blocking I/O) whenever possible.
      * On SunOS 4, we must use FNDELAY (BSD-style non-blocking I/O),
      * otherwise connect() still blocks and can be interrupted by SIGALRM.
      */
 
-#ifdef SUNOS4
-    fcntl(osfd, F_SETFL, flags | FNDELAY);
-#else
     fcntl(osfd, F_SETFL, flags | O_NONBLOCK);
-#endif
     }
 
 PRInt32 _MD_open(const char *name, PRIntn flags, PRIntn mode)
 {
     PRInt32 osflags;
     PRInt32 rv, err;
 
     if (flags & PR_RDWR) {
@@ -3317,17 +3312,17 @@ int _MD_unix_get_nonblocking_connect_err
                 return errno;
             } else {
                 return err;
             }		
         }
     } else {
         return ECONNREFUSED;
     }	
-#elif defined(NCR) || defined(UNIXWARE) || defined(SNI) || defined(NEC)
+#elif defined(UNIXWARE)
     /*
      * getsockopt() fails with EPIPE, so use getmsg() instead.
      */
 
     int rv;
     int flags = 0;
     rv = getmsg(osfd, NULL, NULL, &flags);
     PR_ASSERT(-1 == rv || 0 == rv);
--- a/nsprpub/pr/src/md/unix/unix_errors.c
+++ b/nsprpub/pr/src/md/unix/unix_errors.c
@@ -526,17 +526,17 @@ void _MD_unix_map_accept_error(int err)
 void _MD_unix_map_connect_error(int err)
 {
     PRErrorCode prError;
 
     switch (err) {
         case EACCES:
             prError = PR_ADDRESS_NOT_SUPPORTED_ERROR;
             break;
-#if defined(UNIXWARE) || defined(SNI) || defined(NEC)
+#if defined(UNIXWARE)
         /*
          * On some platforms, if we connect to a port on the local host 
          * (the loopback address) that no process is listening on, we get 
          * EIO instead of ECONNREFUSED.
          */
         case EIO:
             prError = PR_CONNECT_REFUSED_ERROR;
             break;
--- a/nsprpub/pr/src/md/unix/uxproces.c
+++ b/nsprpub/pr/src/md/unix/uxproces.c
@@ -706,21 +706,16 @@ static void pr_InstallSigchldHandler()
 #endif  /* !defined(_PR_NATIVE_THREADS) */
 
 static PRStatus _MD_InitProcesses(void)
 {
 #if !defined(_PR_NATIVE_THREADS)
     int rv;
     int flags;
 #endif
-#ifdef SUNOS4
-#define _PR_NBIO_FLAG FNDELAY
-#else
-#define _PR_NBIO_FLAG O_NONBLOCK
-#endif
 
 #ifdef AIX
     {
         void *handle = dlopen(NULL, RTLD_NOW | RTLD_GLOBAL);
         pr_wp.forkptr = (pid_t (*)(void)) dlsym(handle, "f_fork");
         if (!pr_wp.forkptr) {
             pr_wp.forkptr = fork;
         }
@@ -734,19 +729,19 @@ static PRStatus _MD_InitProcesses(void)
 #if defined(_PR_NATIVE_THREADS)
     pr_wp.numProcs = 0;
     pr_wp.cv = PR_NewCondVar(pr_wp.ml);
     PR_ASSERT(NULL != pr_wp.cv);
 #else
     rv = pipe(pr_wp.pipefd);
     PR_ASSERT(0 == rv);
     flags = fcntl(pr_wp.pipefd[0], F_GETFL, 0);
-    fcntl(pr_wp.pipefd[0], F_SETFL, flags | _PR_NBIO_FLAG);
+    fcntl(pr_wp.pipefd[0], F_SETFL, flags | O_NONBLOCK);
     flags = fcntl(pr_wp.pipefd[1], F_GETFL, 0);
-    fcntl(pr_wp.pipefd[1], F_SETFL, flags | _PR_NBIO_FLAG);
+    fcntl(pr_wp.pipefd[1], F_SETFL, flags | O_NONBLOCK);
 
 #ifndef _PR_SHARE_CLONES
     pr_InstallSigchldHandler();
 #endif
 #endif  /* !_PR_NATIVE_THREADS */
 
     pr_wp.thread = PR_CreateThread(PR_SYSTEM_THREAD,
 	    WaitPidDaemonThread, NULL, PR_PRIORITY_NORMAL,
--- a/nsprpub/pr/src/md/unix/uxrng.c
+++ b/nsprpub/pr/src/md/unix/uxrng.c
@@ -20,24 +20,16 @@ GetHighResClock(void *buf, size_t maxbyt
     hrtime_t t;
     t = gethrtime();
     if (t) {
 	    return _pr_CopyLowBits(buf, maxbytes, &t, sizeof(t));
     }
     return 0;
 }
 
-#elif defined(SUNOS4)
-
-static size_t
-GetHighResClock(void *buf, size_t maxbytes)
-{
-    return 0;
-}
-
 #elif defined(HPUX)
 
 #ifdef __ia64
 #include <ia64/sys/inline.h>
 
 static size_t
 GetHighResClock(void *buf, size_t maxbytes)
 {
@@ -129,24 +121,16 @@ static size_t GetDevURandom( void *buf, 
 } /* end GetDevURandom() */
 
 static size_t
 GetHighResClock(void *buf, size_t maxbytes)
 {             
     return(GetDevURandom( buf, maxbytes ));
 }
 
-#elif defined(NCR)
-
-static size_t
-GetHighResClock(void *buf, size_t maxbytes)
-{
-    return 0;
-}
-
 #elif defined(IRIX)
 #include <fcntl.h>
 #undef PRIVATE
 #include <sys/mman.h>
 #include <sys/syssgi.h>
 #include <sys/immu.h>
 #include <sys/systeminfo.h>
 #include <sys/utsname.h>
@@ -220,44 +204,16 @@ static size_t GetHighResClock(void *buf,
 
     s0[0] = *iotimer_addr;
     if (cntr_size > 4)
 	s0[1] = *(iotimer_addr + 1);
     memcpy(buf, (char *)&s0[0], cntr_size);
     return _pr_CopyLowBits(buf, maxbuf, &s0, cntr_size);
 }
 
-#elif defined(SONY)
-
-static size_t
-GetHighResClock(void *buf, size_t maxbytes)
-{
-    return 0;
-}
-
-#elif defined(SNI)
-#include <sys/times.h>
-
-static size_t
-GetHighResClock(void *buf, size_t maxbytes)
-{
-    int ticks;
-    struct tms buffer;
-
-    ticks=times(&buffer);
-    return _pr_CopyLowBits(buf, maxbytes, &ticks, sizeof(ticks));
-}
-
-#elif defined(NEC)
-
-static size_t
-GetHighResClock(void *buf, size_t maxbytes)
-{
-    return 0;
-}
 #elif defined(SCO) || defined(UNIXWARE) || defined(BSDI) || defined(NTO) \
     || defined(QNX) || defined(DARWIN) || defined(RISCOS)
 #include <sys/times.h>
 
 static size_t
 GetHighResClock(void *buf, size_t maxbytes)
 {
     int ticks;
--- a/nsprpub/pr/src/md/unix/uxwrap.c
+++ b/nsprpub/pr/src/md/unix/uxwrap.c
@@ -65,19 +65,16 @@ void PR_SetXtHackOkayToReleaseXLockFn(in
  *    Wrap up the select system call so that we can deschedule
  *    a thread that tries to wait for i/o.
  *
  *-----------------------------------------------------------------------
  */
 
 #if defined(HPUX9)
 int select(size_t width, int *rl, int *wl, int *el, const struct timeval *tv)
-#elif defined(NEXTSTEP)
-int wrap_select(int width, fd_set *rd, fd_set *wr, fd_set *ex,
-        const struct timeval *tv)
 #elif defined(AIX_RENAME_SELECT)
 int wrap_select(unsigned long width, void *rl, void *wl, void *el,
         struct timeval *tv)
 #elif defined(_PR_SELECT_CONST_TIMEVAL)
 int select(int width, fd_set *rd, fd_set *wr, fd_set *ex,
         const struct timeval *tv)
 #else
 int select(int width, fd_set *rd, fd_set *wr, fd_set *ex, struct timeval *tv)
@@ -253,17 +250,17 @@ int select(int width, fd_set *rd, fd_set
                     nbits++;
                 }
                 if (ex && (unixpd->in_flags & _PR_UNIX_POLL_WRITE)
                         && (unixpd->out_flags & PR_POLL_EXCEPT)) {
                     FD_SET(unixpd->osfd, ex);
                     nbits++;
                 }
                 PR_ASSERT(nbits > 0);
-#if defined(HPUX) || defined(SOLARIS) || defined(SUNOS4) || defined(OSF1) || defined(AIX)
+#if defined(HPUX) || defined(SOLARIS) || defined(OSF1) || defined(AIX)
                 retVal += nbits;
 #else /* IRIX */
                 retVal += 1;
 #endif
             }
         }
     }
 
--- a/nsprpub/pr/src/misc/prtime.c
+++ b/nsprpub/pr/src/misc/prtime.c
@@ -1690,17 +1690,17 @@ PR_FormatTime(char *buf, int buflen, con
         a.tm_yday = tm->tm_yday;
         a.tm_isdst = tm->tm_params.tp_dst_offset ? 1 : 0;
 
         /*
          * On some platforms, for example SunOS 4, struct tm has two
          * additional fields: tm_zone and tm_gmtoff.
          */
 
-#if defined(SUNOS4) || (__GLIBC__ >= 2) || defined(XP_BEOS) \
+#if (__GLIBC__ >= 2) || defined(XP_BEOS) \
         || defined(NETBSD) || defined(OPENBSD) || defined(FREEBSD) \
         || defined(DARWIN) || defined(SYMBIAN) || defined(ANDROID)
         a.tm_zone = NULL;
         a.tm_gmtoff = tm->tm_params.tp_gmt_offset +
                       tm->tm_params.tp_dst_offset;
 #endif
     } else {
         ap = NULL;
--- a/nsprpub/pr/src/pthreads/Makefile.in
+++ b/nsprpub/pr/src/pthreads/Makefile.in
@@ -10,23 +10,16 @@ MOD_DEPTH	= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(MOD_DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/config.mk
 
-# Disable optimization of the nspr on SunOS4.1.3
-ifeq ($(OS_ARCH),SunOS)
-ifeq ($(OS_RELEASE),4.1.3_U1)
-OPTIMIZER =
-endif
-endif
-
 CSRCS = \
 	ptio.c \
 	ptsynch.c \
 	ptthread.c \
 	ptmisc.c \
 	$(NULL)
 
 TARGETS	= $(OBJS)
--- a/nsprpub/pr/src/pthreads/ptio.c
+++ b/nsprpub/pr/src/pthreads/ptio.c
@@ -4845,17 +4845,17 @@ PR_IMPLEMENT(PRInt32) PR_FD_NISSET(PRInt
        if (set->narray[index] == fd) {
            return 1;
        }
     return 0;
 }
 
 #include <sys/types.h>
 #include <sys/time.h>
-#if !defined(SUNOS4) && !defined(HPUX) \
+#if !defined(HPUX) \
     && !defined(LINUX) && !defined(__GNU__) && !defined(__GLIBC__)
 #include <sys/select.h>
 #endif
 
 static PRInt32
 _PR_getset(PR_fd_set *pr_set, fd_set *set)
 {
     PRUint32 index;
--- a/nsprpub/pr/src/threads/combined/Makefile.in
+++ b/nsprpub/pr/src/threads/combined/Makefile.in
@@ -10,23 +10,16 @@ MOD_DEPTH	= ../../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(MOD_DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/config.mk
 
-# Disable optimization of the nspr on SunOS4.1.3
-ifeq ($(OS_ARCH),SunOS)
-ifeq ($(OS_RELEASE),4.1.3_U1)
-OPTIMIZER =
-endif
-endif
-
 ifdef USE_PTHREADS
 CSRCS =         \
 	$(NULL)
 else
 CSRCS =         \
     prucpu.c      \
 	prucv.c      \
 	prulock.c    \
--- a/nsprpub/pr/tests/Makefile.in
+++ b/nsprpub/pr/tests/Makefile.in
@@ -291,67 +291,30 @@ ifeq ($(OS_ARCH),AIX)
     ifneq ($(OS_ARCH)$(OS_RELEASE),AIX4.1)
         LDOPTS += -brtl
         EXTRA_LIBS = -ldl
     endif
 endif
 
 # Solaris
 ifeq ($(OS_ARCH), SunOS)
-    ifneq ($(OS_RELEASE), 4.1.3_U1)
-        ifdef NS_USE_GCC
-            LDOPTS += -Xlinker -R -Xlinker $(ABSOLUTE_LIB_DIR)
-        else
-            ifeq ($(USE_CPLUS), 1)
-                CC = CC
-            endif
-            LDOPTS += -R $(ABSOLUTE_LIB_DIR)
+    ifdef NS_USE_GCC
+        LDOPTS += -Xlinker -R -Xlinker $(ABSOLUTE_LIB_DIR)
+    else
+        ifeq ($(USE_CPLUS), 1)
+            CC = CC
         endif
+        LDOPTS += -R $(ABSOLUTE_LIB_DIR)
     endif
 
     ifdef USE_PTHREADS
         EXTRA_LIBS = -lpthread
     endif
 endif # SunOS
 
-ifeq ($(OS_ARCH), NEC)
-    EXTRA_LIBS = $(OS_LIBS)
-# This hardcodes in the executable programs the directory to find
-# libnspr.so etc. at program startup.  Equivalent to the -R or -rpath
-# option for ld on other platforms.
-    export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
-endif
-
-ifeq ($(OS_ARCH), NCR)
-# NCR needs to link against -lsocket -lnsl -ldl (and -lc, which is
-# linked implicitly by $(CC)).  Note that we did not link with these
-# system libraries when we built libnspr.so.
-    EXTRA_LIBS = -lsocket -lnsl -ldl
-# This hardcodes in the executable programs the directory to find
-# libnspr.so etc. at program startup.  Equivalent to the -R or -rpath 
-# option for ld on other platforms.
-    export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
-endif
-
-ifeq ($(OS_ARCH), NEXTSTEP)
-# balazs.pataki@sztaki.hu: linkage is done in a different pass in the `tests'
-# modeul, so we have to pass the `-posix' flag by "hand" to `ld'
-LDOPTS += -posix
-endif
-
-ifeq ($(OS_ARCH), NEWS-OS)
-# This hardcodes in the executable programs the directory to find
-# libnspr.so etc. at program startup.  Equivalent to the -R or -rpath 
-# option for ld on other platforms.
-#export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
-    LIBNSPR = $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).a
-    LIBPLC = $(dist_libdir)/libplc$(MOD_MAJOR_VERSION).a
-    EXTRA_LIBS = -lsocket -lnsl -lgen -lresolv
-endif
-
 ifeq (,$(filter-out Linux GNU GNU_%,$(OS_ARCH)))
     LDOPTS += -Xlinker -rpath $(ABSOLUTE_LIB_DIR)
     ifeq ($(USE_PTHREADS),1)
         EXTRA_LIBS = -lpthread
     endif
 endif
 
 ifeq ($(OS_ARCH), SCOOS)
@@ -359,24 +322,16 @@ ifeq ($(OS_ARCH), SCOOS)
 # already linked with these system libraries when we built libnspr.so.
 EXTRA_LIBS = -lsocket
 # This hardcodes in the executable programs the directory to find
 # libnspr.so etc. at program startup.  Equivalent to the -R or -rpath 
 # option for ld on other platforms.
 export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
 endif
 
-ifeq ($(OS_ARCH),SINIX)
-EXTRA_LIBS = -lsocket -lnsl -lresolv -ldl
-# This hardcodes in the executable programs the directory to find
-# libnspr.so etc. at program startup.  Equivalent to the -R or -rpath
-# option for ld on other platforms.
-export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
-endif
-
 ifeq ($(OS_ARCH),OpenUNIX)
 export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
 ifeq ($(USE_PTHREADS),1)
 LDOPTS += -pthread
 endif
 endif
 
 ifeq ($(OS_ARCH), UNIXWARE)
@@ -479,25 +434,23 @@ endif # AIX_PRE_4_2
 
 export:: $(TARGETS)
 clean::
 	rm -f $(TARGETS)
 
 # The following tests call BSD socket functions, so they need to link
 # with -lsocket on some platforms.
 ifeq ($(OS_ARCH),SunOS)
-ifneq ($(OS_RELEASE),4.1.3_U1)
 ifeq ($(USE_IPV6),1)
 $(OBJDIR)/gethost: $(OBJDIR)/gethost.o
 	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) -lsocket $(EXTRA_LIBS) -o $@
 endif
 $(OBJDIR)/prpoll: $(OBJDIR)/prpoll.o
 	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) -lsocket $(EXTRA_LIBS) -o $@
 endif
-endif
 
 ifeq ($(USE_PTHREADS), 1)
 $(OBJDIR)/attach: $(OBJDIR)/attach.o
 	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
 $(OBJDIR)/foreign: $(OBJDIR)/foreign.o
 	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
 $(OBJDIR)/provider: $(OBJDIR)/provider.o
 	$(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
--- a/nsprpub/pr/tests/dll/Makefile.in
+++ b/nsprpub/pr/tests/dll/Makefile.in
@@ -9,23 +9,16 @@ MOD_DEPTH	= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(MOD_DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/config.mk
 
-# Disable optimization of the nspr on SunOS4.1.3
-ifeq ($(OS_ARCH),SunOS)
-ifeq ($(OS_RELEASE),4.1.3_U1)
-OPTIMIZER =
-endif
-endif
-
 CSRCS = mygetval.c mysetval.c
 
 INCLUDES = -I$(dist_includedir)
 
 OBJS = $(OBJDIR)/mygetval.$(OBJ_SUFFIX) \
 	$(OBJDIR)/mysetval.$(OBJ_SUFFIX)
 
 ifeq ($(OS_TARGET), WIN16)
--- a/nsprpub/tools/Makefile.in
+++ b/nsprpub/tools/Makefile.in
@@ -81,51 +81,31 @@ endif
 ifeq ($(OS_ARCH),AIX)
 LDOPTS += -blibpath:$(PWD)/$(dist_libdir):/usr/lib:/lib
 LIBPR = -lnspr$(NSPR_VERSION)_shr
 LIBPLC = -lplc$(NSPR_VERSION)_shr
 endif
 
 # Solaris
 ifeq ($(OS_ARCH), SunOS)
-ifneq ($(OS_RELEASE), 4.1.3_U1)
 ifdef NS_USE_GCC
 LDOPTS += -Xlinker -R -Xlinker $(PWD)/$(dist_libdir)
 else
 LDOPTS += -R $(PWD)/$(dist_libdir)
 endif
-endif
 
 # SunOS 5.5 needs to link with -lpthread, even though we already
 # linked with this system library when we built libnspr.so.
 ifeq ($(OS_RELEASE), 5.5)
 ifdef USE_PTHREADS
 EXTRA_LIBS = -lpthread
 endif
 endif
 endif # SunOS
 
-ifeq ($(OS_ARCH), NCR)
-# XXX: We see some strange problems when we link with libnspr.so.
-# So for now we use static libraries on NCR.  The shared library
-# stuff below is commented out.
-LIBPR = $(dist_libdir)/libnspr$(NSPR_VERSION).a
-LIBPLC = $(dist_libdir)/libplc$(NSPR_VERSION).a
-EXTRA_LIBS = -lsocket -lnsl -ldl
-
-# NCR needs to link against -lsocket -lnsl (and -lc, which is linked
-# implicitly by $(CC)) again even though we already linked with these
-# system libraries when we built libnspr.so.
-#EXTRA_LIBS = -lsocket -lnsl
-# This hardcodes in the executable programs the directory to find
-# libnspr.so etc. at program startup.  Equivalent to the -R or -rpath 
-# option for ld on other platforms.
-#export LD_RUN_PATH = $(PWD)/$(dist_libdir)
-endif
-
 ifeq ($(OS_ARCH), SCOOS)
 # SCO Unix needs to link against -lsocket again even though we
 # already linked with these system libraries when we built libnspr.so.
 EXTRA_LIBS = -lsocket
 # This hardcodes in the executable programs the directory to find
 # libnspr.so etc. at program startup.  Equivalent to the -R or -rpath 
 # option for ld on other platforms.
 export LD_RUN_PATH = $(PWD)/$(dist_libdir)