--- old/usr/src/cmd/awk_xpg4/Makefile	2017-09-04 19:55:56.732694602 +0000
+++ new/usr/src/cmd/awk_xpg4/Makefile	2017-09-04 19:55:56.745658302 +0000
@@ -70,8 +70,8 @@
 
 install: all $(ROOTXPG4PROG)
 
-values-xpg4.o: ../../lib/common/common/values-xpg4.c
-	$(COMPILE.c) -o $@ ../../lib/common/common/values-xpg4.c
+values-xpg4.o: ../../lib/crt/common/values-xpg4.c
+	$(COMPILE.c) -o $@ ../../lib/crt/common/values-xpg4.c
 
 clean:
 	$(RM) $(OBJS) $(XPG4) $(CLEANFILES)
--- old/usr/src/cmd/awk_xpg4/inc.flg	2017-09-04 19:55:57.142930209 +0000
+++ /dev/null	2017-09-04 19:55:57.000000000 +0000
@@ -1,30 +0,0 @@
-#!/bin/sh
-#
-# 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 2005 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
-
-echo_file usr/src/lib/common/common/values-xpg4.c
--- old/usr/src/cmd/cron/Makefile	2017-09-04 19:55:57.267419861 +0000
+++ new/usr/src/cmd/cron/Makefile	2017-09-04 19:55:57.280067316 +0000
@@ -181,8 +181,8 @@
 objs.xpg4:
 	-@mkdir -p $@
 
-objs.xpg4/values-xpg4.o:	../../lib/common/common/values-xpg4.c
-	$(COMPILE.c) -o $@ ../../lib/common/common/values-xpg4.c
+objs.xpg4/values-xpg4.o:	../../lib/crt/common/values-xpg4.c
+	$(COMPILE.c) -o $@ ../../lib/crt/common/values-xpg4.c
 
 %.o:			$(SRC)/common/util/%.c
 	$(COMPILE.c) $(OUTPUT_OPTION) $<
--- old/usr/src/cmd/cron/inc.flg	2017-09-04 19:55:57.640375751 +0000
+++ /dev/null	2017-09-04 19:55:57.000000000 +0000
@@ -1,31 +0,0 @@
-#!/bin/sh
-#
-# 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"
-#
-
-echo_file usr/src/lib/common/common/values-xpg4.c
-echo_file usr/src/common/util/getresponse.c
-echo_file usr/src/common/util/getresponse.h
--- old/usr/src/cmd/date/Makefile	2017-09-04 19:55:57.777886554 +0000
+++ new/usr/src/cmd/date/Makefile	2017-09-04 19:55:57.795224593 +0000
@@ -20,8 +20,6 @@
 # CDDL HEADER END
 #
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
-#
 # Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
@@ -48,8 +46,8 @@
 
 install: all $(ROOTPROG) $(ROOTXPG4PROG)
 
-values-xpg4.o: ../../lib/common/common/values-xpg4.c
-	$(COMPILE.c) -o $@ ../../lib/common/common/values-xpg4.c
+values-xpg4.o: ../../lib/crt/common/values-xpg4.c
+	$(COMPILE.c) -o $@ ../../lib/crt/common/values-xpg4.c
 
 clean:
 	$(RM) $(OBJS)
--- old/usr/src/cmd/date/inc.flg	2017-09-04 19:55:58.170765351 +0000
+++ /dev/null	2017-09-04 19:55:58.000000000 +0000
@@ -1,30 +0,0 @@
-#!/bin/sh
-#
-# 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.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
-
-echo_file usr/src/lib/common/common/values-xpg4.c
--- old/usr/src/cmd/ed/Makefile	2017-09-04 19:55:58.309518436 +0000
+++ new/usr/src/cmd/ed/Makefile	2017-09-04 19:55:58.322640922 +0000
@@ -103,11 +103,11 @@
 	$(RM) $(ROOTBIN)/red
 	$(LN) $(ROOTBIN)/ed $(ROOTBIN)/red
 
-values-xpg4.o: ../../lib/common/common/values-xpg4.c
-	$(COMPILE.c) -o $@ ../../lib/common/common/values-xpg4.c
+values-xpg4.o: ../../lib/crt/common/values-xpg4.c
+	$(COMPILE.c) -o $@ ../../lib/crt/common/values-xpg4.c
 
-values-xpg6.o: ../../lib/common/common/values-xpg6.c
-	$(COMPILE.c) -o $@ ../../lib/common/common/values-xpg6.c
+values-xpg6.o: ../../lib/crt/common/values-xpg6.c
+	$(COMPILE.c) -o $@ ../../lib/crt/common/values-xpg6.c
 
 clean:
 	-@rm -rf $(OBJS) $(XPG4) $(XPG6) edobjs.xpg4 edobjs.xpg6 \
--- old/usr/src/cmd/ed/inc.flg	2017-09-04 19:55:58.690001087 +0000
+++ new/usr/src/cmd/ed/inc.flg	2017-09-04 19:55:58.702509060 +0000
@@ -24,9 +24,6 @@
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
 
 echo_file usr/src/cmd/expr/compile.c
 echo_file usr/src/cmd/expr/mapfile-intf
-echo_file usr/src/lib/common/common/values-xpg4.c
-echo_file usr/src/lib/common/common/values-xpg6.c
--- old/usr/src/cmd/env/Makefile	2017-09-04 19:55:59.058131345 +0000
+++ new/usr/src/cmd/env/Makefile	2017-09-04 19:55:59.070596630 +0000
@@ -23,8 +23,6 @@
 # Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 
 PROG= env
 XPG4PROG= env
@@ -44,8 +42,8 @@
 
 install: all $(ROOTPROG) $(ROOTXPG4PROG)
 
-values-xpg4.o: ../../lib/common/common/values-xpg4.c
-	$(COMPILE.c) -o $@ ../../lib/common/common/values-xpg4.c
+values-xpg4.o: ../../lib/crt/common/values-xpg4.c
+	$(COMPILE.c) -o $@ ../../lib/crt/common/values-xpg4.c
 
 clean:
 	$(RM) $(OBJS)
--- old/usr/src/cmd/env/inc.flg	2017-09-04 19:55:59.440152219 +0000
+++ /dev/null	2017-09-04 19:55:59.000000000 +0000
@@ -1,30 +0,0 @@
-#!/bin/sh
-#
-# 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.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
-
-echo_file usr/src/lib/common/common/values-xpg4.c
--- old/usr/src/cmd/getconf/Makefile	2017-09-04 19:55:59.577739460 +0000
+++ new/usr/src/cmd/getconf/Makefile	2017-09-04 19:55:59.590110843 +0000
@@ -111,8 +111,8 @@
 
 install: all $(ROOTPROG) $(ROOTXPG4PROG) $(ROOTXPG6PROG)
 
-values-xpg4.o: ../../lib/common/common/values-xpg4.c
-	$(COMPILE.c) -o $@ ../../lib/common/common/values-xpg4.c
+values-xpg4.o: ../../lib/crt/common/values-xpg4.c
+	$(COMPILE.c) -o $@ ../../lib/crt/common/values-xpg4.c
 
 clean:
 	-@rm -rf $(OBJS) $(XPG4EXOBJS) $(XPG6EXOBJS) $(X4) $(X6) \
--- old/usr/src/cmd/getconf/inc.flg	2017-09-04 19:55:59.917576190 +0000
+++ /dev/null	2017-09-04 19:55:59.000000000 +0000
@@ -1,31 +0,0 @@
-#!/bin/sh
-#
-# 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.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
-
-echo_file usr/src/lib/common/common/values-xpg4.c
-echo_file usr/src/lib/common/common/values-xpg6.c
--- old/usr/src/cmd/link/Makefile	2017-09-04 19:56:00.054132581 +0000
+++ new/usr/src/cmd/link/Makefile	2017-09-04 19:56:00.065904844 +0000
@@ -50,8 +50,8 @@
 	-$(RM) $(ROOTETCPROG)
 	-$(SYMLINK) ../usr/sbin/$(PROG) $(ROOTETCPROG)
 
-values-xpg4.o: ../../lib/common/common/values-xpg4.c
-	$(COMPILE.c) -o $@ ../../lib/common/common/values-xpg4.c
+values-xpg4.o: ../../lib/crt/common/values-xpg4.c
+	$(COMPILE.c) -o $@ ../../lib/crt/common/values-xpg4.c
 
 clean:
 	$(RM) $(OBJS)
--- old/usr/src/cmd/link/inc.flg	2017-09-04 19:56:00.419330258 +0000
+++ /dev/null	2017-09-04 19:56:00.000000000 +0000
@@ -1,30 +0,0 @@
-#!/bin/sh
-#
-# 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.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
-
-echo_file usr/src/lib/common/common/values-xpg4.c
--- old/usr/src/cmd/mv/Makefile	2017-09-04 19:56:00.547990092 +0000
+++ new/usr/src/cmd/mv/Makefile	2017-09-04 19:56:00.559585775 +0000
@@ -76,8 +76,8 @@
 	$(COMPILE.c) -o $@ $<
 	$(POST_PROCESS_O)
 
-%values-xpg4.o:		../../lib/common/common/values-xpg4.c
-	$(COMPILE.c) -o $@ ../../lib/common/common/values-xpg4.c
+%values-xpg4.o:		../../lib/crt/common/values-xpg4.c
+	$(COMPILE.c) -o $@ ../../lib/crt/common/values-xpg4.c
 
 $(CPFILE):	$(PROG)
 	@$(RM) $(CPFILE); $(LN) $(PROG) $(CPFILE)
--- old/usr/src/cmd/mv/inc.flg	2017-09-04 19:56:00.899952955 +0000
+++ /dev/null	2017-09-04 19:56:00.000000000 +0000
@@ -1,31 +0,0 @@
-#!/bin/sh
-#
-# 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"
-#
-
-echo_file usr/src/lib/common/common/values-xpg4.c
-echo_file usr/src/common/util/getresponse.c
-echo_file usr/src/common/util/getresponse.h
--- old/usr/src/cmd/nice/Makefile	2017-09-04 19:56:01.040058646 +0000
+++ new/usr/src/cmd/nice/Makefile	2017-09-04 19:56:01.052284400 +0000
@@ -23,8 +23,6 @@
 # Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 
 PROG= nice
 XPG4PROG= nice
@@ -45,8 +43,8 @@
 
 install: all $(ROOTPROG) $(ROOTXPG4PROG)
 
-values-xpg4.o: ../../lib/common/common/values-xpg4.c
-	$(COMPILE.c) -o $@ ../../lib/common/common/values-xpg4.c
+values-xpg4.o: ../../lib/crt/common/values-xpg4.c
+	$(COMPILE.c) -o $@ ../../lib/crt/common/values-xpg4.c
 
 clean:
 	$(RM) $(OBJS)
--- old/usr/src/cmd/nice/inc.flg	2017-09-04 19:56:01.388780676 +0000
+++ /dev/null	2017-09-04 19:56:01.000000000 +0000
@@ -1,30 +0,0 @@
-#!/bin/sh
-#
-# 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.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
-
-echo_file usr/src/lib/common/common/values-xpg4.c
--- old/usr/src/cmd/sgs/0@0/amd64/Makefile	2017-09-04 19:56:01.517505228 +0000
+++ new/usr/src/cmd/sgs/0@0/amd64/Makefile	2017-09-04 19:56:01.530026550 +0000
@@ -23,10 +23,8 @@
 # Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 
-CRTSRCS =	$(SRC)/lib/common/amd64
+CRTSRCS =	$(SRC)/lib/crt/amd64
 
 include		$(SRC)/cmd/sgs/0@0/Makefile.com
 
--- old/usr/src/cmd/sgs/0@0/i386/Makefile	2017-09-04 19:56:01.907199702 +0000
+++ new/usr/src/cmd/sgs/0@0/i386/Makefile	2017-09-04 19:56:01.921747071 +0000
@@ -23,9 +23,8 @@
 # Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
 
-CRTSRCS=        $(SRC)/lib/common/i386
+CRTSRCS=        $(SRC)/lib/crt/i86
 include		$(SRC)/cmd/sgs/0@0/Makefile.com
 
 .KEEP_STATE:
--- old/usr/src/cmd/sgs/0@0/sparc/Makefile	2017-09-04 19:56:02.288839829 +0000
+++ new/usr/src/cmd/sgs/0@0/sparc/Makefile	2017-09-04 19:56:02.303806371 +0000
@@ -23,9 +23,8 @@
 # Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
 
-CRTSRCS=	$(SRC)/lib/common/sparc
+CRTSRCS=	$(SRC)/lib/crt/sparcv7
 
 include		$(SRC)/cmd/sgs/0@0/Makefile.com
 
--- old/usr/src/cmd/sgs/0@0/sparcv9/Makefile	2017-09-04 19:56:02.678496891 +0000
+++ new/usr/src/cmd/sgs/0@0/sparcv9/Makefile	2017-09-04 19:56:02.691451609 +0000
@@ -23,9 +23,8 @@
 # Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
 
-CRTSRCS=        $(SRC)/lib/common/sparcv9
+CRTSRCS=        $(SRC)/lib/crt/sparcv9
 include		$(SRC)/cmd/sgs/0@0/Makefile.com
 
 .KEEP_STATE:
--- old/usr/src/cmd/sgs/rtld/amd64/Makefile	2017-09-04 19:56:03.057539280 +0000
+++ new/usr/src/cmd/sgs/rtld/amd64/Makefile	2017-09-04 19:56:03.070119297 +0000
@@ -48,7 +48,7 @@
 
 S_ASOBJS=	
 
-CRTSRCS=	../../../../lib/common/amd64
+CRTSRCS=	../../../../lib/crt/amd64
 CRTI=		pics/crti.o
 CRTN=		pics/crtn.o
 CRTS=		$(CRTI)		$(CRTN)
