--- old/usr/src/lib/libc/Makefile	Mon Jun 12 08:24:23 2017
+++ new/usr/src/lib/libc/Makefile	Mon Jun 12 08:24:23 2017
@@ -18,12 +18,11 @@
 #
 # CDDL HEADER END
 #
+
 #
 # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2017 Nexenta Systems, Inc.
 #
-# Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
 
 LIBBASENAME=	libc
 LIBRARY=	$(LIBBASENAME:%=%.a)
@@ -39,9 +38,6 @@
 ROOTLIB64=	$(ROOTLIB)/$(MACH64)
 ROOTFS_LIB64=	$(ROOTFS_LIB)/$(MACH64)
 
-ROOTVARIANTDIR=	$(ROOTLIB)/libc
-ROOTVARIANTDIR64=	$(ROOTLIB64)/libc
-
 ROOTFS_LINTDIR=		$(ROOTFS_LIB)
 ROOTFS_LINTDIR64=	$(ROOTFS_LIB64)
 ROOTFS_LINTLIB=		$(ROOTFS_LINTDIR)/$(LINTLIB)
@@ -50,34 +46,7 @@
 # include common library definitions
 include ../Makefile.lib
 
-#
-# on some architectures, we build multiple libc variants
-#
-VAR1 =		hwcap1
-VAR2 =		hwcap2
-VAR3 =		hwcap3
-
-VARBLD_1=	$(MACH:sparc=sparc)
-VARBLD=		$(VARBLD_1:i386=)
-
-VARBLD64_1=	$(MACH:sparc=sparcv9)
-VARBLD64=	$(VARBLD64_1:i386=)
-
-VAR1_DYNLIB =	$(LIBRARY:%.a=%_$(VAR1).so$(VERS))
-VAR1_BLDDIR =	$(MACH)_$(VAR1)/$(VARBLD)
-VAR2_DYNLIB =	$(LIBRARY:%.a=%_$(VAR2).so$(VERS))
-VAR2_BLDDIR =	$(MACH)_$(VAR2)/$(VARBLD)
-VAR3_DYNLIB =	$(LIBRARY:%.a=%_$(VAR3).so$(VERS))
-VAR3_BLDDIR =	$(MACH)_$(VAR3)/$(VARBLD)
-
-VAR1_DYNLIB64 =	$(LIBRARY:%.a=%_$(VAR1).so$(VERS))
-VAR1_BLDDIR64 =	$(MACH)_$(VAR1)/$(VARBLD64)
-
-i386_VARIANTS=	$(VAR1) $(VAR2) $(VAR3)
-sparc_VARIANTS=
-sparcv9_VARIANTS=
-
-i386_COMP=
+i386_COMP=	capabilities
 sparc_COMP=	capabilities
 
 MACH_COMP=	$($(MACH)_COMP)
@@ -85,26 +54,15 @@
 i386_ETC=	$(MACH)/etc
 sparc_ETC=
 
-VARIANTS=	$($(MACH)_VARIANTS)
-VARIANT_SUBDIRS	= $(VARIANTS:%=$(MACH)_%/$(VARBLD))
+SUBDIRS=	$(MACH_CAP) $(MACH) $(MACH_ETC) $(BUILD64) $(MACH64)
 
-VARIANTS64=	$($(MACH64)_VARIANTS)
-VARIANT_SUBDIRS64	= $(VARIANTS64:%=$(MACH)_%/$(VARBLD64))
-
-SUBDIRS=	$(MACH_CAP) $(MACH) $(MACH_ETC) $(VARIANT_SUBDIRS)
-$(BUILD64)SUBDIRS += $(MACH64) $(VARIANT_SUBDIRS64)
-
 LIBS =		$(DYNLIB) $(LINTLIB)
 
 ROOTLIBS64=	$(ROOTLIBDIR64)/$(DYNLIB) $(ROOTLIBDIR64)/$(LINTLIB)
 MACHLIBS64=	$(MACH64)/$(DYNLIB) $(MACH64)/$(LINTLIB)
-VARIANTLIBS=	$(VARIANTS:%=$(MACH)_%/$(VARBLD)/$(LIBBASENAME)_%.so.1)
-VARIANTLIBS64=	$(VARIANTS64:%=$(MACH)_%/$(VARBLD64)/$(LIBBASENAME)_%.so.1)
-ROOTVARIANTLIBS= $(VARIANTS:%=$(ROOTVARIANTDIR)/$(LIBBASENAME)_%.so.1)
-ROOTVARIANTLIBS64= $(VARIANTS64:%=$(ROOTVARIANTDIR64)/$(LIBBASENAME)_%.so.1)
 
 # definitions for install_h target
-BASEHDRS=	getxby_door.h 
+BASEHDRS=	getxby_door.h
 CHECKHDRS=	$(BASEHDRS:%.h=port/gen/%.check)
 HDRS=		$(BASEHDRS)
 
@@ -116,17 +74,9 @@
 
 $(ROOTLIBDIR)/$(DYNLIB)	:=	FILEMODE = 755
 $(ROOTLIBDIR64)/$(DYNLIB) :=	FILEMODE = 755
-$(ROOTFS_LIBDIR)/$(DYNLIB)	:=	FILEMODE = 755
-$(ROOTFS_LIBDIR64)/$(DYNLIB)	:=	FILEMODE = 755
+$(ROOTFS_LIBDIR)/$(DYNLIB) :=	FILEMODE = 755
+$(ROOTFS_LIBDIR64)/$(DYNLIB) :=	FILEMODE = 755
 
-$(ROOTVARIANTDIR)			:= FILEMODE= 755
-$(ROOTVARIANTDIR)/$(VAR1_DYNLIB)	:= FILEMODE= 755
-$(ROOTVARIANTDIR)/$(VAR2_DYNLIB)	:= FILEMODE= 755
-$(ROOTVARIANTDIR)/$(VAR3_DYNLIB)	:= FILEMODE= 755
-
-$(ROOTVARIANTDIR64)			:= FILEMODE= 755
-$(ROOTVARIANTDIR64)/$(VAR1_DYNLIB64)	:= FILEMODE= 755
-
 .KEEP_STATE:
 
 all:	all_h lib32 $(BUILD64) .WAIT lib64 .WAIT etc THIRDPARTYLICENSE
@@ -137,7 +87,7 @@
 
 etc:	$($(MACH)_ETC)
 
-lib32:	$(MACH_COMP) $(MACHLIBS) $(MACH)/$(LIB_PIC) $(VARIANTLIBS)
+lib32:	$(MACH_COMP) $(MACHLIBS) $(MACH)/$(LIB_PIC)
 	@if $(ELFDUMP) -r $(MACH)/$(DYNLIB) | $(GREP) -w environ ; then \
 		$(ECHO) "Error: Invalid reference to environ" ; \
 		$(ECHO) "Error: See comments in port/gen/env_data.c" ; \
@@ -144,7 +94,7 @@
 		exit 1; \
 	fi
 
-lib64:	$(MACH_COMP) $(MACHLIBS64) $(MACH64)/$(LIB_PIC) $(VARIANTLIBS64)
+lib64:	$(MACH_COMP) $(MACHLIBS64) $(MACH64)/$(LIB_PIC)
 	@if $(ELFDUMP) -r $(MACH64)/$(DYNLIB) | $(GREP) -w environ ; then \
 		$(ECHO) "Error: Invalid reference to environ" ; \
 		$(ECHO) "Error: See comments in port/gen/env_data.c" ; \
@@ -154,12 +104,6 @@
 $(MACH)/assym.h $(MACH64)/assym.h:
 	@cd $(@D); $(MAKE) assym.h
 
-$(VARIANTLIBS): FRC
-	@cd $(@D); pwd; VERSION='$(VERSION)' $(MAKE) $(@F)
-
-$(VARIANTLIBS64): FRC
-	@cd $(@D); pwd; VERSION='$(VERSION)' $(MAKE) $(@F)
-
 $($(MACH)_ETC): FRC
 	@cd $(@); pwd; $(MAKE) $(TARGET)
 
@@ -171,13 +115,9 @@
 		inslib32		\
 		$(BUILD64) inslib64
 
-inslib32:	$(ROOTFS_LIBS) $(ROOTFS_LINKS) $(ROOTFS_LINT) \
-		$(ROOTFS_LINTLIB) \
-		$(ROOTVARIANTLIBS)
+inslib32:	$(ROOTFS_LIBS) $(ROOTFS_LINKS) $(ROOTFS_LINT) $(ROOTFS_LINTLIB)
 
-inslib64:	$(ROOTFS_LIBS64) $(ROOTFS_LINKS64) \
-		$(ROOTFS_LINTLIB64) \
-		$(ROOTVARIANTLIBS64)
+inslib64:	$(ROOTFS_LIBS64) $(ROOTFS_LINKS64) $(ROOTFS_LINTLIB64)
 
 install_h: all_h $(ROOTHDRS)
 
@@ -194,20 +134,6 @@
 $(ROOTFS_LIBDIR64)/$(LIBLINKS): $(ROOTFS_LIBDIR64)/$(LIBLINKS)$(VERS)
 	$(INS.liblink)
 
-$(ROOTVARIANTDIR): $(ROOTLIB)
-	$(INS.dir)
-$(ROOTVARIANTDIR)/%: $(ROOTVARIANTDIR) $(VAR1_BLDDIR)/%
-	$(INS.file)
-$(ROOTVARIANTDIR)/%: $(ROOTVARIANTDIR) $(VAR2_BLDDIR)/%
-	$(INS.file)
-$(ROOTVARIANTDIR)/%: $(ROOTVARIANTDIR) $(VAR3_BLDDIR)/%
-	$(INS.file)
-
-$(ROOTVARIANTDIR64): $(ROOTLIB64)
-	$(INS.dir)
-$(ROOTVARIANTDIR64)/%: $(ROOTVARIANTDIR64) $(VAR1_BLDDIR64)/%
-	$(INS.file)
-
 # install rule for lint library target
 $(ROOTFS_LINTDIR)/%: port/%
 	$(INS.file)
--- old/usr/src/lib/libc/capabilities/Makefile	Mon Jun 12 08:24:24 2017
+++ new/usr/src/lib/libc/capabilities/Makefile	Mon Jun 12 08:24:24 2017
@@ -21,12 +21,13 @@
 
 #
 # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2017 Nexenta Systems, Inc.
 #
 
 include		$(SRC)/Makefile.master
 
 # Each target directory is responsible for making a symbol capabilities object.
-$(SPARC_BLD)SUBDIRS = \
+$(SPARC_BLD)SUBDIRS= \
 		sun4u \
 		sun4u-opl \
 		sun4u-us3-hwcap1 \
@@ -33,7 +34,10 @@
 		sun4u-us3-hwcap2 \
 		sun4v-hwcap1 \
 		sun4v-hwcap2
-$(INTEL_BLD)SUBDIRS =
+$(INTEL_BLD)SUBDIRS= \
+		i386-hwcap1 \
+		i386-hwcap2 \
+		i386-hwcap3
 
 all :=		TARGET= all
 clean :=	TARGET= clean
@@ -44,8 +48,7 @@
 
 .PARALLEL:	$(SUBDIRS)
 
-all clean clobber install: \
-		$(SUBDIRS)
+all clean clobber install: $(SUBDIRS)
 
 lint:
 
