--- old/usr/src/Makefile.master	Sun Jun 18 12:12:26 2017
+++ new/usr/src/Makefile.master	Sun Jun 18 12:12:26 2017
@@ -27,6 +27,7 @@
 # Copyright 2015 Gary Mills
 # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
 # Copyright 2016 Toomas Soome <tsoome@me.com>
+# Copyright 2017 RackTop Systems.
 #
 
 #
@@ -99,6 +100,12 @@
 $(__SUNC)__GNUC=	$(POUND_SIGN)
 __GNUC64=		$(__GNUC)
 
+# If ADJUNCT_PROTO was set we set ADJUNCT_PROTO_NOT_SET to POUND_SIGN so
+# we can use it to turn off the -zassert-deflib exceptions that allow
+# linking against host libraries.
+ADJUNCT_PROTO_NOT_SET=		$(ADJUNCT_PROTO:%=$(POUND_SIGN))
+$(ADJUNCT_PROTO_NOT_SET)ADJUNCT_PROTO_SET=	$(POUND_SIGN)
+
 # Allow build-time "configuration" to enable or disable some things.
 # The default is POUND_SIGN, meaning "not enabled". If the environment
 # passes in an override like ENABLE_SMB_PRINTING= (empty) that will
@@ -672,11 +679,6 @@
 # LDLIBS32 and LDLIBS64 can be set in the environment to override the following
 # assignments.
 #
-# These environment settings make sure that no libraries are searched outside
-# of the local workspace proto area:
-#	LDLIBS32=-YP,$ROOT/lib:$ROOT/usr/lib
-#	LDLIBS64=-YP,$ROOT/lib/$MACH64:$ROOT/usr/lib/$MACH64
-#
 LDLIBS32 =	$(ENVLDLIBS1) $(ENVLDLIBS2) $(ENVLDLIBS3)
 LDLIBS32 +=	$(ADJUNCT_PROTO:%=-L%/usr/lib -L%/lib)
 LDLIBS.cmd = 	$(LDLIBS32)
@@ -688,6 +690,12 @@
 LDLIBS64 +=     $(ADJUNCT_PROTO:%=-L%/usr/lib/$(MACH64) -L%/lib/$(MACH64))
 
 #
+# Defines to be used when overriding the default search path with -YP.
+#
+DEFLDPATH =	/lib:/usr/lib
+DEFLDPATH64 =	/lib/64:/usr/lib/64
+
+#
 # Define compilation macros.
 #
 COMPILE.c=	$(CC) $(CFLAGS) $(CPPFLAGS) -c
@@ -873,6 +881,7 @@
 ZREDLOCSYM=	-zredlocsym
 ZTEXT=		-ztext
 ZVERBOSE=	-zverbose
+ZASSERTDEFLIB=	-zassert-deflib
 
 GSHARED=	-G
 CCMT=		-mt
--- old/usr/src/cmd/Makefile.cmd	Sun Jun 18 12:12:26 2017
+++ new/usr/src/cmd/Makefile.cmd	Sun Jun 18 12:12:26 2017
@@ -20,6 +20,7 @@
 #
 #
 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2017 RackTop Systems.
 #
 # Definitions common to command source.
 #
@@ -123,7 +124,8 @@
 
 LDFLAGS.cmd = \
 	$(BDIRECT) $(ENVLDFLAGS1) $(ENVLDFLAGS2) $(ENVLDFLAGS3) \
-	$(MAPFILE.NES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%)
+	$(MAPFILE.NES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%) \
+	$(ZASSERTDEFLIB)
 
 LDFLAGS =	$(LDFLAGS.cmd)
 
--- old/usr/src/cmd/availdevs/Makefile	Sun Jun 18 12:12:26 2017
+++ new/usr/src/cmd/availdevs/Makefile	Sun Jun 18 12:12:26 2017
@@ -23,6 +23,8 @@
 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 
 PROG=		availdevs
 
@@ -40,6 +42,9 @@
 all install := LDLIBS += -lxml2
 LINTFLAGS += -xerroff=E_NAME_USED_NOT_DEF2
 
+# Allow libxml2 to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libxml2.so
+
 CPPFLAGS += $(INCS) -D_LARGEFILE64_SOURCE=1 -D_REENTRANT
 $(NOT_RELEASE_BUILD) CPPFLAGS += -DDEBUG
 
--- old/usr/src/cmd/boot/bootadm/Makefile	Sun Jun 18 12:12:26 2017
+++ new/usr/src/cmd/boot/bootadm/Makefile	Sun Jun 18 12:12:26 2017
@@ -24,6 +24,7 @@
 #
 # Copyright 2016 Toomas Soome <tsoome@me.com>
 # Copyright 2016 Nexenta Systems, Inc.
+# Copyright 2017 RackTop Systems.
 #
 
 PROG= bootadm
@@ -45,6 +46,9 @@
 LDLIBS += -lficl-sys -lmd -lcryptoutil -lnvpair -lgen -ladm -lefi
 LDLIBS += -lz -lbe -lzfs -lofmt $(LDLIBS_$(MACH))
 
+# Allow zlib to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libz.so
+
 # Writing into string literals is incorrect.  We need to match gcc's
 # behavior, which causes us to take SIGSEGV on such a write.
 CFLAGS +=	$(XSTRCONST)
--- old/usr/src/cmd/boot/fiocompress/Makefile	Sun Jun 18 12:12:26 2017
+++ new/usr/src/cmd/boot/fiocompress/Makefile	Sun Jun 18 12:12:26 2017
@@ -22,6 +22,8 @@
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 
 PROG= fiocompress
 
@@ -36,6 +38,9 @@
 
 LDLIBS +=	-lz
 
+# Allow zlib to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libz.so
+
 CFLAGS +=	-I../../../uts/common
 LINTFLAGS +=	-I../../../uts/common
 
--- old/usr/src/cmd/cdrw/Makefile	Sun Jun 18 12:12:26 2017
+++ new/usr/src/cmd/cdrw/Makefile	Sun Jun 18 12:12:26 2017
@@ -22,6 +22,8 @@
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 
 PROG= cdrw
 
@@ -42,6 +44,9 @@
 CPPFLAGS +=	-D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(HAL_DBUS_CPPFLAGS)
 LINTFLAGS += 	-um
 
+# Allow libdbus to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libdbus-1.so
+
 $(ROOTBIN)/cdrw := FILEMODE = 04755
 
 .KEEP_STATE:
--- old/usr/src/cmd/cmd-crypto/kmfcfg/Makefile	Sun Jun 18 12:12:27 2017
+++ new/usr/src/cmd/cmd-crypto/kmfcfg/Makefile	Sun Jun 18 12:12:27 2017
@@ -22,6 +22,8 @@
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 # Makefile for policy testing code
 #
 
@@ -52,6 +54,9 @@
 LDLIBS		+= -L$(ROOT)/usr/lib -lkmf -lcryptoutil
 XMLLIB		= -lxml2
 
+# Allow libxml2 to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS	+= $(ZASSERTDEFLIB)=libxml2.so
+
 .KEEP_STATE:
 
 XMLDIR=		$(ROOT)/etc/security
--- old/usr/src/cmd/cmd-crypto/tpmadm/Makefile	Sun Jun 18 12:12:27 2017
+++ new/usr/src/cmd/cmd-crypto/tpmadm/Makefile	Sun Jun 18 12:12:27 2017
@@ -21,6 +21,8 @@
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 
 PROG =	tpmadm
 
@@ -38,6 +40,9 @@
 LINTFLAGS += -XCC  -L$(ADJUNCT_PROTO)/usr/lib
 LDLIBS += -ltspi -luuid
 
+# Allow trousers libs to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libtspi.so
+
 CLOBBERFILES = C.ln $(POFILE) $(POFILES)
 
 .KEEP_STATE:
--- old/usr/src/cmd/cmd-inet/usr.lib/wanboot/p12split/Makefile	Sun Jun 18 12:12:27 2017
+++ new/usr/src/cmd/cmd-inet/usr.lib/wanboot/p12split/Makefile	Sun Jun 18 12:12:27 2017
@@ -21,6 +21,8 @@
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 
 include ../Makefile.com
 
@@ -29,6 +31,9 @@
 CPPFLAGS +=	-I$(CMNCRYPTDIR)
 LINTFLAGS +=	-erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
 