--- old/usr/src/cmd/sgs/rtld/i386/Makefile	2017-09-04 19:56:03.431438936 +0000
+++ new/usr/src/cmd/sgs/rtld/i386/Makefile	2017-09-04 19:56:03.444453961 +0000
@@ -48,7 +48,7 @@
 
 S_ASOBJS=
 
-CRTSRCS=	../../../../lib/common/i386
+CRTSRCS=	../../../../lib/crt/i86
 CRTI=		pics/crti.o
 CRTN=		pics/crtn.o
 CRTS=		$(CRTI)		$(CRTN)
--- old/usr/src/cmd/sgs/rtld/sparc/Makefile	2017-09-04 19:56:03.816131141 +0000
+++ new/usr/src/cmd/sgs/rtld/sparc/Makefile	2017-09-04 19:56:03.828862442 +0000
@@ -47,7 +47,7 @@
 
 S_ASOBJS=	boot_a.out.o
 
-CRTSRCS=	../../../../lib/common/sparc
+CRTSRCS=	../../../../lib/crt/sparcv7
 CRTI=		pics/crti.o
 CRTN=		pics/crtn.o
 CRTS=		$(CRTI)		$(CRTN)
--- old/usr/src/cmd/sgs/rtld/sparcv9/Makefile	2017-09-04 19:56:04.178697318 +0000
+++ new/usr/src/cmd/sgs/rtld/sparcv9/Makefile	2017-09-04 19:56:04.191090036 +0000
@@ -46,7 +46,7 @@
 
 S_ASOBJS=	
 
-CRTSRCS=	../../../../lib/common/sparcv9
+CRTSRCS=	../../../../lib/crt/sparcv9
 CRTI=		pics/crti.o
 CRTN=		pics/crtn.o
 CRTS=		$(CRTI)		$(CRTN)
--- old/usr/src/cmd/vi/port/Makefile	2017-09-04 19:56:04.545065644 +0000
+++ new/usr/src/cmd/vi/port/Makefile	2017-09-04 19:56:04.558201773 +0000
@@ -117,11 +117,11 @@
 $(XD4)/compile.o $(XD6)/compile.o: ../../expr/compile.c
 	$(COMPILE.c) -o $@ ../../expr/compile.c
 
-%values-xpg4.o: ../../../lib/common/common/values-xpg4.c
-	$(COMPILE.c) -o $@ ../../../lib/common/common/values-xpg4.c
+%values-xpg4.o: ../../../lib/crt/common/values-xpg4.c
+	$(COMPILE.c) -o $@ ../../../lib/crt/common/values-xpg4.c
 
-%values-xpg6.o: ../../../lib/common/common/values-xpg6.c
-	$(COMPILE.c) -o $@ ../../../lib/common/common/values-xpg6.c
+%values-xpg6.o: ../../../lib/crt/common/values-xpg6.c
+	$(COMPILE.c) -o $@ ../../../lib/crt/common/values-xpg6.c
 
 $(XPG4EXOBJS): $(XD4)
 
--- old/usr/src/cmd/vi/port/inc.flg	2017-09-04 19:56:04.919886616 +0000
+++ new/usr/src/cmd/vi/port/inc.flg	2017-09-04 19:56:04.929593812 +0000
@@ -24,10 +24,6 @@
 # Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 
 echo_file usr/src/cmd/expr/compile.c
-echo_file usr/src/lib/common/common/values-xpg4.c
-echo_file usr/src/lib/common/common/values-xpg6.c
-echo_file usr/src/lib/libc/inc/xpg6.h
+
--- old/usr/src/lib/Makefile	2017-09-04 19:56:05.305517008 +0000
+++ new/usr/src/lib/Makefile	2017-09-04 19:56:05.318381686 +0000
@@ -43,7 +43,7 @@
 
 # Build libc and its dependencies
 SUBDIRS=			\
-	common			\
+	crt			\
 	../cmd/sgs/libconv	\
 	../cmd/sgs/libdl	\
 	libc			\
@@ -548,8 +548,8 @@
 _dc:			$(DCSUBDIRS:%=%-nodepend)
 
 # Library interdependencies are called out explicitly here.
-../cmd/sgs/libconv: common
-../cmd/sgs/libdl: common
+../cmd/sgs/libconv: crt
+../cmd/sgs/libdl: crt
 libc:		../cmd/sgs/libconv ../cmd/sgs/libdl
 
 libm:		libc
