--- old/usr/src/cmd/sgs/Makefile	2016-11-21 14:20:05.892250054 +0000
+++ new/usr/src/cmd/sgs/Makefile	2016-11-21 14:20:05.899967140 +0000
@@ -20,6 +20,7 @@
 #
 #
 # Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
 include		$(SRC)/cmd/Makefile.cmd
@@ -173,6 +174,9 @@
 
 native-proto:
 		-@mkdir -p proto/$(MACH)
+		-@mkdir -p proto/$(MACH)/lib
+		-@mkdir -p proto/$(MACH)/usr
+		-@mkdir -p proto/$(MACH)/usr/bin
 
 FRC:
 
--- old/usr/src/cmd/sgs/Makefile.com	2016-11-21 14:20:06.095590777 +0000
+++ new/usr/src/cmd/sgs/Makefile.com	2016-11-21 14:20:06.105103316 +0000
@@ -84,6 +84,12 @@
 SGSRPATH =	/usr/lib
 SGSRPATH64 =	$(SGSRPATH)/$(MACH64)
 
+# Mimic the structure of an installed system.
+
+SGSLIBDIR =	$(SGSPROTO)/lib
+SGSPREFIX =	$(SGSPROTO)/usr
+SGSBINDIR =	$(SGSPREFIX)/bin
+
 #
 # Macros to be used to include link against libconv and include vernote.o
 #
@@ -121,12 +127,13 @@
 # Native targets should use the minimum of ld(1) flags to allow building on
 # previous releases.  We use mapfiles to scope, but don't bother versioning.
 
-native :=	DYNFLAGS = -R$(SGSPROTO) -L$(SGSPROTO) $(ZNOVERSION) $(HSONAME)
+native :=	DYNFLAGS = -R$(SGSLIBDIR) -L$(SGSLIBDIR) $(ZNOVERSION) \
+			$(HSONAME)
 
 # Comment out the following two lines to have the sgs built from the system
 # link-editor, rather than the local proto link-editor.
-CC_USE_PROTO =	-Yl,$(SGSPROTO)
-LD_USE_PROTO =	$(SGSPROTO)/
+CC_USE_PROTO =	-Yl,$(SGSBINDIR)
+LD_USE_PROTO =	$(SGSBINDIR)/
 
 #
 # lint-related stuff
--- old/usr/src/cmd/sgs/ld/Makefile.com	2016-11-21 14:20:06.297135807 +0000
+++ new/usr/src/cmd/sgs/ld/Makefile.com	2016-11-21 14:20:06.306592265 +0000
@@ -50,8 +50,8 @@
 
 CLEANFILES +=	$(LINTOUTS)
 
-native :=	LDFLAGS = -R$(SGSPROTO) $(ZNOVERSION)
-native :=	LDLIBS = -L$(SGSPROTO) $(LD_LIB) -lelf $(CONVLIBDIR) \
+native :=	LDFLAGS = -R$(SGSLIBDIR) $(ZNOVERSION)
+native :=	LDLIBS = -L$(SGSLIBDIR) $(LD_LIB) -lelf $(CONVLIBDIR) \
 		    $(CONV_LIB)
 native :=	CPPFLAGS += -DNATIVE_BUILD
 
--- old/usr/src/cmd/sgs/ld/Makefile.targ	2016-11-21 14:20:06.503961083 +0000
+++ new/usr/src/cmd/sgs/ld/Makefile.targ	2016-11-21 14:20:06.512984002 +0000
@@ -23,7 +23,7 @@
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
+# Copyright 2016 RackTop Systems.
 #
 
 all:		$(PROG)
@@ -51,9 +51,9 @@
 # Special target for native builds (ie. when we need to build a version of ld
 # to build a version of ld :-).
 
-native:		$(SGSPROTO)/$(PROG)
+native:		$(SGSBINDIR)/$(PROG)
 
-$(SGSPROTO)/$(PROG) \
+$(SGSBINDIR)/$(PROG) \
 $(PROG):	$$(OBJS)
 		$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
 		$(POST_PROCESS)
--- old/usr/src/cmd/sgs/ldprof/Makefile.com	2016-11-21 14:20:06.712214875 +0000
+++ new/usr/src/cmd/sgs/ldprof/Makefile.com	2016-11-21 14:20:06.721148538 +0000
@@ -34,8 +34,6 @@
 
 ROOTLIBDIR=	$(ROOT)/usr/lib/link_audit
 