--- /dev/null	Mon Jun 12 08:24:26 2017
+++ new/usr/src/lib/libc/capabilities/i386-hwcap1/Makefile	Mon Jun 12 08:24:26 2017
@@ -0,0 +1,48 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License").  You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+# Copyright 2017 Nexenta Systems, Inc.
+#
+
+include		../Makefile.com
+
+OBJECTS=	memcpy.o memset.o
+MAPFILE-CAP=	mapfile-cap
+
+include		$(SRC)/lib/Makefile.lib
+
+AS_CPPFLAGS +=	-D_ASM -D_CMOV_INSN -D_SSE_INSN -D_MMX_INSN -D_SEP_INSN
+ASFLAGS=	-P -K pic
+#CFLAGS +=	-xtarget=pentium_pro
+
+.KEEP_STATE:
+
+all install:	$(SYMCAP)
+
+pics/%.o:	../i386/common/%.s
+		$(COMPILE.s) $< -o $@
+		$(POST_PROCESS_O)
+
+include		../Makefile.targ
--- old/usr/src/lib/libc/i386_hwcap2/mapfile	Mon Jun 12 08:24:27 2017
+++ /dev/null	Mon Jun 12 08:24:26 2017
@@ -1,28 +0,0 @@
-#
-# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-$mapfile_version 2
-
-CAPABILITY {
-	hw += fpu cmov amd_sysc mmx sse sse2;
-};
--- /dev/null	Mon Jun 12 08:24:26 2017
+++ new/usr/src/lib/libc/capabilities/i386-hwcap1/mapfile-cap	Mon Jun 12 08:24:27 2017
@@ -0,0 +1,43 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2017 Nexenta Systems, Inc.
+#
+
+$mapfile_version 2
+
+CAPABILITY i386-hwcap1 {
+	HW += fpu cmov sep mmx sse;
+};
+
+SYMBOL_SCOPE {
+    global:
+	_memcpy;
+	_memmove;
+	_memset;
+	memcpy;
+	memmove;
+	memset;
+    local:
+	*;
+};
--- /dev/null	Mon Jun 12 08:24:29 2017
+++ new/usr/src/lib/libc/capabilities/i386-hwcap2/Makefile	Mon Jun 12 08:24:29 2017
@@ -0,0 +1,49 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License").  You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+# Copyright 2017 Nexenta Systems, Inc.
+#
+
+include		../Makefile.com
+
+OBJECTS=	memcpy.o memset.o
+MAPFILE-CAP=	mapfile-cap
+
+include		$(SRC)/lib/Makefile.lib
+
+AS_CPPFLAGS +=	-D_ASM -D_CMOV_INSN -D_SSE_INSN -D_SSE2_INSN -D_MMX_INSN \
+		-D_SYSC_INSN
+ASFLAGS=	-P -K pic
+#CFLAGS +=	-xtarget=pentium_pro
+
+.KEEP_STATE:
+
+all install:	$(SYMCAP)
+
+pics/%.o:	../i386/common/%.s
+		$(COMPILE.s) $< -o $@
+		$(POST_PROCESS_O)
+
+include		../Makefile.targ
--- old/usr/src/lib/libc/i386_hwcap3/mapfile	Mon Jun 12 08:24:30 2017
+++ /dev/null	Mon Jun 12 08:24:29 2017
@@ -1,28 +0,0 @@
-#
-# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-$mapfile_version 2
-
-CAPABILITY {
-	hw += fpu cmov mmx sse;
-};
--- /dev/null	Mon Jun 12 08:24:29 2017
+++ new/usr/src/lib/libc/capabilities/i386-hwcap2/mapfile-cap	Mon Jun 12 08:24:30 2017
@@ -0,0 +1,43 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2017 Nexenta Systems, Inc.
+#
+
+$mapfile_version 2
+
+CAPABILITY i386-hwcap2 {
+	HW += fpu cmov amd_sysc mmx sse sse2;
+};
+
+SYMBOL_SCOPE {
+    global:
+	_memcpy;
+	_memmove;
+	_memset;
+	memcpy;
+	memmove;
+	memset;
+    local:
+	*;
+};
--- /dev/null	Mon Jun 12 08:24:31 2017
+++ new/usr/src/lib/libc/capabilities/i386-hwcap3/Makefile	Mon Jun 12 08:24:31 2017
@@ -0,0 +1,48 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License").  You may not use this file except in compliance
+# with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+# Copyright 2017 Nexenta Systems, Inc.
+#
+
+include		../Makefile.com
+
+OBJECTS=	memcpy.o memset.o
+MAPFILE-CAP=	mapfile-cap
+
+include		$(SRC)/lib/Makefile.lib
+
+AS_CPPFLAGS +=	-D_ASM -D_CMOV_INSN -D_SSE_INSN -D_MMX_INSN
+ASFLAGS=	-P -K pic
+#CFLAGS +=	-xtarget=pentium_pro
+
+.KEEP_STATE:
+
+all install:	$(SYMCAP)
+
+pics/%.o:	../i386/common/%.s
+		$(COMPILE.s) $< -o $@
+		$(POST_PROCESS_O)
+
+include		../Makefile.targ
--- old/usr/src/lib/libc/i386_hwcap1/mapfile	Mon Jun 12 08:24:32 2017
+++ /dev/null	Mon Jun 12 08:24:31 2017
@@ -1,28 +0,0 @@
-#
-# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-$mapfile_version 2
-
-CAPABILITY {
-	hw += fpu cmov sep mmx sse;
-};
--- /dev/null	Mon Jun 12 08:24:31 2017
+++ new/usr/src/lib/libc/capabilities/i386-hwcap3/mapfile-cap	Mon Jun 12 08:24:32 2017
@@ -0,0 +1,43 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2017 Nexenta Systems, Inc.
+#
+
+$mapfile_version 2
+
+CAPABILITY i386-hwcap3 {
+	HW += fpu cmov mmx sse;
+};
+
+SYMBOL_SCOPE {
+    global:
+	_memcpy;
+	_memmove;
+	_memset;
+	memcpy;
+	memmove;
+	memset;
+    local:
+	*;
+};
--- old/usr/src/lib/libc/i386_hwcap1/gen/memcpy.s	Mon Jun 12 08:24:34 2017
+++ /dev/null	Mon Jun 12 08:24:31 2017
@@ -1,276 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-	.file	"memcpy.s"
-
-#include <sys/asm_linkage.h>
-
-	ANSI_PRAGMA_WEAK(memmove,function)
-	ANSI_PRAGMA_WEAK(memcpy,function)
-
-	ENTRY(memmove)
-	movl	0+12(%esp),%ecx	/ get number of bytes to move
-	pushl	%esi		/ save off %edi, %esi and move destination
-	pushl	%edi
-	movl	8+ 4(%esp),%edi	/ destination buffer address
-	movl	8+ 8(%esp),%esi	/ source buffer address
-	movl	%edi, %eax
-	testl	%ecx,%ecx
-	jz	.Return
-
-	cmpl	%esi,%edi	/ if (source addr > dest addr)
-	leal	-1(%esi,%ecx),%edx	/ %edx = src + size - 1
-	jbe	.memcpy_post	/ jump if dst <= src
-	cmpl	%edx,%edi
-	jbe	.CopyLeft	/ jump if dst <= src + size - 1
-	jmp	.memcpy_post
-
-	ENTRY(memcpy)
-	pushl	%esi
-	pushl	%edi
-
-	movl	8+4(%esp),%edi	/ %edi = dest address
-	movl	%edi, %eax	/ save this
-	movl	8+8(%esp),%esi	/ %esi = source address
-	movl	8+12(%esp),%ecx/ %ecx = length of string
-				/ %edx scratch register
-				/ %eax scratch register
-.memcpy_post:	
-	nop			/ this really helps, don't know why
-				/ note:	cld is perf death on P4
-	cmpl	$63,%ecx
-	ja	.move_sse	/ not worth doing sse for less
-
-.movew:	
-	movl	%ecx,%edx	/ save byte cnt
-	shrl	$2,%ecx		/ %ecx = number of words to move
-	rep ; smovl		/ move the words
-
-
-	andl	$0x3,%edx	/ %edx = number of bytes left to move
-	jz	.Return		/ %edx <= 3, so just unroll the loop
-
-	movb	(%esi), %cl
-	movb	%cl, (%edi)
-	decl	%edx
-	jz	.Return
-	movb	1(%esi), %cl
-	movb	%cl, 1(%edi)
-	decl	%edx
-	jz	.Return
-	movb	2(%esi), %cl
-	movb	%cl, 2(%edi)
-
-.Return:
-	popl	%edi		/ restore register variables
-	popl	%esi		
-	ret
-
-.move_sse:
-	/
-	/ time to 16 byte align destination
-	/
-	andl	$15, %eax
-	jnz	.sse_unaligned	/ jmp if dest is unaligned
-.sse:				/ dest is aligned, check source
-	movl	%ecx, %edx	/ get byte count
-	shrl	$6, %edx	/ number of 64 byte blocks to move
-	testl	$15, %esi
-	jnz	.sse_da		/ go to slow loop if source is unaligned
-	cmpl	$65535, %ecx
-	ja	.sse_sa_nt_loop
-	
-	/
-	/ use aligned load since we're lucky
-	/
-.sse_sa_loop:
-	prefetcht0 568(%esi)	/ prefetch source & copy 64 byte at a time
-	prefetcht0 568(%edi)	/ prefetch source & copy 64 byte at a time
-	movaps	0(%esi), %xmm0
-	movaps	%xmm0, 0(%edi)	 
-	movaps	16(%esi), %xmm1
-	movaps	%xmm1, 16(%edi)
-	movaps	32(%esi), %xmm2
-	movaps	%xmm2, 32(%edi)	 
-	movaps	48(%esi), %xmm3
-	movaps	%xmm3, 48(%edi)
-	addl	$64, %esi
-	addl	$64, %edi
-	decl	%edx
-	jnz	.sse_sa_loop
-	
-.sse_cleanup:
-	andl	$63, %ecx	/ compute remaining bytes
-	movl	8+4(%esp), %eax	/ setup return value
-	jz	.Return
-	jmp	.movew
-	
-	/
-	/ use aligned load since we're lucky
-	/
-	.align 16
-.sse_sa_nt_loop:
-	prefetchnta 16384(%esi)	/ prefetch source & copy 64 byte at a time
-	movaps	(%esi), %xmm0
-	movntps	%xmm0, 0(%edi)	 
-	movaps	16(%esi), %xmm1
-	movntps	%xmm1, 16(%edi)
-	movaps	32(%esi), %xmm2
-	movntps	%xmm2, 32(%edi)	 
-	movaps	48(%esi), %xmm3
-	movntps	%xmm3, 48(%edi)
-	addl	$64, %esi
-	addl	$64, %edi
-	decl	%edx
-	jnz	.sse_sa_nt_loop
-#if defined(_SSE2_INSN)
-	mfence
-#elif defined(_SSE_INSN)
-	sfence
-#else
-#error "Must have either SSE or SSE2"
-#endif
-	jmp	.sse_cleanup
-
-	/
-	/ Make certain that destination buffer becomes aligned
-	/
-.sse_unaligned:
-	neg	%eax		/ subtract from 16 and get destination
-	andl	$15, %eax	/ aligned on a 16 byte boundary
-	movl	%ecx, %edx	/ saved count
-	subl	%eax, %ecx	/ subtract from byte count
-	cmpl	$64, %ecx	/ after aligning, will we still have 64 bytes?
-	cmovb	%edx, %ecx	/ if not, restore original byte count,
-	cmovb	8+4(%esp), %eax	/ and restore return value,
-	jb	.movew		/ and do a non-SSE move.
-	xchg	%ecx, %eax	/ flip for copy
-	rep ; smovb		/ move the bytes
-	xchg	%ecx, %eax	/ flip back
-	jmp	.sse
-	
-	.align 16
-.sse_da:
-	cmpl	$65535, %ecx
-	jbe	.sse_da_loop
-
-	/
-	/ use unaligned load since source doesn't line up
-	/
-.sse_da_nt_loop:
-	prefetchnta 16384(%esi)	/ prefetch source & copy 64 byte at a time
-	movups	0(%esi), %xmm0
-	movntps	%xmm0, 0(%edi)	 
-	movups	16(%esi), %xmm1
-	movntps	%xmm1, 16(%edi)
-	movups	32(%esi), %xmm2
-	movntps	%xmm2, 32(%edi)	 
-	movups	48(%esi), %xmm3
-	movntps	%xmm3, 48(%edi)
-	addl	$64, %esi
-	addl	$64, %edi
-	decl	%edx
-	jnz	.sse_da_nt_loop
-#if defined(_SSE2_INSN)
-	mfence
-#elif defined(_SSE_INSN)
-	sfence
-#else
-#error "Must have either SSE or SSE2"
-#endif
-	jmp	.sse_cleanup
-	/
-	/ use unaligned load since source doesn't line up
-	/
-	.align	16
-.sse_da_loop:
-	prefetcht0 568(%esi)	/ prefetch source & copy 64 byte at a time
-	prefetcht0 568(%edi)
-	movups	0(%esi), %xmm0
-	movaps	%xmm0, 0(%edi)	 
-	movups	16(%esi), %xmm1
-	movaps	%xmm1, 16(%edi)
-	movups	32(%esi), %xmm2
-	movaps	%xmm2, 32(%edi)	 
-	movups	48(%esi), %xmm3
-	movaps	%xmm3, 48(%edi)
-	addl	$64, %esi
-	addl	$64, %edi
-	decl	%edx
-	jnz	.sse_da_loop
-	jmp	.sse_cleanup
-	
-	SET_SIZE(memcpy)
-
-
-/ .CopyLeft handles the memmove case where we must perform the copy backwards,
-/ because of overlap between src and dst. This is not particularly optimized.
-
-.CopyLeft:
-	movl	$3,%eax			/ heavily used constant
-	std				/ reverse direction bit (RtoL)
-	cmpl	$12,%ecx		/ if (size < 12)
-	ja	.BigCopyLeft		/ {
-	movl	%edx,%esi		/     src = src + size - 1
-	leal	-1(%ecx,%edi),%edi	/     dst = dst + size - 1
-	rep;	smovb			/    do the byte copy
-	cld				/    reset direction flag to LtoR
-	popl	%edi			/  }
-	popl	%esi			/  restore registers
-	movl	4(%esp),%eax		/  set up return value
-	ret				/  return(dba);
-.BigCopyLeft:				/ } else {
-	xchgl	%edx,%ecx
-	movl	%ecx,%esi		/ align source w/byte copy
-	leal	-1(%edx,%edi),%edi
-	andl	%eax,%ecx
-	jz	.SkipAlignLeft
-	addl	$1, %ecx		/ we need to insure that future
-	subl	%ecx,%edx		/ copy is done on aligned boundary
-	rep;	smovb
-.SkipAlignLeft:
-	movl	%edx,%ecx	
-	subl	%eax,%esi
-	shrl	$2,%ecx			/ do 4 byte copy RtoL
-	subl	%eax,%edi
-	rep;	smovl
-	andl	%eax,%edx		/ do 1 byte copy whats left
-	jz	.CleanupReturnLeft
-	movl	%edx,%ecx	
-	addl	%eax,%esi		/ rep; smovl instruction will decrement
-	addl	%eax,%edi		/ %edi, %esi by four after each copy
-					/ adding 3 will restore pointers to byte
-					/ before last double word copied
-					/ which is where they are expected to
-					/ be for the single byte copy code
-	rep;	smovb
-.CleanupReturnLeft:
-	cld				/ reset direction flag to LtoR
-	popl	%edi
-	popl	%esi			/ restore registers
-	movl	4(%esp),%eax		/ set up return value
-	ret				/ return(dba);
-	SET_SIZE(memmove)
--- /dev/null	Mon Jun 12 08:24:31 2017
+++ new/usr/src/lib/libc/capabilities/i386/common/memcpy.s	Mon Jun 12 08:24:34 2017
@@ -0,0 +1,276 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
+
+	.file	"memcpy.s"
+
+#include <sys/asm_linkage.h>
+
+	ANSI_PRAGMA_WEAK(memmove,function)
+	ANSI_PRAGMA_WEAK(memcpy,function)
+
+	ENTRY(memmove)
+	movl	0+12(%esp),%ecx	/ get number of bytes to move
+	pushl	%esi		/ save off %edi, %esi and move destination
+	pushl	%edi
+	movl	8+ 4(%esp),%edi	/ destination buffer address
+	movl	8+ 8(%esp),%esi	/ source buffer address
+	movl	%edi, %eax
+	testl	%ecx,%ecx
+	jz	.Return
+
+	cmpl	%esi,%edi	/ if (source addr > dest addr)
+	leal	-1(%esi,%ecx),%edx	/ %edx = src + size - 1
+	jbe	.memcpy_post	/ jump if dst <= src
+	cmpl	%edx,%edi
+	jbe	.CopyLeft	/ jump if dst <= src + size - 1
+	jmp	.memcpy_post
+
+	ENTRY(memcpy)
+	pushl	%esi
+	pushl	%edi
+
+	movl	8+4(%esp),%edi	/ %edi = dest address
+	movl	%edi, %eax	/ save this
+	movl	8+8(%esp),%esi	/ %esi = source address
+	movl	8+12(%esp),%ecx/ %ecx = length of string
+				/ %edx scratch register
+				/ %eax scratch register
+.memcpy_post:
+	nop			/ this really helps, don't know why
+				/ note:	cld is perf death on P4
+	cmpl	$63,%ecx
+	ja	.move_sse	/ not worth doing sse for less
+
+.movew:
+	movl	%ecx,%edx	/ save byte cnt
+	shrl	$2,%ecx		/ %ecx = number of words to move
+	rep ; smovl		/ move the words
+
+
+	andl	$0x3,%edx	/ %edx = number of bytes left to move
+	jz	.Return		/ %edx <= 3, so just unroll the loop
+
+	movb	(%esi), %cl
+	movb	%cl, (%edi)
+	decl	%edx
+	jz	.Return
+	movb	1(%esi), %cl
+	movb	%cl, 1(%edi)
+	decl	%edx
+	jz	.Return
+	movb	2(%esi), %cl
+	movb	%cl, 2(%edi)
+
+.Return:
+	popl	%edi		/ restore register variables
+	popl	%esi
+	ret
+
+.move_sse:
+	/
+	/ time to 16 byte align destination
+	/
+	andl	$15, %eax
+	jnz	.sse_unaligned	/ jmp if dest is unaligned
+.sse:				/ dest is aligned, check source
+	movl	%ecx, %edx	/ get byte count
+	shrl	$6, %edx	/ number of 64 byte blocks to move
+	testl	$15, %esi
+	jnz	.sse_da		/ go to slow loop if source is unaligned
+	cmpl	$65535, %ecx
+	ja	.sse_sa_nt_loop
+
+	/
+	/ use aligned load since we're lucky
+	/
+.sse_sa_loop:
+	prefetcht0 568(%esi)	/ prefetch source & copy 64 byte at a time
+	prefetcht0 568(%edi)	/ prefetch source & copy 64 byte at a time
+	movaps	0(%esi), %xmm0
+	movaps	%xmm0, 0(%edi)
+	movaps	16(%esi), %xmm1
+	movaps	%xmm1, 16(%edi)
+	movaps	32(%esi), %xmm2
+	movaps	%xmm2, 32(%edi)
+	movaps	48(%esi), %xmm3
+	movaps	%xmm3, 48(%edi)
+	addl	$64, %esi
+	addl	$64, %edi
+	decl	%edx
+	jnz	.sse_sa_loop
+
+.sse_cleanup:
+	andl	$63, %ecx	/ compute remaining bytes
+	movl	8+4(%esp), %eax	/ setup return value
+	jz	.Return
+	jmp	.movew
+
+	/
+	/ use aligned load since we're lucky
+	/
+	.align 16
+.sse_sa_nt_loop:
+	prefetchnta 16384(%esi)	/ prefetch source & copy 64 byte at a time
+	movaps	(%esi), %xmm0
+	movntps	%xmm0, 0(%edi)
+	movaps	16(%esi), %xmm1
+	movntps	%xmm1, 16(%edi)
+	movaps	32(%esi), %xmm2
+	movntps	%xmm2, 32(%edi)
+	movaps	48(%esi), %xmm3
+	movntps	%xmm3, 48(%edi)
+	addl	$64, %esi
+	addl	$64, %edi
+	decl	%edx
+	jnz	.sse_sa_nt_loop
+#if defined(_SSE2_INSN)
+	mfence
+#elif defined(_SSE_INSN)
+	sfence
+#else
+#error "Must have either SSE or SSE2"
+#endif
+	jmp	.sse_cleanup
+
+	/
+	/ Make certain that destination buffer becomes aligned
+	/
+.sse_unaligned:
+	neg	%eax		/ subtract from 16 and get destination
+	andl	$15, %eax	/ aligned on a 16 byte boundary
+	movl	%ecx, %edx	/ saved count
+	subl	%eax, %ecx	/ subtract from byte count
+	cmpl	$64, %ecx	/ after aligning, will we still have 64 bytes?
+	cmovb	%edx, %ecx	/ if not, restore original byte count,
+	cmovb	8+4(%esp), %eax	/ and restore return value,
+	jb	.movew		/ and do a non-SSE move.
+	xchg	%ecx, %eax	/ flip for copy
+	rep ; smovb		/ move the bytes
+	xchg	%ecx, %eax	/ flip back
+	jmp	.sse
+
+	.align 16
+.sse_da:
+	cmpl	$65535, %ecx
+	jbe	.sse_da_loop
+
+	/
+	/ use unaligned load since source doesn't line up
+	/
+.sse_da_nt_loop:
+	prefetchnta 16384(%esi)	/ prefetch source & copy 64 byte at a time
+	movups	0(%esi), %xmm0
+	movntps	%xmm0, 0(%edi)
+	movups	16(%esi), %xmm1
+	movntps	%xmm1, 16(%edi)
+	movups	32(%esi), %xmm2
+	movntps	%xmm2, 32(%edi)
+	movups	48(%esi), %xmm3
+	movntps	%xmm3, 48(%edi)
+	addl	$64, %esi
+	addl	$64, %edi
+	decl	%edx
+	jnz	.sse_da_nt_loop
+#if defined(_SSE2_INSN)
+	mfence
+#elif defined(_SSE_INSN)
+	sfence
+#else
+#error "Must have either SSE or SSE2"
+#endif
+	jmp	.sse_cleanup
+	/
+	/ use unaligned load since source doesn't line up
+	/
+	.align	16
+.sse_da_loop:
+	prefetcht0 568(%esi)	/ prefetch source & copy 64 byte at a time
+	prefetcht0 568(%edi)
+	movups	0(%esi), %xmm0
+	movaps	%xmm0, 0(%edi)
+	movups	16(%esi), %xmm1
+	movaps	%xmm1, 16(%edi)
+	movups	32(%esi), %xmm2
+	movaps	%xmm2, 32(%edi)
+	movups	48(%esi), %xmm3
+	movaps	%xmm3, 48(%edi)
+	addl	$64, %esi
+	addl	$64, %edi
+	decl	%edx
+	jnz	.sse_da_loop
+	jmp	.sse_cleanup
+
+	SET_SIZE(memcpy)
+
+
+/ .CopyLeft handles the memmove case where we must perform the copy backwards,
+/ because of overlap between src and dst. This is not particularly optimized.
+
+.CopyLeft:
+	movl	$3,%eax			/ heavily used constant
+	std				/ reverse direction bit (RtoL)
+	cmpl	$12,%ecx		/ if (size < 12)
+	ja	.BigCopyLeft		/ {
+	movl	%edx,%esi		/     src = src + size - 1
+	leal	-1(%ecx,%edi),%edi	/     dst = dst + size - 1
+	rep;	smovb			/    do the byte copy
+	cld				/    reset direction flag to LtoR
+	popl	%edi			/  }
+	popl	%esi			/  restore registers
+	movl	4(%esp),%eax		/  set up return value
+	ret				/  return(dba);
+.BigCopyLeft:				/ } else {
+	xchgl	%edx,%ecx
+	movl	%ecx,%esi		/ align source w/byte copy
+	leal	-1(%edx,%edi),%edi
+	andl	%eax,%ecx
+	jz	.SkipAlignLeft
+	addl	$1, %ecx		/ we need to insure that future
+	subl	%ecx,%edx		/ copy is done on aligned boundary
+	rep;	smovb
+.SkipAlignLeft:
+	movl	%edx,%ecx
+	subl	%eax,%esi
+	shrl	$2,%ecx			/ do 4 byte copy RtoL
+	subl	%eax,%edi
+	rep;	smovl
+	andl	%eax,%edx		/ do 1 byte copy whats left
+	jz	.CleanupReturnLeft
+	movl	%edx,%ecx
+	addl	%eax,%esi		/ rep; smovl instruction will decrement
+	addl	%eax,%edi		/ %edi, %esi by four after each copy
+					/ adding 3 will restore pointers to byte
+					/ before last double word copied
+					/ which is where they are expected to
+					/ be for the single byte copy code
+	rep;	smovb
+.CleanupReturnLeft:
+	cld				/ reset direction flag to LtoR
+	popl	%edi
+	popl	%esi			/ restore registers
+	movl	4(%esp),%eax		/ set up return value
+	ret				/ return(dba);
+	SET_SIZE(memmove)
--- old/usr/src/lib/libc/i386_hwcap1/gen/memset.s	Mon Jun 12 08:24:36 2017
+++ /dev/null	Mon Jun 12 08:24:31 2017
@@ -1,186 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-	.file	"memset.s"
-
-#include <sys/asm_linkage.h>
-
-	ANSI_PRAGMA_WEAK(memset,function)
-
-	ENTRY(memset)
-	pushl	%edi		/ save register variable
-	movl	8(%esp),%edi	/ %edi = string address
-	movl	12(%esp),%eax	/ %al = byte to duplicate
-	movl	16(%esp),%ecx	/ %ecx = number of copies
-
-	/ For all basic blocks in this routine, maintain the following
-	/ entry conditions:	%eax each byte is set to desired byte.
-	/			NOTE: .byteset doesn't require this
-	/			%ecx contains # bytes to set
-	/			%edi contain address to set
-
-	cld			/ make sure we go the right way...
-	cmpl	$20,%ecx	/ strings with fewer than 20 chars should be byte set
-	jbe	.byteset	
-
-	andl	$0xff, %eax	/ trim anything above low byte
-	imul	$0x01010101, %eax	/ extend low byte to each byte
-	
-	cmpl	$256, %ecx	/ smaller areas don't benefit from alignment
-	jbe	.wordset
-
-	cmpl	$511, %ecx	/ areas smaller than this should be wordset
-	jbe	.check_wordset	
-
-	/
-	/ prep work for sse temporal and non-temporal
-	/
-
-	pushl	%ebx		/ more registers are needed
-	pushl	%esi		/ for alignment work
-
-	/
-	/ align address to 64 byte boundaries.
-	/
-
-	movl	%ecx, %ebx	/ save byte count
-	movl	%edi, %esi	/ esi is scratch register
-	andl	$63, %esi	/ bytes to align to 64 byte align addr
-	neg	%esi		/ compute count of bytes 
-	addl	$64, %esi	/ needed to align
-	andl	$63, %esi	/ to 64 byte align addr
-	jz	.sse_aligned	/ skip alignment if not needed
-	subl	%esi, %ebx	/ ebx contains remainder of bytes to set
-	movl	%esi, %ecx	/ alignment bytes
-	shrl	$2,%ecx		/ %ecx = number of words to set
-	rep; sstol
-	movl	%esi,%ecx
-	andl	$3,%ecx		/ %ecx = number of bytes left
-	rep; sstob
-	movl	%ebx, %ecx	/ remainder to be set
-
-.sse_aligned:
-	
-	shr	$6, %ecx	/ number of 64 byte blocks to set
-
-	/
-	/ load xmm0 with bytes to be set
-	/
-	subl	$16,%esp	/ give ourselves some working room on the stack
-	movl	%eax,(%esp)	/ copy eax into each of 4 bytes
-	movl	%eax,4(%esp)	/ avoid pushl since it causes more interlocking
-	movl	%eax,8(%esp)	/
-	movl	%eax,12(%esp)	/
-	movups	(%esp), %xmm0	/ unaligned load from stack into xmm0
-	addl	$16,%esp	/ restore stack position
-	
-	cmpl	$262143, %ebx	/ blocks smaller than this allocate in the cache
-	jbe	.sse_loop
-	jmp	.sse_nt_loop	/ branch across alignment nops
-		
-	.align 16
-
-.sse_nt_loop:	
-	movntps %xmm0, (%edi)	/ block non-temporal store
-	movntps %xmm0, 16(%edi)	/ use sse rather than sse2
-	movntps %xmm0, 32(%edi)	/ so we work more places
-	movntps %xmm0, 48(%edi)	/
-
-	addl	$64, %edi	/ increment dest address
-	dec	%ecx		/ dec count of blocks
-	jnz	.sse_nt_loop	/ jump if not done
-
-	andl	$63, %ebx	/ remainder of bytes to copy
-	movl	%ebx, %ecx	/ ecx contains remainer of bytes to set
-	popl	%esi		/ restore stack config
-	popl	%ebx		/
-#if defined(_SSE2_INSN)
-	mfence
-#elif defined(_SSE_INSN)
-	sfence
-#else
-#error "Must have either SSE or SSE2"
-#endif
-	cmpl	$20, %ecx	/ compare and jump accordingly
-	jbe	.byteset
-	jmp	.wordset	
-
-	.align 16
-.sse_loop:
- 	movaps %xmm0, (%edi)	/ block copy w/ SSE
-	movaps %xmm0, 16(%edi)
-	movaps %xmm0, 32(%edi)
-	movaps %xmm0, 48(%edi)
-
-	addl	$64, %edi	/ increment addr
-	dec	%ecx		/ dec count of blocks
-	jnz	.sse_loop	/ jump if not done
-
-	andl	$63, %ebx	/ remainder of bytes to copy
-	movl	%ebx, %ecx	/ in %ecx as normal
-	popl	%esi		/ restore stack config
-	popl	%ebx		/
-	cmpl	$20, %ecx	
-	jbe	.byteset
-	jmp	.wordset
-
-.check_wordset:
-	movl	%edi, %edx	/ save current store ptr
-	andl	$7, %edi	/ check alignment
-	movl	%edx,%edi	/ %edi = string address
-	jz	.wordset	/ all ok 
-	
-
-.align_wordset:	
-	pushl	%ebx		/ more registers are needed
-	pushl	%esi		
-
-	movl	%ecx, %ebx
-	movl	%edi, %esi
-	andl	$7, %esi
-	neg	%esi
-	addl	$8, %esi
-	andl	$7, %esi
-	subl	%esi, %ebx	/ ebx contains remainder of bytes to copy
-	movl	%esi, %ecx
-	rep; sstob	 
-	movl	%ebx, %ecx
-	popl	%esi		/ restore stack config
-	popl	%ebx		/
-
-.wordset:
-	movl	%ecx, %edx	/ save cont
-	shrl	$2,%ecx		/ %ecx = number of words to set
-	rep; sstol
-	movl	%edx,%ecx
-	andl	$3,%ecx		/ %ecx = number of bytes left
-
-.byteset:
-	rep; sstob
-	movl	8(%esp),%eax	/ return string address
-	popl	%edi		/ restore register variable
-	ret
-	SET_SIZE(memset)
--- /dev/null	Mon Jun 12 08:24:31 2017
+++ new/usr/src/lib/libc/capabilities/i386/common/memset.s	Mon Jun 12 08:24:36 2017
@@ -0,0 +1,187 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
+
+	.file	"memset.s"
+
+#include <sys/asm_linkage.h>
+
+	ANSI_PRAGMA_WEAK(memset,function)
+
+	ENTRY(memset)
+	pushl	%edi		/ save register variable
+	movl	8(%esp),%edi	/ %edi = string address
+	movl	12(%esp),%eax	/ %al = byte to duplicate
+	movl	16(%esp),%ecx	/ %ecx = number of copies
+
+	/ For all basic blocks in this routine, maintain the following
+	/ entry conditions:	%eax each byte is set to desired byte.
+	/			NOTE: .byteset doesn't require this
+	/			%ecx contains # bytes to set
+	/			%edi contain address to set
+
+	cld			/ make sure we go the right way...
+	cmpl	$20,%ecx	/ strings with fewer than 20 chars should be
+				/ byte set
+	jbe	.byteset
+
+	andl	$0xff, %eax	/ trim anything above low byte
+	imul	$0x01010101, %eax	/ extend low byte to each byte
+
+	cmpl	$256, %ecx	/ smaller areas don't benefit from alignment
+	jbe	.wordset
+
+	cmpl	$511, %ecx	/ areas smaller than this should be wordset
+	jbe	.check_wordset
+
+	/
+	/ prep work for sse temporal and non-temporal
+	/
+
+	pushl	%ebx		/ more registers are needed
+	pushl	%esi		/ for alignment work
+
+	/
+	/ align address to 64 byte boundaries.
+	/
+
+	movl	%ecx, %ebx	/ save byte count
+	movl	%edi, %esi	/ esi is scratch register
+	andl	$63, %esi	/ bytes to align to 64 byte align addr
+	neg	%esi		/ compute count of bytes
+	addl	$64, %esi	/ needed to align
+	andl	$63, %esi	/ to 64 byte align addr
+	jz	.sse_aligned	/ skip alignment if not needed
+	subl	%esi, %ebx	/ ebx contains remainder of bytes to set
+	movl	%esi, %ecx	/ alignment bytes
+	shrl	$2,%ecx		/ %ecx = number of words to set
+	rep; sstol
+	movl	%esi,%ecx
+	andl	$3,%ecx		/ %ecx = number of bytes left
+	rep; sstob
+	movl	%ebx, %ecx	/ remainder to be set
+
+.sse_aligned:
+
+	shr	$6, %ecx	/ number of 64 byte blocks to set
+
+	/
+	/ load xmm0 with bytes to be set
+	/
+	subl	$16,%esp	/ give ourselves some working room on the stack
+	movl	%eax,(%esp)	/ copy eax into each of 4 bytes
+	movl	%eax,4(%esp)	/ avoid pushl since it causes more interlocking
+	movl	%eax,8(%esp)	/
+	movl	%eax,12(%esp)	/
+	movups	(%esp), %xmm0	/ unaligned load from stack into xmm0
+	addl	$16,%esp	/ restore stack position
+
+	cmpl	$262143, %ebx	/ blocks smaller than this allocate in the cache
+	jbe	.sse_loop
+	jmp	.sse_nt_loop	/ branch across alignment nops
+
+	.align 16
+
+.sse_nt_loop:
+	movntps %xmm0, (%edi)	/ block non-temporal store
+	movntps %xmm0, 16(%edi)	/ use sse rather than sse2
+	movntps %xmm0, 32(%edi)	/ so we work more places
+	movntps %xmm0, 48(%edi)	/
+
+	addl	$64, %edi	/ increment dest address
+	dec	%ecx		/ dec count of blocks
+	jnz	.sse_nt_loop	/ jump if not done
+
+	andl	$63, %ebx	/ remainder of bytes to copy
+	movl	%ebx, %ecx	/ ecx contains remainer of bytes to set
+	popl	%esi		/ restore stack config
+	popl	%ebx		/
+#if defined(_SSE2_INSN)
+	mfence
+#elif defined(_SSE_INSN)
+	sfence
+#else
+#error "Must have either SSE or SSE2"
+#endif
+	cmpl	$20, %ecx	/ compare and jump accordingly
+	jbe	.byteset
+	jmp	.wordset
+
+	.align 16
+.sse_loop:
+ 	movaps %xmm0, (%edi)	/ block copy w/ SSE
+	movaps %xmm0, 16(%edi)
+	movaps %xmm0, 32(%edi)
+	movaps %xmm0, 48(%edi)
+
+	addl	$64, %edi	/ increment addr
+	dec	%ecx		/ dec count of blocks
+	jnz	.sse_loop	/ jump if not done
+
+	andl	$63, %ebx	/ remainder of bytes to copy
+	movl	%ebx, %ecx	/ in %ecx as normal
+	popl	%esi		/ restore stack config
+	popl	%ebx		/
+	cmpl	$20, %ecx
+	jbe	.byteset
+	jmp	.wordset
+
+.check_wordset:
+	movl	%edi, %edx	/ save current store ptr
+	andl	$7, %edi	/ check alignment
+	movl	%edx,%edi	/ %edi = string address
+	jz	.wordset	/ all ok
+
+
+.align_wordset:
+	pushl	%ebx		/ more registers are needed
+	pushl	%esi
+
+	movl	%ecx, %ebx
+	movl	%edi, %esi
+	andl	$7, %esi
+	neg	%esi
+	addl	$8, %esi
+	andl	$7, %esi
+	subl	%esi, %ebx	/ ebx contains remainder of bytes to copy
+	movl	%esi, %ecx
+	rep; sstob
+	movl	%ebx, %ecx
+	popl	%esi		/ restore stack config
+	popl	%ebx		/
+
+.wordset:
+	movl	%ecx, %edx	/ save cont
+	shrl	$2,%ecx		/ %ecx = number of words to set
+	rep; sstol
+	movl	%edx,%ecx
+	andl	$3,%ecx		/ %ecx = number of bytes left
+
+.byteset:
+	rep; sstob
+	movl	8(%esp),%eax	/ return string address
+	popl	%edi		/ restore register variable
+	ret
+	SET_SIZE(memset)
--- old/usr/src/lib/libc/i386/Makefile	Mon Jun 12 08:24:38 2017
+++ new/usr/src/lib/libc/i386/Makefile	Mon Jun 12 08:24:38 2017
@@ -19,27 +19,1334 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2016 Joyent, Inc.
+# Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
+# Copyright 2013 Garrett D'Amore <garrett@damore.org>
+#
+# Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
+
+LIBCBASE=	.
+LIBRARY=	libc.a
+LIBCDIR=	$(SRC)/lib/libc
+LIB_PIC=	libc_pic.a
+VERS=		.1
+CPP=		/usr/lib/cpp
+TARGET_ARCH=	i386
+
+# include comm page definitions
+include $(SRC)/lib/commpage/Makefile.shared.com
+include $(SRC)/lib/commpage/Makefile.shared.targ
+
+VALUES=		values-Xa.o
+
+# objects are grouped by source directory
+
+# Symbol capabilities objects.
+EXTPICS= \
+	$(LIBCDIR)/capabilities/i386-hwcap1/pics/symcap.o \
+	$(LIBCDIR)/capabilities/i386-hwcap2/pics/symcap.o \
+	$(LIBCDIR)/capabilities/i386-hwcap3/pics/symcap.o
+
+# local objects
+STRETS=
+
+CRTOBJS=			\
+	cerror.o		\
+	cerror64.o
+
+DYNOBJS=			\
+	_rtbootld.o
+
+FPOBJS=				\
+	_D_cplx_div.o		\
+	_D_cplx_div_ix.o	\
+	_D_cplx_div_rx.o	\
+	_D_cplx_lr_div.o	\
+	_D_cplx_lr_div_ix.o	\
+	_D_cplx_lr_div_rx.o	\
+	_D_cplx_mul.o		\
+	_F_cplx_div.o		\
+	_F_cplx_div_ix.o	\
+	_F_cplx_div_rx.o	\
+	_F_cplx_lr_div.o	\
+	_F_cplx_lr_div_ix.o	\
+	_F_cplx_lr_div_rx.o	\
+	_F_cplx_mul.o		\
+	_X_cplx_div.o		\
+	_X_cplx_div_ix.o	\
+	_X_cplx_div_rx.o	\
+	_X_cplx_lr_div.o	\
+	_X_cplx_lr_div_ix.o	\
+	_X_cplx_lr_div_rx.o	\
+	_X_cplx_mul.o		\
+	fpgetmask.o		\
+	fpgetround.o		\
+	fpgetsticky.o		\
+	fpsetmask.o		\
+	fpsetround.o		\
+	fpsetsticky.o		\
+	fpstart.o		\
+	ieee.o
+
+FPASMOBJS=			\
+	__xgetRD.o		\
+	_base_il.o		\
+	_xtoll.o		\
+	_xtoull.o		\
+	fpcw.o
+
+ATOMICOBJS=			\
+	atomic.o
+
+CHACHAOBJS=			\
+	chacha.o
+
+XATTROBJS=			\
+	xattr_common.o
+
+COMOBJS=			\
+	bcmp.o			\
+	bcopy.o			\
+	bsearch.o		\
+	bzero.o			\
+	qsort.o			\
+	strtol.o		\
+	strtoul.o		\
+	strtoll.o		\
+	strtoull.o
+
+DTRACEOBJS=			\
+	dtrace_data.o
+
+SECFLAGSOBJS=			\
+	secflags.o
+
+GENOBJS=			\
+	$(COMMPAGE_OBJS)	\
+	_div64.o		\
+	_divdi3.o		\
+	_getsp.o		\
+	_mul64.o		\
+	abs.o			\
+	alloca.o		\
+	arc4random.o		\
+	arc4random_uniform.o	\
+	byteorder.o		\
+	byteorder64.o		\
+	cuexit.o		\
+	ecvt.o			\
+	endian.o		\
+	errlst.o		\
+	i386_data.o		\
+	ladd.o			\
+	ldivide.o		\
+	lmul.o			\
+	lock.o			\
+	lshiftl.o		\
+	lsign.o			\
+	lsub.o			\
+	makectxt.o		\
+	memccpy.o		\
+	memchr.o		\
+	memcmp.o		\
+	memcpy.o		\
+	memset.o		\
+	new_list.o		\
+	setjmp.o		\
+	siginfolst.o		\
+	siglongjmp.o		\
+	strcat.o		\
+	strchr.o		\
+	strcmp.o		\
+	strcpy.o		\
+	strlen.o		\
+	strncat.o		\
+	strncmp.o		\
+	strncpy.o		\
+	strnlen.o		\
+	strrchr.o		\
+	sync_instruction_memory.o
+
+# sysobjs that contain large-file interfaces
+COMSYSOBJS64=			\
+	fstatvfs64.o		\
+	getdents64.o		\
+	getrlimit64.o		\
+	lseek64.o		\
+	mmap64.o		\
+	pread64.o		\
+	preadv64.o		\
+	pwrite64.o		\
+	pwritev64.o		\
+	setrlimit64.o		\
+	statvfs64.o
+
+SYSOBJS64=
+
+COMSYSOBJS=			\
+	__clock_timer.o		\
+	__getloadavg.o		\
+	__rusagesys.o		\
+	__signotify.o		\
+	__sigrt.o		\
+	__time.o		\
+	_lgrp_home_fast.o	\
+	_lgrpsys.o		\
+	_nfssys.o		\
+	_portfs.o		\
+	_pset.o			\
+	_rpcsys.o		\
+	_sigaction.o		\
+	_so_accept.o		\
+	_so_bind.o		\
+	_so_connect.o		\
+	_so_getpeername.o	\
+	_so_getsockname.o	\
+	_so_getsockopt.o	\
+	_so_listen.o		\
+	_so_recv.o		\
+	_so_recvfrom.o		\
+	_so_recvmsg.o		\
+	_so_send.o		\
+	_so_sendmsg.o		\
+	_so_sendto.o		\
+	_so_setsockopt.o	\
+	_so_shutdown.o		\
+	_so_socket.o		\
+	_so_socketpair.o	\
+	_sockconfig.o		\
+	acct.o			\
+	acl.o			\
+	adjtime.o		\
+	alarm.o			\
+	brk.o			\
+	chdir.o			\
+	chroot.o		\
+	cladm.o			\
+	close.o			\
+	execve.o		\
+	exit.o			\
+	facl.o			\
+	fchdir.o		\
+	fchroot.o		\
+	fdsync.o		\
+	fpathconf.o		\
+	fstatfs.o		\
+	fstatvfs.o		\
+	getcpuid.o		\
+	getdents.o		\
+	getegid.o		\
+	geteuid.o		\
+	getgid.o		\
+	getgroups.o		\
+	gethrtime.o		\
+	getitimer.o		\
+	getmsg.o		\
+	getpid.o		\
+	getpmsg.o		\
+	getppid.o		\
+	getrandom.o		\
+	getrlimit.o		\
+	getuid.o		\
+	gtty.o			\
+	install_utrap.o		\
+	ioctl.o			\
+	kaio.o			\
+	kill.o			\
+	llseek.o		\
+	lseek.o			\
+	mmapobjsys.o		\
+	memcntl.o		\
+	mincore.o		\
+	mmap.o			\
+	modctl.o		\
+	mount.o			\
+	mprotect.o		\
+	munmap.o		\
+	nice.o			\
+	ntp_adjtime.o		\
+	ntp_gettime.o		\
+	p_online.o		\
+	pathconf.o		\
+	pause.o			\
+	pcsample.o		\
+	pipe2.o			\
+	pollsys.o		\
+	pread.o			\
+	preadv.o		\
+	priocntlset.o		\
+	processor_bind.o	\
+	processor_info.o	\
+	profil.o		\
+	psecflagsset.o		\
+	putmsg.o		\
+	putpmsg.o		\
+	pwrite.o		\
+	pwritev.o		\
+	read.o			\
+	readv.o			\
+	resolvepath.o		\
+	seteguid.o		\
+	setgid.o		\
+	setgroups.o		\
+	setitimer.o		\
+	setreid.o		\
+	setrlimit.o		\
+	setuid.o		\
+	sigaltstk.o		\
+	sigprocmsk.o		\
+	sigsendset.o		\
+	sigsuspend.o		\
+	statfs.o		\
+	statvfs.o		\
+	stty.o			\
+	sync.o			\
+	sysconfig.o		\
+	sysfs.o			\
+	sysinfo.o		\
+	syslwp.o		\
+	times.o			\
+	ulimit.o		\
+	umask.o			\
+	umount2.o		\
+	utssys.o		\
+	uucopy.o		\
+	vhangup.o		\
+	waitid.o		\
+	write.o			\
+	writev.o		\
+	yield.o
+
+SYSOBJS=			\
+	__clock_gettime.o	\
+	__clock_gettime_sys.o	\
+	__getcontext.o		\
+	__uadmin.o		\
+	_lwp_mutex_unlock.o	\
+	_stack_grow.o		\
+	door.o			\
+	forkx.o			\
+	forkallx.o		\
+	getcontext.o		\
+	gettimeofday.o		\
+	lwp_private.o		\
+	nuname.o		\
+	ptrace.o		\
+	syscall.o		\
+	sysi86.o		\
+	tls_get_addr.o		\
+	uadmin.o		\
+	umount.o		\
+	uname.o			\
+	vforkx.o		\
+	xstat.o
+
+# objects under $(LIBCDIR)/port which contain transitional large file interfaces
+PORTGEN64=			\
+	_xftw64.o		\
+	attropen64.o		\
+	ftw64.o			\
+	mkstemp64.o		\
+	nftw64.o		\
+	tell64.o		\
+	truncate64.o
+
+# objects from source under $(LIBCDIR)/port
+PORTFP=				\
+	__flt_decim.o		\
+	__flt_rounds.o		\
+	__tbl_10_b.o		\
+	__tbl_10_h.o		\
+	__tbl_10_s.o		\
+	__tbl_2_b.o		\
+	__tbl_2_h.o		\
+	__tbl_2_s.o		\
+	__tbl_fdq.o		\
+	__tbl_tens.o		\
+	__x_power.o		\
+	_base_sup.o		\
+	aconvert.o		\
+	decimal_bin.o		\
+	double_decim.o		\
+	econvert.o		\
+	fconvert.o		\
+	file_decim.o		\
+	finite.o		\
+	fp_data.o		\
+	func_decim.o		\
+	gconvert.o		\
+	hex_bin.o		\
+	ieee_globals.o		\
+	pack_float.o		\
+	sigfpe.o		\
+	string_decim.o
+
+PORTGEN=			\
+	_env_data.o		\
+	_xftw.o			\
+	a64l.o			\
+	abort.o			\
+	addsev.o		\
+	ascii_strcasecmp.o	\
+	ascii_strncasecmp.o	\
+	assert.o		\
+	atof.o			\
+	atoi.o			\
+	atol.o			\
+	atoll.o			\
+	attrat.o		\
+	attropen.o		\
+	atexit.o		\
+	atfork.o		\
+	basename.o		\
+	calloc.o		\
+	catgets.o		\
+	catopen.o		\
+	cfgetispeed.o		\
+	cfgetospeed.o		\
+	cfree.o			\
+	cfsetispeed.o		\
+	cfsetospeed.o		\
+	cftime.o		\
+	clock.o			\
+	closedir.o		\
+	closefrom.o		\
+	confstr.o		\
+	crypt.o			\
+	csetlen.o		\
+	ctime.o			\
+	ctime_r.o		\
+	daemon.o		\
+	deflt.o			\
+	directio.o		\
+	dirname.o		\
+	div.o			\
+	drand48.o		\
+	dup.o			\
+	env_data.o		\
+	err.o			\
+	errno.o			\
+	euclen.o		\
+	event_port.o		\
+	execvp.o		\
+	explicit_bzero.o	\
+	fattach.o		\
+	fdetach.o		\
+	fdopendir.o		\
+	ffs.o			\
+	flock.o			\
+	fls.o			\
+	fmtmsg.o		\
+	ftime.o			\
+	ftok.o			\
+	ftw.o			\
+	gcvt.o			\
+	getauxv.o		\
+	getcwd.o		\
+	getdate_err.o		\
+	getdtblsize.o		\
+	getentropy.o		\
+	getenv.o		\
+	getexecname.o		\
+	getgrnam.o		\
+	getgrnam_r.o		\
+	gethostid.o		\
+	gethostname.o		\
+	gethz.o			\
+	getisax.o		\
+	getloadavg.o		\
+	getlogin.o		\
+	getmntent.o		\
+	getnetgrent.o		\
+	get_nprocs.o		\
+	getopt.o		\
+	getopt_long.o		\
+	getpagesize.o		\
+	getpw.o			\
+	getpwnam.o		\
+	getpwnam_r.o		\
+	getrusage.o		\
+	getspent.o		\
+	getspent_r.o		\
+	getsubopt.o		\
+	gettxt.o		\
+	getusershell.o		\
+	getut.o			\
+	getutx.o		\
+	getvfsent.o		\
+	getwd.o			\
+	getwidth.o		\
+	getxby_door.o		\
+	gtxt.o			\
+	hsearch.o		\
+	iconv.o			\
+	imaxabs.o		\
+	imaxdiv.o		\
+	index.o			\
+	initgroups.o		\
+	insque.o		\
+	isaexec.o		\
+	isastream.o		\
+	isatty.o		\
+	killpg.o		\
+	klpdlib.o		\
+	l64a.o			\
+	lckpwdf.o		\
+	lconstants.o		\
+	lexp10.o		\
+	lfind.o			\
+	lfmt.o			\
+	lfmt_log.o		\
+	llabs.o			\
+	lldiv.o			\
+	llog10.o		\
+	lltostr.o		\
+	localtime.o		\
+	lsearch.o		\
+	madvise.o		\
+	malloc.o		\
+	memalign.o		\
+	memmem.o		\
+	mkdev.o			\
+	mkdtemp.o		\
+	mkfifo.o		\
+	mkstemp.o		\
+	mktemp.o		\
+	mlock.o			\
+	mlockall.o		\
+	mon.o			\
+	msync.o			\
+	munlock.o		\
+	munlockall.o		\
+	ndbm.o			\
+	nftw.o			\
+	nlspath_checks.o	\
+	nsparse.o		\
+	nss_common.o		\
+	nss_dbdefs.o		\
+	nss_deffinder.o		\
+	opendir.o		\
+	opt_data.o		\
+	perror.o		\
+	pfmt.o			\
+	pfmt_data.o		\
+	pfmt_print.o		\
+	pipe.o			\
+	plock.o			\
+	poll.o			\
+	posix_fadvise.o		\
+	posix_fallocate.o	\
+	posix_madvise.o		\
+	posix_memalign.o	\
+	priocntl.o		\
+	privlib.o		\
+	priv_str_xlate.o	\
+	psecflags.o		\
+	psiginfo.o		\
+	psignal.o		\
+	pt.o			\
+	putpwent.o		\
+	putspent.o		\
+	raise.o			\
+	rand.o			\
+	random.o		\
+	rctlops.o		\
+	readdir.o		\
+	readdir_r.o		\
+	realpath.o		\
+	reboot.o		\
+	regexpr.o		\
+	remove.o		\
+	rewinddir.o		\
+	rindex.o		\
+	scandir.o		\
+	seekdir.o		\
+	select.o		\
+	setlabel.o		\
+	setpriority.o		\
+	settimeofday.o		\
+	sh_locks.o		\
+	sigflag.o		\
+	siglist.o		\
+	sigsend.o		\
+	sigsetops.o		\
+	ssignal.o		\
+	stack.o			\
+	stpcpy.o		\
+	stpncpy.o		\
+	str2sig.o		\
+	strcase_charmap.o	\
+	strchrnul.o		\
+	strcspn.o		\
+	strdup.o		\
+	strerror.o		\
+	strlcat.o		\
+	strlcpy.o		\
+	strndup.o		\
+	strpbrk.o		\
+	strsep.o		\
+	strsignal.o		\
+	strspn.o		\
+	strstr.o		\
+	strtod.o		\
+	strtoimax.o		\
+	strtok.o		\
+	strtok_r.o		\
+	strtoumax.o		\
+	swab.o			\
+	swapctl.o		\
+	sysconf.o		\
+	syslog.o		\
+	tcdrain.o		\
+	tcflow.o		\
+	tcflush.o		\
+	tcgetattr.o		\
+	tcgetpgrp.o		\
+	tcgetsid.o		\
+	tcsendbreak.o		\
+	tcsetattr.o		\
+	tcsetpgrp.o		\
+	tell.o			\
+	telldir.o		\
+	tfind.o			\
+	time_data.o		\
+	time_gdata.o		\
+	timespec_get.o		\
+	tls_data.o		\
+	truncate.o		\
+	tsdalloc.o		\
+	tsearch.o		\
+	ttyname.o		\
+	ttyslot.o		\
+	ualarm.o		\
+	ucred.o			\
+	valloc.o		\
+	vlfmt.o			\
+	vpfmt.o			\
+	waitpid.o		\
+	walkstack.o		\
+	wdata.o			\
+	xgetwidth.o		\
+	xpg4.o			\
+	xpg6.o
+
+PORTPRINT_W=			\
+	doprnt_w.o
+
+PORTPRINT=			\
+	asprintf.o		\
+	doprnt.o		\
+	fprintf.o		\
+	printf.o		\
+	snprintf.o		\
+	sprintf.o		\
+	vfprintf.o		\
+	vprintf.o		\
+	vsnprintf.o		\
+	vsprintf.o		\
+	vwprintf.o		\
+	wprintf.o
+
+# c89 variants to support 32-bit size of c89 u/intmax_t (32-bit libc only)
+PORTPRINT_C89=			\
+	vfprintf_c89.o		\
+	vprintf_c89.o		\
+	vsnprintf_c89.o		\
+	vsprintf_c89.o		\
+	vwprintf_c89.o
+
+PORTSTDIO_C89=			\
+	vscanf_c89.o		\
+	vwscanf_c89.o		\
+
+# portable stdio objects that contain large file interfaces.
+# Note: fopen64 is a special case, as we build it small.
+PORTSTDIO64=			\
+	fopen64.o		\
+	fpos64.o
+
+PORTSTDIO_W=			\
+	doscan_w.o
+
+PORTSTDIO=			\
+	__extensions.o		\
+	_endopen.o		\
+	_filbuf.o		\
+	_findbuf.o		\
+	_flsbuf.o		\
+	_wrtchk.o		\
+	clearerr.o		\
+	ctermid.o		\
+	ctermid_r.o		\
+	cuserid.o		\
+	data.o			\
+	doscan.o		\
+	fdopen.o		\
+	feof.o			\
+	ferror.o		\
+	fgetc.o			\
+	fgets.o			\
+	fileno.o		\
+	flockf.o		\
+	flush.o			\
+	fopen.o			\
+	fpos.o			\
+	fputc.o			\
+	fputs.o			\
+	fread.o			\
+	fseek.o			\
+	fseeko.o		\
+	ftell.o			\
+	ftello.o		\
+	fwrite.o		\
+	getc.o			\
+	getchar.o		\
+	getline.o		\
+	getpass.o		\
+	gets.o			\
+	getw.o			\
+	mse.o			\
+	popen.o			\
+	putc.o			\
+	putchar.o		\
+	puts.o			\
+	putw.o			\
+	rewind.o		\
+	scanf.o			\
+	setbuf.o		\
+	setbuffer.o		\
+	setvbuf.o		\
+	system.o		\
+	tempnam.o		\
+	tmpfile.o		\
+	tmpnam_r.o		\
+	ungetc.o		\
+	vscanf.o		\
+	vwscanf.o		\
+	wscanf.o
+
+PORTI18N=			\
+	getwchar.o		\
+	putwchar.o		\
+	putws.o			\
+	strtows.o		\
+	wcsnlen.o		\
+	wcsstr.o		\
+	wcstoimax.o		\
+	wcstol.o		\
+	wcstoul.o		\
+	wcswcs.o		\
+	wmemchr.o		\
+	wmemcmp.o		\
+	wmemcpy.o		\
+	wmemmove.o		\
+	wmemset.o		\
+	wscat.o			\
+	wschr.o			\
+	wscmp.o			\
+	wscpy.o			\
+	wscspn.o		\
+	wsdup.o			\
+	wslen.o			\
+	wsncat.o		\
+	wsncmp.o		\
+	wsncpy.o		\
+	wspbrk.o		\
+	wsprintf.o		\
+	wsrchr.o		\
+	wsscanf.o		\
+	wsspn.o			\
+	wstod.o			\
+	wstok.o			\
+	wstol.o			\
+	wstoll.o		\
+	wsxfrm.o		\
+	gettext.o		\
+	gettext_gnu.o		\
+	gettext_real.o		\
+	gettext_util.o		\
+	plural_parser.o		\
+	wdresolve.o		\
+	_ctype.o		\
+	isascii.o		\
+	toascii.o
+
+PORTI18N_COND=			\
+	wcstol_longlong.o	\
+	wcstoul_longlong.o
+
+PORTLOCALE=			\
+	big5.o			\
+	btowc.o			\
+	collate.o		\
+	collcmp.o		\
+	euc.o			\
+	fnmatch.o		\
+	fgetwc.o		\
+	fgetws.o		\
+	fix_grouping.o		\
+	fputwc.o		\
+	fputws.o		\
+	fwide.o			\
+	gb18030.o		\
+	gb2312.o		\
+	gbk.o			\
+	getdate.o		\
+	isdigit.o		\
+	iswctype.o		\
+	ldpart.o		\
+	lmessages.o		\
+	lnumeric.o		\
+	lmonetary.o		\
+	localeconv.o		\
+	localeimpl.o		\
+	mbftowc.o		\
+	mblen.o			\
+	mbrlen.o		\
+	mbrtowc.o		\
+	mbsinit.o		\
+	mbsnrtowcs.o		\
+	mbsrtowcs.o		\
+	mbstowcs.o		\
+	mbtowc.o		\
+	mskanji.o		\
+	nextwctype.o		\
+	nl_langinfo.o		\
+	none.o			\
+	regcomp.o		\
+	regfree.o		\
+	regerror.o		\
+	regexec.o		\
+	rune.o			\
+	runetype.o		\
+	setlocale.o		\
+	setrunelocale.o		\
+	strcasecmp.o		\
+	strcasestr.o		\
+	strcoll.o		\
+	strfmon.o		\
+	strftime.o		\
+	strncasecmp.o		\
+	strptime.o		\
+	strxfrm.o		\
+	table.o			\
+	timelocal.o		\
+	tolower.o		\
+	towlower.o		\
+	ungetwc.o		\
+	utf8.o			\
+	wcrtomb.o		\
+	wcscasecmp.o		\
+	wcscoll.o		\
+	wcsftime.o		\
+	wcsnrtombs.o		\
+	wcsrtombs.o		\
+	wcswidth.o		\
+	wcstombs.o		\
+	wcsxfrm.o		\
+	wctob.o			\
+	wctomb.o		\
+	wctrans.o		\
+	wctype.o		\
+	wcwidth.o		\
+	wscol.o
+
+AIOOBJS=			\
+	aio.o			\
+	aio_alloc.o		\
+	posix_aio.o
+
+RTOBJS=				\
+	clock_timer.o		\
+	mqueue.o		\
+	pos4obj.o		\
+	sched.o			\
+	sem.o			\
+	shm.o			\
+	sigev_thread.o
+
+TPOOLOBJS=			\
+	thread_pool.o
+
+THREADSOBJS=			\
+	alloc.o			\
+	assfail.o		\
+	cancel.o		\
+	c11_thr.o		\
+	door_calls.o		\
+	tmem.o			\
+	pthr_attr.o		\
+	pthr_barrier.o		\
+	pthr_cond.o		\
+	pthr_mutex.o		\
+	pthr_rwlock.o		\
+	pthread.o		\
+	rwlock.o		\
+	scalls.o		\
+	sema.o			\
+	sigaction.o		\
+	spawn.o			\
+	synch.o			\
+	tdb_agent.o		\
+	thr.o			\
+	thread_interface.o	\
+	tls.o			\
+	tsd.o
+
+THREADSMACHOBJS=		\
+	machdep.o
+
+THREADSASMOBJS=			\
+	asm_subr.o
+
+UNICODEOBJS=			\
+	u8_textprep.o		\
+	uconv.o
+
+UNWINDMACHOBJS=			\
+	unwind.o
+
+UNWINDASMOBJS=			\
+	unwind_frame.o
+
+# objects that implement the transitional large file API
+PORTSYS64=			\
+	lockf64.o		\
+	stat64.o
+
+PORTSYS=			\
+	_autofssys.o		\
+	access.o		\
+	acctctl.o		\
+	bsd_signal.o		\
+	chmod.o			\
+	chown.o			\
+	corectl.o		\
+	epoll.o			\
+	eventfd.o		\
+	exacctsys.o		\
+	execl.o			\
+	execle.o		\
+	execv.o			\
+	fcntl.o			\
+	getpagesizes.o		\
+	getpeerucred.o		\
+	inst_sync.o		\
+	issetugid.o		\
+	label.o			\
+	link.o			\
+	lockf.o			\
+	lwp.o			\
+	lwp_cond.o		\
+	lwp_rwlock.o		\
+	lwp_sigmask.o		\
+	meminfosys.o		\
+	mkdir.o			\
+	mknod.o			\
+	msgsys.o		\
+	nfssys.o		\
+	open.o			\
+	pgrpsys.o		\
+	posix_sigwait.o		\
+	ppriv.o			\
+	psetsys.o		\
+	rctlsys.o		\
+	readlink.o		\
+	rename.o		\
+	sbrk.o			\
+	semsys.o		\
+	set_errno.o		\
+	sharefs.o		\
+	shmsys.o		\
+	sidsys.o		\
+	siginterrupt.o		\
+	signal.o		\
+	signalfd.o		\
+	sigpending.o		\
+	sigstack.o		\
+	stat.o			\
+	symlink.o		\
+	tasksys.o		\
+	time.o			\
+	time_util.o		\
+	timerfd.o		\
+	ucontext.o		\
+	unlink.o		\
+	ustat.o			\
+	utimesys.o		\
+	zone.o
+
+PORTREGEX=			\
+	glob.o			\
+	regcmp.o		\
+	regex.o			\
+	wordexp.o
+
+PORTREGEX64=			\
+	glob64.o
+
+MOSTOBJS=			\
+	$(STRETS)		\
+	$(CRTOBJS)		\
+	$(DYNOBJS)		\
+	$(FPOBJS)		\
+	$(FPASMOBJS)		\
+	$(ATOMICOBJS)		\
+	$(CHACHAOBJS)		\
+	$(XATTROBJS)		\
+	$(COMOBJS)		\
+	$(DTRACEOBJS)		\
+	$(GENOBJS)		\
+	$(PORTFP)		\
+	$(PORTGEN)		\
+	$(PORTGEN64)		\
+	$(PORTI18N)		\
+	$(PORTI18N_COND)	\
+	$(PORTLOCALE)		\
+	$(PORTPRINT)		\
+	$(PORTPRINT_C89)	\
+	$(PORTPRINT_W)		\
+	$(PORTREGEX)		\
+	$(PORTREGEX64)		\
+	$(PORTSTDIO)		\
+	$(PORTSTDIO64)		\
+	$(PORTSTDIO_C89)	\
+	$(PORTSTDIO_W)		\
+	$(PORTSYS)		\
+	$(PORTSYS64)		\
+	$(AIOOBJS)		\
+	$(RTOBJS)		\
+	$(SECFLAGSOBJS)		\
+	$(TPOOLOBJS)		\
+	$(THREADSOBJS)		\
+	$(THREADSMACHOBJS)	\
+	$(THREADSASMOBJS)	\
+	$(UNICODEOBJS)		\
+	$(UNWINDMACHOBJS)	\
+	$(UNWINDASMOBJS)	\
+	$(COMSYSOBJS)		\
+	$(SYSOBJS)		\
+	$(COMSYSOBJS64)		\
+	$(SYSOBJS64)		\
+	$(VALUES)
+
+TRACEOBJS=			\
+	plockstat.o
+
+# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
+# modules whose source is provided in the $(SRC)/lib/common directory.
+# This must be done because otherwise the Sun C compiler would insert
+# its own versions of these modules and those versions contain code
+# to call out to C++ initialization functions.  Such C++ initialization
+# functions can call back into libc before thread initialization is
+# complete and this leads to segmentation violations and other problems.
+# Since libc contains no C++ code, linking with the minimal crti.o and
+# crtn.o modules is safe and avoids the problems described above.
+OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
+CRTSRCS= ../../common/i386
+
+LDPASS_OFF=	$(POUND_SIGN)
+
+# include common library definitions
+include ../../Makefile.lib
+
+# we need to override the default SONAME here because we might
+# be building a variant object (still libc.so.1, but different filename)
+SONAME = libc.so.1
+
+CFLAGS += $(CCVERBOSE) $(CTF_FLAGS)
+
+# This is necessary to avoid problems with calling _ex_unwind().
+# We probably don't want any inlining anyway.
+XINLINE = -xinline=
+CFLAGS += $(XINLINE)
+
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-value
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-type-limits
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-clobbered
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-address
+
+# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
+# enables ASSERT() checking in the threads portion of the library.
+# This is automatically enabled for DEBUG builds, not for non-debug builds.
+THREAD_DEBUG =
+$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
+
+# Make string literals read-only to save memory.
+CFLAGS += $(XSTRCONST)
+
+ALTPICS= $(TRACEOBJS:%=pics/%)
+
+$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) \
+		$(EXTPICS) $(LDLIBS)
+
+MAPFILES =	$(LIBCDIR)/port/mapfile-vers
+
 #