--- old/usr/src/lib/common/amd64/crt1.s	2017-09-04 19:56:05.717016922 +0000
+++ /dev/null	2017-09-04 19:56:05.000000000 +0000
@@ -1,192 +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.
- */
-
-/*
- * This crt1.o module is provided as the bare minimum required to build
- * a 64-bit executable with gcc.  It is installed in /usr/lib/amd64
- * where it will be picked up by gcc, along with crti.o and crtn.o
- */
-
-	.ident	"%Z%%M%	%I%	%E% SMI"
-
-	.file	"crt1.s"
-
-	.globl	_start
-
-/* global entities defined elsewhere but used here */
-	.globl	main
-	.globl	__fpstart
-	.globl	exit
-	.globl	_exit
-	.weak	_DYNAMIC
-
-	.section	.data
-
-	.weak	environ
-	.set	environ,_environ
-	.globl	_environ
-	.type	_environ,@object
-	.size	_environ,8
-	.align	8
-_environ:
-	.8byte	0x0
-
-	.globl	__environ_lock
-	.type	__environ_lock,@object
-	.size	__environ_lock,24
-	.align	8
-__environ_lock:
-	.zero	24
-
-	.globl	___Argv
-	.type	___Argv,@object
-	.size	___Argv,8
-	.align	8
-___Argv:
-	.8byte	0x0
-
-	.section	.text
-	.align	8
-
-/*
- *   The SVR4/i386 ABI (pages 3-29) says that when the entry
- *   point runs registers' %rbp, %rsp, %rdx values are specified
- *   the following:
- *
- *	%rbp The content of this register is unspecified at
- *		process initialization time, but the user code should mark
- *		the deepest stack frame by setting the frame pointer to zero.
- *		No other frame's %ebp should have a zero value.
- *
- *	%rsp Performing its usual job, the stack pointer holds the address
- *	of the bottom of the stack, which is guaranteed to be
- *	quadword aligned.
- *
- *		The stack contains the arguments and environment:
- *        ...
- *        envp[0]		(16+(8*argc))(%rsp)
- *        NULL			(8+(8*argc))(%rsp)
- *        ...
- *        argv[0]		8(%rsp)
- *        argc			0(%rsp)
- *
- *	%rdx In a conforming program, this register contains a function
- *		pointer that the application should register with atexit(BA_OS).
- *		This function is used for shared object termination code
- *		[see Dynamic Linking in Chapter 5 of the System V ABI].
- *
- */
-
-	.type	_start,@function
-_start:
-/*
- * Allocate a NULL return address and a NULL previous %rbp as if
- * there was a genuine call to _start.
- */
-	pushq	$0
-	pushq	$0
-	movq	%rsp,%rbp		/* The first stack frame */
-
-/*
- * The stack now is
- *
- *        envp[0]		(32+(8*argc))(%rsp)      - (A)
- *        NULL			(24+(8*argc))(%rsp)
- *        ...
- *        argv[0]		24(%rbp)		 - (B)
- *        argc			16(%rbp)
- *	  0			8(%rbp)
- *	  0			0(%rbp)
- */
-
-	movq	$_DYNAMIC,%rax
-	testq	%rax,%rax
-	jz	1f
-	movq	%rdx,%rdi		/* register rt_do_exit */
-	call	atexit
-1:
-	movq	$_fini,%rdi
-	call	atexit
-
-/*
- * Calculate the location of the envp array by adding the size of
- * the argv array to the start of the argv array.
- */
-	movq	16(%rbp),%rax		/* argc */
-	movq	_environ, %rcx
-	testq	%rcx, %rcx		/* check if _environ==0 */
-	jne	1f
-	leaq	32(%rbp,%rax,8),%rcx	/* (A) */
-	movq	%rcx,_environ		/* copy to _environ */
-1:
-
-/*
- * Force stack alignment - below here there must have been an even
- * number of un-popped pushq instructions whenever a call is reached
- */
-	andq	$-16,%rsp
-	pushq	%rdx
-	leaq	24(%rbp),%rdx		/* argv (B) */
-	movq	%rdx,___Argv
-	pushq	%rcx
-	pushq	%rdx
-	pushq	%rax
-	call	__fpstart
-	call	_init
-	popq	%rdi
-	popq	%rsi
-	popq	%rdx
-	popq	%rcx
-	call	main			/* main(argc,argv,envp) */
-	pushq	%rax
-	pushq	%rax
-	movq	%rax,%rdi		/* and call exit */
-	call	exit
-	popq	%rdi
-	popq	%rdi
-	call	_exit		/* if user redefined exit, call _exit */
-	hlt
-	.size	_start, .-_start
-
-/*
- * The following is here in case any object module compiled with cc -p
- *	was linked into this module.
- */
-	.globl	_mcount
-	.section	.text
-	.align	8
-	.type	_mcount,@function
-_mcount:
-	ret
-	.size	_mcount, .-_mcount
-
-	.globl	__longdouble_used
-	.section	.data
-	.align	8
-	.type	__longdouble_used,@object
-	.size	__longdouble_used,4
-__longdouble_used:
-	.4byte	0
--- old/usr/src/lib/common/amd64/gcrt1.s	2017-09-04 19:56:05.855047997 +0000
+++ /dev/null	2017-09-04 19:56:05.000000000 +0000
@@ -1,191 +0,0 @@
-/*
- * 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.
- */
-
-/*
- * This crt1.o module is provided as the bare minimum required to build a
- * 64-bit progile executable with gcc -pg.  It is installed in /usr/lib/amd64
- * where it will be picked up by gcc, along with crti.o and crtn.o
- */
-
-	.ident	"%Z%%M%	%I%	%E% SMI"
-
-	.file	"gcrt1.s"
-
-	.globl	_start
-	.globl	_etext
-
-/* global entities defined elsewhere but used here */
-	.globl	main
-	.globl	__fpstart
-	.globl	_init
-	.globl	_fini
-	.globl	exit
-	.globl	_exit
-	.globl	monstartup
-	.weak	_mcleanup
-	.weak	_DYNAMIC
-
-	.section	.data
-
-	.weak	environ
-	.set	environ,_environ
-	.globl	_environ
-	.type	_environ,@object
-	.size	_environ,8
-	.align	8
-_environ:
-	.8byte	0x0
-
-	.globl	___Argv
-	.type	___Argv,@object
-	.size	___Argv,8
-	.align	8
-___Argv:
-	.8byte	0x0
-
-	.section	.text
-	.align	8
-
-/*
- *   The SVR4/i386 ABI (pages 3-29) says that when the entry
- *   point runs registers' %rbp, %rsp, %rdx values are specified
- *   the following:
- *
- *	%rbp The content of this register is unspecified at
- *		process initialization time, but the user code should mark
- *		the deepest stack frame by setting the frame pointer to zero.
- *		No other frame's %ebp should have a zero value.
- *
- *	%rsp Performing its usual job, the stack pointer holds the address
- *	of the bottom of the stack, which is guaranteed to be
- *	quadword aligned.
- *
- *		The stack contains the arguments and environment:
- *        ...
- *        envp[0]		(16+(8*argc))(%rsp)
- *        NULL			(8+(8*argc))(%rsp)
- *        ...
- *        argv[0]		8(%rsp)
- *        argc			0(%rsp)
- *
- *	%rdx In a conforming program, this register contains a function
- *		pointer that the application should register with atexit(BA_OS).
- *		This function is used for shared object termination code
- *		[see Dynamic Linking in Chapter 5 of the System V ABI].
- *
- */
-
-	.type	_start,@function
-_start:
-/*
- * Allocate a NULL return address and a NULL previous %rbp as if
- * there was a genuine call to _start.
- */
-	pushq	$0
-	pushq	$0
-	movq	%rsp,%rbp		/* The first stack frame */
-
-/*
- * The stack now is
- *
- *        envp[0]		(32+(8*argc))(%rsp)      - (A)
- *        NULL			(24+(8*argc))(%rsp)
- *        ...
- *        argv[0]		24(%rbp)		 - (B)
- *        argc			16(%rbp)
- *	  0			8(%rbp)
- *	  0			0(%rbp)
- */
-
-/*
- * Check to see if there is an _mcleanup() function linked in, and if so,
- * register it with atexit() as the last thing to be run by exit().
- */
-	movq	%rdx,%r12		/* save rt_do_exit for later atexit */
-
-	movq	$_mcleanup,%rdi
-	testq	%rdi,%rdi
-	jz	1f
-	call	atexit
-1:
-
-	movq	$_DYNAMIC,%rax
-	testq	%rax,%rax
-	jz	1f
-	movq	%r12,%rdi		/* register rt_do_exit */
-	call	atexit
-1:
-
-	movq	$_fini,%rdi
-	call	atexit
-
-/* start profiling */
-	pushq	%rbp
-	movq	%rsp,%rbp
-	movq	$_start,%rdi
-	movq	$_etext,%rsi
-	call	monstartup
-	popq	%rbp
-
-/*
- * Calculate the location of the envp array by adding the size of
- * the argv array to the start of the argv array.
- */
-	movq	16(%rbp),%rax		/* argc */
-	movq	_environ, %rcx
-	testq	%rcx, %rcx		/* check if _environ==0 */
-	jne	1f
-	leaq	32(%rbp,%rax,8),%rcx	/* (A) */
-	movq	%rcx,_environ		/* copy to _environ */
-1:
-
-/*
- * Force stack alignment - below here there must have been an even
- * number of un-popped pushq instructions whenever a call is reached
- */
-	andq	$-16,%rsp
-	pushq	%rdx
-	leaq	24(%rbp),%rdx		/* argv (B) */
-	movq	%rdx,___Argv
-	pushq	%rcx
-	pushq	%rdx
-	pushq	%rax
-	call	__fpstart
-	call	_init
-	popq	%rdi
-	popq	%rsi
-	popq	%rdx
-	popq	%rcx
-	call	main			/* main(argc,argv,envp) */
-	pushq	%rax
-	pushq	%rax
-	movq	%rax,%rdi		/* and call exit */
-	call	exit
-	popq	%rdi
-	popq	%rdi
-	call	_exit		/* if user redefined exit, call _exit */
-	hlt
-	.size	_start, .-_start
--- old/usr/src/lib/common/i386/crt1.s	2017-09-04 19:56:06.001815743 +0000
+++ /dev/null	2017-09-04 19:56:06.000000000 +0000
@@ -1,216 +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.
- */
-
-/*
- * This crt1.o module is provided as the bare minimum required to build
- * a 32-bit executable with gcc.  It is installed in /usr/lib
- * where it will be picked up by gcc, along with crti.o and crtn.o
- */
-
-	.file	"crt1.s"
-
-	.globl	_start
-
-/* global entities defined elsewhere but used here */
-	.globl	main
-	.globl	__fpstart
-	.globl	exit
-	.globl	_exit
-	.weak	_DYNAMIC
-
-	.section	.data
-
-	.weak	environ
-	.set	environ,_environ
-	.globl	_environ
-	.type	_environ,@object
-	.size	_environ,4
-	.align	4
-_environ:
-	.4byte	0x0
-
-	.globl	__environ_lock
-	.type	__environ_lock,@object
-	.size	__environ_lock,24
-	.align	8
-__environ_lock:
-	.zero	24
-
-	.globl	___Argv
-	.type	___Argv,@object
-	.size	___Argv,4
-	.align	4
-___Argv:
-	.4byte	0x0
-
-	.section	.text
-	.align	4
-
-/*
- * C language startup routine.
- * Assume that exec code has cleared the direction flag in the TSS.
- * Assume that %esp is set to the addr after the last word pushed.
- * The stack contains (in order): argc, argv[],envp[],...
- * Assume that all of the segment registers are initialized.
- *
- * Allocate a NULL return address and a NULL previous %ebp as if
- * there was a genuine call to _start.
- * sdb stack trace shows _start(argc,argv[0],argv[1],...,envp[0],...)
- */
-	.type	_start,@function
-_start:
-	pushl	$0
-	pushl	$0
-	movl	%esp,%ebp		/* The first stack frame */
-
-	movl	$_DYNAMIC,%eax
-	testl	%eax,%eax
-	jz	1f
-	pushl	%edx			/* register rt_do_exit */
-	call	atexit
-	addl	$4,%esp
-1:
-	pushl	$_fini
-	call	atexit
-	addl	$4,%esp
-
-/*
- * The following code provides almost standard static destructor handling
- * for systems that do not have the modified atexit processing in their
- * system libraries.  It checks for the existence of the new routine
- * "_get_exit_frame_monitor()", which is in libc.so when the new exit-handling
- * code is there.  It then check for the existence of "__Crun::do_exit_code()"
- * which will be in libCrun.so whenever the code was linked with the C++
- * compiler.  If there is no enhanced atexit, and we do have do_exit_code,
- * we register the latter with atexit.  There are 5 extra slots in
- * atexit, so this will still be standard conforming.  Since the code
- * is registered after the .fini section, it runs before the library
- * cleanup code, leaving nothing for the calls to _do_exit_code_in_range
- * to handle.
- *
- * Remove this code and the associated code in libCrun when the earliest
- * system to be supported is Solaris 8.
- */
-	.weak	_get_exit_frame_monitor
-	.weak	__1cG__CrunMdo_exit_code6F_v_
-
-	.section	.data
-	.align	4
-__get_exit_frame_monitor_ptr:
-	.4byte	_get_exit_frame_monitor
-	.type	__get_exit_frame_monitor_ptr,@object
-	.size	__get_exit_frame_monitor_ptr,4
-
-	.align	4
-__do_exit_code_ptr:
-	.4byte	__1cG__CrunMdo_exit_code6F_v_
-	.type	__do_exit_code_ptr,@object
-	.size	__do_exit_code_ptr,4
-
-	.section	.text
-
-	lea	__get_exit_frame_monitor_ptr, %eax
-	movl	(%eax), %eax
-	testl	%eax,%eax
-	jz	1f
-	lea	__do_exit_code_ptr, %eax
-	movl	(%eax), %eax
-	testl	%eax, %eax
-	jz	1f
-	pushl	%eax
-	call	atexit		/* atexit(__Crun::do_exit_code()) */
-	addl	$4,%esp
-1:
-
-/*
- * End of destructor handling code
- */
-
-/*
- * Calculate the location of the envp array by adding the size of
- * the argv array to the start of the argv array.
- */
-
-	movl	8(%ebp),%eax		/* argc */
-	movl	_environ, %edx		/* fixed bug 4302802 */
-	testl	%edx, %edx		/* check if _enviorn==0 */
-	jne	1f			/* fixed bug 4203802 */
-	leal	16(%ebp,%eax,4),%edx	/* envp */
-	movl	%edx,_environ		/* copy to _environ */
-1:
-	/*
-	 * The stack needs to be 16-byte aligned with a 4-byte bias.  See
-	 * comment in lib/libc/i386/gen/makectxt.c.
-	 *
-	 * Note: If you change it, you need to change it in the following
-	 * files as well:
-	 *
-	 *  - lib/libc/i386/threads/machdep.c
-	 *  - lib/libc/i386/gen/makectxt.c
-	 *  - lib/common/i386/crti.s
-	 */
-	andl	$-16,%esp	/* make main() and exit() be called with */
-	subl	$4,%esp		/* a properly aligned stack pointer */
-	pushl	%edx
-	leal	12(%ebp),%edx	/* argv */
-	movl	%edx,___Argv
-	pushl	%edx
-	pushl	%eax		/* argc */
-	call	__fpstart
-	call	__fsr		/* support for ftrap/fround/fprecision  */
-	call	_init
-	call	main		/* main(argc,argv,envp) */
-	movl	%eax,(%esp)	/* return value from main, for exit() */
-	movl	%eax,4(%esp)	/* remember it for _exit(), below */
-	call	exit
-	movl	4(%esp),%eax	/* if user redefined exit, call _exit */
-	movl	%eax,(%esp)
-	call	_exit
-	hlt
-	.size	_start, .-_start
-
-#include "fsr.s"
-
-/*
- * The following is here in case any object module compiled with cc -p
- *	was linked into this module.
- */
-	.section	.text
-	.align	4
-	.globl	_mcount
-	.type	_mcount,@function
-_mcount:
-	ret
-	.size	_mcount, .-_mcount
-
-	.section	.data
-
-	.globl	__longdouble_used
-	.type	__longdouble_used,@object
-	.size	__longdouble_used,4
-	.align	4
-__longdouble_used:
-	.4byte	0x0
--- old/usr/src/lib/common/i386/gcrt1.s	2017-09-04 19:56:06.140914155 +0000
+++ /dev/null	2017-09-04 19:56:06.000000000 +0000
@@ -1,206 +0,0 @@
-/*
- * 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.
- */
-
-/*
- * This gcrt1.o module is provided as the bare minimum required to build a
- * 32-bit profile executable with gcc -pg.  It is installed in /usr/lib
- * where it will be picked up by gcc, along with crti.o and crtn.o
- */
-
-	.ident	"%Z%%M%	%I%	%E% SMI"
-
-	.file	"gcrt1.s"
-
-	.globl	_start
-	.globl	_etext
-
-/* global entities defined elsewhere but used here */
-	.globl	main
-	.globl	__fpstart
-	.globl	_init
-	.globl	_fini
-	.globl	exit
-	.globl	_exit
-	.globl	monstartup
-	.weak	_mcleanup
-	.weak	_DYNAMIC
-
-	.section	.data
-
-	.weak	environ
-	.set	environ,_environ
-	.globl	_environ
-	.type	_environ,@object
-	.size	_environ,4
-	.align	4
-_environ:
-	.4byte	0x0
-
-	.globl	___Argv
-	.type	___Argv,@object
-	.size	___Argv,4
-	.align	4
-___Argv:
-	.4byte	0x0
-
-	.section	.text
-	.align	4
-
-/*
- * C language startup routine.
- * Assume that exec code has cleared the direction flag in the TSS.
- * Assume that %esp is set to the addr after the last word pushed.
- * The stack contains (in order): argc, argv[],envp[],...
- * Assume that all of the segment registers are initialized.
- *
- * Allocate a NULL return address and a NULL previous %ebp as if
- * there was a genuine call to _start.
- * sdb stack trace shows _start(argc,argv[0],argv[1],...,envp[0],...)
- */
-	.type	_start,@function
-_start:
-	pushl	$0
-	pushl	$0
-	movl	%esp,%ebp		/* The first stack frame */
-
-/*
- * Check to see if there is an _mcleanup() function linked in, and if so,
- * register it with atexit() as the last thing to be run by exit().
- */
-	pushl	%edx			/* save rt_do_exit for later atexit */
-
-	movl	$_mcleanup,%eax
-	testl	%eax,%eax
-	jz	1f
-	pushl	%eax
-	call	atexit
-	addl	$4,%esp
-1:
-
-	movl	$_DYNAMIC,%eax
-	testl	%eax,%eax
-	jz	1f
-	call	atexit			/* register rt_do_exit */
-1:
-	addl	$4,%esp
-
-	pushl	$_fini
-	call	atexit
-	addl	$4,%esp
-
-/* start profiling */
-	pushl	%ebp
-	movl	%esp,%ebp
-	pushl	$_etext
-	pushl	$_start
-	call	monstartup
-	addl	$8,%esp
-	popl	%ebp
-
-/*
- * The following code provides almost standard static destructor handling
- * for systems that do not have the modified atexit processing in their
- * system libraries.  It checks for the existence of the new routine
- * "_get_exit_frame_monitor()", which is in libc.so when the new exit-handling
- * code is there.  It then check for the existence of "__Crun::do_exit_code()"
- * which will be in libCrun.so whenever the code was linked with the C++
- * compiler.  If there is no enhanced atexit, and we do have do_exit_code,
- * we register the latter with atexit.  There are 5 extra slots in
- * atexit, so this will still be standard conforming.  Since the code
- * is registered after the .fini section, it runs before the library
- * cleanup code, leaving nothing for the calls to _do_exit_code_in_range
- * to handle.
- *
- * Remove this code and the associated code in libCrun when the earliest
- * system to be supported is Solaris 8.
- */
-	.weak	_get_exit_frame_monitor
-	.weak	__1cG__CrunMdo_exit_code6F_v_
-
-	.section	.data
-	.align	4
-__get_exit_frame_monitor_ptr:
-	.4byte	_get_exit_frame_monitor
-	.type	__get_exit_frame_monitor_ptr,@object
-	.size	__get_exit_frame_monitor_ptr,4
-
-	.align	4
-__do_exit_code_ptr:
-	.4byte	__1cG__CrunMdo_exit_code6F_v_
-	.type	__do_exit_code_ptr,@object
-	.size	__do_exit_code_ptr,4
-
-	.section	.text
-
-	lea	__get_exit_frame_monitor_ptr, %eax
-	movl	(%eax), %eax
-	testl	%eax,%eax
-	jz	1f
-	lea	__do_exit_code_ptr, %eax
-	movl	(%eax), %eax
-	testl	%eax, %eax
-	jz	1f
-	pushl	%eax
-	call	atexit		/* atexit(__Crun::do_exit_code()) */
-	addl	$4,%esp
-1:
-
-/*
- * End of destructor handling code
- */
-
-/*
- * Calculate the location of the envp array by adding the size of
- * the argv array to the start of the argv array.
- */
-
-	movl	8(%ebp),%eax		/* argc */
-	movl	_environ, %edx		/* fixed bug 4302802 */
-	testl	%edx, %edx		/* check if _enviorn==0 */
-	jne	1f			/* fixed bug 4203802 */
-	leal	16(%ebp,%eax,4),%edx	/* envp */
-	movl	%edx,_environ		/* copy to _environ */
-1:
-	andl	$-16,%esp	/* align the stack */
-	subl	$4,%esp
-
-	pushl	%edx
-	leal	12(%ebp),%edx	/* argv */
-	movl	%edx,___Argv
-	pushl	%edx
-	pushl	%eax		/* argc */
-	call	__fpstart
-	call	_init
-	call	main		/* main(argc,argv,envp) */
-	addl	$12,%esp
-	pushl	%eax		/* return value from main */
-	pushl	%eax		/* push it again (for _exit(), below) */
-	call	exit
-	addl	$4,%esp
-	call	_exit		/* if user redefined exit, call _exit */
-	addl	$4,%esp
-	hlt
-	.size	_start, .-_start
--- old/usr/src/lib/common/sparc/crti.s	2017-09-04 19:56:06.288957057 +0000
+++ /dev/null	2017-09-04 19:56:06.000000000 +0000
@@ -1,60 +0,0 @@
-/*
- * 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 (c) 2001 by Sun Microsystems, Inc.
- *	All rights reserved.
- */
-
-/*
- * These crt*.o modules are provided as the bare minimum required
- * from a crt*.o for inclusion in building low level system
- * libraries.  The are only be to included in libraries which
- * contain *no* C++ code and want to avoid the startup code
- * that the C++ runtime has introduced into the crt*.o modules.
- *
- * For further details - see bug#4433015
- */
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-	.file		"crti.s"
-
-/*
- * _init function prologue
- */
-	.section	".init"
-	.global		_init
-	.type		_init, #function
-	.align	4
-
-_init:
-	save	%sp, -96, %sp
-
-/*
- * _fini function prologue
- */
-	.section	".fini"
-	.global		_fini
-	.type		_fini, #function
-	.align	4
-
-_fini:
-	save	%sp, -96, %sp
--- old/usr/src/lib/common/sparc/crtn.s	2017-09-04 19:56:06.427404764 +0000
+++ /dev/null	2017-09-04 19:56:06.000000000 +0000
@@ -1,54 +0,0 @@
-/*
- * 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 (c) 2001 by Sun Microsystems, Inc.
- *	All rights reserved.
- */
-
-/*
- * These crt*.o modules are provided as the bare minimum required
- * from a crt*.o for inclusion in building low level system
- * libraries.  The are only be to included in libraries which
- * contain *no* C++ code and want to avoid the startup code
- * that the C++ runtime has introduced into the crt*.o modules.
- *
- * For further details - see bug#4433015
- */
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-	.file		"crtn.s"
-
-/*
- * _init function epilogue
- */
-	.section	".init"
-	.align	4
-	ret
-	restore
-
-/*
- * _fini function epilogue
- */
-	.section	".fini"
-	.align	4
-	ret
-	restore
--- old/usr/src/lib/common/Makefile	2017-09-04 19:56:06.564980583 +0000
+++ /dev/null	2017-09-04 19:56:06.000000000 +0000
@@ -1,48 +0,0 @@
-#
-# 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.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
-
-include	../Makefile.lib
-
-SUBDIRS = $(MACH)
-$(BUILD64)SUBDIRS += $(MACH64)
-
-all :=		TARGET= all
-install :=	TARGET= install
-clean :=	TARGET= clean
-clobber :=	TARGET= clobber
-
-.KEEP_STATE:
-
-all install clean clobber: $(SUBDIRS)
-
-lint:
-
-$(SUBDIRS):	FRC
-	@cd $@; pwd; $(MAKE) $(TARGET)
-
-FRC:
--- /dev/null	2017-09-04 19:56:06.000000000 +0000
+++ new/usr/src/lib/crt/Makefile	2017-09-04 19:56:06.577435331 +0000
@@ -0,0 +1,45 @@
+#
+# 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.
+#
+
+include	../Makefile.lib
+
+SUBDIRS = $(MACH32)
+$(BUILD64)SUBDIRS += $(MACH64)
+
+all :=		TARGET= all
+install :=	TARGET= install
+clean :=	TARGET= clean
+clobber :=	TARGET= clobber
+lint :=		TARGET= lint
+
+.KEEP_STATE:
+
+all install clean clobber lint: $(SUBDIRS)
+
+$(SUBDIRS):	FRC
+	@cd $@; pwd; $(MAKE) $(TARGET)
+
+FRC:
--- /dev/null	2017-09-04 19:56:06.000000000 +0000
+++ new/usr/src/lib/crt/Makefile.com	2017-09-04 19:56:06.972674445 +0000
@@ -0,0 +1,98 @@
+#
+# 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 2006 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+
+CRTI = crti.o
+CRTN = crtn.o
+CRT1 = crt1.o
+VALUES = values-Xa.o values-Xc.o values-Xs.o values-Xt.o \
+		values-xpg4.o values-xpg6.o
+COMMON_CRT = common-crt.o
+MACH_CRT = mach-crt1.o
+
+# include library definitions
+include ../../Makefile.lib
+
+SRCS = $(VALUES:%.o=../common/%.c) $(COMMON_CRT:%.o=../common/%.c)
+
+POST_PROCESS_O = $(PROCESS_COMMENT) $@ ; $(STRIP) -x $@
+
+OBJECTS = $(VALUES) $(CRT1) $(CRTI) $(CRTN)
+
+ROOTLIB=	$(ROOT)/usr/lib
+ROOTLIB64=	$(ROOTLIB)/$(MACH64)
+ROOTOBJECTS=	$(OBJECTS:%=$(ROOTLIB)/%)
+ROOTOBJECTS64=	$(OBJECTS:%=$(ROOTLIB64)/%)
+
+$(INTEL_BLD)ROOTOBJECTS += $(ROOTLIB)/gcrt1.o
+$(INTEL_BLD)ROOTOBJECTS64 += $(ROOTLIB64)/gcrt1.o
+
+ASFLAGS +=	-P -D__STDC__ -D_ASM -DPIC $(AS_PICFLAGS)
+
+values-xpg6.o := CPPFLAGS += -I$(SRC)/lib/libc/inc
+values-xpg6.lint := CPPFLAGS += -I$(SRC)/lib/libc/inc
+$(COMMON_CRT) $(VALUES) := CFLAGS += $(C_PICFLAGS)
+$(COMMON_CRT) $(VALUES) := CFLAGS64 += $(C_PICFLAGS64)
+
+.KEEP_STATE:
+
+all:	$(OBJECTS)
+
+clean clobber:
+	$(RM) $(OBJECTS)
+
+%.lint: ../common/%.c
+	$(LINT.c) $(LINTCHECKFLAGS) $<
+
+lint:	$(VALUES:%.o=%.lint) $(COMMON_CRT:%.o=%.lint)
+
+$(CRT1): $(COMMON_CRT) $(MACH_CRT)
+	$(LD) -r $(MACH_CRT) $(COMMON_CRT) -o $(CRT1)
+
+%.o:	../common/%.c
+	$(COMPILE.c) -o $@ $<
+	$(POST_PROCESS_O)
+
+%.o:	%.s
+	$(COMPILE.s) -o $@ $<
+	$(POST_PROCESS_O)
+
+%.o:	../$(MACH)/%.s
+	$(COMPILE.s) -o $@ $<
+	$(POST_PROCESS_O)
+
+# install rule for ROOTOBJECTS and ROOTOBJECTS64
+$(ROOTLIB)/%.o: %.o
+	$(INS.file)
+
+$(ROOTLIB)/gcrt1.o:
+	$(RM) $(ROOTLIB)/gcrt1.o; $(SYMLINK) crt1.o $(ROOTLIB)/gcrt1.o
+
+$(ROOTLIB64)/%.o: %.o
+	$(INS.file)
+
+$(ROOTLIB64)/gcrt1.o:
+	$(RM) $(ROOTLIB64)/gcrt1.o; $(SYMLINK) crt1.o $(ROOTLIB64)/gcrt1.o
+
+FRC:
--- old/usr/src/lib/common/amd64/Makefile	2017-09-04 19:56:07.149372390 +0000
+++ /dev/null	2017-09-04 19:56:06.000000000 +0000
@@ -1,32 +0,0 @@
-#
-# 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.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
-
-include ../Makefile.com
-include ../../Makefile.lib.64
-
-install:	$(ROOTOBJECTS64)
--- /dev/null	2017-09-04 19:56:06.000000000 +0000
+++ new/usr/src/lib/crt/amd64/Makefile	2017-09-04 19:56:07.164422536 +0000
@@ -0,0 +1,30 @@
+#
+# 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.
+#
+
+include ../Makefile.com
+include ../../Makefile.lib.64
+
+install:	$(ROOTOBJECTS64)
--- old/usr/src/lib/common/amd64/crti.s	2017-09-04 19:56:07.574297704 +0000
+++ /dev/null	2017-09-04 19:56:06.000000000 +0000
@@ -1,58 +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 2004 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-	.file	"crti.s"
-
-/*
- * These crt*.o modules are provided as the bare minimum required
- * from a crt*.o for inclusion in building low level system
- * libraries.  The are only be to included in libraries which
- * contain *no* C++ code and want to avoid the startup code
- * that the C++ runtime has introduced into the crt*.o modules.
- *
- * For further details - see bug#4433015
- */
-
-/*
- * _init function prologue
- */
-	.section	.init,"ax"
-	.globl	_init
-	.type	_init,@function
-	.align	16
-_init:
-	pushq	%rbp
-	movq	%rsp, %rbp
-
-/*
- * _fini function prologue
- */
-	.section	.fini,"ax"
-	.globl	_fini
-	.type	_fini,@function
-	.align	16
-_fini:	
-	pushq	%rbp
-	movq	%rsp, %rbp
--- /dev/null	2017-09-04 19:56:06.000000000 +0000
+++ new/usr/src/lib/crt/amd64/crti.s	2017-09-04 19:56:07.586960921 +0000
@@ -0,0 +1,58 @@
+/*
+ * 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 2004 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
+
+	.file	"crti.s"
+
+/*
+ * These crt*.o modules are provided as the bare minimum required
+ * from a crt*.o for inclusion in building low level system
+ * libraries.  The are only be to included in libraries which
+ * contain *no* C++ code and want to avoid the startup code
+ * that the C++ runtime has introduced into the crt*.o modules.
+ *
+ * For further details - see bug#4433015
+ */
+
+/*
+ * _init function prologue
+ */
+	.section	.init,"ax"
+	.globl	_init
+	.type	_init,@function
+	.align	16
+_init:
+	pushq	%rbp
+	movq	%rsp, %rbp
+
+/*
+ * _fini function prologue
+ */
+	.section	.fini,"ax"
+	.globl	_fini
+	.type	_fini,@function
+	.align	16
+_fini:	
+	pushq	%rbp
+	movq	%rsp, %rbp
--- old/usr/src/lib/common/amd64/crtn.s	2017-09-04 19:56:07.774777724 +0000
+++ /dev/null	2017-09-04 19:56:06.000000000 +0000
@@ -1,50 +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 2004 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-	.file	"crtn.s"
-
-/*
- * These crt*.o modules are provided as the bare minimum required
- * from a crt*.o for inclusion in building low level system
- * libraries.  The are only be to included in libraries which
- * contain *no* C++ code and want to avoid the startup code
- * that the C++ runtime has introduced into the crt*.o modules.
- *
- * For further details - see bug#4433015
- */
-
-/*
- * _init function epilogue
- */
-	.section	.init,"ax"
-	leave
-	ret
-
-/*
- * _fini function epilogue
- */
-	.section	.fini,"ax"
-	leave
-	ret
--- /dev/null	2017-09-04 19:56:06.000000000 +0000
+++ new/usr/src/lib/crt/amd64/crtn.s	2017-09-04 19:56:07.788352529 +0000
@@ -0,0 +1,50 @@
+/*
+ * 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 2004 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
+
+	.file	"crtn.s"
+
+/*
+ * These crt*.o modules are provided as the bare minimum required
+ * from a crt*.o for inclusion in building low level system
+ * libraries.  The are only be to included in libraries which
+ * contain *no* C++ code and want to avoid the startup code
+ * that the C++ runtime has introduced into the crt*.o modules.
+ *
+ * For further details - see bug#4433015
+ */
+
+/*
+ * _init function epilogue
+ */
+	.section	.init,"ax"
+	leave
+	ret
+
+/*
+ * _fini function epilogue
+ */
+	.section	.fini,"ax"
+	leave
+	ret
--- /dev/null	2017-09-04 19:56:08.000000000 +0000
+++ new/usr/src/lib/crt/amd64/mach-crt1.s	2017-09-04 19:56:07.984522571 +0000
@@ -0,0 +1,98 @@
+/*
+ * 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.
+ */
+
+#include <sys/asm_linkage.h>
+
+	.file	"mach-crt1.s"
+
+	.global	_start_crt
+
+/*
+ *   The SVR4/i386 ABI (pages 3-29) says that when the entry
+ *   point runs registers' %rbp, %rsp, %rdx values are specified
+ *   the following:
+ *
+ *	%rbp The content of this register is unspecified at
+ *		process initialization time, but the user code should mark
+ *		the deepest stack frame by setting the frame pointer to zero.
+ *		No other frame's %ebp should have a zero value.
+ *
+ *	%rsp Performing its usual job, the stack pointer holds the address
+ *	of the bottom of the stack, which is guaranteed to be
+ *	quadword aligned.
+ *
+ *		The stack contains the arguments and environment:
+ *	  ...
+ *	  envp[0]		(16+(8*argc))(%rsp)
+ *	  NULL			(8+(8*argc))(%rsp)
+ *	  ...
+ *	  argv[0]		8(%rsp)
+ *	  argc			0(%rsp)
+ *
+ *	%rdx In a conforming program, this register contains a function
+ *		pointer that the application should register with atexit(BA_OS).
+ *		This function is used for shared object termination code
+ *		[see Dynamic Linking in Chapter 5 of the System V ABI].
+ *
+ */
+
+ENTRY_NP(_start)
+/*
+ * Allocate a NULL return address and a NULL previous %rbp as if
+ * there was a genuine call to _start.
+ */
+	pushq	$0
+	pushq	$0
+	movq	%rsp,%rbp		/* The first stack frame */
+
+/*
+ * The stack now is
+ *
+ *	  envp[0]		(32+(8*argc))(%rsp)	 - (A)
+ *	  NULL			(24+(8*argc))(%rsp)
+ *	  ...
+ *	  argv[0]		24(%rbp)		 - (B)
+ *	  argc			16(%rbp)
+ *	  0			8(%rbp)
+ *	  0			0(%rbp)
+ */
+
+	andq	$-16,%rsp		/* align the stack */
+	movq	16(%rbp),%rdi		/* argc */
+	leaq	24(%rbp),%rsi		/* argv */
+	/* NB: rt_do_exit, if applicable, is already in %rdx */
+	call	_start_crt
+	hlt
+SET_SIZE(_start)
+
+/*
+ * The following is here in case any object module compiled with cc -p
+ *	was linked into this module.
+ */
+ENTRY_NP(_mcount)
+	.weak	_mcount
+	ret
+SET_SIZE(_mcount)
--- /dev/null	2017-09-04 19:56:08.000000000 +0000
+++ new/usr/src/lib/crt/common/common-crt.c	2017-09-04 19:56:08.181097417 +0000
@@ -0,0 +1,100 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2016, Richard Lowe.
+ */
+
+/*
+ * That of the CRT startup routine which itself may be implemented in C.
+ */
+
+#include <sys/feature_tests.h>
+#include <sys/types.h>
+
+#include <stdlib.h>
+#include <synch.h>
+#include <unistd.h>
+
+#pragma weak _DYNAMIC
+extern uintptr_t _DYNAMIC;
+
+#pragma weak environ = _environ
+char **_environ = NULL;
+char **___Argv = NULL;
+
+extern int main(int argc, char **argv, char **envp);
+extern void _init(void);
+extern void _fini(void);
+
+#pragma weak _start_crt_compiler
+extern void _start_crt_compiler(int argc, char **argv);
+
+#if defined(__x86)
+int __longdouble_used = 0;
+extern void __fpstart(void);
+#endif
+
+#if defined(__i386)		/* Not amd64 */
+#pragma weak __fsr_init_value
+extern long __fsr_init_value;
+extern void __fsr(uintptr_t);
+#endif
+
+
+/*
+ * Defined here for ABI reasons, must match the definition in libc.
+ * If it cannot, a new symbol must be created.
+ */
+mutex_t __environ_lock = DEFAULTMUTEX;
+
+void
+_start_crt(int argc, char **argv, void (*exit_handler)(void))
+{
+	int ret = 0;
+
+	/*
+	 * On x86, we check whether we're a dynamic executable to see whether
+	 * we'll receive an exit_handler.
+	 *
+	 * On SPARC, we just need to check whether the handler was NULL.
+	 */
+#if defined(__x86)
+	if (&_DYNAMIC != NULL)
+		(void) atexit(exit_handler);
+#elif defined(__sparc)
+	if (exit_handler != NULL)
+		(void) atexit(exit_handler);
+#endif
+
+	(void) atexit(_fini);
+
+	_environ = argv + (argc + 1);
+	___Argv = argv;
+
+	if (&_start_crt_compiler != NULL)
+		_start_crt_compiler(argc, argv);
+
+#if defined(__x86)
+	__fpstart();
+#endif
+#if defined(__i386) 		/* Not amd64 */
+	/*
+	 * Note that Studio cc(1) sets the _value of the symbol_, that is, its
+	 * address.  Not the value _at_ that address.
+	 */
+	__fsr((uintptr_t)&__fsr_init_value);
+#endif
+	_init();
+	ret = main(argc, argv, _environ);
+	exit(ret);
+	_exit(ret);
+}
--- old/usr/src/lib/common/common/values-Xa.c	2017-09-04 19:56:08.368534275 +0000
+++ /dev/null	2017-09-04 19:56:08.000000000 +0000
@@ -1,45 +0,0 @@
-/*
- * 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.
- */
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-/*	Copyright (c) 1988 AT&T	*/
-/*	  All Rights Reserved  	*/
-
-
-#include <sys/types.h>
-#include <math.h>
-
-/*
- * variables which differ depending on the
- * compilation mode
- *
- * ANSI conforming mode
- * This file is linked into the a.out immediately following
- * the startup routine if the -Xa compilation mode is selected
- */
-
-const enum version _lib_version = ansi_1;
--- /dev/null	2017-09-04 19:56:08.000000000 +0000
+++ new/usr/src/lib/crt/common/values-Xa.c	2017-09-04 19:56:08.378394061 +0000
@@ -0,0 +1,43 @@
+/*
+ * 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 (c) 1988 AT&T	*/
+/*	  All Rights Reserved  	*/
+
+
+#include <sys/types.h>
+#include <math.h>
+
+/*
+ * variables which differ depending on the
+ * compilation mode
+ *
+ * ANSI conforming mode
+ * This file is linked into the a.out immediately following
+ * the startup routine if the -Xa compilation mode is selected
+ */
+
+const enum version _lib_version = ansi_1;
--- old/usr/src/lib/common/common/values-Xc.c	2017-09-04 19:56:08.781935855 +0000
+++ /dev/null	2017-09-04 19:56:08.000000000 +0000
@@ -1,45 +0,0 @@
-/*
- * 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.
- */
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-/*	Copyright (c) 1988 AT&T	*/
-/*	  All Rights Reserved  	*/
-
-
-#include <sys/types.h>
-#include <math.h>
-
-/*
- * variables which differ depending on the
- * compilation mode
- *
- * Strict ANSI mode
- * This file is linked into the a.out immediately following
- * the startup routine if the -Xc compilation mode is selected
- */
-
-const enum version _lib_version = strict_ansi;
--- /dev/null	2017-09-04 19:56:08.000000000 +0000
+++ new/usr/src/lib/crt/common/values-Xc.c	2017-09-04 19:56:08.794316945 +0000
@@ -0,0 +1,43 @@
+/*
+ * 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 (c) 1988 AT&T	*/
+/*	  All Rights Reserved  	*/
+
+
+#include <sys/types.h>
+#include <math.h>
+
+/*
+ * variables which differ depending on the
+ * compilation mode
+ *
+ * Strict ANSI mode
+ * This file is linked into the a.out immediately following
+ * the startup routine if the -Xc compilation mode is selected
+ */
+
+const enum version _lib_version = strict_ansi;
--- old/usr/src/lib/common/common/values-Xs.c	2017-09-04 19:56:09.189657466 +0000
+++ /dev/null	2017-09-04 19:56:08.000000000 +0000
@@ -1,47 +0,0 @@
-/*
- * 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.
- */
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-/*	Copyright (c) 1988 AT&T	*/
-/*	  All Rights Reserved  	*/
-
-
-#include <sys/types.h>
-#include <math.h>
-
-/*
- * variables which differ depending on the
- * compilation mode
- *
- * C Issue 4.2 compatibility mode
- * This file is linked into the a.out by default if
- * no compilation mode was specified or if the -Xt option
- * was specified - the linking occurs if there is an unresolved
- * reference to _lib_version
- */
-
-const enum version _lib_version = c_issue_4;
--- /dev/null	2017-09-04 19:56:08.000000000 +0000
+++ new/usr/src/lib/crt/common/values-Xs.c	2017-09-04 19:56:09.202028328 +0000
@@ -0,0 +1,45 @@
+/*
+ * 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 (c) 1988 AT&T	*/
+/*	  All Rights Reserved  	*/
+
+
+#include <sys/types.h>
+#include <math.h>
+
+/*
+ * variables which differ depending on the
+ * compilation mode
+ *
+ * C Issue 4.2 compatibility mode
+ * This file is linked into the a.out by default if
+ * no compilation mode was specified or if the -Xt option
+ * was specified - the linking occurs if there is an unresolved
+ * reference to _lib_version
+ */
+
+const enum version _lib_version = c_issue_4;
--- old/usr/src/lib/common/common/values-Xt.c	2017-09-04 19:56:09.587643300 +0000
+++ /dev/null	2017-09-04 19:56:08.000000000 +0000
@@ -1,47 +0,0 @@
-/*
- * 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.
- */
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-/*	Copyright (c) 1988 AT&T	*/
-/*	  All Rights Reserved  	*/
-
-
-#include <sys/types.h>
-#include <math.h>
-
-/*
- * variables which differ depending on the
- * compilation mode
- *
- * C Issue 4.2 compatibility mode
- * This file is linked into the a.out by default if
- * no compilation mode was specified or if the -Xt option
- * was specified - the linking occurs if there is an unresolved
- * reference to _lib_version
- */
-
-const enum version _lib_version = c_issue_4;
--- /dev/null	2017-09-04 19:56:08.000000000 +0000
+++ new/usr/src/lib/crt/common/values-Xt.c	2017-09-04 19:56:09.597996095 +0000
@@ -0,0 +1,45 @@
+/*
+ * 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 (c) 1988 AT&T	*/
+/*	  All Rights Reserved  	*/
+
+
+#include <sys/types.h>
+#include <math.h>
+
+/*
+ * variables which differ depending on the
+ * compilation mode
+ *
+ * C Issue 4.2 compatibility mode
+ * This file is linked into the a.out by default if
+ * no compilation mode was specified or if the -Xt option
+ * was specified - the linking occurs if there is an unresolved
+ * reference to _lib_version
+ */
+
+const enum version _lib_version = c_issue_4;
--- old/usr/src/lib/common/common/values-xpg4.c	2017-09-04 19:56:10.035054464 +0000
+++ /dev/null	2017-09-04 19:56:08.000000000 +0000
@@ -1,36 +0,0 @@
-/*
- * 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.
- */
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#include <sys/types.h>
-/*
- * Setting thie value to 1 enables XPG4 mode for APIs
- * which have differing runtime behaviour from XPG3 to XPG4.
- * See usr/src/lib/libc/port/gen/xpg4.c for the default value.
- */
-
-int __xpg4 = 1;
--- /dev/null	2017-09-04 19:56:08.000000000 +0000
+++ new/usr/src/lib/crt/common/values-xpg4.c	2017-09-04 19:56:10.047972695 +0000
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+#include <sys/types.h>
+/*
+ * Setting thie value to 1 enables XPG4 mode for APIs
+ * which have differing runtime behaviour from XPG3 to XPG4.
+ * See usr/src/lib/libc/port/gen/xpg4.c for the default value.
+ */
+
+int __xpg4 = 1;
--- old/usr/src/lib/common/common/values-xpg6.c	2017-09-04 19:56:10.445482622 +0000
+++ /dev/null	2017-09-04 19:56:08.000000000 +0000
@@ -1,57 +0,0 @@
-/*
- * 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.
- */
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-/*
- * __xpg6 (C99/SUSv3) was first introduced in Solaris 10.
- *
- * This file is NOT linked into libc.  See xpg6.c.
- * This value is linked into an application when the application is
- * requesting conforming C99/SUSv3 behavior.  This is usually done
- * with the c99 utility.
- *
- * __xpg6 is used to control certain behaviors between the C99 standard,
- * the SUSv3 standard, and Solaris.  More explanation in inc/xpg6.h.
- * The XPG6 C compiler utility (c99) will add an object file that contains an
- * alternate definition for __xpg6.  The symbol interposition provided
- * by the linker will allow libc to find that symbol instead.
- *
- * Possible settings are available and documented in inc/xpg6.h.
- */
-
-/*
- * This setting enables strictly conforming C99/SUSv3 behavior.
- */
-
-#include "xpg6.h"
-
-unsigned int __xpg6 = _C99SUSv3_mode_ON;
-
-/*
- * Also turn on XPG4 mode.
- */
-int __xpg4 = 1;
--- /dev/null	2017-09-04 19:56:08.000000000 +0000
+++ new/usr/src/lib/crt/common/values-xpg6.c	2017-09-04 19:56:10.458796070 +0000
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+
+/*
+ * __xpg6 (C99/SUSv3) was first introduced in Solaris 10.
+ *
+ * This file is NOT linked into libc.  See xpg6.c.
+ * This value is linked into an application when the application is
+ * requesting conforming C99/SUSv3 behavior.  This is usually done
+ * with the c99 utility.
+ *
+ * __xpg6 is used to control certain behaviors between the C99 standard,
+ * the SUSv3 standard, and Solaris.  More explanation in inc/xpg6.h.
+ * The XPG6 C compiler utility (c99) will add an object file that contains an
+ * alternate definition for __xpg6.  The symbol interposition provided
+ * by the linker will allow libc to find that symbol instead.
+ *
+ * Possible settings are available and documented in inc/xpg6.h.
+ */
+
+/*
+ * This setting enables strictly conforming C99/SUSv3 behavior.
+ */
+
+#include "xpg6.h"
+
+unsigned int __xpg6 = _C99SUSv3_mode_ON;
+
+/*
+ * Also turn on XPG4 mode.
+ */
+int __xpg4 = 1;
--- old/usr/src/lib/common/sparc/Makefile	2017-09-04 19:56:10.831095432 +0000
+++ /dev/null	2017-09-04 19:56:08.000000000 +0000
@@ -1,31 +0,0 @@
-#
-# 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.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
-
-include ../Makefile.com
-
-install:	$(ROOTOBJECTS)
--- /dev/null	2017-09-04 19:56:08.000000000 +0000
+++ new/usr/src/lib/crt/i86/Makefile	2017-09-04 19:56:10.844042016 +0000
@@ -0,0 +1,29 @@
+#
+# 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.
+#
+
+include ../Makefile.com
+
+install:	$(ROOTOBJECTS)
--- old/usr/src/lib/common/i386/crti.s	2017-09-04 19:56:11.251248365 +0000
+++ /dev/null	2017-09-04 19:56:08.000000000 +0000
@@ -1,86 +0,0 @@
-/*
- * 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 (c) 2001 by Sun Microsystems, Inc.
- * All rights reserved.
- */
-/*
- * Copyright (c) 2013, Joyent, Inc.  All rights reserved.
- */
-
-/*
- * These crt*.o modules are provided as the bare minimum required
- * from a crt*.o for inclusion in building low level system
- * libraries.  The are only be to included in libraries which
- * contain *no* C++ code and want to avoid the startup code
- * that the C++ runtime has introduced into the crt*.o modules.
- *
- * For further details - see bug#4433015
- */
-
-	.file	"crti.s"
-
-/*
- * Note that when _init and _fini are called the stack needs to be 16-byte
- * aligned with a 4-byte bias.  See comment in lib/libc/i386/gen/makectxt.c.
- *
- * Note: If you change it, you need to change it in the following files as
- * well:
- *
- *  - lib/libc/i386/threads/machdep.c
- *  - lib/libc/i386/gen/makectxt.c
- *  - lib/common/i386/crt1.s
- */
-
-/*
- * _init function prologue
- */
-	.section	.init,"ax"
-	.globl	_init
-	.type	_init,@function
-	.align	16
-_init:
-	pushl	%ebp
-	movl	%esp, %ebp
-	andl	$-16,%esp
-	subl	$12,%esp
-	pushl	%ebx
-	call	.L1
-.L1:	popl	%ebx
-	addl	$_GLOBAL_OFFSET_TABLE_+[.-.L1], %ebx
-
-/*
- * _fini function prologue
- */
-	.section	.fini,"ax"
-	.globl	_fini
-	.type	_fini,@function
-	.align	16
-_fini:
-	pushl	%ebp
-	movl	%esp, %ebp
-	andl	$-16,%esp
-	subl	$12,%esp
-	pushl	%ebx
-	call	.L2
-.L2:	popl	%ebx
-	addl	$_GLOBAL_OFFSET_TABLE_+[.-.L2], %ebx
--- /dev/null	2017-09-04 19:56:08.000000000 +0000
+++ new/usr/src/lib/crt/i86/crti.s	2017-09-04 19:56:11.265257986 +0000
@@ -0,0 +1,86 @@
+/*
+ * 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 (c) 2001 by Sun Microsystems, Inc.
+ * All rights reserved.
+ */
+/*
+ * Copyright (c) 2013, Joyent, Inc.  All rights reserved.
+ */
+
+/*
+ * These crt*.o modules are provided as the bare minimum required
+ * from a crt*.o for inclusion in building low level system
+ * libraries.  The are only be to included in libraries which
+ * contain *no* C++ code and want to avoid the startup code
+ * that the C++ runtime has introduced into the crt*.o modules.
+ *
+ * For further details - see bug#4433015
+ */
+
+	.file	"crti.s"
+
+/*
+ * Note that when _init and _fini are called the stack needs to be 16-byte
+ * aligned with a 4-byte bias.  See comment in lib/libc/i386/gen/makectxt.c.
+ *
+ * Note: If you change it, you need to change it in the following files as
+ * well:
+ *
+ *  - lib/libc/i386/threads/machdep.c
+ *  - lib/libc/i386/gen/makectxt.c
+ *  - lib/crt/i86/mach-crt1.s
+ */
+
+/*
+ * _init function prologue
+ */
+	.section	.init,"ax"
+	.globl	_init
+	.type	_init,@function
+	.align	16
+_init:
+	pushl	%ebp
+	movl	%esp, %ebp
+	andl	$-16,%esp
+	subl	$12,%esp
+	pushl	%ebx
+	call	.L1
+.L1:	popl	%ebx
+	addl	$_GLOBAL_OFFSET_TABLE_+[.-.L1], %ebx
+
+/*
+ * _fini function prologue
+ */
+	.section	.fini,"ax"
+	.globl	_fini
+	.type	_fini,@function
+	.align	16
+_fini:
+	pushl	%ebp
+	movl	%esp, %ebp
+	andl	$-16,%esp
+	subl	$12,%esp
+	pushl	%ebx
+	call	.L2
+.L2:	popl	%ebx
+	addl	$_GLOBAL_OFFSET_TABLE_+[.-.L2], %ebx
--- old/usr/src/lib/common/i386/crtn.s	2017-09-04 19:56:11.666451768 +0000
+++ /dev/null	2017-09-04 19:56:08.000000000 +0000
@@ -1,55 +0,0 @@
-/*
- * 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 (c) 2001 by Sun Microsystems, Inc.
- * All rights reserved.
- */
-
-/*
- * These crt*.o modules are provided as the bare minimum required
- * from a crt*.o for inclusion in building low level system
- * libraries.  The are only be to included in libraries which
- * contain *no* C++ code and want to avoid the startup code
- * that the C++ runtime has introduced into the crt*.o modules.
- *
- * For further details - see bug#4433015
- */
-	.ident	"%Z%%M%	%I%	%E% SMI"
-	.file	"crtn.s"
-
-/*
- * _init function epilogue
- */
-	.section	.init,"ax"
-
-	popl	%ebx
-	leave
-	ret
-
-/*
- * _fini function epilogue
- */
-	.section	.fini,"ax"
-
-	popl	%ebx
-	leave
-	ret
--- /dev/null	2017-09-04 19:56:08.000000000 +0000
+++ new/usr/src/lib/crt/i86/crtn.s	2017-09-04 19:56:11.679894004 +0000
@@ -0,0 +1,54 @@
+/*
+ * 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 (c) 2001 by Sun Microsystems, Inc.
+ * All rights reserved.
+ */
+
+/*
+ * These crt*.o modules are provided as the bare minimum required
+ * from a crt*.o for inclusion in building low level system
+ * libraries.  The are only be to included in libraries which
+ * contain *no* C++ code and want to avoid the startup code
+ * that the C++ runtime has introduced into the crt*.o modules.
+ *
+ * For further details - see bug#4433015
+ */
+	.file	"crtn.s"
+
+/*
+ * _init function epilogue
+ */
+	.section	.init,"ax"
+
+	popl	%ebx
+	leave
+	ret
+
+/*
+ * _fini function epilogue
+ */
+	.section	.fini,"ax"
+
+	popl	%ebx
+	leave
+	ret
--- old/usr/src/lib/common/i386/fsr.s	2017-09-04 19:56:12.091560610 +0000
+++ /dev/null	2017-09-04 19:56:08.000000000 +0000
@@ -1,159 +0,0 @@
-/*
- * 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 2005 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-	.ident	"%Z%%M%	%I%	%E% SMI"
-
-	.file	"fsr.s"
-
-	.section	.data
-	.align 4
-
-	.weak	__fsr_init_value
-
-__fsr_init_value_ptr:
-	.4byte	__fsr_init_value
-	.type   __fsr_init_value_ptr,@object
-	.size   __fsr_init_value_ptr,4
-
-/*
- * The following table maps trap enable bits in __fsr_init_value
- * (after shifting right one bit):
- *
- * bit 0 - inexact trap
- * bit 1 - division trap
- * bit 2 - underflow trap
- * bit 3 - overflow trap
- * bit 4 - invalid trap
- *
- * to exception masks in the floating point control word
- *
- * bit 0 - invalid mask
- * bit 2 - zero divide mask
- * bit 3 - overflow mask
- * bit 4 - underflow mask
- * bit 5 - inexact mask
- */
-	.local	trap_table
-	.type	trap_table,@object
-trap_table:
-	.byte	0b11111111
-	.byte	0b11011111
-	.byte	0b11111011
-	.byte	0b11011011
-	.byte	0b11101111
-	.byte	0b11001111
-	.byte	0b11101011
-	.byte	0b11001011
-	.byte	0b11110111
-	.byte	0b11010111
-	.byte	0b11110011
-	.byte	0b11010011
-	.byte	0b11100111
-	.byte	0b11000111
-	.byte	0b11100011
-	.byte	0b11000011
-	.byte	0b11111110
-	.byte	0b11011110
-	.byte	0b11111010
-	.byte	0b11011010
-	.byte	0b11101110
-	.byte	0b11001110
-	.byte	0b11101010
-	.byte	0b11001010
-	.byte	0b11110110
-	.byte	0b11010110
-	.byte	0b11110010
-	.byte	0b11010010
-	.byte	0b11100110
-	.byte	0b11000110
-	.byte	0b11100010
-	.byte	0b11000010
-
-	.size	trap_table,32
-
-	.section	.text
-	.align	4
-
-	.globl	__fsr
-	.type	__fsr,@function
-__fsr:
-	pushl	%ebp
-	movl	%esp,%ebp
-	pushl	%edx
-	pushl	%ecx
-	subl	$4,%esp
-
-	lea	__fsr_init_value_ptr, %ecx
-	movl	(%ecx),%ecx		/* get the value set by CG */
-	shrl	$1,%ecx			/* get rid of fns bit */
-	cmpl	$0,%ecx			/* if remaining bits are zero */
-	je	3f			/*   there's nothing to do */
-
-	fstcw	0(%esp)			/* store the control word */
-
-	movl	%ecx,%edx
-	andl	$0x1f,%edx		/* get the trap enable bits */
-	movb	trap_table(%edx),%al
-	andb	%al,0(%esp)	/* unmask the corresponding exceptions */
-
-	testl	$0x200,%ecx		/* test denormal trap enable */
-	jz	1f			/* skip if zero */
-
-	andb	$0xfd,0(%esp)	/* unmask denormal exception */
-
-1:
-	movl	%ecx,%edx
-	andl	$0x60,%edx		/* get the rounding direction */
-	jz	1f			/* skip if zero */
-
-	movl	%edx,%eax		/* exchange negative<->tozero */
-	andl	$0x20,%eax		/*   leaving nearest and positive */
-	shll	$1,%eax			/*   as is */
-	xorl	%eax,%edx
-	shll	$5,%edx
-	andw	$0xf3ff,0(%esp)		/* update rounding direction */
-	orw	%dx,0(%esp)
-
-1:
-	andl	$0x180,%ecx		/* get the rounding precision */
-	jz	1f			/* skip if zero */
-
-	xorl	$0x180,%ecx		/* reverse bits */
-	shll	$1,%ecx
-	andw	$0xfcff,0(%esp)		/* update rounding precision */
-	orw	%cx,0(%esp)
-
-1:
-	fldcw	0(%esp)			/* load the modified control word */
-
-3:
-	addl	$4,%esp
-	popl	%ecx
-	popl	%edx
-	popl	%ebp
-	ret
-
-	.size	__fsr,[.-__fsr]
--- /dev/null	2017-09-04 19:56:08.000000000 +0000
+++ new/usr/src/lib/crt/i86/fsr.s	2017-09-04 19:56:12.104924253 +0000
@@ -0,0 +1,154 @@
+/*
+ * 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 2005 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#include <sys/asm_linkage.h>
+
+	.file	"fsr.s"
+
+	.section	.data
+	.align 4
+
+/*
+ * The following table maps trap enable bits in __fsr_init_value
+ * (after shifting right one bit):
+ *
+ * bit 0 - inexact trap
+ * bit 1 - division trap
+ * bit 2 - underflow trap
+ * bit 3 - overflow trap
+ * bit 4 - invalid trap
+ *
+ * to exception masks in the floating point control word
+ *
+ * bit 0 - invalid mask
+ * bit 2 - zero divide mask
+ * bit 3 - overflow mask
+ * bit 4 - underflow mask
+ * bit 5 - inexact mask
+ */
+	.local	trap_table
+	.type	trap_table,@object
+trap_table:
+	.byte	0b11111111
+	.byte	0b11011111
+	.byte	0b11111011
+	.byte	0b11011011
+	.byte	0b11101111
+	.byte	0b11001111
+	.byte	0b11101011
+	.byte	0b11001011
+	.byte	0b11110111
+	.byte	0b11010111
+	.byte	0b11110011
+	.byte	0b11010011
+	.byte	0b11100111
+	.byte	0b11000111
+	.byte	0b11100011
+	.byte	0b11000011
+	.byte	0b11111110
+	.byte	0b11011110
+	.byte	0b11111010
+	.byte	0b11011010
+	.byte	0b11101110
+	.byte	0b11001110
+	.byte	0b11101010
+	.byte	0b11001010
+	.byte	0b11110110
+	.byte	0b11010110
+	.byte	0b11110010
+	.byte	0b11010010
+	.byte	0b11100110
+	.byte	0b11000110
+	.byte	0b11100010
+	.byte	0b11000010
+
+	.size	trap_table,32
+
+ENTRY_NP(__fsr)
+	pushl	%ebp
+	movl	%esp,%ebp
+	pushl	%edx
+	pushl	%ecx
+	pushl	%ebx
+	subl	$4,%esp
+
+	/* Setup PIC */
+	call	9f
+9:	popl	%ebx
+	addl	$_GLOBAL_OFFSET_TABLE_ + [. - 9b], %ebx
+
+	movl	8(%ebp), %ecx		/* the value set by CG is passed in */
+	shrl	$1,%ecx			/* get rid of fns bit */
+	cmpl	$0,%ecx			/* if remaining bits are zero */
+	je	3f			/*   there's nothing to do */
+
+	fstcw	0(%esp)			/* store the control word */
+
+	movl	%ecx,%edx
+	andl	$0x1f,%edx		/* get the trap enable bits */
+	movl	trap_table@GOT(%ebx), %eax
+	addl	%eax,%edx
+	movb	(%edx),%al
+	andb	%al,0(%esp)	/* unmask the corresponding exceptions */
+
+	testl	$0x200,%ecx		/* test denormal trap enable */
+	jz	1f			/* skip if zero */
+
+	andb	$0xfd,0(%esp)	/* unmask denormal exception */
+
+1:
+	movl	%ecx,%edx
+	andl	$0x60,%edx		/* get the rounding direction */
+	jz	1f			/* skip if zero */
+
+	movl	%edx,%eax		/* exchange negative<->tozero */
+	andl	$0x20,%eax		/*   leaving nearest and positive */
+	shll	$1,%eax			/*   as is */
+	xorl	%eax,%edx
+	shll	$5,%edx
+	andw	$0xf3ff,0(%esp)		/* update rounding direction */
+	orw	%dx,0(%esp)
+
+1:
+	andl	$0x180,%ecx		/* get the rounding precision */
+	jz	1f			/* skip if zero */
+
+	xorl	$0x180,%ecx		/* reverse bits */
+	shll	$1,%ecx
+	andw	$0xfcff,0(%esp)		/* update rounding precision */
+	orw	%cx,0(%esp)
+
+1:
+	fldcw	0(%esp)			/* load the modified control word */
+
+3:
+	addl	$4,%esp
+	popl	%ebx
+	popl	%ecx
+	popl	%edx
+	popl	%ebp
+	ret
+SET_SIZE(__fsr)
--- /dev/null	2017-09-04 19:56:12.000000000 +0000
+++ new/usr/src/lib/crt/i86/mach-crt1.s	2017-09-04 19:56:12.522745248 +0000
@@ -0,0 +1,80 @@
+/*
+ * 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.
+ */
+#include <sys/asm_linkage.h>
+
+	.file	"mach-crt1.s"
+
+/* global entities defined elsewhere but used here */
+	.globl	_start_crt
+
+/*
+ * C language startup routine.
+ * Assume that exec code has cleared the direction flag in the TSS.
+ * Assume that %esp is set to the addr after the last word pushed.
+ * The stack contains (in order): argc, argv[],envp[],...
+ * Assume that all of the segment registers are initialized.
+ *
+ * Allocate a NULL return address and a NULL previous %ebp as if
+ * there was a genuine call to _start.
+ * debugger stack trace shows _start(argc,argv[0],argv[1],...,envp[0],...)
+ */
+ENTRY_NP(_start)
+	pushl	$0
+	pushl	$0
+	movl	%esp,%ebp		/* The first stack frame */
+
+	/*
+	 * The stack needs to be 16-byte aligned with a 4-byte bias.  See
+	 * comment in lib/libc/i386/gen/makectxt.c.
+	 *
+	 * Note: If you change it, you need to change it in the following
+	 * files as well:
+	 *
+	 *  - lib/libc/i386/threads/machdep.c
+	 *  - lib/libc/i386/gen/makectxt.c
+	 *  - lib/crt/i86/crti.s
+	 */
+	andl	$-16,%esp	/* make main() and exit() be called with */
+	subl	$4,%esp		/* a properly aligned stack pointer */
+	pushl	%edx		/* possible atexit handler */
+	leal	12(%ebp),%edx	/* argv */
+	movl	8(%ebp),%eax	/* argc */
+	pushl	%edx
+	pushl	%eax
+	call	_start_crt
+	hlt
+SET_SIZE(_start)
+
+#include "fsr.s"
+
+/*
+ * The following is here in case any object module compiled with cc -p
+ * was linked into this module.
+ */
+ENTRY_NP(_mcount)
+	.weak	_mcount
+	ret
+SET_SIZE(_mcount)
--- old/usr/src/lib/common/sparcv9/crti.s	2017-09-04 19:56:12.694606131 +0000
+++ /dev/null	2017-09-04 19:56:12.000000000 +0000
@@ -1,59 +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) 2001 by Sun Microsystems, Inc.
- * All rights reserved.
- */
-
-
-/*
- * These crt*.o modules are provided as the bare minimum required
- * from a crt*.o for inclusion in building low level system
- * libraries.  The are only be to included in libraries which
- * contain *no* C++ code and want to avoid the startup code
- * that the C++ runtime has introduced into the crt*.o modules.
- *
- * For further details - see bug#4433015
- */
-
-	.file		"crti.s"
-
-#include <sys/asm_linkage.h>
-
-/*
- * _init function prologue
- */
-	.section	".init"
-	.global		_init
-	.type		_init, #function
-	.align	4
-_init:
-	save	%sp, -SA(MINFRAME), %sp
-
-/*
- * _fini function prologue
- */
-	.section	".fini"
-	.global		_fini
-	.type		_fini, #function
-	.align	4
-_fini:
-	save	%sp, -SA(MINFRAME), %sp
--- /dev/null	2017-09-04 19:56:12.000000000 +0000
+++ new/usr/src/lib/crt/sparc/crti.s	2017-09-04 19:56:12.706768169 +0000
@@ -0,0 +1,59 @@
+/*
+ * 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) 2001 by Sun Microsystems, Inc.
+ * All rights reserved.
+ */
+
+
+/*
+ * These crt*.o modules are provided as the bare minimum required
+ * from a crt*.o for inclusion in building low level system
+ * libraries.  The are only be to included in libraries which
+ * contain *no* C++ code and want to avoid the startup code
+ * that the C++ runtime has introduced into the crt*.o modules.
+ *
+ * For further details - see bug#4433015
+ */
+
+	.file		"crti.s"
+
+#include <sys/asm_linkage.h>
+
+/*
+ * _init function prologue
+ */
+	.section	".init"
+	.global		_init
+	.type		_init, #function
+	.align	4
+_init:
+	save	%sp, -SA(MINFRAME), %sp
+
+/*
+ * _fini function prologue
+ */
+	.section	".fini"
+	.global		_fini
+	.type		_fini, #function
+	.align	4
+_fini:
+	save	%sp, -SA(MINFRAME), %sp
--- old/usr/src/lib/common/sparcv9/crtn.s	2017-09-04 19:56:12.878012216 +0000
+++ /dev/null	2017-09-04 19:56:12.000000000 +0000
@@ -1,52 +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) 2001 by Sun Microsystems, Inc.
- * All rights reserved.
- */
-
-/*
- * These crt*.o modules are provided as the bare minimum required
- * from a crt*.o for inclusion in building low level system
- * libraries.  The are only be to included in libraries which
- * contain *no* C++ code and want to avoid the startup code
- * that the C++ runtime has introduced into the crt*.o modules.
- *
- * For further details - see bug#4433015
- */
-
-	.file		"crtn.s"
-
-/*
- * _init function epilogue
- */
-	.section	".init"
-	.align		4
-	ret
-	restore
-
-/*
- * _fini function epilogue
- */
-	.section	".fini"
-	.align		4
-	ret
-	restore
--- /dev/null	2017-09-04 19:56:12.000000000 +0000
+++ new/usr/src/lib/crt/sparc/crtn.s	2017-09-04 19:56:12.889782336 +0000
@@ -0,0 +1,52 @@
+/*
+ * 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) 2001 by Sun Microsystems, Inc.
+ * All rights reserved.
+ */
+
+/*
+ * These crt*.o modules are provided as the bare minimum required
+ * from a crt*.o for inclusion in building low level system
+ * libraries.  The are only be to included in libraries which
+ * contain *no* C++ code and want to avoid the startup code
+ * that the C++ runtime has introduced into the crt*.o modules.
+ *
+ * For further details - see bug#4433015
+ */
+
+	.file		"crtn.s"
+
+/*
+ * _init function epilogue
+ */
+	.section	".init"
+	.align		4
+	ret
+	restore
+
+/*
+ * _fini function epilogue
+ */
+	.section	".fini"
+	.align		4
+	ret
+	restore
--- /dev/null	2017-09-04 19:56:13.000000000 +0000
+++ new/usr/src/lib/crt/sparc/mach-crt1.s	2017-09-04 19:56:13.077473908 +0000
@@ -0,0 +1,75 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
+	
+/* Copyright 2016, Richard Lowe. */
+
+#include <sys/asm_linkage.h>
+#include <sys/stack.h>
+
+	.file	"mach-crt1.s"
+
+	.global	_start_crt
+
+#if defined(__sparcv9)
+#define	EB_MAX_SIZE	128
+#else
+#define	EB_MAX_SIZE	64
+#endif
+
+ENTRY_NP(_start)
+	/*
+	 * On entry, the stack is:
+	 *
+	 * .-----------------------.   <--- %sp
+	 * |			   |
+	 * |	    Window	   |
+	 * |			   |
+	 * |-----------------------|
+	 * |	    argc	   |
+	 * |-----------------------|
+	 * |	    argv[0]	   |
+	 * |	    argv[1]	   |
+	 * |	    argv[2]	   |
+	 * |	    argv[3]	   |
+	 * |	    ...		   |
+	 * |	 argv[argc - 1]	   |
+	 * |-----------------------|
+	 * |	      NULL	   |
+	 * |-----------------------|
+	 * |	    envp[0]	   |
+	 * |	    envp[1]	   |
+	 * |	    envp[2]	   |
+	 * |	    envp[3]	   |
+	 * |	     ...	   |
+	 * |	    envp[N]	   |
+	 * |-----------------------|
+	 * |	      NULL	   |
+	 * .-----------------------.
+	 *
+	 * and an exit handler from the linker is in %g1
+	 */
+	clr	%fp		! don't trace the stack past this point 
+
+	add	%sp, WINDOWSIZE + STACK_BIAS, %l0	! address of argc
+
+	! allocate a minimally sized frame, and align ourselves
+	add	%sp, -SA(MINFRAME - EB_MAX_SIZE), %sp
+
+	ldn	[%l0], %o0			! argc
+	add	%l0, CPTRSIZE, %o1	! argv
+	call	_start_crt
+	    mov %g1, %o2			! exit_handler in delay slot
+SET_SIZE(_start)
--- old/usr/src/lib/common/i386/Makefile	2017-09-04 19:56:13.249899473 +0000
+++ /dev/null	2017-09-04 19:56:13.000000000 +0000
@@ -1,31 +0,0 @@
-#
-# 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.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
-
-include ../Makefile.com
-
-install:	$(ROOTOBJECTS)
--- /dev/null	2017-09-04 19:56:13.000000000 +0000
+++ new/usr/src/lib/crt/sparcv7/Makefile	2017-09-04 19:56:13.262495186 +0000
@@ -0,0 +1,29 @@
+#
+# 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.
+#
+
+include ../Makefile.com
+
+install:	$(ROOTOBJECTS)
--- old/usr/src/lib/common/sparcv9/Makefile	2017-09-04 19:56:13.676572714 +0000
+++ /dev/null	2017-09-04 19:56:13.000000000 +0000
@@ -1,32 +0,0 @@
-#
-# 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.
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
-
-include ../Makefile.com
-include ../../Makefile.lib.64
-
-install:	$(ROOTOBJECTS64)
--- /dev/null	2017-09-04 19:56:13.000000000 +0000
+++ new/usr/src/lib/crt/sparcv9/Makefile	2017-09-04 19:56:13.689557091 +0000
@@ -0,0 +1,30 @@
+#
+# 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.
+#
+
+include ../Makefile.com
+include ../../Makefile.lib.64
+
+install:	$(ROOTOBJECTS64)
--- old/usr/src/lib/libc/Makefile.targ	2017-09-04 19:56:14.101350355 +0000
+++ new/usr/src/lib/libc/Makefile.targ	2017-09-04 19:56:14.114278391 +0000
@@ -270,7 +270,7 @@
 	$(COMPILE.c) -o $@ $<
 	$(POST_PROCESS_O)
 