+# Allow libcrypto to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libcrypto.so
+
 all:		$(PROG)
 
 install:	all $(ROOTCMD)
--- old/usr/src/cmd/cmd-inet/usr.lib/wanboot/wanboot-cgi/Makefile	Sun Jun 18 12:12:27 2017
+++ new/usr/src/cmd/cmd-inet/usr.lib/wanboot/wanboot-cgi/Makefile	Sun Jun 18 12:12:27 2017
@@ -21,6 +21,8 @@
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 
 include ../Makefile.com
 
@@ -29,6 +31,9 @@
 CPPFLAGS +=	-I$(CMNCRYPTDIR)
 LINTFLAGS +=	-erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
 
+# Allow libcrypto to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libcrypto.so
+
 all:		$(PROG)
 
 install:	all $(ROOTCMD)
--- old/usr/src/cmd/cmd-inet/usr.lib/wpad/Makefile	Sun Jun 18 12:12:27 2017
+++ new/usr/src/cmd/cmd-inet/usr.lib/wpad/Makefile	Sun Jun 18 12:12:27 2017
@@ -21,6 +21,8 @@
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 
 PROG =		wpad
 MANIFEST =	wpa.xml
@@ -37,6 +39,9 @@
 
 LINTFLAGS += 	-u
 
+# Allow libcrypto to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libcrypto.so
+
 .KEEP_STATE:
 
 all:		$(PROG)
--- old/usr/src/cmd/dfs.cmds/sharemgr/Makefile.com	Sun Jun 18 12:12:27 2017
+++ new/usr/src/cmd/dfs.cmds/sharemgr/Makefile.com	Sun Jun 18 12:12:27 2017
@@ -24,6 +24,8 @@
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 
 include ../../../Makefile.cmd
 
@@ -43,6 +45,9 @@
 all install := LDLIBS += -lxml2
 LINTFLAGS	+= -u
 
+# Allow libxml2 to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libxml2.so
+
 CERRWARN	+= -_gcc=-Wno-uninitialized
 
 POFILES = $(SRCS:.c=.po)
--- old/usr/src/cmd/fm/modules/common/fabric-xlate/Makefile	Sun Jun 18 12:12:28 2017
+++ new/usr/src/cmd/fm/modules/common/fabric-xlate/Makefile	Sun Jun 18 12:12:28 2017
@@ -22,6 +22,8 @@
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 
 MODULE = fabric-xlate
 CLASS = common
@@ -38,6 +40,9 @@
 LDFLAGS += -L$(ROOT)/usr/lib/fm -R/usr/lib/fm
 LDLIBS += -luutil -lxml2 -L$(ROOTLIB)/fm -ltopo
 
+# Allow libxml2 to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libxml2.so
+
 CERRWARN += -_gcc=-Wno-parentheses
 CERRWARN += -_gcc=-Wno-switch
 CERRWARN += -_gcc=-Wno-uninitialized
--- old/usr/src/cmd/fm/notify/snmp-notify/Makefile.com	Sun Jun 18 12:12:28 2017
+++ new/usr/src/cmd/fm/notify/snmp-notify/Makefile.com	Sun Jun 18 12:12:28 2017
@@ -21,6 +21,7 @@
 
 #
 # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2017 RackTop Systems.
 #
 
 .KEEP_STATE:
@@ -50,6 +51,10 @@
 LDFLAGS += -R/usr/lib/fm
 LINTFLAGS += -mnu
 
+# Allow Net-SNMP libs to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libnetsnmp.so
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libnetsnmpagent.so
+
 CERRWARN += -_gcc=-Wno-parentheses
 
 .NO_PARALLEL:
--- old/usr/src/cmd/hal/addons/acpi/Makefile	Sun Jun 18 12:12:28 2017
+++ new/usr/src/cmd/hal/addons/acpi/Makefile	Sun Jun 18 12:12:28 2017
@@ -22,7 +22,7 @@
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
+# Copyright 2017 RackTop Systems.
 #
 
 PROG =		hald-addon-acpi
@@ -36,6 +36,10 @@
 
 LDLIBS +=	-lc -ldbus-1 -lhal -lglib-2.0
 
+# Allow libdbus and libglib to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libdbus-1.so
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libglib-2.0.so
+
 CPPFLAGS +=	$(HAL_DBUS_CPPFLAGS) $(HAL_GLIB_CPPFLAGS) $(HAL_CONFIG_CPPFLAGS)
 CPPFLAGS +=	-I$(ROOT)/usr/include/hal -I../../hald
 C99MODE =	$(C99_ENABLE)
--- old/usr/src/cmd/hal/addons/cpufreq/Makefile	Sun Jun 18 12:12:28 2017
+++ new/usr/src/cmd/hal/addons/cpufreq/Makefile	Sun Jun 18 12:12:28 2017
@@ -23,7 +23,7 @@
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#pragma	ident	"%Z%%M%	%I%	%E% SMI"
+# Copyright 2017 RackTop Systems.
 #
 
 PROG =		hald-addon-cpufreq
@@ -37,6 +37,11 @@
 
 LDLIBS +=	-lc -ldbus-1 -lhal -lglib-2.0 -ldbus-glib-1 -lpolkit -lbsm
 
+# Allow HAL to take some of its dependencies from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libdbus-1.so
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libglib-2.0.so
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libdbus-glib-1.so
+
 CPPFLAGS +=	$(HAL_DBUS_CPPFLAGS) $(HAL_GLIB_CPPFLAGS) $(HAL_CONFIG_CPPFLAGS)
 CPPFLAGS +=	-I$(ROOT)/usr/include/hal -I../../hald
 CPPFLAGS +=	-I$(ROOT)/usr/include/libpolkit -g
--- old/usr/src/cmd/hal/addons/network-devices/Makefile	Sun Jun 18 12:12:28 2017
+++ new/usr/src/cmd/hal/addons/network-devices/Makefile	Sun Jun 18 12:12:28 2017
@@ -22,7 +22,9 @@
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
 #
+#
 
 PROG =		hald-addon-network-discovery
 OBJS =		addon-network-discovery.o probe-snmp.o snmp.o logger.o cache.o common.o printer.o
@@ -43,6 +45,12 @@
 LDLIBS +=	-lnsl -lsocket
 LDLIBS +=	$(ZIGNORE) -lnetsnmp
 
+# Allow HAL to take some of it dependencies from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libdbus-1.so
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libglib-2.0.so
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libdbus-glib-1.so
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libnetsnmp.so
+
 CPPFLAGS +=	$(HAL_DBUS_CPPFLAGS) $(HAL_GLIB_CPPFLAGS) $(HAL_CONFIG_CPPFLAGS)
 CPPFLAGS +=	-I$(ROOT)/usr/include/hal -I../../hald -I../../utils
 C99MODE =	$(C99_ENABLE)
--- old/usr/src/cmd/hal/addons/storage/Makefile	Sun Jun 18 12:12:28 2017
+++ new/usr/src/cmd/hal/addons/storage/Makefile	Sun Jun 18 12:12:28 2017
@@ -22,6 +22,8 @@
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 
 PROG =		hald-addon-storage
 OBJS =		addon-storage.o logger.o
@@ -34,6 +36,9 @@
 
 LDLIBS +=	-lc -ldbus-1 -lhal -lnvpair -lsysevent
 
+# Allow libdbus to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libdbus-1.so
+
 CPPFLAGS +=	$(HAL_DBUS_CPPFLAGS) $(HAL_CONFIG_CPPFLAGS)
 CPPFLAGS +=	-I$(ROOT)/usr/include/hal -I../../hald
 C99MODE =	$(C99_ENABLE)
--- old/usr/src/cmd/hal/hald-runner/Makefile	Sun Jun 18 12:12:28 2017
+++ new/usr/src/cmd/hal/hald-runner/Makefile	Sun Jun 18 12:12:28 2017
@@ -22,7 +22,7 @@
 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
+# Copyright 2017 RackTop Systems.
 #
 
 PROG =		hald-runner
@@ -36,6 +36,11 @@
 
 LDLIBS +=	-lc -ldbus-1 -ldbus-glib-1 -lglib-2.0
 
+# Allow HAL to take some of its dependencies from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libdbus-1.so
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libdbus-glib-1.so
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libglib-2.0.so
+
 CPPFLAGS +=	$(HAL_DBUS_CPPFLAGS) $(HAL_GLIB_CPPFLAGS) $(HAL_CONFIG_CPPFLAGS)
 CPPFLAGS +=	-UDBUS_API_SUBJECT_TO_CHANGE
 C99MODE =	$(C99_ENABLE)
