--- old/usr/src/Makefile.master	Tue Dec 13 03:05:11 2016
+++ new/usr/src/Makefile.master	Tue Dec 13 03:05:11 2016
@@ -27,6 +27,7 @@
 # Copyright 2015 Gary Mills
 # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
 # Copyright 2016 Toomas Soome <tsoome@me.com>
+# Copyright 2016 RackTop Systems.
 #
 
 #
@@ -105,6 +106,8 @@
 # uncomment things in the lower Makefiles to enable the feature.
 ENABLE_IPP_PRINTING=	$(POUND_SIGN)
 ENABLE_SMB_PRINTING=	$(POUND_SIGN)
+ENABLE_32BIT_PERL=	$(POUND_SIGN)
+ENABLE_64BIT_PERL=	$(POUND_SIGN)
 
 # CLOSED is the root of the tree that contains source which isn't released
 # as open source
@@ -175,8 +178,10 @@
 PERL=		/usr/bin/perl
 PERL_VERSION=	5.10.0
 PERL_PKGVERS=	-510
-PERL_ARCH =		i86pc-solaris-64int
-$(SPARC_BLD)PERL_ARCH =	sun4-solaris-64int
+PERL_MACH=	i86pc
+$(SPARC_BLD)PERL_MACH=	sun4
+PERL_ARCH=	$(PERL_MACH)-solaris$(PERL_VARIANT)-64int
+PERL_ARCH64=	$(PERL_MACH)-solaris$(PERL_VARIANT)-64
 PYTHON_VERSION=	2.7
 PYTHON_PKGVERS=	-27
 PYTHON=		/usr/bin/python$(PYTHON_VERSION)
@@ -709,6 +714,11 @@
 $(__GNUC)CCNEEDED	= -L$(GCCLIBDIR) -lstdc++ -lgcc_s
 $(__GNUC)CCEXTNEEDED	= $(CCNEEDED)
 
+CCNEEDED64		= -lCrun
+CCEXTNEEDED64		= -lCrun -lCstd
+$(__GNUC64)CCNEEDED64	= -L$(GCCLIBDIR) -lstdc++ -lgcc_s
+$(__GNUC64)CCEXTNEEDED	= $(CCNEEDED64)
+
 LINK.c=		$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
 LINK64.c=	$(CC) $(CFLAGS64) $(CPPFLAGS) $(LDFLAGS)
 NORUNPATH=	-norunpath -nolib
@@ -715,7 +725,7 @@
 LINK.cc=	$(CCC) $(CCFLAGS) $(CPPFLAGS) $(NORUNPATH) \
 		$(LDFLAGS) $(CCNEEDED)
 LINK64.cc=	$(CCC) $(CCFLAGS64) $(CPPFLAGS) $(NORUNPATH) \
-		$(LDFLAGS) $(CCNEEDED)
+		$(LDFLAGS) $(CCNEEDED64)
 
 #
 # lint macros
@@ -758,6 +768,7 @@
 #
 # For now at least, we cross-compile amd64 on i386 machines.
 NATIVE_MACH=	$(MACH:amd64=i386)
+NATIVE_MACH64=	$(MACH64)
 
 # Define native compilation macros
 #
@@ -823,6 +834,13 @@
 NATIVELD=		$($(NATIVE_MACH)_LD)
 NATIVELINT=		$($(NATIVE_MACH)_LINT)
 
+NATIVECC64=		$($(NATIVE_MACH64)_CC)
+NATIVECCC64=		$($(NATIVE_MACH64)_CCC)
+NATIVECPP64=		$($(NATIVE_MACH64)_CPP)
+NATIVEAS64=		$($(NATIVE_MACH64)_AS)
+NATIVELD64=		$($(NATIVE_MACH64)_LD)
+NATIVELINT64=		$($(NATIVE_MACH64)_LINT)
+
 #
 # Makefile.master.64 overrides these settings
 #
@@ -833,6 +851,13 @@
 LD=			$(NATIVELD)
 LINT=			$(NATIVELINT)
 