-SGSPROTO=	../../proto/$(MACH)
-
 MAPFILES =	../common/mapfile-vers
 
 DYNFLAGS +=	$(CC_USE_PROTO)
--- old/usr/src/cmd/sgs/libelf/Makefile.targ	2016-11-21 14:20:06.912967992 +0000
+++ new/usr/src/cmd/sgs/libelf/Makefile.targ	2016-11-21 14:20:06.923281069 +0000
@@ -20,6 +20,7 @@
 #
 #
 # Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2016 RackTop Systems.
 #
 
 objs/%.o \
@@ -131,14 +132,15 @@
 # Special target for native builds (ie. when we need to build a version of ld
 # to build a version of ld :-).
 
-native:		$(SGSPROTO)/$(DYNLIB)
+native:		$(SGSLIBDIR)/$(LIBLINKS)
 
-$(SGSPROTO)/$(DYNLIB): \
-		pics .WAIT $$(PICS)
+$(SGSLIBDIR)/$(DYNLIB): pics .WAIT $$(PICS)
 		$(BUILD.SO)
 		$(POST_PROCESS_SO)
-		-@$(RM) $(SGSPROTO)/$(LIBLINKS)
-		$(SYMLINK) $(DYNLIB) $(SGSPROTO)/$(LIBLINKS)
+
+$(SGSLIBDIR)/$(LIBLINKS): $(SGSLIBDIR)/$(DYNLIB)
+		-@$(RM) $(SGSLIBDIR)/$(LIBLINKS)
+		$(SYMLINK) $(DYNLIB) $(SGSLIBDIR)/$(LIBLINKS)
 
 
 # Derived source and header files (messaging).  Make sure that the sgsmsg
--- old/usr/src/cmd/sgs/libld/Makefile.targ	2016-11-21 14:20:07.117198459 +0000
+++ new/usr/src/cmd/sgs/libld/Makefile.targ	2016-11-21 14:20:07.125695411 +0000
@@ -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 2016 RackTop Systems.
 #
 
 pics/%.o:	../common/%.c
@@ -101,14 +101,15 @@
 # Special target for native builds (ie. when we need to build a version of ld
 # to build a version of ld :-).
 
-native:		$(SGSPROTO)/$(DYNLIB)
+native:		$(SGSLIBDIR)/$(LIBLINKS)
 
-$(SGSPROTO)/$(DYNLIB): \
-		pics .WAIT $$(PICS)
+$(SGSLIBDIR)/$(DYNLIB): pics .WAIT $$(PICS)
 		$(BUILD.SO)
 		$(POST_PROCESS_SO)
-		@$(RM) $(SGSPROTO)/$(LIBLINKS)
-		$(SYMLINK) $(DYNLIB) $(SGSPROTO)/$(LIBLINKS)
+
+$(SGSLIBDIR)/$(LIBLINKS): $(SGSLIBDIR)/$(DYNLIB)
+		@$(RM) $(SGSLIBDIR)/$(LIBLINKS)
+		$(SYMLINK) $(DYNLIB) $(SGSLIBDIR)/$(LIBLINKS)
 
 include		$(SRC)/lib/Makefile.targ
 include		$(SRC)/cmd/sgs/Makefile.targ
--- old/usr/src/cmd/sgs/liblddbg/Makefile.targ	2016-11-21 14:20:07.323412791 +0000
+++ new/usr/src/cmd/sgs/liblddbg/Makefile.targ	2016-11-21 14:20:07.332749797 +0000
@@ -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 2016 RackTop Systems.
 #
 
 pics/%.o:	../common/%.c
@@ -55,14 +55,15 @@
 # Special target for native builds (ie. when we need to build a version of ld
 # to build a version of ld :-).
 
-native:		$(SGSPROTO)/$(DYNLIB)
+native:		$(SGSLIBDIR)/$(LIBLINKS)
 
-$(SGSPROTO)/$(DYNLIB): \
-		pics .WAIT $$(PICS)
+$(SGSLIBDIR)/$(DYNLIB): pics .WAIT $$(PICS)
 		$(BUILD.SO)
 		$(POST_PROCESS_SO)