--- old/usr/src/cmd/hal/hald/Makefile	Sun Jun 18 12:12:29 2017
+++ new/usr/src/cmd/hal/hald/Makefile	Sun Jun 18 12:12:29 2017
@@ -22,6 +22,8 @@
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 
 SUBDIRS =	solaris
 
@@ -45,6 +47,13 @@
 
 all install $(PROG) :=	LDLIBS += -lexpat
 
+# Allow HAL to take some of its dependencies from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libdbus-1.so
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libdbus-glib-1.so
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libglib-2.0.so
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libgobject-2.0.so
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libexpat.so
+
 CPPFLAGS +=	$(HAL_DBUS_CPPFLAGS) $(HAL_GLIB_CPPFLAGS) $(HAL_CONFIG_CPPFLAGS)
 C99MODE =	$(C99_ENABLE)
 
--- old/usr/src/cmd/hal/probing/acpi/Makefile	Sun Jun 18 12:12:29 2017
+++ new/usr/src/cmd/hal/probing/acpi/Makefile	Sun Jun 18 12:12:29 2017
@@ -22,7 +22,7 @@
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
+# Copyright 2017 RackTop Systems.
 #
 
 PROG =		hald-probe-acpi
@@ -36,6 +36,10 @@
 
 LDLIBS +=	-lc -ldbus-1 -lhal -lglib-2.0
 
+# Allow libdbus and libglib to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libdbus-1.so
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libglib-2.0.so
+
 CPPFLAGS +=	$(HAL_DBUS_CPPFLAGS) $(HAL_CONFIG_CPPFLAGS) $(HAL_GLIB_CPPFLAGS)
 CPPFLAGS +=	-I$(ROOT)/usr/include/hal -I../../utils -I../../hald
 C99MODE =	$(C99_ENABLE)
--- old/usr/src/cmd/hal/probing/network-printer/Makefile	Sun Jun 18 12:12:29 2017
+++ new/usr/src/cmd/hal/probing/network-printer/Makefile	Sun Jun 18 12:12:29 2017
@@ -22,6 +22,7 @@
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
 #
 
 PROG =		hald-probe-network-printer
@@ -36,6 +37,10 @@
 LDLIBS +=	-lc -ldbus-1 -lhal
 LDLIBS +=	$(ZIGNORE) -lnetsnmp
 
+# Allow libdbus and libnetsnmp to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libdbus-1.so
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libnetsnmp.so
+
 CPPFLAGS +=	$(HAL_DBUS_CPPFLAGS) $(HAL_CONFIG_CPPFLAGS)
 CPPFLAGS +=	-I$(ROOT)/usr/include/hal -I../../utils -I../../hald
 C99MODE =	$(C99_ENABLE)
--- old/usr/src/cmd/hal/probing/printer/Makefile	Sun Jun 18 12:12:29 2017
+++ new/usr/src/cmd/hal/probing/printer/Makefile	Sun Jun 18 12:12:29 2017
@@ -22,7 +22,7 @@
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
+# Copyright 2017 RackTop Systems.
 #
 
 PROG =		hald-probe-printer
@@ -36,6 +36,9 @@
 
 LDLIBS +=	-lc -ldbus-1 -lhal
 
+# Allow libdbus to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libdbus-1.so
+
 CPPFLAGS +=	$(HAL_DBUS_CPPFLAGS) $(HAL_CONFIG_CPPFLAGS)
 CPPFLAGS +=	-I$(ROOT)/usr/include/hal -I../../utils -I../../hald
 C99MODE =	$(C99_ENABLE)
--- old/usr/src/cmd/hal/probing/storage/Makefile	Sun Jun 18 12:12:29 2017
+++ new/usr/src/cmd/hal/probing/storage/Makefile	Sun Jun 18 12:12:29 2017
@@ -22,7 +22,7 @@
 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
+# Copyright 2017 RackTop Systems.
 #
 
 PROG =		hald-probe-storage
@@ -36,6 +36,9 @@
 
 LDLIBS +=	-lc -ldbus-1 -lhal -ladm -lefi
 
+# Allow libdbus to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libdbus-1.so
+
 CPPFLAGS +=	-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
 CPPFLAGS +=	$(HAL_DBUS_CPPFLAGS) $(HAL_CONFIG_CPPFLAGS)
 CPPFLAGS +=	-I$(ROOT)/usr/include/hal -I../../utils -I../../hald
--- old/usr/src/cmd/hal/probing/volume/Makefile	Sun Jun 18 12:12:29 2017
+++ new/usr/src/cmd/hal/probing/volume/Makefile	Sun Jun 18 12:12:29 2017
@@ -22,7 +22,7 @@
 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
+# Copyright 2017 RackTop Systems.
 #
 
 PROG =		hald-probe-volume
@@ -36,6 +36,9 @@
 
 LDLIBS +=	-lc -ldbus-1 -lhal -lfstyp -lnvpair -ladm -lefi
 
+# Allow libdbus to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libdbus-1.so
+
 CPPFLAGS +=	-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
 CPPFLAGS +=	$(HAL_DBUS_CPPFLAGS) $(HAL_CONFIG_CPPFLAGS)
 CPPFLAGS +=	-I$(ROOT)/usr/include/hal -I../../utils -I../../hald
--- old/usr/src/cmd/hal/probing/xkb/Makefile	Sun Jun 18 12:12:30 2017
+++ new/usr/src/cmd/hal/probing/xkb/Makefile	Sun Jun 18 12:12:30 2017
@@ -22,6 +22,7 @@
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
 #
 
 PROG =		hald-probe-xkb
@@ -35,6 +36,9 @@
 
 LDLIBS +=	-lc -ldbus-1 -lhal
 
+# Allow libdbus to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libdbus-1.so
+
 CPPFLAGS +=	$(HAL_DBUS_CPPFLAGS) $(HAL_CONFIG_CPPFLAGS)
 CPPFLAGS +=	-I$(ROOT)/usr/include/hal -I../../hald
 C99MODE =	$(C99_ENABLE)
--- old/usr/src/cmd/hal/tools/Makefile	Sun Jun 18 12:12:30 2017
+++ new/usr/src/cmd/hal/tools/Makefile	Sun Jun 18 12:12:30 2017
@@ -22,6 +22,8 @@
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 
 SUBDIR =	sunos	
 
@@ -69,6 +71,11 @@
 
 $(STORAGE_METHOD_PROG) := LDLIBS += -lpolkit
 
+# Allow HAL to take some of its dependencies from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libdbus-1.so
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libdbus-glib-1.so
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libglib-2.0.so
+
 CPPFLAGS += $(HAL_DBUS_CPPFLAGS) $(HAL_GLIB_CPPFLAGS) $(HAL_CONFIG_CPPFLAGS)
 CPPFLAGS += -I$(ROOT)/usr/include/hal
 CPPFLAGS += -I$(ROOT)/usr/include/libpolkit
--- old/usr/src/cmd/hal/tools/sunos/Makefile	Sun Jun 18 12:12:30 2017
+++ new/usr/src/cmd/hal/tools/sunos/Makefile	Sun Jun 18 12:12:30 2017
@@ -22,7 +22,7 @@
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
+# Copyright 2017 RackTop Systems.
 #
 
 HAL_PROGS =	hal-system-lcd-set-brightness-sunos \
@@ -40,6 +40,9 @@
 
 $(HAL_PROGS) :=		LDLIBS += -lc $(ZIGNORE) -lglib-2.0
 
+# Allow libglib to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libglib-2.0.so
+
 CPPFLAGS += $(HAL_DBUS_CPPFLAGS) $(HAL_GLIB_CPPFLAGS) $(HAL_CONFIG_CPPFLAGS)
 CPPFLAGS += -I$(ROOT)/usr/include/hal
 CPPFLAGS += -I$(ROOT)/usr/include/libpolkit
--- old/usr/src/cmd/isns/isnsadm/Makefile	Sun Jun 18 12:12:30 2017
+++ new/usr/src/cmd/isns/isnsadm/Makefile	Sun Jun 18 12:12:30 2017
@@ -22,6 +22,8 @@
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 
 PROG = isnsadm
 SRCS = cmdparse.c isnsadm.c isnsadm_msg.c