+CC64=			$(NATIVECC64)
+CCC64=			$(NATIVECCC64)
+CPP64=			$(NATIVECPP64)
+AS64=			$(NATIVEAS64)
+LD64=			$(NATIVELD64)
+LINT64=			$(NATIVELINT64)
+
 # The real compilers used for this build
 CW_CC_CMD=		$(CC) -_compiler
 CW_CCC_CMD=		$(CCC) -_compiler
--- old/usr/src/Makefile.master.64	Tue Dec 13 03:05:11 2016
+++ new/usr/src/Makefile.master.64	Tue Dec 13 03:05:11 2016
@@ -21,6 +21,7 @@
 #
 # Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright 2014 Garrett D'Amore <garrett@damore.org>
+# Copyright 2016 RackTop Systems.
 #
 
 # rebind basic build macros to 64-bit versions
@@ -56,18 +57,18 @@
 #
 # Override Makefile.master's settings of CC, CCC, AS and LINT
 #
-CC=		$($(MACH64)_CC)
-CCC=		$($(MACH64)_CCC)
-CPP=		$($(MACH64)_CPP)
-AS=		$($(MACH64)_AS)
-LD=		$($(MACH64)_LD)
-LINT=		$($(MACH64)_LINT)
+CC=		$(CC64)
+CCC=		$(CCC64)
+CPP=		$(CPP64)
+AS=		$(AS64)
+LD=		$(LD64)
+LINT=		$(LINT64)
 
 REAL_CC=	$(CW_CC_CMD:sh)
 REAL_CCC=	$(CW_CCC_CMD:sh)
 