-pics/%.o: $(LIBCBASE)/../../common/common/%.c
+pics/%.o: $(LIBCBASE)/../../crt/common/%.c
 	$(COMPILE.c) -o $@ $<
 	$(POST_PROCESS_O)
 
--- old/usr/src/lib/libc/amd64/Makefile	2017-09-04 19:56:14.500753369 +0000
+++ new/usr/src/lib/libc/amd64/Makefile	2017-09-04 19:56:14.515609365 +0000
@@ -991,7 +991,7 @@
 	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.
+# modules whose source is provided in the $(SRC)/lib/crt 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
@@ -1000,7 +1000,7 @@
 # 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/amd64
+CRTSRCS= ../../crt/amd64
 
 # include common library definitions
 include ../../Makefile.lib
--- old/usr/src/lib/libc/i386/Makefile.com	2017-09-04 19:56:14.928777510 +0000
+++ new/usr/src/lib/libc/i386/Makefile.com	2017-09-04 19:56:14.942292967 +0000
@@ -1033,7 +1033,7 @@
 	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.
+# modules whose source is provided in the $(SRC)/lib/crt 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
@@ -1042,7 +1042,7 @@
 # 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
+CRTSRCS= ../../crt/i86
 
 LDPASS_OFF=	$(POUND_SIGN)
 