@@ -35,6 +37,9 @@
 POFILE = isnsadm_all.po
 POFILES = $(OBJS:%.o=%.po)
 
+# Allow libxml2 to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libxml2.so
+
 LINTFLAGS += -xerroff=E_BAD_FORMAT_STR2
 
 CERRWARN += -_gcc=-Wno-parentheses
--- old/usr/src/cmd/isns/isnsd/Makefile	Sun Jun 18 12:12:30 2017
+++ new/usr/src/cmd/isns/isnsd/Makefile	Sun Jun 18 12:12:30 2017
@@ -25,6 +25,7 @@
 
 #
 # Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright 2017 RackTop Systems.
 #
 
 PROG = isns
@@ -70,6 +71,9 @@
 
 LDLIBS		+= -lsecdb -lsocket -lnsl -lscf -lxml2
 
+# Allow libxml2 to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS	+= $(ZASSERTDEFLIB)=libxml2.so
+
 .KEEP_STATE:
 
 all:	$(PROG)
--- old/usr/src/cmd/latencytop/Makefile.com	Sun Jun 18 12:12:30 2017
+++ new/usr/src/cmd/latencytop/Makefile.com	Sun Jun 18 12:12:30 2017
@@ -22,6 +22,8 @@
 # Copyright (c) 2008-2009, Intel Corporation.
 # All Rights Reserved.
 #
+# Copyright 2017 RackTop Systems.
+#
 
 PROG = latencytop
 OBJS = latencytop.o display.o dwrapper.o klog.o stat.o table.o util.o
@@ -40,6 +42,9 @@
 LDLIBS += -lcurses -ldtrace
 all install	:= LDLIBS += -lglib-2.0
 
+# Allow libglib to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libglib-2.0.so
+
 LINTFLAGS += -erroff=E_NAME_USED_NOT_DEF2
 LINTFLAGS += -erroff=E_FUNC_RET_ALWAYS_IGNOR2
 LINTFLAGS += -erroff=E_FUNC_RET_MAYBE_IGNORED2
--- old/usr/src/cmd/lp/filter/postscript/font/Makefile	Sun Jun 18 12:12:30 2017
+++ new/usr/src/cmd/lp/filter/postscript/font/Makefile	Sun Jun 18 12:12:30 2017
@@ -20,11 +20,11 @@
 # CDDL HEADER END
 #
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 # Copyright 1989-2002 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 # cmd/lp/filter/postscript/font/Makefile
 #
 
@@ -51,6 +51,7 @@
 $(NATIVEPROG) :=	CC=$(NATIVECC)
 $(NATIVEPROG) :=	LDLIBS=
 $(NATIVEPROG) :=	CPPFLAGS.master=
+$(NATIVEPROG) :=	ZASSERTDEFLIB=
 
 .KEEP_STATE:
 
--- old/usr/src/cmd/mandoc/Makefile	Sun Jun 18 12:12:31 2017
+++ new/usr/src/cmd/mandoc/Makefile	Sun Jun 18 12:12:31 2017
@@ -12,6 +12,7 @@
 #
 # Copyright 2014 Garrett D'Amore <garrett@damore.org>
 # Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
+# Copyright 2017 RackTop Systems.
 #
 
 include		$(SRC)/cmd/Makefile.cmd
@@ -30,4 +31,7 @@
 
 install:	all $(ROOTPROG)
 
+# Allow zlib to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libz.so
+
 include		$(SRC)/cmd/Makefile.targ
--- old/usr/src/cmd/oawk/Makefile	Sun Jun 18 12:12:31 2017
+++ new/usr/src/cmd/oawk/Makefile	Sun Jun 18 12:12:31 2017
@@ -23,6 +23,8 @@
 # Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 
 include		../Makefile.cmd
 
@@ -50,6 +52,7 @@
 $(MAKEPRCTAB) :=	CC = $(NATIVECC)
 $(MAKEPRCTAB) :=	POST_PROCESS=
 $(MAKEPRCTAB) :=	POST_PROCESS_O=
+$(MAKEPRCTAB) :=	ZASSERTDEFLIB=
 
 CLEANFILES =	proctab.c y.tab.h y.tab.c awk.h awk.g.c		\
 		tmptoken.c awk.lx.c $(NATIVEOBJS) $(MAKEPRCTAB)	\
--- old/usr/src/cmd/policykit/Makefile	Sun Jun 18 12:12:31 2017
+++ new/usr/src/cmd/policykit/Makefile	Sun Jun 18 12:12:31 2017
@@ -22,6 +22,8 @@
 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 
 PROG =	polkit-is-privileged
 
@@ -32,6 +34,9 @@
 
 LDLIBS +=	-lpolkit $(POLICYKIT_GLIB_LDLIBS)
 
+# Allow libglib to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libglib-2.0.so
+
 CPPFLAGS +=	-I$(ROOT)/usr/include/libpolkit
 CPPFLAGS +=	$(POLICYKIT_DBUS_CPPFLAGS) $(POLICYKIT_GLIB_CPPFLAGS)
 CPPFLAGS +=	-DPACKAGE_VERSION=\"$(POLICYKIT_VERSION)\"
--- old/usr/src/cmd/rmmount/Makefile	Sun Jun 18 12:12:31 2017
+++ new/usr/src/cmd/rmmount/Makefile	Sun Jun 18 12:12:31 2017
@@ -22,6 +22,8 @@
 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 
 PROG =		rmmount
 LOCAL_OBJS =	rmmount.o
@@ -36,6 +38,11 @@
 
 LDLIBS +=	-ldbus-1 -ldbus-glib-1 -lglib-2.0 -lhal -lhal-storage -lcontract
 
+# Allow rmmount to take some of its dependencies from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libdbus-1.so
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libdbus-glib-1.so
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libglib-2.0.so
+
 CPPFLAGS +=	$(HAL_DBUS_CPPFLAGS) $(HAL_GLIB_CPPFLAGS)
 CPPFLAGS +=	-I$(ROOT)/usr/include/hal
 CPPFLAGS +=	-I$(SRC)/cmd/rmvolmgr
--- old/usr/src/cmd/rmvolmgr/Makefile	Sun Jun 18 12:12:31 2017
+++ new/usr/src/cmd/rmvolmgr/Makefile	Sun Jun 18 12:12:31 2017
@@ -22,6 +22,8 @@
 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 
 PROG =		rmvolmgr
 OBJS =		rmm_common.o rmvolmgr.o vold.o
@@ -38,6 +40,11 @@
 
 LDLIBS +=	-ldbus-1 -ldbus-glib-1 -lglib-2.0 -lhal -lhal-storage -lcontract -lscf
 
+# Allow rmvolmgr to take some of its dependencies from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libdbus-1.so
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libdbus-glib-1.so
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libglib-2.0.so
+
 CPPFLAGS +=	$(HAL_DBUS_CPPFLAGS) $(HAL_GLIB_CPPFLAGS)
 CPPFLAGS +=	-I$(ROOT)/usr/include/hal
 C99MODE =	$(C99_ENABLE)
--- old/usr/src/cmd/sendmail/src/Makefile	Sun Jun 18 12:12:31 2017
+++ new/usr/src/cmd/sendmail/src/Makefile	Sun Jun 18 12:12:31 2017
@@ -25,6 +25,8 @@
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 # cmd/sendmail/src/Makefile
 #
 
@@ -48,6 +50,10 @@
 		-lnsl ../db/libdb.a -lldap -lsldap -lwrap -lumem \
 		-lssl -lcrypto -lsasl
 
+# Allow libssl and libcrypto to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libssl.so
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libcrypto.so
+
 INCPATH=	-I. -I../include -I../db
 
 ENVDEF=		-DNETINET6 -DTCPWRAPPERS -DSTARTTLS -DSASL=20115
--- old/usr/src/cmd/svc/svccfg/Makefile	Sun Jun 18 12:12:32 2017
+++ new/usr/src/cmd/svc/svccfg/Makefile	Sun Jun 18 12:12:32 2017
@@ -21,6 +21,7 @@
 
 #
 # Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2017 RackTop Systems.
 #
 
 MYPROG =	svccfg
@@ -89,6 +90,9 @@
 SVCCFG_EXTRA_LIBS = -lxml2 -lscf -ll -luutil -lumem -lmd5 -lnvpair
 $(NOT_NATIVE)SVCCFG_EXTRA_LIBS += -ltecla
 