-BUILD.SO=	$(CC) $(CFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
-		$(PICS) $(EXTPICS) -L $(ROOTLIBDIR64) $(LDLIBS)
+BUILD.SO=	$(BUILD64.SO)
+BUILDCCC.SO=	$(BUILDCCC64.SO)
 
 #
 # ld(1) requires the -64 option to create a 64-bit filter solely from a mapfile
@@ -74,10 +75,4 @@
 #
 MAPFILECLASS=	-64
 
-CCNEEDED =		-lCrun
-$(__GNUC64)CCNEEDED =	-L$(GCCLIBDIR) -lstdc++
-$(__GNUC64)CCNEEDED +=	-lgcc_s
-
-BUILDCCC.SO=    $(CCC) $(CCFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
-		$(PICS) $(EXTPICS) $(LDLIBS) $(CCNEEDED)
 MAPFILE.NGB =	$(MAPFILE.NGB_$(MACH64))
--- old/usr/src/cmd/perl/Makefile.perl	Tue Dec 13 03:05:11 2016
+++ new/usr/src/cmd/perl/Makefile.perl	Tue Dec 13 03:05:11 2016
@@ -9,8 +9,8 @@
 # http://www.illumos.org/license/CDDL.
 #
 #
-# Copyright (c) 2014 Racktop Systems.
 # Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
 include $(SRC)/lib/Makefile.lib
@@ -22,16 +22,33 @@
 PERLDIR = $(ADJUNCT_PROTO)/usr/perl5/$(PERL_VERSION)
 PERLLIBDIR = $(PERLDIR)/lib/$(PERL_ARCH)
 PERLINCDIR = $(PERLLIBDIR)/CORE
+PERLLIBDIR64 = $(PERLDIR)/lib/$(PERL_ARCH64)
+PERLINCDIR64 = $(PERLLIBDIR64)/CORE
 
 PERLMOD = $(MODULE).pm
 PERLEXT = $(MACH)/$(MODULE).so
+PERLEXT64 = $(MACH64)/$(MODULE).so
 
 ROOTPERLDIR = $(ROOT)/usr/perl5/$(PERL_VERSION)
 ROOTPERLLIBDIR = $(ROOTPERLDIR)/lib/$(PERL_ARCH)
 ROOTPERLMODDIR = $(ROOTPERLLIBDIR)/Sun/Solaris
 ROOTPERLEXTDIR = $(ROOTPERLLIBDIR)/auto/Sun/Solaris/$(MODULE)
+ROOTPERLLIBDIR64 = $(ROOTPERLDIR)/lib/$(PERL_ARCH64)
+ROOTPERLMODDIR64 = $(ROOTPERLLIBDIR64)/Sun/Solaris
+ROOTPERLEXTDIR64 = $(ROOTPERLLIBDIR64)/auto/Sun/Solaris/$(MODULE)
 
 ROOTPERLMOD = $(ROOTPERLMODDIR)/$(MODULE).pm
 ROOTPERLEXT = $(ROOTPERLEXTDIR)/$(MODULE).so
+ROOTPERLMOD64 = $(ROOTPERLMODDIR64)/$(MODULE).pm
+ROOTPERLEXT64 = $(ROOTPERLEXTDIR64)/$(MODULE).so
 
+XSUBPP = $(PERLDIR)/bin/$(MACH)/perl $(PERLDIR)/lib/ExtUtils/xsubpp \
+	-typemap $(PERLDIR)/lib/ExtUtils/typemap
+
+XSUBPP64 = $(PERLDIR)/bin/$(MACH64)/perl $(PERLDIR)/lib/ExtUtils/xsubpp \
+	-typemap $(PERLDIR)/lib/ExtUtils/typemap
+
 C99MODE = $(C99_ENABLE)
+
+32BIT_PERL = $(ENABLE_32BIT_PERL)
+64BIT_PERL = $(ENABLE_64BIT_PERL)
--- old/usr/src/cmd/perl/Makefile.targ	Tue Dec 13 03:05:12 2016
+++ new/usr/src/cmd/perl/Makefile.targ	Tue Dec 13 03:05:12 2016
@@ -9,43 +9,66 @@
 # http://www.illumos.org/license/CDDL.
 #
 #
-# Copyright (c) 2014 Racktop Systems.
 # Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
 # Link against libc as perl solaris specs
 $(PERLEXT):= LDLIBS += -lc
+$(PERLEXT64):= LDLIBS += -lc
 
 # Allow for undefined symbols satisfied by perl
 $(PERLEXT):= ZDEFS =
+$(PERLEXT64):= ZDEFS =
 
 $(ROOTPERLEXT) := FILEMODE = 0555
 $(ROOTPERLMOD) := FILEMODE = 0444
+$(ROOTPERLEXT64) := FILEMODE = 0555
+$(ROOTPERLMOD64) := FILEMODE = 0444
 
 # CFLAGS for perl, specifically.
 PCFLAGS= -DPERL_EUPXS_ALWAYS_EXPORT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \
 	-DPERL_USE_SAFE_PUTENV -D_TS_ERRNO
+PCFLAGS64= -DPERL_EUPXS_ALWAYS_EXPORT -D_LARGEFILE64_SOURCE \
+	-DPERL_USE_SAFE_PUTENV -D_TS_ERRNO
 
-$(MACH):
+$(MACH) $(MACH64):
 	$(INS.dir)
 
 $(PERLEXT): $(MACH)/$(MODULE).o
 	$(BUILD.SO) $(MACH)/$(MODULE).o
 
+$(PERLEXT64): $(MACH64)/$(MODULE).o
+	$(BUILD64.SO) $(MACH64)/$(MODULE).o
+
+# NOTE: With later version of Perl, we need to define PERL_EUPXS_ALWAYS_EXPORT
+# which is a backward-compatibility definition for the assumes-5.10 stuff here.
 $(MACH)/$(MODULE).o: $(MACH)/$(MODULE).c
 	$(COMPILE.c) $(PCFLAGS) $(C_PICFLAGS) -I$(PERLINCDIR) $< -o $@
 
+$(MACH64)/$(MODULE).o: $(MACH64)/$(MODULE).c
+	$(COMPILE64.c) $(PCFLAGS64) $(C_PICFLAGS) -I$(PERLINCDIR64) $< -o $@
+
 $(MACH)/$(MODULE).c: $(MACH) $(MODULE).xs 
-	$(PERLDIR)/bin/xsubpp $(XSUBPPFLAGS) $(MODULE).xs >$@
+	$(XSUBPP) $(XSUBPPFLAGS) $(MODULE).xs >$@
 
-$(ROOTPERLMODDIR):
+$(MACH64)/$(MODULE).c: $(MACH64) $(MODULE).xs
+	$(XSUBPP64) $(XSUBPPFLAGS) $(MODULE).xs >$@
+
+$(ROOTPERLMODDIR) $(ROOTPERLMODDIR64):
 	$(INS.dir)
 
 $(ROOTPERLMOD): $(ROOTPERLMODDIR) $(MODULE).pm
 	$(RM) $@; $(INS) -s -m $(FILEMODE) -f $^
 
-$(ROOTPERLEXTDIR):
+$(ROOTPERLMOD64): $(ROOTPERLMODDIR64) $(MODULE).pm
+	$(RM) $@; $(INS) -s -m $(FILEMODE) -f $^
+
+$(ROOTPERLEXTDIR) $(ROOTPERLEXTDIR64):
 	$(INS.dir)
 
 $(ROOTPERLEXT): $(ROOTPERLEXTDIR) $(MACH)/$(MODULE).so
+	$(RM) $@; $(INS) -s -m $(FILEMODE) -f $^
+
+$(ROOTPERLEXT64): $(ROOTPERLEXTDIR64) $(MACH64)/$(MODULE).so
 	$(RM) $@; $(INS) -s -m $(FILEMODE) -f $^
--- old/usr/src/cmd/perl/contrib/Sun/Solaris/BSM/Makefile	Tue Dec 13 03:05:12 2016
+++ new/usr/src/cmd/perl/contrib/Sun/Solaris/BSM/Makefile	Tue Dec 13 03:05:12 2016
@@ -9,7 +9,8 @@
 # http://www.illumos.org/license/CDDL.
 #
 #
-# Copyright (c) 2014 Racktop Systems.
+# Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
 MODULE = _BSMparse
@@ -16,7 +17,7 @@
 
 include $(SRC)/cmd/perl/Makefile.perl
 
-# Install module into arch independant directory
+# Install module into arch independent directory
 ROOTPERLMODDIR = $(ROOTPERLDIR)/lib/Sun/Solaris/BSM
 
 include $(SRC)/cmd/perl/Makefile.targ
@@ -28,4 +29,3 @@
 install: $(ROOTPERLMOD)
 
 clean clobber:
-	$(RM) -r $(MACH)
--- old/usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/Makefile	Tue Dec 13 03:05:12 2016
+++ new/usr/src/cmd/perl/contrib/Sun/Solaris/Intrs/Makefile	Tue Dec 13 03:05:12 2016
@@ -9,7 +9,8 @@
 # http://www.illumos.org/license/CDDL.
 #
 #
-# Copyright (c) 2014 Racktop Systems.
+# Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
 MODULE = Intrs
@@ -24,9 +25,11 @@
 
 .KEEP_STATE:
 
-all: $(PERLEXT) $(PERLMOD)
+$(32BIT_PERL)all: $(PERLEXT) $(PERLMOD)
+$(64BIT_PERL)all: $(PERLEXT64) $(PERLMOD)
 
-install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+$(32BIT_PERL)install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+$(64BIT_PERL)install: $(ROOTPERLEXT64) $(ROOTPERLMOD64)
 
 clean clobber:
-	$(RM) -r $(MACH)
+	$(RM) -r $(MACH) $(MACH64)
--- old/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/Makefile	Tue Dec 13 03:05:12 2016
+++ new/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/Makefile	Tue Dec 13 03:05:12 2016
@@ -10,7 +10,8 @@
 #
 # Copyright 2014 Gary Mills
 #
-# Copyright (c) 2014 Racktop Systems.
+# Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
 MODULE = Kstat
@@ -33,9 +34,11 @@
 
 .KEEP_STATE:
 
-all: $(PERLEXT) $(PERLMOD)
+$(32BIT_PERL)all: $(PERLEXT) $(PERLMOD)
+$(64BIT_PERL)all: $(PERLEXT64) $(PERLMOD)
 
-install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+$(32BIT_PERL)install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+$(64BIT_PERL)install: $(ROOTPERLEXT64) $(ROOTPERLMOD64)
 
 clean clobber:
-	$(RM) -r $(MACH)
+	$(RM) -r $(MACH) $(MACH64)
--- old/usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/Makefile	Tue Dec 13 03:05:12 2016
+++ new/usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/Makefile	Tue Dec 13 03:05:12 2016
@@ -9,7 +9,8 @@
 # http://www.illumos.org/license/CDDL.
 #
 #
-# Copyright (c) 2014 Racktop Systems.
+# Copyright 2014, OmniTI Computer Consulting. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
 MODULE = Lgrp
@@ -28,9 +29,11 @@
 
 .KEEP_STATE:
 
-all: $(PERLEXT) $(PERLMOD)
+$(32BIT_PERL)all: $(PERLEXT) $(PERLMOD)
+$(64BIT_PERL)all: $(PERLEXT64) $(PERLMOD)
 
-install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+$(32BIT_PERL)install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+$(64BIT_PERL)install: $(ROOTPERLEXT64) $(ROOTPERLMOD64)
 
 clean clobber:
-	$(RM) -r $(MACH)
+	$(RM) -r $(MACH) $(MACH64)
--- old/usr/src/cmd/perl/contrib/Sun/Solaris/Pg/Makefile	Tue Dec 13 03:05:12 2016
+++ new/usr/src/cmd/perl/contrib/Sun/Solaris/Pg/Makefile	Tue Dec 13 03:05:12 2016
@@ -9,7 +9,8 @@
 # http://www.illumos.org/license/CDDL.
 #
 #
-# Copyright (c) 2014 Racktop Systems.
+# Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
 MODULE = Pg
@@ -16,7 +17,7 @@
 
 include $(SRC)/cmd/perl/Makefile.perl
 
-# Install module into arch independant directory
+# Install module into arch independent directory
 ROOTPERLMODDIR = $(ROOTPERLDIR)/lib/Sun/Solaris
 
 include $(SRC)/cmd/perl/Makefile.targ
@@ -28,4 +29,3 @@
 install: $(ROOTPERLMOD)
 
 clean clobber:
-	$(RM) -r $(MACH)
--- old/usr/src/cmd/perl/contrib/Sun/Solaris/Project/Makefile	Tue Dec 13 03:05:12 2016
+++ new/usr/src/cmd/perl/contrib/Sun/Solaris/Project/Makefile	Tue Dec 13 03:05:12 2016
@@ -9,7 +9,8 @@
 # http://www.illumos.org/license/CDDL.
 #
 #
-# Copyright (c) 2014 Racktop Systems.
+# Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
 MODULE = Project
@@ -28,9 +29,11 @@
 
 .KEEP_STATE:
 
-all: $(PERLEXT) $(PERLMOD)
+$(32BIT_PERL)all: $(PERLEXT) $(PERLMOD)
+$(64BIT_PERL)all: $(PERLEXT64) $(PERLMOD)
 
-install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+$(32BIT_PERL)install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+$(64BIT_PERL)install: $(ROOTPERLEXT64) $(ROOTPERLMOD64)
 
 clean clobber:
-	$(RM) -r $(MACH)
+	$(RM) -r $(MACH) $(MACH64)
--- old/usr/src/cmd/perl/contrib/Sun/Solaris/Task/Makefile	Tue Dec 13 03:05:13 2016
+++ new/usr/src/cmd/perl/contrib/Sun/Solaris/Task/Makefile	Tue Dec 13 03:05:13 2016
@@ -9,7 +9,8 @@
 # http://www.illumos.org/license/CDDL.
 #
 #
-# Copyright (c) 2014 Racktop Systems.
+# Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
 MODULE = Task
@@ -24,9 +25,11 @@
 
 .KEEP_STATE:
 
-all: $(PERLEXT) $(PERLMOD)
+$(32BIT_PERL)all: $(PERLEXT) $(PERLMOD)
+$(64BIT_PERL)all: $(PERLEXT64) $(PERLMOD)
 
-install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+$(32BIT_PERL)install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+$(64BIT_PERL)install: $(ROOTPERLEXT64) $(ROOTPERLMOD64)
 
 clean clobber:
-	$(RM) -r $(MACH)
+	$(RM) -r $(MACH) $(MACH64)
--- old/usr/src/cmd/perl/contrib/Sun/Solaris/Utils/Makefile	Tue Dec 13 03:05:13 2016
+++ new/usr/src/cmd/perl/contrib/Sun/Solaris/Utils/Makefile	Tue Dec 13 03:05:13 2016
@@ -9,8 +9,8 @@
 # http://www.illumos.org/license/CDDL.
 #
 #
-# Copyright (c) 2014 Racktop Systems.
 # Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
 MODULE = Utils
@@ -25,9 +25,11 @@
 
 .KEEP_STATE:
 
-all: $(PERLEXT) $(PERLMOD)
+$(32BIT_PERL)all: $(PERLEXT) $(PERLMOD)
+$(64BIT_PERL)all: $(PERLEXT64) $(PERLMOD)
 
-install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+$(32BIT_PERL)install: $(ROOTPERLEXT) $(ROOTPERLMOD)
+$(64BIT_PERL)install: $(ROOTPERLEXT64) $(ROOTPERLMOD64)
 
 clean clobber:
-	$(RM) -r $(MACH)
+	$(RM) -r $(MACH) $(MACH64)
--- old/usr/src/lib/Makefile.lib	Tue Dec 13 03:05:13 2016
+++ new/usr/src/lib/Makefile.lib	Tue Dec 13 03:05:13 2016
@@ -21,6 +21,7 @@
 # Copyright 2015 Gary Mills
 # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 #
 # Definitions common to libraries.
@@ -158,8 +159,12 @@
 BUILD.AR=	$(AR) $(ARFLAGS) $@ $(AROBJS)
 BUILD.SO=	$(CC) $(CFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
 		$(PICS) $(EXTPICS) $(LDLIBS)
+BUILD64.SO=	$(CC64) $(CFLAGS64) -o $@ $(GSHARED) $(DYNFLAGS) \
+		$(PICS) $(EXTPICS) -L $(ROOTLIBDIR64) $(LDLIBS)
 BUILDCCC.SO=	$(CCC) $(CCFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
 		$(PICS) $(EXTPICS) $(LDLIBS)
+BUILDCCC64.SO=	$(CCC64) $(CCFLAGS64) -o $@ $(GSHARED) $(DYNFLAGS) \
+		$(PICS) $(EXTPICS) $(LDLIBS) $(CCNEEDED64)
 
 # default dynamic library symlink
 INS.liblink=	-$(RM) $@; $(SYMLINK) $(LIBLINKPATH)$(LIBLINKS)$(VERS) $@
--- old/usr/src/pkg/Makefile	Tue Dec 13 03:05:13 2016
+++ new/usr/src/pkg/Makefile	Tue Dec 13 03:05:13 2016
@@ -23,6 +23,7 @@
 # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
 # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
+# Copyright 2016 RackTop Systems.
 #
 
 include $(SRC)/Makefile.master
@@ -179,8 +180,11 @@
 	PKGVERS_BRANCH=$(PKGVERS_BRANCH) \
 	PKGVERS=$(PKGVERS) \
 	PERL_ARCH=$(PERL_ARCH) \
+	PERL_ARCH64=$(PERL_ARCH64) \
 	PERL_VERSION=$(PERL_VERSION) \
 	PERL_PKGVERS=$(PERL_PKGVERS) \
+	32BIT_PERL=$(ENABLE_32BIT_PERL) \
+	64BIT_PERL=$(ENABLE_64BIT_PERL) \
 	PYTHON_VERSION=$(PYTHON_VERSION) \
 	PYTHON_PKGVERS=$(PYTHON_PKGVERS)
 
--- old/usr/src/pkg/manifests/runtime-perl-module-sun-solaris.mf	Tue Dec 13 03:05:13 2016
+++ new/usr/src/pkg/manifests/runtime-perl-module-sun-solaris.mf	Tue Dec 13 03:05:13 2016
@@ -21,11 +21,11 @@
 
 #
 # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
-# Copyright (c) 2014 Racktop Systems.
 # Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
-<transform file path=.*\.(pm|bs) -> default mode 0444>
+<transform file path=.*\.pm -> default mode 0444>
 <transform file path=.*\.so -> default mode 0555>
 set name=pkg.fmri \
     value=pkg:/runtime/perl$(PERL_PKGVERS)/module/sun-solaris@0.5.11,$(PKGVERS_BUILTON)-$(PKGVERS_BRANCH)
@@ -37,41 +37,97 @@
 dir path=usr/perl5
 dir path=usr/perl5/$(PERL_VERSION)
 dir path=usr/perl5/$(PERL_VERSION)/lib
-dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)
-dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/Sun
-dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/Sun/Solaris
-dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto
-dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto/Sun
-dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto/Sun/Solaris
-dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto/Sun/Solaris/Intrs
-dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto/Sun/Solaris/Kstat
-dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto/Sun/Solaris/Lgrp
-dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto/Sun/Solaris/Project
-dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto/Sun/Solaris/Task
-dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto/Sun/Solaris/Utils
+$(32BIT_PERL)dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)
+$(32BIT_PERL)dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/Sun
+$(32BIT_PERL)dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/Sun/Solaris
+$(32BIT_PERL)dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto
+$(32BIT_PERL)dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto/Sun
+$(32BIT_PERL)dir \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto/Sun/Solaris
+$(32BIT_PERL)dir \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto/Sun/Solaris/Intrs
+$(32BIT_PERL)dir \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto/Sun/Solaris/Kstat
+$(32BIT_PERL)dir \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto/Sun/Solaris/Lgrp
+$(32BIT_PERL)dir \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto/Sun/Solaris/Project
+$(32BIT_PERL)dir \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto/Sun/Solaris/Task
+$(32BIT_PERL)dir \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto/Sun/Solaris/Utils
+$(64BIT_PERL)dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)
+$(64BIT_PERL)dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/Sun
+$(64BIT_PERL)dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/Sun/Solaris
+$(64BIT_PERL)dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto
+$(64BIT_PERL)dir path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun
+$(64BIT_PERL)dir \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris
+$(64BIT_PERL)dir \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Intrs
+$(64BIT_PERL)dir \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Kstat
+$(64BIT_PERL)dir \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Lgrp
+$(64BIT_PERL)dir \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Project
+$(64BIT_PERL)dir \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Task
+$(64BIT_PERL)dir \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Utils
 dir path=usr/perl5/$(PERL_VERSION)/lib/Sun
 dir path=usr/perl5/$(PERL_VERSION)/lib/Sun/Solaris
 dir path=usr/perl5/$(PERL_VERSION)/lib/Sun/Solaris/BSM
 dir path=usr/share/man
 dir path=usr/share/man/man3perl
-file path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/Sun/Solaris/Intrs.pm
-file path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/Sun/Solaris/Kstat.pm
-file path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/Sun/Solaris/Lgrp.pm
-file path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/Sun/Solaris/Project.pm
-file path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/Sun/Solaris/Task.pm
-file path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/Sun/Solaris/Utils.pm
-file \
+$(32BIT_PERL)file \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/Sun/Solaris/Intrs.pm
+$(32BIT_PERL)file \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/Sun/Solaris/Kstat.pm
+$(32BIT_PERL)file \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/Sun/Solaris/Lgrp.pm
+$(32BIT_PERL)file \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/Sun/Solaris/Project.pm
+$(32BIT_PERL)file \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/Sun/Solaris/Task.pm
+$(32BIT_PERL)file \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/Sun/Solaris/Utils.pm
+$(32BIT_PERL)file \
     path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto/Sun/Solaris/Intrs/Intrs.so
-file \
+$(32BIT_PERL)file \
     path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto/Sun/Solaris/Kstat/Kstat.so
-file \
+$(32BIT_PERL)file \
     path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto/Sun/Solaris/Lgrp/Lgrp.so
-file \
+$(32BIT_PERL)file \
     path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto/Sun/Solaris/Project/Project.so
-file \
+$(32BIT_PERL)file \
     path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto/Sun/Solaris/Task/Task.so
-file \
+$(32BIT_PERL)file \
     path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH)/auto/Sun/Solaris/Utils/Utils.so
