--- nspr/pr/src/Makefile.in.orig	2020-12-31 05:17:43 +0000
+++ nspr/pr/src/Makefile.in	2020-12-31 05:19:14 +0000
@@ -67,7 +67,7 @@
 endif	# SunOS
 
 ifeq ($(OS_ARCH),AIX)
-DSO_LDOPTS	+= -binitfini::_PR_Fini
+DSO_LDOPTS	+= 
 OS_LIBS		= -lodm -lcfg
 ifeq ($(CLASSIC_NSPR),1)
 ifeq ($(OS_RELEASE),4.1)
--- nspr/configure.orig	2018-02-23 08:11:13 -0500
+++ nspr/configure	2018-02-23 08:11:28 -0500
@@ -6376,7 +6376,7 @@
         AIX_LINK_OPTS='-brtl -bnso -berok'
         ;;
     esac
-    CFLAGS="$CFLAGS -qro -qroconst"
+    CFLAGS="$CFLAGS"
     AIX_WRAP='$(DIST)/lib/aixwrap.o'
     AIX_TMP='./_aix_tmp.o'
     if test -n "$USE_64"; then
--- nspr/pr/tests/Makefile.in.orig	2018-02-23 08:36:33 -0500
+++ nspr/pr/tests/Makefile.in	2018-02-23 08:37:04 -0500
@@ -291,9 +291,9 @@
 
 # AIX
 ifeq ($(OS_ARCH),AIX)
-    LDOPTS += -blibpath:$(ABSOLUTE_LIB_DIR):/usr/lib:/lib
+    LDOPTS += -Wl,-blibpath:$(ABSOLUTE_LIB_DIR):/usr/lib:/lib
     ifneq ($(OS_ARCH)$(OS_RELEASE),AIX4.1)
-        LDOPTS += -brtl
+        LDOPTS += -Wl,-brtl
         EXTRA_LIBS = -ldl
     endif
 endif
--- nspr/tools/Makefile.in.orig	2018-02-23 08:35:59 -0500
+++ nspr/tools/Makefile.in	2018-02-23 08:36:21 -0500
@@ -79,7 +79,7 @@
 
 # AIX
 ifeq ($(OS_ARCH),AIX)
-LDOPTS += -blibpath:$(PWD)/$(dist_libdir):/usr/lib:/lib
+LDOPTS += -Wl,-blibpath:$(PWD)/$(dist_libdir):/usr/lib:/lib
 LIBPR = -lnspr$(NSPR_VERSION)_shr
 LIBPLC = -lplc$(NSPR_VERSION)_shr
 endif
--- nspr/pr/src/cplus/tests/Makefile.in.orig	2018-02-23 08:38:25 -0500
+++ nspr/pr/src/cplus/tests/Makefile.in	2018-02-23 08:38:53 -0500
@@ -113,12 +113,12 @@
 
 # AIX
 ifeq ($(OS_ARCH),AIX)
-    LDOPTS += -blibpath:$(PWD)/$(dist_libdir):/usr/lib:/lib
+    LDOPTS += -Wl,-blibpath:$(PWD)/$(dist_libdir):/usr/lib:/lib
     ifeq ($(OS_ARCH)$(OS_RELEASE),AIX4.1)
         LIBPR = -lnspr$(MOD_MAJOR_VERSION)_shr
         LIBPLC = -lplc$(MOD_MAJOR_VERSION)_shr
     else
-        LDOPTS += -brtl
+        LDOPTS += -Wl,-brtl
         EXTRA_LIBS = -ldl
     endif
 endif
--- ./nspr/config/rules.mk.orig	2021-01-11 12:28:37 +0000
+++ ./nspr/config/rules.mk	2021-01-11 12:30:19 +0000
@@ -280,6 +280,14 @@
 	$(STRIP) $@
 endif
 
+ifeq ($(OS_ARCH), AIX)
+# Without the p*vrsion.o modules in libnspr4.a/libplc4.a tests will not build
+$(LIBRARY): $(OBJS)
+	@$(MAKE_OBJDIR)
+	rm -f $@
+	$(AR) $(AR_FLAGS) $(OBJS) $(AR_EXTRA_ARGS)
+	$(RANLIB) $@
+else    # AIX
 # Same as OBJS, but without any file that matches p*vrsion.o, since these
 # collide for static libraries, and are not useful for that case anyway.
 STATICLIB_OBJS = $(filter-out $(OBJDIR)/p%vrsion.$(OBJ_SUFFIX),$(OBJS))
--- ./nspr/config/rules.mk.orig	2021-01-11 12:32:23 +0000
+++ ./nspr/config/rules.mk	2021-01-11 12:32:52 +0000
@@ -296,6 +296,7 @@
 	rm -f $@
 	$(AR) $(AR_FLAGS) $(STATICLIB_OBJS) $(AR_EXTRA_ARGS)
 	$(RANLIB) $@
+endif #AIX
 
 ifeq ($(OS_TARGET), OS2)
 $(IMPORT_LIBRARY): $(MAPFILE)