+# Allow libxml2 to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libxml2.so
+
 LIBSCF		= $(SRC)/lib/libscf
 LIBTECLA	= $(SRC)/lib/libtecla		# just for the header
 LIBUUTIL	= $(SRC)/lib/libuutil
--- old/usr/src/cmd/volcheck/Makefile	Sun Jun 18 12:12:32 2017
+++ new/usr/src/cmd/volcheck/Makefile	Sun Jun 18 12:12:32 2017
@@ -22,6 +22,8 @@
 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 
 PROG =		volcheck
 LOCAL_OBJS =	volcheck.o
@@ -36,6 +38,11 @@
 
 LDLIBS +=	-ldbus-1 -ldbus-glib-1 -lglib-2.0 -lhal -lhal-storage -lcontract
 
+# Allow volcheck to take some of its dependencies from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libdbus-1.so
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libdbus-glib-1.so
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libglib-2.0.so
+
 CPPFLAGS +=	$(HAL_DBUS_CPPFLAGS) $(HAL_GLIB_CPPFLAGS)
 CPPFLAGS +=	-I$(ROOT)/usr/include/hal
 CPPFLAGS +=	-I$(SRC)/cmd/rmvolmgr
--- old/usr/src/cmd/volrmmount/Makefile	Sun Jun 18 12:12:32 2017
+++ new/usr/src/cmd/volrmmount/Makefile	Sun Jun 18 12:12:32 2017
@@ -22,6 +22,8 @@
 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 
 PROG =		volrmmount
 LOCAL_OBJS =	volrmmount.o
@@ -36,6 +38,11 @@
 
 LDLIBS +=	-ldbus-1 -ldbus-glib-1 -lglib-2.0 -lhal -lhal-storage -lcontract
 
+# Allow volrmmount to take some of its dependencies from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libdbus-1.so
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libdbus-glib-1.so
+$(ADJUNCT_PROTO_NOT_SET)LDFLAGS += $(ZASSERTDEFLIB)=libglib-2.0.so
+
 CPPFLAGS +=	$(HAL_DBUS_CPPFLAGS) $(HAL_GLIB_CPPFLAGS)
 CPPFLAGS +=	-I$(ROOT)/usr/include/hal
 CPPFLAGS +=	-I$(SRC)/cmd/rmvolmgr
--- old/usr/src/lib/Makefile.lib	Sun Jun 18 12:12:32 2017
+++ new/usr/src/lib/Makefile.lib	Sun Jun 18 12:12:32 2017
@@ -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 2017 RackTop Systems.
 #
 #
 # Definitions common to libraries.
@@ -137,7 +138,7 @@
 
 
 HSONAME=	-h$(SONAME)
-DYNFLAGS=	$(HSONAME) $(ZTEXT) $(ZDEFS) $(BDIRECT) \
+DYNFLAGS=	$(HSONAME) $(ZTEXT) $(ZDEFS) $(ZASSERTDEFLIB) $(BDIRECT) \
 		$(MAPFILES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%)
 
 LDLIBS=		$(LDLIBS.lib)
@@ -213,7 +214,7 @@
 #
 # Keep in sync with the standard DYNFLAGS
 #
-$(DYNLIBCCC):=	DYNFLAGS = $(HSONAMECCC) $(ZTEXT) $(ZDEFS) \
+$(DYNLIBCCC):=	DYNFLAGS = $(HSONAMECCC) $(ZTEXT) $(ZDEFS) $(ZASSERTDEFLIB) \
 		$(MAPFILES:%=-M%) $(MAPFILE.PGA:%=-M%) $(MAPFILE.NED:%=-M%) \
 		$(BDIRECT) $(NORUNPATH)
 
--- old/usr/src/lib/fm/libfmd_snmp/Makefile.com	Sun Jun 18 12:12:32 2017
+++ new/usr/src/lib/fm/libfmd_snmp/Makefile.com	Sun Jun 18 12:12:32 2017
@@ -22,6 +22,8 @@
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 
 LIBRARY = libfmd_snmp.a
 VERS = .1
@@ -55,6 +57,11 @@
 SNMPLIBS = -lnetsnmp -lnetsnmphelpers -lnetsnmpagent
 lint := SNMPLIBS=
 
+# Allow Net-SNMP libs to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += $(ZASSERTDEFLIB)=libnetsnmp.so
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += $(ZASSERTDEFLIB)=libnetsnmphelpers.so
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += $(ZASSERTDEFLIB)=libnetsnmpagent.so
+
 LDLIBS += $(MACH_LDLIBS)
 LDLIBS += -lfmd_adm -luutil -lnvpair -ltopo
 LDLIBS += $(SNMPLIBS)
--- old/usr/src/lib/fm/topo/libtopo/Makefile.com	Sun Jun 18 12:12:32 2017
+++ new/usr/src/lib/fm/topo/libtopo/Makefile.com	Sun Jun 18 12:12:32 2017
@@ -20,6 +20,7 @@
 #
 #
 # Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2017 RackTop Systems.
 #
 
 LIBRARY = libtopo.a
@@ -89,6 +90,9 @@
 	-lnvpair -lelf -lumem -lxml2 -lkstat -luuid -ldevinfo \
 	-lsmbios -lc -ldevid -lipmi -lscf
 
+# Allow libxml2 to be taken from the proto area.
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += $(ZASSERTDEFLIB)=libxml2.so
+
 $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC)
 $(LINTLIB) := LINTFLAGS = -nsvx
 $(LINTLIB) := LINTFLAGS64 = -nsvx -m64
--- old/usr/src/lib/hal/libhal-storage/Makefile.com	Sun Jun 18 12:12:32 2017
+++ new/usr/src/lib/hal/libhal-storage/Makefile.com	Sun Jun 18 12:12:33 2017
@@ -22,7 +22,9 @@
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
 #
+#
 # usr/src/lib/hal/libhal-storage/Makefile.com
 #
 
@@ -38,6 +40,9 @@
 LDLIBS +=	-lc -ldbus-1 -lhal
 $(LINTLIB) := 	SRCS = $(SRCDIR)/$(LINTSRC)
 
+# Allow libdbus to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += $(ZASSERTDEFLIB)=libdbus-1.so
+
 SRCDIR =	../common
 
 CFLAGS +=	$(CCVERBOSE)
--- old/usr/src/lib/hal/libhal/Makefile.com	Sun Jun 18 12:12:33 2017
+++ new/usr/src/lib/hal/libhal/Makefile.com	Sun Jun 18 12:12:33 2017
@@ -22,7 +22,9 @@
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
 #
+#
 # usr/src/lib/hal/libhal/Makefile.com
 #
 
@@ -38,6 +40,9 @@
 LDLIBS +=	-lc -ldbus-1
 $(LINTLIB) := 	SRCS = $(SRCDIR)/$(LINTSRC)
 
+# Allow libdbus to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += $(ZASSERTDEFLIB)=libdbus-1.so
+
 SRCDIR =	../common
 
 CFLAGS +=	$(CCVERBOSE)
--- old/usr/src/lib/krb5/plugins/preauth/pkinit/Makefile.com	Sun Jun 18 12:12:33 2017
+++ new/usr/src/lib/krb5/plugins/preauth/pkinit/Makefile.com	Sun Jun 18 12:12:33 2017
@@ -22,7 +22,9 @@
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
 #
+#
 
 LIBRARY= pkinit.a
 VERS= .1
@@ -72,6 +74,9 @@
 DYNFLAGS +=	$(KRUNPATH) $(KMECHLIB) -znodelete
 LDLIBS +=	-L $(ROOTLIBDIR) -lcrypto -lc
 
+# Allow libcrypto to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += $(ZASSERTDEFLIB)=libcrypto.so
+
 ROOTLIBDIR= $(ROOT)/usr/lib/krb5/plugins/preauth
 
 $(ROOTLIBDIR):
--- old/usr/src/lib/libbrand/Makefile.com	Sun Jun 18 12:12:33 2017
+++ new/usr/src/lib/libbrand/Makefile.com	Sun Jun 18 12:12:33 2017
@@ -22,6 +22,8 @@
 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 
 LIBRARY=	libbrand.a
 VERS=		.1