-# lib/libc/i386/Makefile
+# EXTN_CPPFLAGS and EXTN_CFLAGS set in enclosing Makefile
 #
+CFLAGS +=	$(EXTN_CFLAGS)
+CPPFLAGS=	-D_REENTRANT -Di386 $(EXTN_CPPFLAGS) $(THREAD_DEBUG) \
+		-I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
+ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) $(i386_AS_XARCH)
 
-LIBCBASE=../i386
+# As a favor to the dtrace syscall provider, libc still calls the
+# old syscall traps that have been obsoleted by the *at() interfaces.
+# Delete this to compile libc using only the new *at() system call traps
+CPPFLAGS += -D_RETAIN_OLD_SYSCALLS
 
-EXTN_CPPFLAGS =
-EXTN_XFLAGS =
+# Inform the run-time linker about libc specialized initialization
+RTLDINFO =	-z rtldinfo=tls_rtldinfo
+DYNFLAGS +=	$(RTLDINFO)
 
-LIBRARY =	libc.a
+# Force libc's internal references to be resolved immediately upon loading
+# in order to avoid critical region problems.  Since almost all libc symbols
+# are marked 'protected' in the mapfiles, this is a minimal set (15 to 20).
+DYNFLAGS +=	-znow
 
-# Special postprocessing for 32-bit fpcw.o: strip the SSE HWCAP attribute
-# from the object file; the internal functions with SSE instructions are
-# called conditionally on systems which have SSE instruction support
-pics/fpcw.o := POST_PROCESS_O += ; \
-	if $(ELFDUMP) -H $@ | grep " SSE "; then \
-		$(ELFEDIT) -e 'cap:hw1 -and -cmp SSE' $@; \
-	fi
+DYNFLAGS +=	-e __rtboot
+DYNFLAGS +=	$(EXTN_DYNFLAGS)
 