+$(64BIT_PERL)file \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/Sun/Solaris/Intrs.pm
+$(64BIT_PERL)file \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/Sun/Solaris/Kstat.pm
+$(64BIT_PERL)file \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/Sun/Solaris/Lgrp.pm
+$(64BIT_PERL)file \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/Sun/Solaris/Project.pm
+$(64BIT_PERL)file \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/Sun/Solaris/Task.pm
+$(64BIT_PERL)file \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/Sun/Solaris/Utils.pm
+$(64BIT_PERL)file \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Intrs/Intrs.so
+$(64BIT_PERL)file \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Kstat/Kstat.so
+$(64BIT_PERL)file \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Lgrp/Lgrp.so
+$(64BIT_PERL)file \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Project/Project.so
+$(64BIT_PERL)file \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Task/Task.so
+$(64BIT_PERL)file \
+    path=usr/perl5/$(PERL_VERSION)/lib/$(PERL_ARCH64)/auto/Sun/Solaris/Utils/Utils.so
 file path=usr/perl5/$(PERL_VERSION)/lib/Sun/Solaris/BSM/_BSMparse.pm
 file path=usr/perl5/$(PERL_VERSION)/lib/Sun/Solaris/Pg.pm
 file path=usr/share/man/man3perl/Kstat.3perl