@@ -36,6 +38,9 @@
 CPPFLAGS +=	-I$(ADJUNCT_PROTO)/usr/include/libxml2 -I$(SRCDIR) -D_REENTRANT
 $(DYNLIB) :=	LDLIBS += -lxml2
 
+# Allow libxml2 to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += $(ZASSERTDEFLIB)=libxml2.so
+
 SRCDIR=		../common
 
 .KEEP_STATE:
--- old/usr/src/lib/libkmf/libkmf/Makefile.com	Sun Jun 18 12:12:33 2017
+++ new/usr/src/lib/libkmf/libkmf/Makefile.com	Sun Jun 18 12:12:33 2017
@@ -19,6 +19,7 @@
 # CDDL HEADER END
 #
 # Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2017 RackTop Systems.
 #
 
 LIBRARY= libkmf.a
@@ -63,6 +64,9 @@
 $(DYNLIB) :=    LDLIBS += -lxml2
 $(DYNLIB64) :=  LDLIBS64 += -lxml2
 
+# Allow libxml2 to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += $(ZASSERTDEFLIB)=libxml2.so
+
 CPPFLAGS	+=	-I$(INCDIR) -I$(ADJUNCT_PROTO)/usr/include/libxml2 \
 			-I../../ber_der/inc -I$(SRCDIR)
 
--- old/usr/src/lib/libkmf/plugins/kmf_nss/Makefile.com	Sun Jun 18 12:12:33 2017
+++ new/usr/src/lib/libkmf/plugins/kmf_nss/Makefile.com	Sun Jun 18 12:12:33 2017
@@ -22,6 +22,8 @@
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 # Makefile for KMF Plugins
 #
 
@@ -33,16 +35,30 @@
 include	$(SRC)/lib/Makefile.lib
 
 MPSDIR=		/usr/lib/mps
+MPSDIR64=	$(MPSDIR)/64
 KMFINC=		-I../../../include -I../../../ber_der/inc
 NSSINC=		-I$(ADJUNCT_PROTO)/usr/include/mps
 BERLIB=		-lkmf -lkmfberder
 BERLIB64=	$(BERLIB)
 
-NSSLIBS=	$(BERLIB) -L$(ADJUNCT_PROTO)$(MPSDIR) -R$(MPSDIR) \
-		-lnss3 -lnspr4 -lsmime3 -lc
-NSSLIBS64=	$(BERLIB64) -L$(ADJUNCT_PROTO)$(MPSDIR)/$(MACH64) \
-		-R$(MPSDIR)/$(MACH64) -lnss3 -lnspr4 -lsmime3 -lc
+NSSLIBS=	$(BERLIB) -R$(MPSDIR) -lnss3 -lnspr4 -lsmime3 -lc
+NSSLIBS64=	$(BERLIB64) -R$(MPSDIR64) -lnss3 -lnspr4 -lsmime3 -lc
 
+# Allow NSS libraries to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += $(ZASSERTDEFLIB)=libnss3.so
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += $(ZASSERTDEFLIB)=libnspr4.so
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += $(ZASSERTDEFLIB)=libsmime3.so
+
+# Override the default linker path so that libraries found in the host
+# directories will trigger -zassert-deflib logic.
+LDLIBS32	+= -YP,$(DEFLDPATH):$(MPSDIR)
+LDLIBS64	+= -YP,$(DEFLDPATH64):$(MPSDIR64)
+
+# Only add -L options for the NSS directories if ADJUNCT_PROTO is being
+# used because it disables the -zassert-deflib logic.
+$(ADJUNCT_PROTO_SET)LDLIBS32	+= -L$(ADJUNCT_PROTO)$(MPSDIR)
+$(ADJUNCT_PROTO_SET)LDLIBS64	+= -L$(ADJUNCT_PROTO)$(MPSDIR64)
+
 SRCDIR=		../common
 INCDIR=		../../include
 
--- old/usr/src/lib/libkmf/plugins/kmf_openssl/Makefile.com	Sun Jun 18 12:12:33 2017
+++ new/usr/src/lib/libkmf/plugins/kmf_openssl/Makefile.com	Sun Jun 18 12:12:33 2017
@@ -21,6 +21,8 @@
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 # Makefile for KMF Plugins
 #
 
@@ -43,6 +45,9 @@
 LINTSSLLIBS	= $(BERLIB) -lcrypto -lcryptoutil -lc
 LINTSSLLIBS64	= $(BERLIB64) -lcrypto -lcryptoutil -lc
 
+# Allow libcrypto to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += $(ZASSERTDEFLIB)=libcrypto.so
+
 # Because of varying openssl implementations, we need to not have lint
 # complain if we're being liberal in our suppression directives.
 LINTFLAGS	+=	-erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
--- old/usr/src/lib/libldap5/Makefile.com	Sun Jun 18 12:12:34 2017
+++ new/usr/src/lib/libldap5/Makefile.com	Sun Jun 18 12:12:34 2017
@@ -22,6 +22,8 @@
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 
 LIBRARY= libldap.a
 VERS= .5
@@ -83,6 +85,9 @@
 LIBS =		$(DYNLIB) $(LINTLIB)
 DYNFLAGS +=	$(ZNODELETE)
 
+# Allow the NSS libraries to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += $(NSS_LIBS:-l%=$(ZASSERTDEFLIB)=lib%.so)
+
 CPPFLAGS=	$(COM_INC) $(CPPFLAGS.master)
 
 # definitions for lint
@@ -120,8 +125,18 @@
 CERRWARN +=	-_gcc=-Wno-unused-value
 CERRWARN +=	-_gcc=-Wno-address
 
-LDLIBS +=	-lsasl -lsocket -lnsl -lmd -lc
+# Override the default linker path so that libraries found in the host
+# directories will trigger the -zassert-deflib logic.
+LDLIBS32 +=	-YP,$(DEFLDPATH):$(NSS_LDPATH)
+LDLIBS64 +=	-YP,$(DEFLDPATH64):$(NSS_LDPATH64)
 
+# Only add -L options for the NSS directories if ADJUNCT_PROTO is being
+# used because it disables the -zassert-deflib logic.
+$(ADJUNCT_PROTO_SET)LDLIBS32 +=	-L$(NSS_LDPATH)
+$(ADJUNCT_PROTO_SET)LDLIBS64 +=	-L$(NSS_LDPATH64)
+
+LDLIBS +=	-lsasl -lsocket -lnsl -lmd -lc $(NSS_LIBS)
+
 .KEEP_STATE:
 
 # include library targets
--- old/usr/src/lib/libldap5/amd64/Makefile	Sun Jun 18 12:12:34 2017
+++ new/usr/src/lib/libldap5/amd64/Makefile	Sun Jun 18 12:12:34 2017
@@ -8,7 +8,6 @@
 include ../Makefile.com
 include ../../Makefile.lib.64
 
-LDLIBS +=	-L$(ADJUNCT_PROTO)$(NSS_LDPATH64) $(NSS_LIBS)
 DYNFLAGS +=	-R$(NSS_LDPATH64)
 
 all: $(LIBS)
--- old/usr/src/lib/libldap5/i386/Makefile	Sun Jun 18 12:12:34 2017
+++ new/usr/src/lib/libldap5/i386/Makefile	Sun Jun 18 12:12:34 2017
@@ -9,7 +9,6 @@
 
 include ../Makefile.com
 
-LDLIBS +=	-L$(ADJUNCT_PROTO)$(NSS_LDPATH) $(NSS_LIBS)
 DYNFLAGS +=	-R$(NSS_LDPATH)
 
 all: $(LIBS)
--- old/usr/src/lib/libldap5/sparc/Makefile	Sun Jun 18 12:12:34 2017
+++ new/usr/src/lib/libldap5/sparc/Makefile	Sun Jun 18 12:12:34 2017
@@ -9,7 +9,6 @@
 
 include ../Makefile.com
 
-LDLIBS +=	-L$(ADJUNCT_PROTO)$(NSS_LDPATH) $(NSS_LIBS)
 DYNFLAGS +=	-R$(NSS_LDPATH)
 
 
--- old/usr/src/lib/libldap5/sparcv9/Makefile	Sun Jun 18 12:12:34 2017
+++ new/usr/src/lib/libldap5/sparcv9/Makefile	Sun Jun 18 12:12:34 2017
@@ -10,7 +10,6 @@
 include ../Makefile.com
 include ../../Makefile.lib.64
 