-include Makefile.com
+# Inform the kernel about the initial DTrace area (in case
+# libc is being used as the interpreter / runtime linker).
+DTRACE_DATA =	-zdtrace=dtrace_data
+DYNFLAGS +=	$(DTRACE_DATA)
+
+# DTrace needs an executable data segment.
+MAPFILE.NED=
+
+BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
+
+# Override this top level flag so the compiler builds in its native
+# C99 mode.  This has been enabled to support the complex arithmetic
+# added to libc.
+C99MODE=	$(C99_ENABLE)
+
+# libc method of building an archive
+# The "$(GREP) -v ' L '" part is necessary only until
+# lorder is fixed to ignore thread-local variables.
+BUILD.AR= $(RM) $@ ; \
+	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%) | $(GREP) -v ' L ' | $(TSORT)`
+
+# extra files for the clean target
+CLEANFILES +=			\
+	$(LIBCDIR)/port/gen/errlst.c	\
+	$(LIBCDIR)/port/gen/new_list.c	\
+	assym.h			\
+	genassym		\
+	crt/_rtld.s		\
+	crt/_rtbootld.s		\
+	pics/_rtbootld.o	\
+	pics/crti.o		\
+	pics/crtn.o		\
+	$(ALTPICS)
+
+CLOBBERFILES +=	$(LIB_PIC)
+
+# list of C source for lint
+SRCS=							\
+	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
+	$(XATTROBJS:%.o=$(SRC)/common/xattr/%.c)	\
+	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
+	$(DTRACEOBJS:%.o=$(SRC)/common/dtrace/%.c)	\
+	$(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c)			\
+	$(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c)			\
+	$(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c)		\
+	$(PORTLOCALE:%.o=$(LIBCDIR)/port/locale/%.c)		\
+	$(PORTPRINT:%.o=$(LIBCDIR)/port/print/%.c)		\
+	$(PORTREGEX:%.o=$(LIBCDIR)/port/regex/%.c)		\
+	$(PORTSTDIO:%.o=$(LIBCDIR)/port/stdio/%.c)		\
+	$(PORTSYS:%.o=$(LIBCDIR)/port/sys/%.c)			\
+	$(AIOOBJS:%.o=$(LIBCDIR)/port/aio/%.c)			\
+	$(RTOBJS:%.o=$(LIBCDIR)/port/rt/%.c)			\
+	$(SECFLAGSOBJS:%.o=$(SRC)/common/secflags/%.c)		\
+	$(TPOOLOBJS:%.o=$(LIBCDIR)/port/tpool/%.c)		\
+	$(THREADSOBJS:%.o=$(LIBCDIR)/port/threads/%.c)		\
+	$(THREADSMACHOBJS:%.o=$(LIBCDIR)/$(MACH)/threads/%.c)	\
+	$(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)	\
+	$(UNWINDMACHOBJS:%.o=$(LIBCDIR)/port/unwind/%.c)	\
+	$(FPOBJS:%.o=$(LIBCDIR)/$(MACH)/fp/%.c)			\
+	$(LIBCBASE)/gen/ecvt.c				\
+	$(LIBCBASE)/gen/makectxt.c			\
+	$(LIBCBASE)/gen/siginfolst.c			\
+	$(LIBCBASE)/gen/siglongjmp.c			\
+	$(LIBCBASE)/gen/strcmp.c			\
+	$(LIBCBASE)/gen/sync_instruction_memory.c	\
+	$(LIBCBASE)/sys/ptrace.c			\
+	$(LIBCBASE)/sys/uadmin.c
+
+# conditional assignments
+$(DYNLIB) := CRTI = crti.o
+$(DYNLIB) := CRTN = crtn.o
+
+# Files which need the threads .il inline template
+TIL=				\
+	aio.o			\
+	alloc.o			\
+	assfail.o		\
+	atexit.o		\
+	atfork.o		\
+	cancel.o		\
+	door_calls.o		\
+	err.o			\
+	errno.o			\
+	lwp.o			\
+	ma.o			\
+	machdep.o		\
+	posix_aio.o		\
+	pthr_attr.o		\
+	pthr_barrier.o		\
+	pthr_cond.o		\
+	pthr_mutex.o		\
+	pthr_rwlock.o		\
+	pthread.o		\
+	rand.o			\
+	rwlock.o		\
+	scalls.o		\
+	sched.o			\
+	sema.o			\
+	sigaction.o		\
+	sigev_thread.o		\
+	spawn.o			\
+	stack.o			\
+	synch.o			\
+	tdb_agent.o		\
+	thr.o			\
+	thread_interface.o	\
+	thread_pool.o		\
+	tls.o			\
+	tsd.o			\
+	tmem.o			\
+	unwind.o
+
+THREADS_INLINES = $(LIBCBASE)/threads/i386.il
+$(TIL:%=pics/%) := CFLAGS += $(THREADS_INLINES)
+
+# pics/mul64.o := CFLAGS += $(LIBCBASE)/crt/mul64.il
+
+# large-file-aware components that should be built large
+
+$(COMSYSOBJS64:%=pics/%) := \
+	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+
+$(SYSOBJS64:%=pics/%) := \
+	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+
+$(PORTGEN64:%=pics/%) := \
+	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+
+$(PORTREGEX64:%=pics/%) := \
+	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+
+$(PORTSTDIO64:%=pics/%) := \
+	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+
+$(PORTSYS64:%=pics/%) := \
+	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+
+$(PORTSTDIO_W:%=pics/%) := \
+	CPPFLAGS += -D_WIDE
+
+$(PORTPRINT_W:%=pics/%) := \
+	CPPFLAGS += -D_WIDE
+
+$(PORTPRINT_C89:%=pics/%) := \
+	CPPFLAGS += -D_C89_INTMAX32
+
+$(PORTSTDIO_C89:%=pics/%) := \
+	CPPFLAGS += -D_C89_INTMAX32
+
+$(PORTI18N_COND:%=pics/%) := \
+	CPPFLAGS += -D_WCS_LONGLONG
+
+pics/arc4random.o :=	CPPFLAGS += -I$(SRC)/common/crypto/chacha
+
+pics/__clock_gettime.o := CPPFLAGS += $(COMMPAGE_CPPFLAGS)
+
+.KEEP_STATE:
+
+all: $(LIBS) $(LIB_PIC)
+
+lint	:=	CPPFLAGS += -I$(LIBCDIR)/$(MACH)/fp
+lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
+lint	:=	LINTFLAGS += -mn -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
+
+lint:
+	@echo $(LINT.c) ...
+	@$(LINT.c) $(SRCS) $(LDLIBS)
+
+$(LINTLIB):= SRCS=$(LIBCDIR)/port/llib-lc
+$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
+$(LINTLIB):= LINTFLAGS=-nvx
+
+# object files that depend on inline template
+$(TIL:%=pics/%): $(LIBCBASE)/threads/i386.il
+# pics/mul64.o: $(LIBCBASE)/crt/mul64.il
+
+# include common libc targets
+include $(LIBCDIR)/Makefile.targ
+
+# We need to strip out all CTF and DOF data from the static library
+$(LIB_PIC) := DIR = pics
+$(LIB_PIC): pics $$(PICS)
+	$(BUILD.AR)
+	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
+	$(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
+	$(AR) -ts $@ > /dev/null
+	$(POST_PROCESS_A)
+
+$(LIBCBASE)/crt/_rtbootld.s: $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.c
+	$(CC) $(CPPFLAGS) $(CTF_FLAGS) -O -S $(C_PICFLAGS) \
+	    $(LIBCBASE)/crt/_rtld.c -o $(LIBCBASE)/crt/_rtld.s
+	$(CAT) $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.s > $@
+	$(RM) $(LIBCBASE)/crt/_rtld.s
+
+# partially built from C source
+pics/_rtbootld.o: $(LIBCBASE)/crt/_rtbootld.s
+	$(AS) $(ASFLAGS) $(LIBCBASE)/crt/_rtbootld.s -o $@
+	$(CTFCONVERT_O)
+
+ASSYMDEP_OBJS=			\
+	_lwp_mutex_unlock.o	\
+	_stack_grow.o		\
+	getcontext.o		\
+	setjmp.o		\
+	tls_get_addr.o		\
+	vforkx.o
+
+$(ASSYMDEP_OBJS:%=pics/%)	:=	CPPFLAGS += -I.
+
+$(ASSYMDEP_OBJS:%=pics/%): assym.h
+
+# assym.h build rules
+
+GENASSYM_C = $(LIBCDIR)/$(MACH)/genassym.c
+
+genassym: $(GENASSYM_C)
+	$(NATIVECC) $(NATIVE_CFLAGS) -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc	\
+		-D__EXTENSIONS__ $(CPPFLAGS.native) -o $@ $(GENASSYM_C)
+
+OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in
+
+assym.h: $(OFFSETS) genassym
+	$(OFFSETS_CREATE) <$(OFFSETS) >$@
+	./genassym >>$@
+
+# derived C source and related explicit dependencies
+$(LIBCDIR)/port/gen/errlst.c + \
+$(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk
+	cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist
+
+pics/errlst.o: $(LIBCDIR)/port/gen/errlst.c
+
+pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c
--- old/usr/src/lib/libc/i386/Makefile.com	Mon Jun 12 08:24:39 2017
+++ /dev/null	Mon Jun 12 08:24:31 2017
@@ -1,1344 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
-# Copyright 2016 Joyent, Inc.
-# Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
-# Copyright 2013 Garrett D'Amore <garrett@damore.org>
-#
-# Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-
-LIBCDIR=	$(SRC)/lib/libc
-LIB_PIC=	libc_pic.a
-VERS=		.1
-CPP=		/usr/lib/cpp
-TARGET_ARCH=	i386
-
-# include comm page definitions
-include $(SRC)/lib/commpage/Makefile.shared.com
-include $(SRC)/lib/commpage/Makefile.shared.targ
-
-VALUES=		values-Xa.o
-
-# objects are grouped by source directory
-
-# local objects
-STRETS=
-
-CRTOBJS=			\
-	cerror.o		\
-	cerror64.o
-
-DYNOBJS=			\
-	_rtbootld.o
-
-FPOBJS=				\
-	_D_cplx_div.o		\
-	_D_cplx_div_ix.o	\
-	_D_cplx_div_rx.o	\
-	_D_cplx_lr_div.o	\
-	_D_cplx_lr_div_ix.o	\
-	_D_cplx_lr_div_rx.o	\
-	_D_cplx_mul.o		\
-	_F_cplx_div.o		\
-	_F_cplx_div_ix.o	\
-	_F_cplx_div_rx.o	\
-	_F_cplx_lr_div.o	\
-	_F_cplx_lr_div_ix.o	\
-	_F_cplx_lr_div_rx.o	\
-	_F_cplx_mul.o		\
-	_X_cplx_div.o		\
-	_X_cplx_div_ix.o	\
-	_X_cplx_div_rx.o	\
-	_X_cplx_lr_div.o	\
-	_X_cplx_lr_div_ix.o	\
-	_X_cplx_lr_div_rx.o	\
-	_X_cplx_mul.o		\
-	fpgetmask.o		\
-	fpgetround.o		\
-	fpgetsticky.o		\
-	fpsetmask.o		\
-	fpsetround.o		\
-	fpsetsticky.o		\
-	fpstart.o		\
-	ieee.o
-
-FPASMOBJS=			\
-	__xgetRD.o		\
-	_base_il.o		\
-	_xtoll.o		\
-	_xtoull.o		\
-	fpcw.o
-
-ATOMICOBJS=			\
-	atomic.o
-
-CHACHAOBJS=			\
-	chacha.o
-
-XATTROBJS=			\
-	xattr_common.o
-
-COMOBJS=			\
-	bcmp.o			\
-	bcopy.o			\
-	bsearch.o		\
-	bzero.o			\
-	qsort.o			\
-	strtol.o		\
-	strtoul.o		\
-	strtoll.o		\
-	strtoull.o
-
-DTRACEOBJS=			\
-	dtrace_data.o
-
-SECFLAGSOBJS=			\
-	secflags.o
-
-GENOBJS=			\
-	$(COMMPAGE_OBJS)	\
-	_div64.o		\
-	_divdi3.o		\
-	_getsp.o		\
-	_mul64.o		\
-	abs.o			\
-	alloca.o		\
-	arc4random.o		\
-	arc4random_uniform.o	\
-	byteorder.o		\
-	byteorder64.o		\
-	cuexit.o		\
-	ecvt.o			\
-	endian.o		\
-	errlst.o		\
-	i386_data.o		\
-	ladd.o			\
-	ldivide.o		\
-	lmul.o			\
-	lock.o			\
-	lshiftl.o		\
-	lsign.o			\
-	lsub.o			\
-	makectxt.o		\
-	memccpy.o		\
-	memchr.o		\
-	memcmp.o		\
-	memcpy.o		\
-	memset.o		\
-	new_list.o		\
-	setjmp.o		\
-	siginfolst.o		\
-	siglongjmp.o		\
-	strcat.o		\
-	strchr.o		\
-	strcmp.o		\
-	strcpy.o		\
-	strlen.o		\
-	strncat.o		\
-	strncmp.o		\
-	strncpy.o		\
-	strnlen.o		\
-	strrchr.o		\
-	sync_instruction_memory.o
-
-# sysobjs that contain large-file interfaces
-COMSYSOBJS64=			\
-	fstatvfs64.o		\
-	getdents64.o		\
-	getrlimit64.o		\
-	lseek64.o		\
-	mmap64.o		\
-	pread64.o		\
-	preadv64.o		\
-	pwrite64.o		\
-	pwritev64.o		\
-	setrlimit64.o		\
-	statvfs64.o
-
-SYSOBJS64=
-
-COMSYSOBJS=			\
-	__clock_timer.o		\
-	__getloadavg.o		\
-	__rusagesys.o		\
-	__signotify.o		\
-	__sigrt.o		\
-	__time.o		\
-	_lgrp_home_fast.o	\
-	_lgrpsys.o		\
-	_nfssys.o		\
-	_portfs.o		\
-	_pset.o			\
-	_rpcsys.o		\
-	_sigaction.o		\
-	_so_accept.o		\
-	_so_bind.o		\
-	_so_connect.o		\
-	_so_getpeername.o	\
-	_so_getsockname.o	\
-	_so_getsockopt.o	\
-	_so_listen.o		\
-	_so_recv.o		\
-	_so_recvfrom.o		\
-	_so_recvmsg.o		\
-	_so_send.o		\
-	_so_sendmsg.o		\
-	_so_sendto.o		\
-	_so_setsockopt.o	\
-	_so_shutdown.o		\
-	_so_socket.o		\
-	_so_socketpair.o	\
-	_sockconfig.o		\
-	acct.o			\
-	acl.o			\
-	adjtime.o		\
-	alarm.o			\
-	brk.o			\
-	chdir.o			\
-	chroot.o		\
-	cladm.o			\
-	close.o			\
-	execve.o		\
-	exit.o			\
-	facl.o			\
-	fchdir.o		\
-	fchroot.o		\
-	fdsync.o		\
-	fpathconf.o		\
-	fstatfs.o		\
-	fstatvfs.o		\
-	getcpuid.o		\
-	getdents.o		\
-	getegid.o		\
-	geteuid.o		\
-	getgid.o		\
-	getgroups.o		\
-	gethrtime.o		\
-	getitimer.o		\
-	getmsg.o		\
-	getpid.o		\
-	getpmsg.o		\
-	getppid.o		\
-	getrandom.o		\
-	getrlimit.o		\
-	getuid.o		\
-	gtty.o			\
-	install_utrap.o		\
-	ioctl.o			\
-	kaio.o			\
-	kill.o			\
-	llseek.o		\
-	lseek.o			\
-	mmapobjsys.o		\
-	memcntl.o		\
-	mincore.o		\
-	mmap.o			\
-	modctl.o		\
-	mount.o			\
-	mprotect.o		\
-	munmap.o		\
-	nice.o			\
-	ntp_adjtime.o		\
-	ntp_gettime.o		\
-	p_online.o		\
-	pathconf.o		\
-	pause.o			\
-	pcsample.o		\
-	pipe2.o			\
-	pollsys.o		\
-	pread.o			\
-	preadv.o		\
-	priocntlset.o		\
-	processor_bind.o	\
-	processor_info.o	\
-	profil.o		\
-	psecflagsset.o		\
-	putmsg.o		\
-	putpmsg.o		\
-	pwrite.o		\
-	pwritev.o		\
-	read.o			\
-	readv.o			\
-	resolvepath.o		\
-	seteguid.o		\
-	setgid.o		\
-	setgroups.o		\
-	setitimer.o		\
-	setreid.o		\
-	setrlimit.o		\
-	setuid.o		\
-	sigaltstk.o		\
-	sigprocmsk.o		\
-	sigsendset.o		\
-	sigsuspend.o		\
-	statfs.o		\
-	statvfs.o		\
-	stty.o			\
-	sync.o			\
-	sysconfig.o		\
-	sysfs.o			\
-	sysinfo.o		\
-	syslwp.o		\
-	times.o			\
-	ulimit.o		\
-	umask.o			\
-	umount2.o		\
-	utssys.o		\
-	uucopy.o		\
-	vhangup.o		\
-	waitid.o		\
-	write.o			\
-	writev.o		\
-	yield.o
-
-SYSOBJS=			\
-	__clock_gettime.o	\
-	__clock_gettime_sys.o	\
-	__getcontext.o		\
-	__uadmin.o		\
-	_lwp_mutex_unlock.o	\
-	_stack_grow.o		\
-	door.o			\
-	forkx.o			\
-	forkallx.o		\
-	getcontext.o		\
-	gettimeofday.o		\
-	lwp_private.o		\
-	nuname.o		\
-	ptrace.o		\
-	syscall.o		\
-	sysi86.o		\
-	tls_get_addr.o		\
-	uadmin.o		\
-	umount.o		\
-	uname.o			\
-	vforkx.o		\
-	xstat.o
-
-# objects under $(LIBCDIR)/port which contain transitional large file interfaces
-PORTGEN64=			\
-	_xftw64.o		\
-	attropen64.o		\
-	ftw64.o			\
-	mkstemp64.o		\
-	nftw64.o		\
-	tell64.o		\
-	truncate64.o
-
-# objects from source under $(LIBCDIR)/port
-PORTFP=				\
-	__flt_decim.o		\
-	__flt_rounds.o		\
-	__tbl_10_b.o		\
-	__tbl_10_h.o		\
-	__tbl_10_s.o		\
-	__tbl_2_b.o		\
-	__tbl_2_h.o		\
-	__tbl_2_s.o		\
-	__tbl_fdq.o		\
-	__tbl_tens.o		\
-	__x_power.o		\
-	_base_sup.o		\
-	aconvert.o		\
-	decimal_bin.o		\
-	double_decim.o		\
-	econvert.o		\
-	fconvert.o		\
-	file_decim.o		\
-	finite.o		\
-	fp_data.o		\
-	func_decim.o		\
-	gconvert.o		\
-	hex_bin.o		\
-	ieee_globals.o		\
-	pack_float.o		\
-	sigfpe.o		\
-	string_decim.o
-
-PORTGEN=			\
-	_env_data.o		\
-	_xftw.o			\
-	a64l.o			\
-	abort.o			\
-	addsev.o		\
-	ascii_strcasecmp.o	\
-	ascii_strncasecmp.o	\
-	assert.o		\
-	atof.o			\
-	atoi.o			\
-	atol.o			\
-	atoll.o			\
-	attrat.o		\
-	attropen.o		\
-	atexit.o		\
-	atfork.o		\
-	basename.o		\
-	calloc.o		\
-	catgets.o		\
-	catopen.o		\
-	cfgetispeed.o		\
-	cfgetospeed.o		\
-	cfree.o			\
-	cfsetispeed.o		\
-	cfsetospeed.o		\
-	cftime.o		\
-	clock.o			\
-	closedir.o		\
-	closefrom.o		\
-	confstr.o		\
-	crypt.o			\
-	csetlen.o		\
-	ctime.o			\
-	ctime_r.o		\
-	daemon.o		\
-	deflt.o			\
-	directio.o		\
-	dirname.o		\
-	div.o			\
-	drand48.o		\
-	dup.o			\
-	env_data.o		\
-	err.o			\
-	errno.o			\
-	euclen.o		\
-	event_port.o		\
-	execvp.o		\
-	explicit_bzero.o	\
-	fattach.o		\
-	fdetach.o		\
-	fdopendir.o		\
-	ffs.o			\
-	flock.o			\
-	fls.o			\
-	fmtmsg.o		\
-	ftime.o			\
-	ftok.o			\
-	ftw.o			\
-	gcvt.o			\
-	getauxv.o		\
-	getcwd.o		\
-	getdate_err.o		\
-	getdtblsize.o		\
-	getentropy.o		\
-	getenv.o		\
-	getexecname.o		\
-	getgrnam.o		\
-	getgrnam_r.o		\
-	gethostid.o		\
-	gethostname.o		\
-	gethz.o			\
-	getisax.o		\
-	getloadavg.o		\
-	getlogin.o		\
-	getmntent.o		\
-	getnetgrent.o		\
-	get_nprocs.o		\
-	getopt.o		\
-	getopt_long.o		\
-	getpagesize.o		\
-	getpw.o			\
-	getpwnam.o		\
-	getpwnam_r.o		\
-	getrusage.o		\
-	getspent.o		\
-	getspent_r.o		\
-	getsubopt.o		\
-	gettxt.o		\
-	getusershell.o		\
-	getut.o			\
-	getutx.o		\
-	getvfsent.o		\
-	getwd.o			\
-	getwidth.o		\
-	getxby_door.o		\
-	gtxt.o			\
-	hsearch.o		\
-	iconv.o			\
-	imaxabs.o		\
-	imaxdiv.o		\
-	index.o			\
-	initgroups.o		\
-	insque.o		\
-	isaexec.o		\
-	isastream.o		\
-	isatty.o		\
-	killpg.o		\
-	klpdlib.o		\
-	l64a.o			\
-	lckpwdf.o		\
-	lconstants.o		\
-	lexp10.o		\
-	lfind.o			\
-	lfmt.o			\
-	lfmt_log.o		\
-	llabs.o			\
-	lldiv.o			\
-	llog10.o		\
-	lltostr.o		\
-	localtime.o		\
-	lsearch.o		\
-	madvise.o		\
-	malloc.o		\
-	memalign.o		\
-	memmem.o		\
-	mkdev.o			\
-	mkdtemp.o		\
-	mkfifo.o		\
-	mkstemp.o		\
-	mktemp.o		\
-	mlock.o			\
-	mlockall.o		\
-	mon.o			\
-	msync.o			\
-	munlock.o		\
-	munlockall.o		\
-	ndbm.o			\
-	nftw.o			\
-	nlspath_checks.o	\
-	nsparse.o		\
-	nss_common.o		\
-	nss_dbdefs.o		\
-	nss_deffinder.o		\
-	opendir.o		\
-	opt_data.o		\
-	perror.o		\
-	pfmt.o			\
-	pfmt_data.o		\
-	pfmt_print.o		\
-	pipe.o			\
-	plock.o			\
-	poll.o			\
-	posix_fadvise.o		\
-	posix_fallocate.o	\
-	posix_madvise.o		\
-	posix_memalign.o	\
-	priocntl.o		\
-	privlib.o		\
-	priv_str_xlate.o	\
-	psecflags.o		\
-	psiginfo.o		\
-	psignal.o		\
-	pt.o			\
-	putpwent.o		\
-	putspent.o		\
-	raise.o			\
-	rand.o			\
-	random.o		\
-	rctlops.o		\
-	readdir.o		\
-	readdir_r.o		\
-	realpath.o		\
-	reboot.o		\
-	regexpr.o		\
-	remove.o		\
-	rewinddir.o		\
-	rindex.o		\
-	scandir.o		\
-	seekdir.o		\
-	select.o		\
-	setlabel.o		\
-	setpriority.o		\
-	settimeofday.o		\
-	sh_locks.o		\
-	sigflag.o		\
-	siglist.o		\
-	sigsend.o		\
-	sigsetops.o		\
-	ssignal.o		\
-	stack.o			\
-	stpcpy.o		\
-	stpncpy.o		\
-	str2sig.o		\
-	strcase_charmap.o	\
-	strchrnul.o		\
-	strcspn.o		\
-	strdup.o		\
-	strerror.o		\
-	strlcat.o		\
-	strlcpy.o		\
-	strndup.o		\
-	strpbrk.o		\
-	strsep.o		\
-	strsignal.o		\
-	strspn.o		\
-	strstr.o		\
-	strtod.o		\
-	strtoimax.o		\
-	strtok.o		\
-	strtok_r.o		\
-	strtoumax.o		\
-	swab.o			\
-	swapctl.o		\
-	sysconf.o		\
-	syslog.o		\
-	tcdrain.o		\
-	tcflow.o		\
-	tcflush.o		\
-	tcgetattr.o		\
-	tcgetpgrp.o		\
-	tcgetsid.o		\
-	tcsendbreak.o		\
-	tcsetattr.o		\
-	tcsetpgrp.o		\
-	tell.o			\
-	telldir.o		\
-	tfind.o			\
-	time_data.o		\
-	time_gdata.o		\
-	timespec_get.o		\
-	tls_data.o		\
-	truncate.o		\
-	tsdalloc.o		\
-	tsearch.o		\
-	ttyname.o		\
-	ttyslot.o		\
-	ualarm.o		\
-	ucred.o			\
-	valloc.o		\
-	vlfmt.o			\
-	vpfmt.o			\
-	waitpid.o		\
-	walkstack.o		\
-	wdata.o			\
-	xgetwidth.o		\
-	xpg4.o			\
-	xpg6.o
-
-PORTPRINT_W=			\
-	doprnt_w.o
-
-PORTPRINT=			\
-	asprintf.o		\
-	doprnt.o		\
-	fprintf.o		\
-	printf.o		\
-	snprintf.o		\
-	sprintf.o		\
-	vfprintf.o		\
-	vprintf.o		\
-	vsnprintf.o		\
-	vsprintf.o		\
-	vwprintf.o		\
-	wprintf.o
-
-# c89 variants to support 32-bit size of c89 u/intmax_t (32-bit libc only)
-PORTPRINT_C89=			\
-	vfprintf_c89.o		\
-	vprintf_c89.o		\
-	vsnprintf_c89.o		\
-	vsprintf_c89.o		\
-	vwprintf_c89.o
-
-PORTSTDIO_C89=			\
-	vscanf_c89.o		\
-	vwscanf_c89.o		\
-
-# portable stdio objects that contain large file interfaces.
-# Note: fopen64 is a special case, as we build it small.
-PORTSTDIO64=			\
-	fopen64.o		\
-	fpos64.o
-
-PORTSTDIO_W=			\
-	doscan_w.o
-
-PORTSTDIO=			\
-	__extensions.o		\
-	_endopen.o		\
-	_filbuf.o		\
-	_findbuf.o		\
-	_flsbuf.o		\
-	_wrtchk.o		\
-	clearerr.o		\
-	ctermid.o		\
-	ctermid_r.o		\
-	cuserid.o		\
-	data.o			\
-	doscan.o		\
-	fdopen.o		\
-	feof.o			\
-	ferror.o		\
-	fgetc.o			\
-	fgets.o			\
-	fileno.o		\
-	flockf.o		\
-	flush.o			\
-	fopen.o			\
-	fpos.o			\
-	fputc.o			\
-	fputs.o			\
-	fread.o			\
-	fseek.o			\
-	fseeko.o		\
-	ftell.o			\
-	ftello.o		\
-	fwrite.o		\
-	getc.o			\
-	getchar.o		\
-	getline.o		\
-	getpass.o		\
-	gets.o			\
-	getw.o			\
-	mse.o			\
-	popen.o			\
-	putc.o			\
-	putchar.o		\
-	puts.o			\
-	putw.o			\
-	rewind.o		\
-	scanf.o			\
-	setbuf.o		\
-	setbuffer.o		\
-	setvbuf.o		\
-	system.o		\
-	tempnam.o		\
-	tmpfile.o		\
-	tmpnam_r.o		\
-	ungetc.o		\
-	vscanf.o		\
-	vwscanf.o		\
-	wscanf.o
-
-PORTI18N=			\
-	getwchar.o		\
-	putwchar.o		\
-	putws.o			\
-	strtows.o		\
-	wcsnlen.o		\
-	wcsstr.o		\
-	wcstoimax.o		\
-	wcstol.o		\
-	wcstoul.o		\
-	wcswcs.o		\
-	wmemchr.o		\
-	wmemcmp.o		\
-	wmemcpy.o		\
-	wmemmove.o		\
-	wmemset.o		\
-	wscat.o			\
-	wschr.o			\
-	wscmp.o			\
-	wscpy.o			\
-	wscspn.o		\
-	wsdup.o			\
-	wslen.o			\
-	wsncat.o		\
-	wsncmp.o		\
-	wsncpy.o		\
-	wspbrk.o		\
-	wsprintf.o		\
-	wsrchr.o		\
-	wsscanf.o		\
-	wsspn.o			\
-	wstod.o			\
-	wstok.o			\
-	wstol.o			\
-	wstoll.o		\
-	wsxfrm.o		\
-	gettext.o		\
-	gettext_gnu.o		\
-	gettext_real.o		\
-	gettext_util.o		\
-	plural_parser.o		\
-	wdresolve.o		\
-	_ctype.o		\
-	isascii.o		\
-	toascii.o
-
-PORTI18N_COND=			\
-	wcstol_longlong.o	\
-	wcstoul_longlong.o
-
-PORTLOCALE=			\
-	big5.o			\
-	btowc.o			\
-	collate.o		\
-	collcmp.o		\
-	euc.o			\
-	fnmatch.o		\
-	fgetwc.o		\
-	fgetws.o		\
-	fix_grouping.o		\
-	fputwc.o		\
-	fputws.o		\
-	fwide.o			\
-	gb18030.o		\
-	gb2312.o		\
-	gbk.o			\
-	getdate.o		\
-	isdigit.o		\
-	iswctype.o		\
-	ldpart.o		\
-	lmessages.o		\
-	lnumeric.o		\
-	lmonetary.o		\
-	localeconv.o		\
-	localeimpl.o		\
-	mbftowc.o		\
-	mblen.o			\
-	mbrlen.o		\
-	mbrtowc.o		\
-	mbsinit.o		\
-	mbsnrtowcs.o		\
-	mbsrtowcs.o		\
-	mbstowcs.o		\
-	mbtowc.o		\
-	mskanji.o		\
-	nextwctype.o		\
-	nl_langinfo.o		\
-	none.o			\
-	regcomp.o		\
-	regfree.o		\
-	regerror.o		\
-	regexec.o		\
-	rune.o			\
-	runetype.o		\
-	setlocale.o		\
-	setrunelocale.o		\
-	strcasecmp.o		\
-	strcasestr.o		\
-	strcoll.o		\
-	strfmon.o		\
-	strftime.o		\
-	strncasecmp.o		\
-	strptime.o		\
-	strxfrm.o		\
-	table.o			\
-	timelocal.o		\
-	tolower.o		\
-	towlower.o		\
-	ungetwc.o		\
-	utf8.o			\
-	wcrtomb.o		\
-	wcscasecmp.o		\
-	wcscoll.o		\
-	wcsftime.o		\
-	wcsnrtombs.o		\
-	wcsrtombs.o		\
-	wcswidth.o		\
-	wcstombs.o		\
-	wcsxfrm.o		\
-	wctob.o			\
-	wctomb.o		\
-	wctrans.o		\
-	wctype.o		\
-	wcwidth.o		\
-	wscol.o
-
-AIOOBJS=			\
-	aio.o			\
-	aio_alloc.o		\
-	posix_aio.o
-
-RTOBJS=				\
-	clock_timer.o		\
-	mqueue.o		\
-	pos4obj.o		\
-	sched.o			\
-	sem.o			\
-	shm.o			\
-	sigev_thread.o
-
-TPOOLOBJS=			\
-	thread_pool.o
-
-THREADSOBJS=			\
-	alloc.o			\
-	assfail.o		\
-	cancel.o		\
-	c11_thr.o		\
-	door_calls.o		\
-	tmem.o			\
-	pthr_attr.o		\
-	pthr_barrier.o		\
-	pthr_cond.o		\
-	pthr_mutex.o		\
-	pthr_rwlock.o		\
-	pthread.o		\
-	rwlock.o		\
-	scalls.o		\
-	sema.o			\
-	sigaction.o		\
-	spawn.o			\
-	synch.o			\
-	tdb_agent.o		\
-	thr.o			\
-	thread_interface.o	\
-	tls.o			\
-	tsd.o
-
-THREADSMACHOBJS=		\
-	machdep.o
-
-THREADSASMOBJS=			\
-	asm_subr.o
-
-UNICODEOBJS=			\
-	u8_textprep.o		\
-	uconv.o
-
-UNWINDMACHOBJS=			\
-	unwind.o
-
-UNWINDASMOBJS=			\
-	unwind_frame.o
-
-# objects that implement the transitional large file API
-PORTSYS64=			\
-	lockf64.o		\
-	stat64.o
-
-PORTSYS=			\
-	_autofssys.o		\
-	access.o		\
-	acctctl.o		\
-	bsd_signal.o		\
-	chmod.o			\
-	chown.o			\
-	corectl.o		\
-	epoll.o			\
-	eventfd.o		\
-	exacctsys.o		\
-	execl.o			\
-	execle.o		\
-	execv.o			\
-	fcntl.o			\
-	getpagesizes.o		\
-	getpeerucred.o		\
-	inst_sync.o		\
-	issetugid.o		\
-	label.o			\
-	link.o			\
-	lockf.o			\
-	lwp.o			\
-	lwp_cond.o		\
-	lwp_rwlock.o		\
-	lwp_sigmask.o		\
-	meminfosys.o		\
-	mkdir.o			\
-	mknod.o			\
-	msgsys.o		\
-	nfssys.o		\
-	open.o			\
-	pgrpsys.o		\
-	posix_sigwait.o		\
-	ppriv.o			\
-	psetsys.o		\
-	rctlsys.o		\
-	readlink.o		\
-	rename.o		\
-	sbrk.o			\
-	semsys.o		\
-	set_errno.o		\
-	sharefs.o		\
-	shmsys.o		\
-	sidsys.o		\
-	siginterrupt.o		\
-	signal.o		\
-	signalfd.o		\
-	sigpending.o		\
-	sigstack.o		\
-	stat.o			\
-	symlink.o		\
-	tasksys.o		\
-	time.o			\
-	time_util.o		\
-	timerfd.o		\
-	ucontext.o		\
-	unlink.o		\
-	ustat.o			\
-	utimesys.o		\
-	zone.o
-
-PORTREGEX=			\
-	glob.o			\
-	regcmp.o		\
-	regex.o			\
-	wordexp.o
-
-PORTREGEX64=			\
-	glob64.o
-
-MOSTOBJS=			\
-	$(STRETS)		\
-	$(CRTOBJS)		\
-	$(DYNOBJS)		\
-	$(FPOBJS)		\
-	$(FPASMOBJS)		\
-	$(ATOMICOBJS)		\
-	$(CHACHAOBJS)		\
-	$(XATTROBJS)		\
-	$(COMOBJS)		\
-	$(DTRACEOBJS)		\
-	$(GENOBJS)		\
-	$(PORTFP)		\
-	$(PORTGEN)		\
-	$(PORTGEN64)		\
-	$(PORTI18N)		\
-	$(PORTI18N_COND)	\
-	$(PORTLOCALE)		\
-	$(PORTPRINT)		\
-	$(PORTPRINT_C89)	\
-	$(PORTPRINT_W)		\
-	$(PORTREGEX)		\
-	$(PORTREGEX64)		\
-	$(PORTSTDIO)		\
-	$(PORTSTDIO64)		\
-	$(PORTSTDIO_C89)	\
-	$(PORTSTDIO_W)		\
-	$(PORTSYS)		\
-	$(PORTSYS64)		\
-	$(AIOOBJS)		\
-	$(RTOBJS)		\
-	$(SECFLAGSOBJS)		\
-	$(TPOOLOBJS)		\
-	$(THREADSOBJS)		\
-	$(THREADSMACHOBJS)	\
-	$(THREADSASMOBJS)	\
-	$(UNICODEOBJS)		\
-	$(UNWINDMACHOBJS)	\
-	$(UNWINDASMOBJS)	\
-	$(COMSYSOBJS)		\
-	$(SYSOBJS)		\
-	$(COMSYSOBJS64)		\
-	$(SYSOBJS64)		\
-	$(VALUES)
-
-TRACEOBJS=			\
-	plockstat.o
-
-# NOTE:	libc.so.1 must be linked with the minimal crti.o and crtn.o
-# modules whose source is provided in the $(SRC)/lib/common directory.
-# This must be done because otherwise the Sun C compiler would insert
-# its own versions of these modules and those versions contain code
-# to call out to C++ initialization functions.  Such C++ initialization
-# functions can call back into libc before thread initialization is
-# complete and this leads to segmentation violations and other problems.
-# Since libc contains no C++ code, linking with the minimal crti.o and
-# crtn.o modules is safe and avoids the problems described above.
-OBJECTS= $(CRTI) $(MOSTOBJS) $(CRTN)
-CRTSRCS= ../../common/i386
-
-LDPASS_OFF=	$(POUND_SIGN)
-
-# include common library definitions
-include ../../Makefile.lib
-
-# we need to override the default SONAME here because we might
-# be building a variant object (still libc.so.1, but different filename)
-SONAME = libc.so.1
-
-CFLAGS += $(CCVERBOSE) $(CTF_FLAGS)
-
-# This is necessary to avoid problems with calling _ex_unwind().
-# We probably don't want any inlining anyway.
-XINLINE = -xinline=
-CFLAGS += $(XINLINE)
-
-CERRWARN += -_gcc=-Wno-parentheses
-CERRWARN += -_gcc=-Wno-switch
-CERRWARN += -_gcc=-Wno-uninitialized
-CERRWARN += -_gcc=-Wno-unused-value
-CERRWARN += -_gcc=-Wno-unused-label
-CERRWARN += -_gcc=-Wno-unused-variable
-CERRWARN += -_gcc=-Wno-type-limits
-CERRWARN += -_gcc=-Wno-char-subscripts
-CERRWARN += -_gcc=-Wno-clobbered
-CERRWARN += -_gcc=-Wno-unused-function
-CERRWARN += -_gcc=-Wno-address
-
-# Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...)
-# enables ASSERT() checking in the threads portion of the library.
-# This is automatically enabled for DEBUG builds, not for non-debug builds.
-THREAD_DEBUG =
-$(NOT_RELEASE_BUILD)THREAD_DEBUG = -DTHREAD_DEBUG
-
-# Make string literals read-only to save memory.
-CFLAGS += $(XSTRCONST)
-
-ALTPICS= $(TRACEOBJS:%=pics/%)
-
-$(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) \
-		$(EXTPICS) $(LDLIBS)
-
-MAPFILES =	$(LIBCDIR)/port/mapfile-vers
-
-#
-# EXTN_CPPFLAGS and EXTN_CFLAGS set in enclosing Makefile
-#
-CFLAGS +=	$(EXTN_CFLAGS)
-CPPFLAGS=	-D_REENTRANT -Di386 $(EXTN_CPPFLAGS) $(THREAD_DEBUG) \
-		-I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
-ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) $(i386_AS_XARCH)
-
-# As a favor to the dtrace syscall provider, libc still calls the
-# old syscall traps that have been obsoleted by the *at() interfaces.
-# Delete this to compile libc using only the new *at() system call traps
-CPPFLAGS += -D_RETAIN_OLD_SYSCALLS
-
-# Inform the run-time linker about libc specialized initialization
-RTLDINFO =	-z rtldinfo=tls_rtldinfo
-DYNFLAGS +=	$(RTLDINFO)
-
-# Force libc's internal references to be resolved immediately upon loading
-# in order to avoid critical region problems.  Since almost all libc symbols
-# are marked 'protected' in the mapfiles, this is a minimal set (15 to 20).
-DYNFLAGS +=	-znow
-
-DYNFLAGS +=	-e __rtboot
-DYNFLAGS +=	$(EXTN_DYNFLAGS)
-
-# Inform the kernel about the initial DTrace area (in case
-# libc is being used as the interpreter / runtime linker).
-DTRACE_DATA =	-zdtrace=dtrace_data
-DYNFLAGS +=	$(DTRACE_DATA)
-
-# DTrace needs an executable data segment.
-MAPFILE.NED=
-
-BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
-
-# Override this top level flag so the compiler builds in its native
-# C99 mode.  This has been enabled to support the complex arithmetic
-# added to libc.
-C99MODE=	$(C99_ENABLE)
-
-# libc method of building an archive
-# The "$(GREP) -v ' L '" part is necessary only until
-# lorder is fixed to ignore thread-local variables.
-BUILD.AR= $(RM) $@ ; \
-	$(AR) q $@ `$(LORDER) $(MOSTOBJS:%=$(DIR)/%) | $(GREP) -v ' L ' | $(TSORT)`
-
-# extra files for the clean target
-CLEANFILES +=			\
-	$(LIBCDIR)/port/gen/errlst.c	\
-	$(LIBCDIR)/port/gen/new_list.c	\
-	assym.h			\
-	genassym		\
-	crt/_rtld.s		\
-	crt/_rtbootld.s		\
-	pics/_rtbootld.o	\
-	pics/crti.o		\
-	pics/crtn.o		\
-	$(ALTPICS)
-
-CLOBBERFILES +=	$(LIB_PIC)
-
-# list of C source for lint
-SRCS=							\
-	$(ATOMICOBJS:%.o=$(SRC)/common/atomic/%.c)	\
-	$(XATTROBJS:%.o=$(SRC)/common/xattr/%.c)	\
-	$(COMOBJS:%.o=$(SRC)/common/util/%.c)		\
-	$(DTRACEOBJS:%.o=$(SRC)/common/dtrace/%.c)	\
-	$(PORTFP:%.o=$(LIBCDIR)/port/fp/%.c)			\
-	$(PORTGEN:%.o=$(LIBCDIR)/port/gen/%.c)			\
-	$(PORTI18N:%.o=$(LIBCDIR)/port/i18n/%.c)		\
-	$(PORTLOCALE:%.o=$(LIBCDIR)/port/locale/%.c)		\
-	$(PORTPRINT:%.o=$(LIBCDIR)/port/print/%.c)		\
-	$(PORTREGEX:%.o=$(LIBCDIR)/port/regex/%.c)		\
-	$(PORTSTDIO:%.o=$(LIBCDIR)/port/stdio/%.c)		\
-	$(PORTSYS:%.o=$(LIBCDIR)/port/sys/%.c)			\
-	$(AIOOBJS:%.o=$(LIBCDIR)/port/aio/%.c)			\
-	$(RTOBJS:%.o=$(LIBCDIR)/port/rt/%.c)			\
-	$(SECFLAGSOBJS:%.o=$(SRC)/common/secflags/%.c)		\
-	$(TPOOLOBJS:%.o=$(LIBCDIR)/port/tpool/%.c)		\
-	$(THREADSOBJS:%.o=$(LIBCDIR)/port/threads/%.c)		\
-	$(THREADSMACHOBJS:%.o=$(LIBCDIR)/$(MACH)/threads/%.c)	\
-	$(UNICODEOBJS:%.o=$(SRC)/common/unicode/%.c)	\
-	$(UNWINDMACHOBJS:%.o=$(LIBCDIR)/port/unwind/%.c)	\
-	$(FPOBJS:%.o=$(LIBCDIR)/$(MACH)/fp/%.c)			\
-	$(LIBCBASE)/gen/ecvt.c				\
-	$(LIBCBASE)/gen/makectxt.c			\
-	$(LIBCBASE)/gen/siginfolst.c			\
-	$(LIBCBASE)/gen/siglongjmp.c			\
-	$(LIBCBASE)/gen/strcmp.c			\
-	$(LIBCBASE)/gen/sync_instruction_memory.c	\
-	$(LIBCBASE)/sys/ptrace.c			\
-	$(LIBCBASE)/sys/uadmin.c
-
-# conditional assignments
-$(DYNLIB) := CRTI = crti.o
-$(DYNLIB) := CRTN = crtn.o
-
-# Files which need the threads .il inline template
-TIL=				\
-	aio.o			\
-	alloc.o			\
-	assfail.o		\
-	atexit.o		\
-	atfork.o		\
-	cancel.o		\
-	door_calls.o		\
-	err.o			\
-	errno.o			\
-	lwp.o			\
-	ma.o			\
-	machdep.o		\
-	posix_aio.o		\
-	pthr_attr.o		\
-	pthr_barrier.o		\
-	pthr_cond.o		\
-	pthr_mutex.o		\
-	pthr_rwlock.o		\
-	pthread.o		\
-	rand.o			\
-	rwlock.o		\
-	scalls.o		\
-	sched.o			\
-	sema.o			\
-	sigaction.o		\
-	sigev_thread.o		\
-	spawn.o			\
-	stack.o			\
-	synch.o			\
-	tdb_agent.o		\
-	thr.o			\
-	thread_interface.o	\
-	thread_pool.o		\
-	tls.o			\
-	tsd.o			\
-	tmem.o			\
-	unwind.o
-
-THREADS_INLINES = $(LIBCBASE)/threads/i386.il
-$(TIL:%=pics/%) := CFLAGS += $(THREADS_INLINES)
-
-# pics/mul64.o := CFLAGS += $(LIBCBASE)/crt/mul64.il
-
-# large-file-aware components that should be built large
-
-$(COMSYSOBJS64:%=pics/%) := \
-	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-
-$(SYSOBJS64:%=pics/%) := \
-	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-
-$(PORTGEN64:%=pics/%) := \
-	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-
-$(PORTREGEX64:%=pics/%) := \
-	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-
-$(PORTSTDIO64:%=pics/%) := \
-	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-
-$(PORTSYS64:%=pics/%) := \
-	CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-
-$(PORTSTDIO_W:%=pics/%) := \
-	CPPFLAGS += -D_WIDE
-
-$(PORTPRINT_W:%=pics/%) := \
-	CPPFLAGS += -D_WIDE
-
-$(PORTPRINT_C89:%=pics/%) := \
-	CPPFLAGS += -D_C89_INTMAX32
-
-$(PORTSTDIO_C89:%=pics/%) := \
-	CPPFLAGS += -D_C89_INTMAX32
-
-$(PORTI18N_COND:%=pics/%) := \
-	CPPFLAGS += -D_WCS_LONGLONG
-
-pics/arc4random.o :=	CPPFLAGS += -I$(SRC)/common/crypto/chacha
-
-pics/__clock_gettime.o := CPPFLAGS += $(COMMPAGE_CPPFLAGS)
-
-.KEEP_STATE:
-
-all: $(LIBS) $(LIB_PIC)
-
-lint	:=	CPPFLAGS += -I$(LIBCDIR)/$(MACH)/fp
-lint	:=	CPPFLAGS += -D_MSE_INT_H -D_LCONV_C99
-lint	:=	LINTFLAGS += -mn -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
-
-lint:
-	@echo $(LINT.c) ...
-	@$(LINT.c) $(SRCS) $(LDLIBS)
-
-$(LINTLIB):= SRCS=$(LIBCDIR)/port/llib-lc
-$(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
-$(LINTLIB):= LINTFLAGS=-nvx
-
-# object files that depend on inline template
-$(TIL:%=pics/%): $(LIBCBASE)/threads/i386.il
-# pics/mul64.o: $(LIBCBASE)/crt/mul64.il
-
-# include common libc targets
-include $(LIBCDIR)/Makefile.targ
-
-# We need to strip out all CTF and DOF data from the static library
-$(LIB_PIC) := DIR = pics
-$(LIB_PIC): pics $$(PICS)
-	$(BUILD.AR)
-	$(MCS) -d -n .SUNW_ctf $@ > /dev/null 2>&1
-	$(MCS) -d -n .SUNW_dof $@ > /dev/null 2>&1
-	$(AR) -ts $@ > /dev/null
-	$(POST_PROCESS_A)
-
-$(LIBCBASE)/crt/_rtbootld.s: $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.c
-	$(CC) $(CPPFLAGS) $(CTF_FLAGS) -O -S $(C_PICFLAGS) \
-	    $(LIBCBASE)/crt/_rtld.c -o $(LIBCBASE)/crt/_rtld.s
-	$(CAT) $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.s > $@
-	$(RM) $(LIBCBASE)/crt/_rtld.s
-
-# partially built from C source
-pics/_rtbootld.o: $(LIBCBASE)/crt/_rtbootld.s
-	$(AS) $(ASFLAGS) $(LIBCBASE)/crt/_rtbootld.s -o $@
-	$(CTFCONVERT_O)
-
-ASSYMDEP_OBJS=			\
-	_lwp_mutex_unlock.o	\
-	_stack_grow.o		\
-	getcontext.o		\
-	setjmp.o		\
-	tls_get_addr.o		\
-	vforkx.o
-
-$(ASSYMDEP_OBJS:%=pics/%)	:=	CPPFLAGS += -I.
-
-$(ASSYMDEP_OBJS:%=pics/%): assym.h
-
-# assym.h build rules
-
-GENASSYM_C = $(LIBCDIR)/$(MACH)/genassym.c
-
-genassym: $(GENASSYM_C)
-	$(NATIVECC) $(NATIVE_CFLAGS) -I$(LIBCBASE)/inc -I$(LIBCDIR)/inc	\
-		-D__EXTENSIONS__ $(CPPFLAGS.native) -o $@ $(GENASSYM_C)
-
-OFFSETS = $(LIBCDIR)/$(MACH)/offsets.in
-
-assym.h: $(OFFSETS) genassym
-	$(OFFSETS_CREATE) <$(OFFSETS) >$@
-	./genassym >>$@
-
-# derived C source and related explicit dependencies
-$(LIBCDIR)/port/gen/errlst.c + \
-$(LIBCDIR)/port/gen/new_list.c: $(LIBCDIR)/port/gen/errlist $(LIBCDIR)/port/gen/errlist.awk
-	cd $(LIBCDIR)/port/gen; pwd; $(AWK) -f errlist.awk < errlist
-
-pics/errlst.o: $(LIBCDIR)/port/gen/errlst.c
-
-pics/new_list.o: $(LIBCDIR)/port/gen/new_list.c
--- old/usr/src/lib/libc/i386_hwcap3/Makefile	Mon Jun 12 08:24:40 2017
+++ /dev/null	Mon Jun 12 08:24:31 2017
@@ -1,48 +0,0 @@
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
-# lib/libc/i386_hwcap3/Makefile
-#
-
-LIBCBASE=	../i386
-
-LIBRARY=	libc_hwcap3.a
-
-EXTN_CPPFLAGS=	-D_CMOV_INSN -D_SSE_INSN -D_MMX_INSN
-EXTN_CFLAGS=	-xtarget=pentium_pro
-EXTN_DYNFLAGS=	-M mapfile
-
-# Defining this means build targets will first try to use source from this
-# directory before falling back to unoptimized i386 source.
-#
-# Currently, the only differences between hwcap3 and hwcap1 is the kernel entry
-# method (hwcap1 uses "sysenter" and hwcap2 uses "syscall" while hwcap3 uses
-# "int 0x91".  So for now, build libc_hwcap3 with the optimized sources for
-# libc_hwcap1.
-#
-OPTIMIZED_LIBCBASE=../i386_hwcap1
-
-include ../i386/Makefile.com
--- old/usr/src/pkg/manifests/system-library.mf	Mon Jun 12 08:24:41 2017
+++ new/usr/src/pkg/manifests/system-library.mf	Mon Jun 12 08:24:41 2017
@@ -101,7 +101,6 @@
 dir path=usr/lib/cfgadm
 dir path=usr/lib/cfgadm/$(ARCH64)
 dir path=usr/lib/iconv/$(ARCH64)
-$(i386_ONLY)dir path=usr/lib/libc
 dir path=usr/lib/lwp
 dir path=usr/lib/lwp/$(ARCH64)
 dir path=usr/lib/python$(PYTHON_VERSION)
@@ -261,7 +260,7 @@
 file path=lib/libaio.so.1
 file path=lib/libavl.so.1
 file path=lib/libbsm.so.1
-file path=lib/libc.so.1 reboot-needed=true
+file path=lib/libc.so.1
 file path=lib/libc_db.so.1
 file path=lib/libcmdutils.so.1
 file path=lib/libcontract.so.1
@@ -411,9 +410,6 @@
 file path=usr/lib/libadutils.so.1
 file path=usr/lib/libast.so.1
 file path=usr/lib/libbsdmalloc.so.1
-$(i386_ONLY)file path=usr/lib/libc/libc_hwcap1.so.1 reboot-needed=true
-$(i386_ONLY)file path=usr/lib/libc/libc_hwcap2.so.1 reboot-needed=true
-$(i386_ONLY)file path=usr/lib/libc/libc_hwcap3.so.1 reboot-needed=true
 file path=usr/lib/libcfgadm.so.1
 file path=usr/lib/libcmd.so.1
 file path=usr/lib/libcommputil.so.1
@@ -617,7 +613,7 @@
 link path=lib/$(ARCH64)/libaio.so target=libaio.so.1
 link path=lib/$(ARCH64)/libavl.so target=libavl.so.1
 link path=lib/$(ARCH64)/libbsm.so target=libbsm.so.1
-link path=lib/$(ARCH64)/libc.so reboot-needed=true target=libc.so.1
+link path=lib/$(ARCH64)/libc.so target=libc.so.1
 link path=lib/$(ARCH64)/libc_db.so target=libc_db.so.1
 link path=lib/$(ARCH64)/libcontract.so target=libcontract.so.1
 link path=lib/$(ARCH64)/libcryptoutil.so target=libcryptoutil.so.1