-		-@$(RM) $(SGSPROTO)/$(LIBLINKS)
-		$(SYMLINK) $(DYNLIB) $(SGSPROTO)/$(LIBLINKS)
+
+$(SGSLIBDIR)/$(LIBLINKS): $(SGSLIBDIR)/$(DYNLIB)
+		-@$(RM) $(SGSLIBDIR)/$(LIBLINKS)
+		$(SYMLINK) $(DYNLIB) $(SGSLIBDIR)/$(LIBLINKS)
 
 include		$(SRC)/lib/Makefile.targ
 include		$(SRC)/cmd/sgs/Makefile.targ
--- old/usr/src/cmd/sgs/libldmake/Makefile.com	2016-11-21 14:20:07.528433127 +0000
+++ new/usr/src/cmd/sgs/libldmake/Makefile.com	2016-11-21 14:20:07.538392531 +0000
@@ -34,8 +34,6 @@
 ROOTLIBDIR=	$(ROOT)/opt/SUNWonld/lib
 ROOTLIBDIR64=	$(ROOT)/opt/SUNWonld/lib/$(MACH64)
 
-SGSPROTO=	../../proto/$(MACH)
-
 SRCDIR =	../common
 
 DYNFLAGS +=	$(CC_USE_PROTO)
--- old/usr/src/cmd/sgs/libldstab/Makefile.targ	2016-11-21 14:20:07.749791885 +0000
+++ new/usr/src/cmd/sgs/libldstab/Makefile.targ	2016-11-21 14:20:07.757512619 +0000
@@ -22,6 +22,8 @@
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2016 RackTop Systems.
+#
 
 pics/%.o:	../common/%.c
 		$(COMPILE.c) -o $@ $<
@@ -39,10 +41,9 @@
 # Special target for native builds (ie. when we need to build a version of ld
 # to build a version of ld :-).
 
-native:		$(SGSPROTO)/$(DYNLIB)
+native:		$(SGSLIBDIR)/$(DYNLIB)
 
-$(SGSPROTO)/$(DYNLIB): \
-		pics .WAIT $$(PICS)
+$(SGSLIBDIR)/$(DYNLIB): pics .WAIT $$(PICS)
 		$(BUILD.SO)
 		$(POST_PROCESS_SO)
 
--- old/usr/src/cmd/sgs/librtld/Makefile.targ	2016-11-21 14:20:07.987411824 +0000
+++ new/usr/src/cmd/sgs/librtld/Makefile.targ	2016-11-21 14:20:07.995765573 +0000
@@ -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 2016 RackTop Systems.
 #
 
 pics/%.o:	../common/%.c
@@ -38,14 +38,15 @@
 # Special target for native builds (ie. when we need to build a version of ld
 # to build a version of ld :-).
 
-native:		$(SGSPROTO)/$(DYNLIB)
+native:		$(SGSLIBDIR)/$(LIBLINKS)
 
-$(SGSPROTO)/$(DYNLIB): \
-		pics .WAIT $$(PICS)
+$(SGSLIBDIR)/$(DYNLIB): pics .WAIT $$(PICS)
 		$(BUILD.SO)
 		$(POST_PROCESS_SO)
-		-@$(RM) $(SGSPROTO)/$(LIBLINKS)
-		$(SYMLINK) $(DYNLIB) $(SGSPROTO)/$(LIBLINKS)
+
+$(SGSLIBDIR)/$(LIBLINKS): $(SGSLIBDIR)/$(DYNLIB)
+		-@$(RM) $(SGSLIBDIR)/$(LIBLINKS)
+		$(SYMLINK) $(DYNLIB) $(SGSLIBDIR)/$(LIBLINKS)
 
 include		$(SRC)/lib/Makefile.targ
 include		$(SRC)/cmd/sgs/Makefile.targ
--- old/usr/src/cmd/sgs/link_audit/Makefile.com	2016-11-21 14:20:08.187553263 +0000
+++ new/usr/src/cmd/sgs/link_audit/Makefile.com	2016-11-21 14:20:08.195960733 +0000
@@ -28,8 +28,6 @@
 
 NO_ASM_WARN=	-erroff=E_ASM_DISABLES_OPTIMIZATION
 
-SGSPROTO=	../../proto/$(MACH)
-
 TRUSSLIB=	truss.so.1
 TRUSSSRC=	truss.c
 