-LDLIBS +=	-L$(ADJUNCT_PROTO)$(NSS_LDPATH64) $(NSS_LIBS)
 DYNFLAGS +=	-R$(NSS_LDPATH64)
 
 all: $(LIBS)
--- old/usr/src/lib/libpool/Makefile.com	Sun Jun 18 12:12:34 2017
+++ new/usr/src/lib/libpool/Makefile.com	Sun Jun 18 12:12:34 2017
@@ -22,6 +22,8 @@
 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 
 LIBRARY =	libpool.a
 VERS =		.1
@@ -41,6 +43,9 @@
 # for libxml2, so add it to DYNFLAGS
 DYNFLAGS +=	-lxml2
 
+# Allow libxml2 to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += $(ZASSERTDEFLIB)=libxml2.so
+
 LIBS =		$(DYNLIB) $(LINTLIB)
 LDLIBS +=	-lscf -lnvpair -lexacct -lc
 
--- old/usr/src/lib/libscf/Makefile.com	Sun Jun 18 12:12:34 2017
+++ new/usr/src/lib/libscf/Makefile.com	Sun Jun 18 12:12:34 2017
@@ -20,6 +20,7 @@
 #
 #
 # Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2017 RackTop Systems.
 #
 
 LIBRARY =	libscf.a
@@ -42,6 +43,7 @@
 $(NOT_NATIVE)NATIVE_BUILD = $(POUND_SIGN)
 $(NATIVE_BUILD)VERS =
 $(NATIVE_BUILD)LIBS = $(DYNLIB)
+$(NATIVE_BUILD)$(DYNLIB) := ZASSERTDEFLIB=
 
 LDLIBS_i386 += -lsmbios
 LDLIBS +=	-luutil -lc -lgen -lnsl -lnvpair
--- old/usr/src/lib/libshare/Makefile.com	Sun Jun 18 12:12:35 2017
+++ new/usr/src/lib/libshare/Makefile.com	Sun Jun 18 12:12:35 2017
@@ -20,6 +20,7 @@
 #
 # Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright (c) 2016 by Delphix. All rights reserved.
+# Copyright 2017 RackTop Systems.
 #
 LIBRARY =	libshare.a
 VERS =		.1
@@ -41,6 +42,9 @@
 LDLIBS +=	-lc -lnsl -lscf -lzfs -luuid -lxml2 -lnvpair
 $(LINTLIB) :=	SRCS = $(SRCDIR)/$(LINTSRC)
 
+# Allow libxml2 to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += $(ZASSERTDEFLIB)=libxml2.so
+
 #add nfs/lib directory as part of the include path
 CFLAGS +=	$(CCVERBOSE)
 C99MODE +=	$(C99_ENABLE)
--- old/usr/src/lib/libshare/autofs/Makefile.com	Sun Jun 18 12:12:35 2017
+++ new/usr/src/lib/libshare/autofs/Makefile.com	Sun Jun 18 12:12:35 2017
@@ -20,6 +20,7 @@
 #
 #
 # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2017 RackTop Systems.
 #
 #
 
@@ -44,6 +45,9 @@
 LIBS =		$(DYNLIB)
 LDLIBS +=	-lshare -lscf -lumem -lc -lxml2
 
+# Allow libxml2 to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += $(ZASSERTDEFLIB)=libxml2.so
+
 #add nfs/lib directory as part of the include path
 CFLAGS +=	$(CCVERBOSE)
 CERRWARN +=	-_gcc=-Wno-switch
--- old/usr/src/lib/libshare/nfs/Makefile.com	Sun Jun 18 12:12:35 2017
+++ new/usr/src/lib/libshare/nfs/Makefile.com	Sun Jun 18 12:12:35 2017
@@ -21,6 +21,7 @@
 #
 #
 # Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2017 RackTop Systems.
 #
 
 LIBRARY =	libshare_nfs.a
@@ -44,6 +45,9 @@
 LIBS =		$(DYNLIB)
 LDLIBS +=	-lshare -lnsl -lscf -lumem -lc -lxml2
 
+# Allow libxml2 to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += $(ZASSERTDEFLIB)=libxml2.so
+
 #add nfs/lib directory as part of the include path
 CFLAGS +=	$(CCVERBOSE)
 CERRWARN +=	-_gcc=-Wno-parentheses
--- old/usr/src/lib/libshare/smb/Makefile.com	Sun Jun 18 12:12:35 2017
+++ new/usr/src/lib/libshare/smb/Makefile.com	Sun Jun 18 12:12:35 2017
@@ -23,6 +23,7 @@
 # Use is subject to license terms.
 #
 # Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
+# Copyright 2017 RackTop Systems.
 #
 
 LIBRARY =	libshare_smb.a
@@ -47,6 +48,9 @@
 LIBS =		$(DYNLIB)
 LDLIBS +=	-lshare -lscf -luuid -ldlpi -lnsl -lnvpair -lxml2 -lumem -lc
 
+# Allow libxml2 to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += $(ZASSERTDEFLIB)=libxml2.so
+
 CFLAGS +=	$(CCVERBOSE)
 CERRWARN +=	-_gcc=-Wno-char-subscripts
 CERRWARN +=	-_gcc=-Wno-switch
--- old/usr/src/lib/libshare/smbfs/Makefile.com	Sun Jun 18 12:12:35 2017
+++ new/usr/src/lib/libshare/smbfs/Makefile.com	Sun Jun 18 12:12:35 2017
@@ -22,6 +22,8 @@
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 
 LIBRARY =	libshare_smbfs.a
 VERS =		.1
@@ -40,6 +42,9 @@
 LIBS =		$(DYNLIB)
 LDLIBS +=	-lshare -lscf -lumem -luuid -lc -lxml2 -lsmbfs
 
+# Allow libxml2 to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += $(ZASSERTDEFLIB)=libxml2.so
+
 CFLAGS +=	$(CCVERBOSE)
 CERRWARN +=	-_gcc=-Wno-switch
 CERRWARN +=	-_gcc=-Wno-uninitialized
--- old/usr/src/lib/libuutil/Makefile.com	Sun Jun 18 12:12:35 2017
+++ new/usr/src/lib/libuutil/Makefile.com	Sun Jun 18 12:12:35 2017
@@ -20,6 +20,7 @@
 #
 #
 # Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2017 RackTop Systems.
 #
 
 LIBRARY =	libuutil.a
@@ -46,6 +47,7 @@
 $(NOT_NATIVE)NATIVE_BUILD = $(POUND_SIGN)
 $(NATIVE_BUILD)VERS =
 $(NATIVE_BUILD)LIBS = $(DYNLIB)
+$(NATIVE_BUILD)$(DYNLIB) := ZASSERTDEFLIB=
 
 SRCS =	\
 	../../../common/avl/avl.c \
--- old/usr/src/lib/libwanboot/Makefile.com	Sun Jun 18 12:12:36 2017
+++ new/usr/src/lib/libwanboot/Makefile.com	Sun Jun 18 12:12:36 2017
@@ -22,6 +22,7 @@
 # Use is subject to license terms.
 #
 # Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright 2017 RackTop Systems.
 #
 
 LIBRARY =	libwanboot.a
@@ -61,6 +62,11 @@
 LIBS +=		$(LINTLIB)
 LDLIBS +=	-lnvpair -lresolv -lnsl -lsocket -ldevinfo -ldhcputil \
 		-linetutil -lc -lcrypto -lssl
+
+# Allow libcrypto and libssl to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += $(ZASSERTDEFLIB)=libcrypto.so
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += $(ZASSERTDEFLIB)=libssl.so
+
 CPPFLAGS =	-I$(SRC)/common/net/wanboot/crypt $(CPPFLAGS.master)
 CERRWARN +=	-_gcc=-Wno-switch
 CERRWARN +=	-_gcc=-Wno-parentheses
--- old/usr/src/lib/libzfs/Makefile.com	Sun Jun 18 12:12:36 2017
+++ new/usr/src/lib/libzfs/Makefile.com	Sun Jun 18 12:12:36 2017
@@ -22,6 +22,7 @@
 # Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>
 # Copyright (c) 2011, 2016 by Delphix. All rights reserved.
+# Copyright 2017 RackTop Systems.
 #
 
 LIBRARY= libzfs.a
@@ -77,6 +78,9 @@
 # There's no lint library for zlib, so only include this when building
 $(DYNLIB) := LDLIBS +=	-lz
 