--- old/usr/src/lib/libc/i386/gen/makectxt.c	2017-09-04 19:56:15.393666347 +0000
+++ new/usr/src/lib/libc/i386/gen/makectxt.c	2017-09-04 19:56:15.406427311 +0000
@@ -64,8 +64,8 @@
  * files as well:
  *
  *  - lib/libc/i386/threads/machdep.c
- *  - lib/common/i386/crti.s
- *  - lib/common/i386/crt1.s
+ *  - lib/crt/i86/crti.s
+ *  - lib/crt/i86/crt1.s
  */
 #undef	STACK_ALIGN
 #define	STACK_ALIGN	16
--- old/usr/src/lib/libc/i386/threads/machdep.c	2017-09-04 19:56:15.806224682 +0000
+++ new/usr/src/lib/libc/i386/threads/machdep.c	2017-09-04 19:56:15.819699093 +0000
@@ -36,8 +36,8 @@
  * well:
  *
  *  - lib/libc/i386/gen/makectxt.c
- *  - lib/common/i386/crti.s
- *  - lib/common/i386/crt1.s
+ *  - lib/crt/i86/crti.s
+ *  - lib/crt/i86/crt1.s
  */
 #undef	STACK_ALIGN
 #define	STACK_ALIGN	16
@@ -86,7 +86,7 @@
 
 int
 setup_context(ucontext_t *ucp, void *(*func)(ulwp_t *),
-	ulwp_t *ulwp, caddr_t stk, size_t stksize)
+    ulwp_t *ulwp, caddr_t stk, size_t stksize)
 {
 	static int initialized;
 	static greg_t fs, es, ds, cs, ss;
@@ -210,10 +210,10 @@
 
 int
 __csigsetjmp(greg_t cs, greg_t ss, greg_t gs,
-	greg_t fs, greg_t es, greg_t ds,
-	greg_t edi, greg_t esi, greg_t ebp, greg_t esp,
-	greg_t ebx, greg_t edx, greg_t ecx, greg_t eax, greg_t eip,
-	sigjmp_buf env, int savemask)
+    greg_t fs, greg_t es, greg_t ds,
+    greg_t edi, greg_t esi, greg_t ebp, greg_t esp,
+    greg_t ebx, greg_t edx, greg_t ecx, greg_t eax, greg_t eip,
+    sigjmp_buf env, int savemask)
 {
 	ucontext_t *ucp = (ucontext_t *)env;
 	ulwp_t *self = curthread;
--- old/usr/src/lib/libc/req.flg	2017-09-04 19:56:16.205231095 +0000
+++ new/usr/src/lib/libc/req.flg	2017-09-04 19:56:16.219639731 +0000
@@ -28,4 +28,4 @@
 find_files "s.*" usr/src/common/dtrace
 find_files "s.*" usr/src/common/secflags
 find_files "s.*" usr/src/common/util
-find_files "s.*" usr/src/lib/common
+find_files "s.*" usr/src/lib/crt
--- old/usr/src/lib/libc/sparc/Makefile.com	2017-09-04 19:56:16.560569251 +0000
+++ new/usr/src/lib/libc/sparc/Makefile.com	2017-09-04 19:56:16.572476350 +0000
@@ -1064,7 +1064,7 @@
 	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.
+# modules whose source is provided in the $(SRC)/lib/crt 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
@@ -1073,7 +1073,7 @@
 # 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/sparc
+CRTSRCS= ../../crt/sparcv7
 
 # include common library definitions
 include $(SRC)/lib/Makefile.lib
--- old/usr/src/lib/libc/sparcv9/Makefile.com	2017-09-04 19:56:16.993706052 +0000
+++ new/usr/src/lib/libc/sparcv9/Makefile.com	2017-09-04 19:56:17.008277638 +0000
@@ -1004,7 +1004,7 @@
 	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.
+# modules whose source is provided in the $(SRC)/lib/crt 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
@@ -1013,7 +1013,7 @@
 # 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/sparcv9
+CRTSRCS= ../../crt/sparcv9
 
 # include common library definitions
 include $(SRC)/lib/Makefile.lib
--- old/usr/src/lib/libc_db/amd64/Makefile	2017-09-04 19:56:17.445705645 +0000
+++ new/usr/src/lib/libc_db/amd64/Makefile	2017-09-04 19:56:17.457909813 +0000
@@ -23,10 +23,8 @@
 # Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 
-CRTSRCS= ../../common/amd64
+CRTSRCS= ../../crt/amd64
 
 include ../Makefile.com
 include ../../Makefile.lib.64
--- old/usr/src/lib/libc_db/i386/Makefile	2017-09-04 19:56:17.829041091 +0000
+++ new/usr/src/lib/libc_db/i386/Makefile	2017-09-04 19:56:17.844097002 +0000
@@ -23,10 +23,8 @@
 # Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 
-CRTSRCS= ../../common/i386
+CRTSRCS= ../../crt/i86
 
 include ../Makefile.com
 
--- old/usr/src/lib/libc_db/sparc/Makefile	2017-09-04 19:56:18.214094836 +0000
+++ new/usr/src/lib/libc_db/sparc/Makefile	2017-09-04 19:56:18.227678918 +0000
@@ -23,10 +23,8 @@
 # Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 
-CRTSRCS= ../../common/sparc
+CRTSRCS= ../../crt/sparcv7
 
 include ../Makefile.com
 
--- old/usr/src/lib/libc_db/sparcv9/Makefile	2017-09-04 19:56:18.587677053 +0000
+++ new/usr/src/lib/libc_db/sparcv9/Makefile	2017-09-04 19:56:18.599995321 +0000
@@ -23,10 +23,8 @@
 # Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 
-CRTSRCS= ../../common/sparcv9
+CRTSRCS= ../../crt/sparcv9
 
 include ../Makefile.com
 include ../../Makefile.lib.64
--- old/usr/src/lib/libnsl/Makefile.com	2017-09-04 19:56:18.945032186 +0000
+++ new/usr/src/lib/libnsl/Makefile.com	2017-09-04 19:56:18.957648836 +0000
@@ -188,7 +188,7 @@
 CCFLAGS += $(NOEXCEPTIONS)
 CCFLAGS64 += $(NOEXCEPTIONS)
 
-CPPFLAGS +=	-I$(SRC)/lib/common/inc -I$(SRC)/lib/libnsl/include -D_REENTRANT
+CPPFLAGS +=	-I$(SRC)/lib/libnsl/include -D_REENTRANT
 CPPFLAGS +=	-I$(SRC)/lib/libnsl/dial
 
 CFLAGS +=	$(CCVERBOSE)
--- old/usr/src/lib/req.flg	2017-09-04 19:56:19.322367278 +0000
+++ new/usr/src/lib/req.flg	2017-09-04 19:56:19.331309235 +0000
@@ -23,14 +23,12 @@
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 
 echo_file usr/src/lib/Makefile.lib
 echo_file usr/src/lib/Makefile.targ
 echo_file usr/src/lib/Makefile.mach
 echo_file usr/src/lib/Makefile.lib.64
 echo_file usr/src/lib/Makefile.rootfs
-find_files "s.*" usr/src/lib/common
+find_files "s.*" usr/src/lib/crt
 find_files "s.*" usr/src/common/mapfiles
 exec_file usr/src/cmd/req.flg
--- old/usr/src/pkg/manifests/developer-library-lint.mf	2017-09-04 19:56:19.664135413 +0000
+++ new/usr/src/pkg/manifests/developer-library-lint.mf	2017-09-04 19:56:19.676500200 +0000
@@ -26,8 +26,7 @@
 #
 
 set name=pkg.fmri value=pkg:/developer/library/lint@$(PKGVERS)
-set name=pkg.description \
-    value="lint libraries and startup objects for software development"
+set name=pkg.description value="lint libraries for software development"
 set name=pkg.summary value="Lint Libraries"
 set name=info.classification value=org.opensolaris.category.2008:Development/C
 set name=variant.arch value=$(ARCH)
@@ -200,10 +199,6 @@
 file path=lib/llib-luuid.ln
 file path=lib/llib-lxnet
 file path=lib/llib-lxnet.ln
-$(i386_ONLY)file path=usr/lib/$(ARCH64)/crt1.o
-file path=usr/lib/$(ARCH64)/crti.o
-file path=usr/lib/$(ARCH64)/crtn.o
-$(i386_ONLY)file path=usr/lib/$(ARCH64)/gcrt1.o
 file path=usr/lib/$(ARCH64)/llib-lads.ln
 file path=usr/lib/$(ARCH64)/llib-ladutils.ln
 file path=usr/lib/$(ARCH64)/llib-lbsdmalloc.ln
@@ -243,16 +238,6 @@
 file path=usr/lib/$(ARCH64)/llib-lvolmgt.ln
 file path=usr/lib/$(ARCH64)/llib-lwrap.ln
 file path=usr/lib/$(ARCH64)/llib-lzoneinfo.ln
-file path=usr/lib/$(ARCH64)/values-Xa.o
-file path=usr/lib/$(ARCH64)/values-Xc.o
-file path=usr/lib/$(ARCH64)/values-Xs.o
-file path=usr/lib/$(ARCH64)/values-Xt.o
-file path=usr/lib/$(ARCH64)/values-xpg4.o
-file path=usr/lib/$(ARCH64)/values-xpg6.o
-$(i386_ONLY)file path=usr/lib/crt1.o
-file path=usr/lib/crti.o
-file path=usr/lib/crtn.o
-$(i386_ONLY)file path=usr/lib/gcrt1.o
 file path=usr/lib/llib-lads
 file path=usr/lib/llib-lads.ln
 file path=usr/lib/llib-ladutils
@@ -339,12 +324,6 @@
 file path=usr/lib/scsi/llib-lses.ln
 file path=usr/lib/scsi/llib-lsmp
 file path=usr/lib/scsi/llib-lsmp.ln
-file path=usr/lib/values-Xa.o
-file path=usr/lib/values-Xc.o
-file path=usr/lib/values-Xs.o
-file path=usr/lib/values-Xt.o
-file path=usr/lib/values-xpg4.o
-file path=usr/lib/values-xpg6.o
 file path=usr/xpg4/lib/$(ARCH64)/llib-lcurses.ln
 file path=usr/xpg4/lib/llib-lcurses
 file path=usr/xpg4/lib/llib-lcurses.ln
@@ -379,18 +358,6 @@
     target=../../../../lib/$(ARCH64)/llib-lcurses.ln
 link path=usr/ccs/lib/$(ARCH64)/llib-ly.ln \
     target=../../../lib/$(ARCH64)/llib-ly.ln
-link path=usr/ccs/lib/$(ARCH64)/values-Xa.o \
-    target=../../../lib/$(ARCH64)/values-Xa.o
-link path=usr/ccs/lib/$(ARCH64)/values-Xc.o \
-    target=../../../lib/$(ARCH64)/values-Xc.o
-link path=usr/ccs/lib/$(ARCH64)/values-Xs.o \
-    target=../../../lib/$(ARCH64)/values-Xs.o
-link path=usr/ccs/lib/$(ARCH64)/values-Xt.o \
-    target=../../../lib/$(ARCH64)/values-Xt.o
-link path=usr/ccs/lib/$(ARCH64)/values-xpg4.o \
-    target=../../../lib/$(ARCH64)/values-xpg4.o
-link path=usr/ccs/lib/$(ARCH64)/values-xpg6.o \
-    target=../../../lib/$(ARCH64)/values-xpg6.o
 link path=usr/ccs/lib/llib-lcurses target=../../../lib/llib-lcurses
 link path=usr/ccs/lib/llib-lcurses.ln target=../../../lib/llib-lcurses.ln
 link path=usr/ccs/lib/llib-lform target=../../lib/llib-lform
@@ -405,12 +372,6 @@
 link path=usr/ccs/lib/llib-ltermcap.ln target=../../../lib/llib-ltermcap.ln
 link path=usr/ccs/lib/llib-ltermlib target=../../../lib/llib-lcurses
 link path=usr/ccs/lib/llib-ltermlib.ln target=../../../lib/llib-lcurses.ln
-link path=usr/ccs/lib/values-Xa.o target=../../lib/values-Xa.o
-link path=usr/ccs/lib/values-Xc.o target=../../lib/values-Xc.o
-link path=usr/ccs/lib/values-Xs.o target=../../lib/values-Xs.o
-link path=usr/ccs/lib/values-Xt.o target=../../lib/values-Xt.o
-link path=usr/ccs/lib/values-xpg4.o target=../../lib/values-xpg4.o
-link path=usr/ccs/lib/values-xpg6.o target=../../lib/values-xpg6.o
 link path=usr/lib/$(ARCH64)/llib-ladm.ln \
     target=../../../lib/$(ARCH64)/llib-ladm.ln
 link path=usr/lib/$(ARCH64)/llib-laio.ln \
@@ -585,3 +546,5 @@
 link path=usr/lib/llib-luuid.ln target=../../lib/llib-luuid.ln
 link path=usr/lib/llib-lxnet target=../../lib/llib-lxnet
 link path=usr/lib/llib-lxnet.ln target=../../lib/llib-lxnet.ln
+# Used to be incorrectly in this package, pull it in for compatibility
+depend fmri=system/library/c-runtime type=group
--- /dev/null	2017-09-04 19:56:20.000000000 +0000
+++ new/usr/src/pkg/manifests/system-library-c-runtime.mf	2017-09-04 19:56:20.070227050 +0000
@@ -0,0 +1,57 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source.  A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+# Copyright 2016, Richard Lowe.
+set name=pkg.fmri value=pkg:/system/library/c-runtime@$(PKGVERS)
+set name=pkg.description value="C runtime objects"
+set name=pkg.summary value="C Runtime"
+set name=info.classification value=org.opensolaris.category.2008:Development/C
+set name=variant.arch value=$(ARCH)
+file path=usr/lib/$(ARCH64)/crt1.o
+file path=usr/lib/$(ARCH64)/crti.o
+file path=usr/lib/$(ARCH64)/crtn.o
+file path=usr/lib/$(ARCH64)/values-Xa.o
+file path=usr/lib/$(ARCH64)/values-Xc.o
+file path=usr/lib/$(ARCH64)/values-Xs.o
+file path=usr/lib/$(ARCH64)/values-Xt.o
+file path=usr/lib/$(ARCH64)/values-xpg4.o
+file path=usr/lib/$(ARCH64)/values-xpg6.o
+file path=usr/lib/crt1.o
+file path=usr/lib/crti.o
+file path=usr/lib/crtn.o
+file path=usr/lib/values-Xa.o
+file path=usr/lib/values-Xc.o
+file path=usr/lib/values-Xs.o
+file path=usr/lib/values-Xt.o
+file path=usr/lib/values-xpg4.o
+file path=usr/lib/values-xpg6.o
+license cr_Sun license=cr_Sun
+license lic_CDDL license=lic_CDDL
+link path=usr/ccs/lib/$(ARCH64)/values-Xa.o \
+    target=../../../lib/$(ARCH64)/values-Xa.o
+link path=usr/ccs/lib/$(ARCH64)/values-Xc.o \
+    target=../../../lib/$(ARCH64)/values-Xc.o
+link path=usr/ccs/lib/$(ARCH64)/values-Xs.o \
+    target=../../../lib/$(ARCH64)/values-Xs.o
+link path=usr/ccs/lib/$(ARCH64)/values-Xt.o \
+    target=../../../lib/$(ARCH64)/values-Xt.o
+link path=usr/ccs/lib/$(ARCH64)/values-xpg4.o \
+    target=../../../lib/$(ARCH64)/values-xpg4.o
+link path=usr/ccs/lib/$(ARCH64)/values-xpg6.o \
+    target=../../../lib/$(ARCH64)/values-xpg6.o
+link path=usr/ccs/lib/values-Xa.o target=../../lib/values-Xa.o
+link path=usr/ccs/lib/values-Xc.o target=../../lib/values-Xc.o
+link path=usr/ccs/lib/values-Xs.o target=../../lib/values-Xs.o
+link path=usr/ccs/lib/values-Xt.o target=../../lib/values-Xt.o
+link path=usr/ccs/lib/values-xpg4.o target=../../lib/values-xpg4.o
+link path=usr/ccs/lib/values-xpg6.o target=../../lib/values-xpg6.o
+$(i386_ONLY)link path=usr/lib/$(ARCH64)/gcrt1.o target=crt1.o
+$(i386_ONLY)link path=usr/lib/gcrt1.o target=crt1.o