@@ -81,3 +137,4 @@
 license cr_Sun license=cr_Sun
 license usr/src/cmd/perl/THIRDPARTYLICENSE \
     license=usr/src/cmd/perl/THIRDPARTYLICENSE
+depend fmri=runtime/perl$(PERL_PKGVERS) type=require
--- old/usr/src/pkg/manifests/system-extended-system-utilities.mf	Tue Dec 13 03:05:13 2016
+++ new/usr/src/pkg/manifests/system-extended-system-utilities.mf	Tue Dec 13 03:05:13 2016
@@ -22,6 +22,7 @@
 #
 # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright 2012 Nexenta Systems, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
 set name=pkg.fmri value=pkg:/system/extended-system-utilities@$(PKGVERS)
@@ -281,3 +282,4 @@
 link path=usr/share/man/man1/unpack.1 target=pack.1
 link path=usr/share/man/man1/zcat.1 target=compress.1
 depend fmri=runtime/perl$(PERL_PKGVERS) type=require
+depend fmri=runtime/perl$(PERL_PKGVERS)/module/sun-solaris type=require
--- old/usr/src/tools/env/illumos.sh	Tue Dec 13 03:05:14 2016
+++ new/usr/src/tools/env/illumos.sh	Tue Dec 13 03:05:14 2016
@@ -22,6 +22,7 @@
 # Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
 # Copyright 2012 Joshua M. Clulow <josh@sysmgr.org>
 # Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
 # Configuration variables for the runtime environment of the nightly
@@ -222,9 +223,17 @@
 # don't want to bother providing the CUPS headers this needs.
 export ENABLE_SMB_PRINTING=
 
+# Comment this out to disable building of 32bit perl modules, i.e
+# if you're running a distro that only provides 64bit perl.
+export ENABLE_32BIT_PERL=
+
+# Comment this out to disable building of 64bit perl modules, i.e
+# if you're running a distro that doesn't provide 64bit perl.
+export ENABLE_64BIT_PERL=
+
 # If your distro uses certain versions of Perl, make sure either Makefile.master
 # contains your new defaults OR your .env file sets them.
 # These are how you would override for building on OmniOS r151012, for example.
 #export PERL_VERSION=5.16.1
-#export PERL_ARCH=i86pc-solaris-thread-multi-64int
+#export PERL_VARIANT=-thread-multi
 #export PERL_PKGVERS=-5161