+# Allow zlib to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += $(ZASSERTDEFLIB)=libz.so
+
 LINTFLAGS +=	-erroff=E_STATIC_UNUSED
 LINTFLAGS64 +=	-erroff=E_STATIC_UNUSED
 
--- old/usr/src/lib/libzonecfg/Makefile.com	Sun Jun 18 12:12:36 2017
+++ new/usr/src/lib/libzonecfg/Makefile.com	Sun Jun 18 12:12:36 2017
@@ -20,6 +20,7 @@
 #
 #
 # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2017 RackTop Systems.
 #
 
 LIBRARY=	libzonecfg.a
@@ -34,6 +35,9 @@
 # DYNLIB libraries do not have lint libs and are not linted
 $(DYNLIB) :=	LDLIBS += -lxml2
 
+# Allow libxml2 to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += $(ZASSERTDEFLIB)=libxml2.so
+
 SRCDIR =	../common
 CPPFLAGS +=	-I$(ADJUNCT_PROTO)/usr/include/libxml2 -I$(SRCDIR) -D_REENTRANT
 CERRWARN +=	-_gcc=-Wno-uninitialized
--- old/usr/src/lib/libzpool/Makefile.com	Sun Jun 18 12:12:36 2017
+++ new/usr/src/lib/libzpool/Makefile.com	Sun Jun 18 12:12:36 2017
@@ -22,6 +22,7 @@
 # Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright (c) 2013, 2015 by Delphix. All rights reserved.
 # Copyright 2017 Joyent, Inc.
+# Copyright 2017 RackTop Systems.
 #
 
 LIBRARY= libzpool.a
@@ -68,6 +69,9 @@
 LDLIBS +=	-lcmdutils -lumem -lavl -lnvpair -lz -lc -lsysevent -lmd
 CPPFLAGS +=	$(INCS)	-DDEBUG
 
+# Allow zlib to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += $(ZASSERTDEFLIB)=libz.so
+
 CERRWARN +=	-_gcc=-Wno-parentheses
 CERRWARN +=	-_gcc=-Wno-switch
 CERRWARN +=	-_gcc=-Wno-type-limits
--- old/usr/src/lib/policykit/Makefile.com	Sun Jun 18 12:12:36 2017
+++ new/usr/src/lib/policykit/Makefile.com	Sun Jun 18 12:12:36 2017
@@ -22,6 +22,8 @@
 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2017 RackTop Systems.
+#
 
 include $(SRC)/lib/Makefile.lib
 include $(SRC)/lib/policykit/Makefile.policykit
@@ -32,6 +34,10 @@
 
 C99MODE =	$(C99_ENABLE)
 
+# Allow libdbus and libglib to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += $(ZASSERTDEFLIB)=libdbus-1.so
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += $(ZASSERTDEFLIB)=libglib-2.0.so
+
 ROOTLIBPCDIR =	$(ROOT)/usr/lib/pkgconfig
 ROOTLIBPC =	$(LIBPCSRC:%=$(ROOTLIBPCDIR)/%)
 
--- old/usr/src/lib/pylibbe/Makefile.com	Sun Jun 18 12:12:36 2017
+++ new/usr/src/lib/pylibbe/Makefile.com	Sun Jun 18 12:12:36 2017
@@ -22,6 +22,7 @@
 #
 # Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
 # Copyright 2012 OmniTI Computer Consulting, Inc.  All rights reserved.
+# Copyright 2017 RackTop Systems.
 #
 
 LIBRARY =	libbe_py.a
@@ -46,6 +47,10 @@
 CPPFLAGS +=	-I$(ADJUNCT_PROTO)/usr/include/python$(PYTHON_VERSION) \
 		-D_FILE_OFFSET_BITS=64 -I../../libbe/common
 
+# Allow libpython to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)$(DYNLIB) := DYNFLAGS += \
+	$(ZASSERTDEFLIB)=libpython$(PYTHON_VERSION).so
+
 .KEEP_STATE:
 
 all install := LDLIBS += -lpython$(PYTHON_VERSION)
--- old/usr/src/lib/pysolaris/Makefile.com	Sun Jun 18 12:12:37 2017
+++ new/usr/src/lib/pysolaris/Makefile.com	Sun Jun 18 12:12:37 2017
@@ -20,6 +20,7 @@
 #
 #
 # Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2017 RackTop Systems.
 #
 
 LIBRARY =	misc.a
@@ -46,6 +47,10 @@
 CERRWARN +=	-_gcc=-Wno-unused-variable
 CPPFLAGS +=	-I$(ADJUNCT_PROTO)/usr/include/python$(PYTHON_VERSION)
 
+# Allow libpython to be taken from outside the proto area.
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += \
+	$(ZASSERTDEFLIB)=libpython$(PYTHON_VERSION).so
+
 .KEEP_STATE:
 
 all: $(PYOBJS) $(LIBS)
--- old/usr/src/lib/pyzfs/Makefile.com	Sun Jun 18 12:12:37 2017
+++ new/usr/src/lib/pyzfs/Makefile.com	Sun Jun 18 12:12:37 2017
@@ -20,6 +20,7 @@
 #
 #
 # Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2017 RackTop Systems.
 #
 
 LIBRARY =	ioctl.a
@@ -51,6 +52,10 @@
 CPPFLAGS +=	-I../../../uts/common/fs/zfs
 CPPFLAGS +=	-I../../../common/zfs
 
+# Allow libpython to be taken from outside of the proto area.
+$(ADJUNCT_PROTO_NOT_SET)DYNFLAGS += \
+	$(ZASSERTDEFLIB)=libpython$(PYTHON_VERSION).so
+
 .KEEP_STATE:
 
 all: $(PYOBJS) $(LIBS)
--- old/usr/src/tools/ctf/dwarf/Makefile.com	Sun Jun 18 12:12:37 2017
+++ new/usr/src/tools/ctf/dwarf/Makefile.com	Sun Jun 18 12:12:37 2017
@@ -3,6 +3,8 @@
 # Use is subject to license terms.
 #
 # Copyright 2011, Richard Lowe.
+# Copyright 2017 RackTop Systems.
+#
 
 include ../../Makefile.ctf
 
@@ -99,5 +101,8 @@
 $(DYNLIB) := CTFMERGE_POST= :
 CTFCONVERT_O= :
 
+# Disable -zassert-deflib.  We want to link against host libraries.
+$(DYNLIB) := ZASSERTDEFLIB=
+
 include $(SRC)/lib/Makefile.targ
 
--- old/usr/src/tools/cw/cw.c	Sun Jun 18 12:12:37 2017
+++ new/usr/src/tools/cw/cw.c	Sun Jun 18 12:12:37 2017
@@ -21,6 +21,7 @@
 
 /*
  * Copyright 2011, Richard Lowe.
+ * Copyright 2017 RackTop Systems.
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
@@ -36,7 +37,7 @@
  */
 
 /* If you modify this file, you must increment CW_VERSION */
-#define	CW_VERSION	"1.30"
+#define	CW_VERSION	"1.31"
 
 /*
  * -#		Verbose mode
@@ -1394,6 +1395,14 @@
 			/* Just ignore -YS,... for now */
 			if (strncmp(arg, "S,", 2) == 0)
 				break;
+			/* Reformat -YP or GCC will moan */
+			if (strncmp(arg, "P,", 2) == 0) {
+				char *s;
+				(void) asprintf(&s, "-Y%s", arg);
+				newae(ctx->i_ae, s);
+				free(s);
+				break;
+			}
 			if (strncmp(arg, "l,", 2) == 0) {
 				char *s = strdup(arg);
 				s[0] = '-';
--- old/usr/src/tools/make/lib/makestate/Makefile.com	Sun Jun 18 12:12:37 2017
+++ new/usr/src/tools/make/lib/makestate/Makefile.com	Sun Jun 18 12:12:37 2017
@@ -10,6 +10,7 @@
 #
 
 # Copyright 2015, Richard Lowe.
+# Copyright 2017 RackTop Systems.
 
 include $(SRC)/tools/Makefile.tools
 
@@ -37,4 +38,7 @@
 $(ROOTONBLDLIBMACH64)/%: %
 	$(INS.file)
 
+# Disable -zassert-deflib.  We want to link against host libraries.
+$(DYNLIB) := ZASSERTDEFLIB=
+
 include $(SRC)/lib/Makefile.targ
