6237094 perl build should honor $(CC)
authorwesolows
Tue, 20 Sep 2005 15:07:36 -0700
changeset 580 70dfd36fd02c
parent 579 6139238196bb
child 581 16ccc69108c3
6237094 perl build should honor $(CC) 6272179 relocation processing should be bypassed when building libgenunix et al 6307198 Need to pass in -save_args option when the new gcc is available 6310495 gcc and sun4 rootnex don't get along 6310534 new gcc options should be used to build ON 6319181 cw needs -xbuiltin support
usr/src/Makefile.master
usr/src/Makefile.master.64
usr/src/cmd/mdb/sparc/Makefile.sparcv7
usr/src/cmd/mdb/sparc/Makefile.sparcv9
usr/src/cmd/perl/5.6.1/Makefile
usr/src/cmd/perl/5.6.1/distrib/Makefile
usr/src/cmd/perl/5.6.1/extract_config.sh
usr/src/cmd/perl/5.8.4/Makefile
usr/src/cmd/perl/5.8.4/distrib/Makefile
usr/src/cmd/perl/5.8.4/extract_config.sh
usr/src/tools/cw/cw.c
usr/src/uts/Makefile.uts
usr/src/uts/i86pc/Makefile.rules
usr/src/uts/intel/amd64/krtld/kobj_boot.c
usr/src/uts/intel/genunix/Makefile
usr/src/uts/intel/ia32/krtld/kobj_boot.c
usr/src/uts/sparc/krtld/Makefile
usr/src/uts/sun4/io/rootnex.c
usr/src/uts/sun4u/Makefile.rules
usr/src/uts/sun4u/blade/platmod/Makefile
usr/src/uts/sun4u/cheetah/Makefile
usr/src/uts/sun4u/cheetahplus/Makefile
usr/src/uts/sun4u/cherrystone/platmod/Makefile
usr/src/uts/sun4u/chicago/platmod/Makefile
usr/src/uts/sun4u/daktari/platmod/Makefile
usr/src/uts/sun4u/darwin/platmod/Makefile
usr/src/uts/sun4u/enchilada/platmod/Makefile
usr/src/uts/sun4u/excalibur/platmod/Makefile
usr/src/uts/sun4u/fjlite/platmod/Makefile
usr/src/uts/sun4u/genunix/Makefile
usr/src/uts/sun4u/grover/platmod/Makefile
usr/src/uts/sun4u/hummingbird/Makefile
usr/src/uts/sun4u/jalapeno/Makefile
usr/src/uts/sun4u/javelin/platmod/Makefile
usr/src/uts/sun4u/littleneck/platmod/Makefile
usr/src/uts/sun4u/platmod/Makefile
usr/src/uts/sun4u/serengeti/cheetah/Makefile
usr/src/uts/sun4u/serengeti/cheetahplus/Makefile
usr/src/uts/sun4u/serengeti/unix/Makefile
usr/src/uts/sun4u/serrano/Makefile
usr/src/uts/sun4u/snowbird/platmod/Makefile
usr/src/uts/sun4u/spitfire/Makefile
usr/src/uts/sun4u/starcat/cheetah/Makefile
usr/src/uts/sun4u/starcat/cheetahplus/Makefile
usr/src/uts/sun4u/starcat/unix/Makefile
usr/src/uts/sun4u/starfire/platmod/Makefile
usr/src/uts/sun4u/starfire/spitfire/Makefile
usr/src/uts/sun4u/starfire/unix/Makefile
usr/src/uts/sun4u/taco/platmod/Makefile
usr/src/uts/sun4u/tazmo/platmod/Makefile
usr/src/uts/sun4u/unix/Makefile
usr/src/uts/sun4v/Makefile.rules
usr/src/uts/sun4v/generic/Makefile
usr/src/uts/sun4v/genunix/Makefile
usr/src/uts/sun4v/niagara/Makefile
usr/src/uts/sun4v/ontario/platmod/Makefile
usr/src/uts/sun4v/platmod/Makefile
usr/src/uts/sun4v/unix/Makefile
--- a/usr/src/Makefile.master	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/Makefile.master	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,12 +18,15 @@
 #
 # CDDL HEADER END
 #
+
 #
 # Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
 #
+
+#
 # Makefile.master, global definitions for system source
 #
 ROOT=		/proto
@@ -295,13 +297,12 @@
 #
 # XX64	future versions of gcc will make -mcmodel=kernel imply -mno-red-zone
 #
-sparc_STAND_FLAGS=
-sparcv9_STAND_FLAGS=
+sparc_STAND_FLAGS=	-_gcc=-ffreestanding
+sparcv9_STAND_FLAGS=	-_gcc=-ffreestanding
 i386_STAND_FLAGS=	-_gcc=-ffreestanding
 amd64_STAND_FLAGS=	-Wu,-xmodel=kernel
 
 SAVEARGS=		-Wu,-save_args
-$(__GNUC64)SAVEARGS=
 amd64_STAND_FLAGS	+= $(SAVEARGS)
 
 STAND_FLAGS_32 = $($(MACH)_STAND_FLAGS)
@@ -357,20 +358,28 @@
 # (gives them a unique prefix). Disable that.
 CNOGLOBAL= -W0,-noglobal
 
+# Normally, gcc uses indirect DWARF strings to save space.  However,
+# this causes relocations that ctfconvert cannot handle.  Disable this.
+CDWARFSTR=	-_gcc=-fno-dwarf2-indirect-strings
+
+# Sometimes we want all symbols and types in debugging information even
+# if they aren't used.
+CALLSYMS=	-W0,-xdbggen=no%usedonly
+
 #
 # Flags used to build in debug mode for ctf generation.  Bugs in the Devpro
 # compilers currently prevent us from building with cc-emitted DWARF.
 #
-CTF_FLAGS_sparc	= -g -Wc,-Qiselect-T1 $(C99MODE) $(CNOGLOBAL)
-CTF_FLAGS_i386	= -g $(C99MODE) $(CNOGLOBAL)
+CTF_FLAGS_sparc	= -g -Wc,-Qiselect-T1 $(C99MODE) $(CNOGLOBAL) $(CDWARFSTR)
+CTF_FLAGS_i386	= -g $(C99MODE) $(CNOGLOBAL) $(CDWARFSTR)
 CTF_FLAGS	= $(CTF_FLAGS_$(MACH))
 
 #
 # Flags used with genoffsets
 #
 GOFLAGS = -_noecho \
-	-_gcc=-fno-eliminate-unused-debug-symbols \
-	-_gcc=-fno-eliminate-unused-debug-types	
+	$(CALLSYMS) \
+	$(CDWARFSTR)
 
 OFFSETS_CREATE = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
 	$(CC) $(GOFLAGS) $(CFLAGS) $(CPPFLAGS)
@@ -611,6 +620,12 @@
 LD=			$(NATIVELD)
 LINT=			$(NATIVELINT)
 
+# The real compilers used for this build
+CW_CC_CMD=		$(CC) -_compiler
+CW_CCC_CMD=		$(CCC) -_compiler
+REAL_CC=		$(CW_CC_CMD:sh)
+REAL_CCC=		$(CW_CCC_CMD:sh)
+
 # Pass -Y flag to cpp (method of which is release-dependent)
 CCYFLAG=		-Y I,
 
@@ -635,6 +650,7 @@
 ZNODLOPEN=	-znodlopen
 ZNODUMP=	-znodump
 ZNOLAZYLOAD=	-znolazyload
+ZNORELOC=	-znoreloc
 ZNOVERSION=	-znoversion
 ZREDLOCSYM=	-zredlocsym
 ZTEXT=		-ztext
--- a/usr/src/Makefile.master.64	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/Makefile.master.64	Tue Sep 20 15:07:36 2005 -0700
@@ -71,6 +71,9 @@
 LD=		$($(MACH64)_LD)
 LINT=		$($(MACH64)_LINT)
 
+REAL_CC=	$(CW_CC_CMD:sh)
+REAL_CCC=	$(CW_CCC_CMD:sh)
+
 BUILD.SO=	$(CC) $(CFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \
 		$(PICS) -L $(ROOTLIBDIR64) $(LDLIBS)
 
--- a/usr/src/cmd/mdb/sparc/Makefile.sparcv7	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/cmd/mdb/sparc/Makefile.sparcv7	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -34,7 +33,7 @@
 	$(INS.file)
 
 CFLAGS += $(CTF_FLAGS) $(CCVERBOSE) -xstrconst
-CTFSTABSCFLAGS = $(CFLAGS)
+CTFSTABSCFLAGS = $(CFLAGS) $(CALLSYMS)
 LINTFLAGS += -u -erroff=E_BAD_FORMAT_STR2,E_BAD_FORMAT_ARG_TYPE2
 
 LFLAGS = -t -v
--- a/usr/src/cmd/mdb/sparc/Makefile.sparcv9	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/cmd/mdb/sparc/Makefile.sparcv9	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -36,7 +35,7 @@
 CFLAGS = $(CTF_FLAGS) $(XSTRCONST)
 CFLAGS64 += $(CTF_FLAGS) $(XSTRCONST)
 CPPFLAGS += -D_ELF64
-CTFSTABSCFLAGS = $(CFLAGS64)
+CTFSTABSCFLAGS = $(CFLAGS64) $(CALLSYMS)
 
 LINTTAGS1 = E_BAD_FORMAT_STR2,E_INCONS_ARG_DECL2,E_INCONS_VAL_TYPE_DECL2
 LINTTAGS2 = E_BAD_FORMAT_ARG_TYPE2
--- a/usr/src/cmd/perl/5.6.1/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/cmd/perl/5.6.1/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,8 +18,9 @@
 #
 # CDDL HEADER END
 #
+
 #
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -54,6 +54,10 @@
 clean	:= TARGET = clean
 test	:= TARGET = test
 
+# Compiler replacement rules
+SED_CC		= -e "s!'cc'!'$(CC)'!"
+SED_CC_E	= -e "s!'cc -E'!'$(REAL_CC) -E'!"
+
 # distrib holds the perl source, contrib holds the SMI modules.
 all clean test: configure FRC
 	@ cd distrib; pwd; $(KEEP_STATE_OFF); $(MAKE) $(TARGET)
@@ -67,7 +71,7 @@
 
 # Modify config.sh to refer to the compiler used for the build.
 distrib/config.sh: $(MACH)/config.sh
-	$(SED)	-e "s!'cc!'$(SPRO_VROOT)/bin/cc!" $(MACH)/config.sh > $@
+	$(SED)	$(SED_CC) $(SED_CC_E) $(MACH)/config.sh > $@
 
 Makefile.perlcfg: extract_config $(MACH)/config.sh
 	./extract_config $(MACH)/config.sh > Makefile.perlcfg
--- a/usr/src/cmd/perl/5.6.1/distrib/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/cmd/perl/5.6.1/distrib/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,11 +18,14 @@
 #
 # CDDL HEADER END
 #
+
 #
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 # The perl5 installation for Solaris differs from that generated by the
 # Perl Configure procedure.  The configuration appropriate for the current
@@ -62,6 +64,10 @@
 # Add in the libraries perl needs to be linked against.
 LDLIBS += $(PERL_LDLIBS)
 
+# Compiler replacement rules
+SED_UN_CC =	-e "s!'$(CC)!'cc!"
+SED_UN_CC_E =	-e "s!'$(REAL_CC)!'cc!"
+
 all :=		TARGET = all
 install :=	TARGET = install
 clobber :=	TARGET = clobber
@@ -167,7 +173,7 @@
 
 $(DYNALOADER): ext/DynaLoader/Makefile $(PERL_CONFIGDEP) cflags FRC
 	@ cd ext/DynaLoader; pwd; $(PERL_MM_ENV); \
-	$(MAKE) LINKTYPE=static CCCDLFLAGS=all
+	$(MAKE) LINKTYPE=static CCCDLFLAGS=
 
 #
 # Create the perl executable.
@@ -214,13 +220,13 @@
 	umask 022; $(MKDIR) -p $(PERL_VENDOR_DIR)
 
 	$(RM) $(PERL_ARCHLIB_DIR)/Config.pm
-	$(SED) -e "s!'$(CC)!'cc!" $(PERL_CONFIG_PM) \
+	$(SED) $(SED_UN_CC) $(SED_UN_CC_E) $(PERL_CONFIG_PM) \
 	    > $(PERL_ARCHLIB_DIR)/Config.pm
 	$(CHMOD) 444 $(PERL_ARCHLIB_DIR)/Config.pm
 
 	@ $(CHOWN) -R $(OWNER):$(GROUP) $(PERL_ROOT_STEM) 
 
-install: all install_files
+install: all .WAIT install_files
 
 #
 # Perl test suite target.
--- a/usr/src/cmd/perl/5.6.1/extract_config.sh	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/cmd/perl/5.6.1/extract_config.sh	Tue Sep 20 15:07:36 2005 -0700
@@ -1,10 +1,12 @@
 #!/bin/ksh -p
 
 #
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 # This script extracts values from the passed config.sh file and prints them to
 # stdout in a form that is suitable for including in a Makefile.  This removes
@@ -29,9 +31,8 @@
 
 #
 # ON Makefile macro adjustments.  Perl needs to build/ship with a consistent
-# set of flags, and needs to build with the Forte compilers.
+# set of flags, and needs to build with the selected compilers.
 #
-printf 'CC = $(SPRO_VROOT)/bin/cc\n'
 printf 'C99MODE = $(C99_DISABLE)\n'
 printf 'COPTFLAG = %s\n' "$optimize"
 printf 'SPACEFLAG =\n'
--- a/usr/src/cmd/perl/5.8.4/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/cmd/perl/5.8.4/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,11 +18,12 @@
 #
 # CDDL HEADER END
 #
+
 #
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
 #
 
 #
@@ -54,6 +54,10 @@
 clean	:= TARGET = clean
 test	:= TARGET = test
 
+# Compiler replacement rules
+SED_CC		= -e "s!'cc'!'$(CC)'!"
+SED_CC_E	= -e "s!'cc -E'!'$(REAL_CC) -E'!"
+
 # distrib holds the perl source, contrib holds the SMI modules.
 all clean test: configure FRC
 	@ cd distrib; pwd; $(KEEP_STATE_OFF); $(MAKE) $(TARGET)
@@ -67,7 +71,7 @@
 
 # Modify config.sh to refer to the compiler used for the build.
 distrib/config.sh: $(MACH)/config.sh
-	$(SED) -e "s!'cc!'$(SPRO_VROOT)/bin/cc!" $(MACH)/config.sh > $@
+	$(SED)	$(SED_CC) $(SED_CC_E) $(MACH)/config.sh > $@
 
 Makefile.perlcfg: extract_config $(MACH)/config.sh
 	./extract_config $(MACH)/config.sh > Makefile.perlcfg
--- a/usr/src/cmd/perl/5.8.4/distrib/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/cmd/perl/5.8.4/distrib/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,11 +18,14 @@
 #
 # CDDL HEADER END
 #
+
 #
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 # The perl5 installation for Solaris differs from that generated by the
 # Perl Configure procedure.  The configuration appropriate for the current
@@ -68,6 +70,10 @@
 # Add in the libraries perl needs to be linked against.
 LDLIBS += $(PERL_LDLIBS)
 
+# Compiler replacement rules
+SED_UN_CC	= -e "s!'$(CC)!'cc!"
+SED_UN_CC_E	= -e "s!'$(REAL_CC)!'cc!"
+
 all :=		TARGET = all
 install :=	TARGET = install
 clobber :=	TARGET = clobber
@@ -189,7 +195,7 @@
 
 $(DYNALOADER): ext/DynaLoader/Makefile $(PERL_CONFIGDEP) cflags FRC
 	@ cd ext/DynaLoader; pwd; $(PERL_MM_ENV); \
-	$(MAKE) LINKTYPE=static CCCDLFLAGS=all
+	$(MAKE) LINKTYPE=static CCCDLFLAGS=
 
 #
 # Create the perl executable.
@@ -251,13 +257,13 @@
 	@ $(CHOWN) $(OWNER):$(GROUP) $(ROOTPROG)
 
 	$(RM) $(PERL_ARCHLIB_DIR)/Config.pm
-	$(SED) -e "s!'$(CC)!'cc!" $(PERL_CONFIG_PM) \
+	$(SED) $(SED_UN_CC) $(SED_UN_CC_E) $(PERL_CONFIG_PM) \
 	    > $(PERL_ARCHLIB_DIR)/Config.pm
 	$(CHMOD) 444 $(PERL_ARCHLIB_DIR)/Config.pm
 
 	@ $(CHOWN) -R $(OWNER):$(GROUP) $(PERL_ROOT_STEM) 
 
-install: all install_files
+install: all .WAIT install_files
 
 #
 # Perl test suite target.
--- a/usr/src/cmd/perl/5.8.4/extract_config.sh	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/cmd/perl/5.8.4/extract_config.sh	Tue Sep 20 15:07:36 2005 -0700
@@ -1,9 +1,12 @@
 #!/bin/ksh -p
+
 #
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 # This script extracts values from the passed config.sh file and prints them to
 # stdout in a form that is suitable for including in a Makefile.  This removes
@@ -28,9 +31,8 @@
 
 #
 # ON Makefile flag macro adjustments.  Perl needs to build/ship with a
-# consistent set of flags, and needs to build with the Forte compilers.
+# consistent set of flags, and needs to build with the selected compilers.
 #
-printf 'CC = $(SPRO_VROOT)/bin/cc\n'
 printf 'C99MODE = $(C99_ENABLE)\n'
 printf 'COPTFLAG = %s\n' "$optimize"
 printf 'SPACEFLAG =\n'
--- a/usr/src/tools/cw/cw.c	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/tools/cw/cw.c	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
  * 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.
+ * 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.
@@ -19,6 +18,7 @@
  *
  * CDDL HEADER END
  */
+
 /*
  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
@@ -234,7 +234,7 @@
  * -x386			-march=i386 (x86 only)
  * -x486			-march=i486 (x86 only)
  * -xarch=<a>			table
- * -xbuiltin[=<b>]		error
+ * -xbuiltin[=<b>]		-fbuiltin (-fno-builtin otherwise)
  * -xCC				ignore
  * -xchar_byte_order=<o>	error
  * -xchip=<c>			table
@@ -520,6 +520,17 @@
 	newae(h, "-fno-asm");
 	newae(h, "-nodefaultlibs");
 
+#if defined(__sparc)
+	/*
+	 * The SPARC ldd and std instructions require 8-byte alignment of
+	 * their address operand.  gcc correctly uses them only when the
+	 * ABI requires 8-byte alignment; unfortunately we have a number of
+	 * pieces of buggy code that doesn't conform to the ABI.  This
+	 * flag makes gcc work more like Studio with -xmemalign=4.
+	 */
+	newae(h, "-mno-integer-ldd-std");
+#endif
+
 	/*
 	 * This is needed because 'u' is defined
 	 * under a conditional on 'sun'.  Should
@@ -929,11 +940,8 @@
 			}
 #if defined(__x86)
 			if (strcmp(arg, "-Wu,-no_got_reloc") == 0) {
-				/*
-				 * Don't create any GOT relocations?
-				 * Well, gcc doesn't have this degree
-				 * of control over its pic code ...
-				 */
+				newae(h, "-fno-jump-tables");
+				newae(h, "-fno-constant-pools");
 				break;
 			}
 			if (strcmp(arg, "-Wu,-xmodel=kernel") == 0) {
@@ -993,6 +1001,14 @@
 				}
 				error(arg);
 				break;
+			case 'b':
+				if (strncmp(arg, "-xbuiltin=", 10) == 0) {
+					if (strcmp(arg + 10, "%all"))
+						newae(h, "-fbuiltin");
+					break;
+				}
+				error(arg);
+				break;
 			case 'C':
 				/* Accept C++ style comments -- ignore */
 				if (strcmp(arg, "-xCC") == 0)
@@ -1141,7 +1157,6 @@
 				}
 				error(arg);
 				break;
-			case 'b':
 			case 'e':
 			case 'h':
 			case 'l':
--- a/usr/src/uts/Makefile.uts	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/Makefile.uts	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,12 +18,15 @@
 #
 # CDDL HEADER END
 #
+
 #
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
 #
+
+#
 #	This Makefile contains the common targets and definitions for
 #	all kernels. It is to be included in the Makefiles for specific
 #	implementation architectures and processor architecture dependent
@@ -443,6 +445,22 @@
 IPCTF			= $(IPDRV_DIR)/$(OBJS_DIR)/ipctf.a
 
 #
+# Rule for building fake shared libraries used for symbol resolution
+# when building other modules.  -znoreloc is needed here to avoid
+# tripping over code that isn't really suitable for shared libraries.
+#
+BUILD.SO		= \
+	$(LD) -o $@ $(GSHARED) $(ZNORELOC) -h $(SONAME)
+
+#
+# SONAME defaults for common fake shared libraries.
+#
+$(LIBGEN)		:= SONAME = $(MODULE)
+$(PLATLIB)		:= SONAME = misc/platmod
+$(CPULIB)		:= SONAME = 'cpu/$$CPU'
+$(DTRACESTUBS)		:= SONAME = dtracestubs
+
+#
 #	Installation directories
 #
 
--- a/usr/src/uts/i86pc/Makefile.rules	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/i86pc/Makefile.rules	Tue Sep 20 15:07:36 2005 -0700
@@ -191,7 +191,7 @@
 	    $$1, $$1, $$1); }' > $(OBJS_DIR)/dtracestubs.s
 
 $(DTRACESTUBS):	$(DTRACESTUBS_O)
-	$(LD) -o $@ -G -h dtracestubs $(DTRACESTUBS_O)
+	$(BUILD.SO) $(DTRACESTUBS_O)
 
 #
 #	Section 1b: Lint `object' build rules
--- a/usr/src/uts/intel/amd64/krtld/kobj_boot.c	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/intel/amd64/krtld/kobj_boot.c	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
  * 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.
+ * 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.
@@ -20,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -104,20 +103,6 @@
 	 */
 	for (; ebp->eb_tag != EB_NULL; ebp++) {
 		switch (ebp->eb_tag) {
-#if defined(__GNUC__)
-		/*
-		 * gcc 2.95, 3.1 cannot be told to not generate GOT references,
-		 * which krtld cannot handle.  yet switch statements which
-		 * can be mapped to jump tables are a frequent generator
-		 * of such references.
-		 */
-		case 0x12345678:
-			/*
-			 * deliberately mess up the compilers
-			 * temptation to create a jump table
-			 */
-			break;
-#endif
 		case EB_AUXV:
 			auxv = (auxv_t *)ebp->eb_un.eb_ptr;
 			break;
@@ -137,14 +122,6 @@
 	 */
 	for (; auxv->a_type != AT_NULL; auxv++) {
 		switch (auxv->a_type) {
-#if defined(__GNUC__)
-		case 0x12345678:
-			/*
-			 * deliberately mess up the compilers
-			 * temptation to create a jump table
-			 */
-			break;
-#endif
 		case AT_PHDR:
 			bootaux[BA_PHDR].ba_ptr = auxv->a_un.a_ptr;
 			break;
@@ -410,14 +387,6 @@
 			 * order unaligned.
 			 */
 			switch (rtype) {
-#if defined(__GNUC__)
-			case 0x12345678:
-				/*
-				 * deliberately mess up the compilers
-				 * temptation to create a jump table
-				 */
-				break;
-#endif
 			case R_AMD64_64:
 				*(unsigned long *)offptr = value + addend;
 				break;
--- a/usr/src/uts/intel/genunix/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/intel/genunix/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,11 +18,14 @@
 #
 # CDDL HEADER END
 #
+
 #
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 #	This makefile drives the production of the generic
 #	unix kernel module.
@@ -52,7 +54,6 @@
 
 LIBGEN		= $(OBJS_DIR)/libgenunix.so
 LIBSTUBS	= $(GENSTUBS_OBJS:%=$(OBJS_DIR)/%)
-SONAME		= $(MODULE)
 
 #
 #	Include common rules.
@@ -108,7 +109,7 @@
 install:	$(INSTALL_DEPS)
 
 $(LIBGEN):	$(GENUNIX) $(LIBSTUBS)
-	$(LD) -o $@ -G -h $(SONAME) $(GENUNIX) $(LIBSTUBS)
+	$(BUILD.SO) $(GENUNIX) $(LIBSTUBS)
 
 $(IPCTF_TARGET) ipctf_target: FRC
 	@cd $(IPDRV_DIR); pwd; $(MAKE) ipctf.$(OBJS_DIR)
--- a/usr/src/uts/intel/ia32/krtld/kobj_boot.c	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/intel/ia32/krtld/kobj_boot.c	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
  * 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.
+ * 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.
@@ -20,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -102,20 +101,6 @@
 	 */
 	for (; ebp->eb_tag != EB_NULL; ebp++) {
 		switch (ebp->eb_tag) {
-#if defined(__GNUC__)
-		/*
-		 * gcc 2.95, 3.1 cannot be told to not generate GOT references,
-		 * which krtld cannot handle.  yet switch statements which
-		 * can be mapped to jump tables are a frequent generator
-		 * of such references.
-		 */
-		case 0x12345678:
-			/*
-			 * deliberately mess up the compilers
-			 * temptation to create a jump table
-			 */
-			break;
-#endif
 		case EB_AUXV:
 			auxv = (auxv_t *)ebp->eb_un.eb_ptr;
 			break;
@@ -135,14 +120,6 @@
 	 */
 	for (; auxv->a_type != AT_NULL; auxv++) {
 		switch (auxv->a_type) {
-#if defined(__GNUC__)
-		case 0x12345678:
-			/*
-			 * deliberately mess up the compilers
-			 * temptation to create a jump table
-			 */
-			break;
-#endif
 		case AT_PHDR:
 			bootaux[BA_PHDR].ba_ptr = auxv->a_un.a_ptr;
 			break;
@@ -382,14 +359,6 @@
 			 * order unaligned.
 			 */
 			switch (rtype) {
-#if defined(__GNUC__)
-			case 0x12345678:
-				/*
-				 * deliberately mess up the compilers
-				 * temptation to create a jump table
-				 */
-				break;
-#endif
 			case R_386_PC32:
 			case R_386_32:
 			case R_386_PLT32:
--- a/usr/src/uts/sparc/krtld/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sparc/krtld/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -83,7 +82,8 @@
 # the changed symbols) unless we tell it to use fuzzy matching.
 CTFMRGFLAGS	= -f
 
-$(PICS)		:= CFLAGS += -K pic
+$(PICS)		:= CFLAGS += -K pic -_gcc=-fno-constant-pools \
+		-_gcc=-fno-jump-tables
 
 #
 # krtld has its own private copies of these functions and objects
--- a/usr/src/uts/sun4/io/rootnex.c	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4/io/rootnex.c	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
  * 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.
+ * 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.
@@ -19,6 +18,7 @@
  *
  * CDDL HEADER END
  */
+
 /*
  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
@@ -386,7 +386,7 @@
 		}
 	}
 
-	DPRINTF(ROOTNEX_MAP_DEBUG, ("at virtual 0x%x\n", *vaddrp));
+	DPRINTF(ROOTNEX_MAP_DEBUG, ("at virtual 0x%p\n", *vaddrp));
 	return (0);
 }
 
@@ -725,8 +725,8 @@
 {
 	extern struct seg_ops segdev_ops;
 
-	DPRINTF(ROOTNEX_MAP_DEBUG, ("rootnex_map_fault: address <%x> "
-	    "pfn <%x>", addr, pfn));
+	DPRINTF(ROOTNEX_MAP_DEBUG, ("rootnex_map_fault: address <%p> "
+	    "pfn <%lx>", addr, pfn));
 	DPRINTF(ROOTNEX_MAP_DEBUG, (" Seg <%s>\n",
 	    seg->s_ops == &segdev_ops ? "segdev" :
 	    seg == &kvseg ? "segkmem" : "NONE!"));
--- a/usr/src/uts/sun4u/Makefile.rules	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/Makefile.rules	Tue Sep 20 15:07:36 2005 -0700
@@ -188,7 +188,7 @@
 	    $$1, $$1, $$1); }' > $(OBJS_DIR)/dtracestubs.s
 
 $(DTRACESTUBS):	$(DTRACESTUBS_O)
-	$(LD) -o $@ -G -h dtracestubs $(DTRACESTUBS_O)
+	$(BUILD.SO) $(DTRACESTUBS_O)
 
 #
 #	Section 1b: Lint `object' build rules
--- a/usr/src/uts/sun4u/blade/platmod/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/blade/platmod/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,13 +18,14 @@
 #
 # CDDL HEADER END
 #
+
 #
-# uts/sun4u/blade/platmod/Makefile
-#
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 #	This makefile drives the production of the sun4u blade platform module.
 #
@@ -96,7 +96,7 @@
 LINT_LIB_DIR	= $(BLADE_LINT_LIB_DIR)
 
 $(PLATLIB):	$(BINARY)
-	${LD} -o $(PLATLIB) -G $(BINARY)
+	$(BUILD.SO) $(BINARY)
 
 $(SYM_MOD):	$(UNIX_O) $(PLATLIB)
 	@echo "resolving symbols against unix.o"
--- a/usr/src/uts/sun4u/cheetah/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/cheetah/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,15 +18,17 @@
 #
 # CDDL HEADER END
 #
+
 #
-# uts/sun4u/cheetah/Makefile
-#
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
 #
-#	This makefile drives the production of the sun4u UltraSPARC driver module.
+
+#
+#	This makefile drives the production of the sun4u UltraSPARC driver
+#	module.
 #
 #	sun4u implementation architecture dependent
 #
@@ -99,7 +100,7 @@
 install:	$(INSTALL_DEPS)
 
 $(CPULIB):	$(BINARY)
-	$(LD) -o $(CPULIB) -G $(BINARY)
+	$(BUILD.SO) $(BINARY)
 
 $(SYM_MOD):	$(UNIX_O) $(CPULIB)
 	@echo "resolving symbols against unix.o"
--- a/usr/src/uts/sun4u/cheetahplus/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/cheetahplus/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,15 +18,17 @@
 #
 # CDDL HEADER END
 #
+
 #
-# uts/sun4u/cheetahplus/Makefile
-#
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
 #
-#	This makefile drives the production of the sun4u UltraSPARC driver module.
+
+#
+#	This makefile drives the production of the sun4u UltraSPARC driver
+#	module.
 #
 #	sun4u implementation architecture dependent
 #
@@ -105,7 +106,7 @@
 install:	$(INSTALL_DEPS)
 
 $(CPULIB):	$(BINARY)
-	$(LD) -o $(CPULIB) -G $(BINARY)
+	$(BUILD.SO) $(BINARY)
 
 $(SYM_MOD):	$(UNIX_O) $(CPULIB)
 	@echo "resolving symbols against unix.o"
--- a/usr/src/uts/sun4u/cherrystone/platmod/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/cherrystone/platmod/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,12 +18,14 @@
 #
 # CDDL HEADER END
 #
+
 #
-# uts/sun4u/cherrystone/platmod/Makefile
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 #	This makefile drives the production of the sun4u lneck platform module.
 #
@@ -99,7 +100,7 @@
 LINT_LIB_DIR	= $(CHERRYSTONE_LINT_LIB_DIR)
 
 $(PLATLIB):	$(BINARY)
-	${LD} -o $(PLATLIB) -G $(BINARY) -h misc/platmod
+	$(BUILD.SO) $(BINARY)
 
 $(SYM_MOD):	$(UNIX_O) $(PLATLIB)
 	@echo "resolving symbols against unix.o"
--- a/usr/src/uts/sun4u/chicago/platmod/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/chicago/platmod/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,13 +18,14 @@
 #
 # CDDL HEADER END
 #
+
 #
 # Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
 #
-# uts/sun4u/chicago/platmod/Makefile
+
 #
 # This makefile drives the production of the sun4u chicago platform module.
 #
@@ -96,7 +96,7 @@
 LINT_LIB_DIR	= $(CHICAGO_LINT_LIB_DIR)
 
 $(PLATLIB):	$(BINARY)
-	${LD} -o $(PLATLIB) -G $(BINARY)
+	$(BUILD.SO) $(BINARY)
 
 $(SYM_MOD):	$(UNIX_O) $(PLATLIB)
 	@echo "resolving symbols against unix.o"
--- a/usr/src/uts/sun4u/daktari/platmod/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/daktari/platmod/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,16 +18,17 @@
 #
 # CDDL HEADER END
 #
+
 #
-# uts/sun4u/daktari/platmod/Makefile
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 #	This makefile drives the production of the sun4u daktari platmod module
 #
-#
 
 #
 #	Path to the base of the uts directory tree (usually /usr/src/uts).
@@ -101,7 +101,7 @@
 LINT_LIB_DIR	=$(DAKTARI_LINT_LIB_DIR)
 
 $(PLATLIB):	$(BINARY)
-	$(LD) -o $(PLATLIB) -G $(BINARY)
+	$(BUILD.SO) $(BINARY)
 
 $(SYM_MOD):	$(UNIX_O) $(PLATLIB)
 	@echo "resolving symbols against unix.o"
--- a/usr/src/uts/sun4u/darwin/platmod/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/darwin/platmod/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,12 +18,14 @@
 #
 # CDDL HEADER END
 #
+
 #
-# uts/sun4u/darwin/platmod/Makefile
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 #	This makefile drives the production of the sun4u darwin platform module.
 #
@@ -95,7 +96,7 @@
 LINT_LIB_DIR	= $(DARWIN_LINT_LIB_DIR)
 
 $(PLATLIB):	$(BINARY)
-	${LD} -o $(PLATLIB) -G $(BINARY)
+	$(BUILD.SO) $(BINARY)
 
 $(SYM_MOD):	$(UNIX_O) $(PLATLIB)
 	@echo "resolving symbols against unix.o"
--- a/usr/src/uts/sun4u/enchilada/platmod/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/enchilada/platmod/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,13 +18,14 @@
 #
 # CDDL HEADER END
 #
+
 #
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
 #
-# uts/sun4u/enchilada/platmod/Makefile
+
 #
 # This makefile drives the production of the sun4u enchilada platform module.
 #
@@ -96,7 +96,7 @@
 LINT_LIB_DIR	= $(ENCHILADA_LINT_LIB_DIR)
 
 $(PLATLIB):	$(BINARY)
-	${LD} -o $(PLATLIB) -G $(BINARY)
+	$(BUILD.SO) $(BINARY)
 
 $(SYM_MOD):	$(UNIX_O) $(PLATLIB)
 	@echo "resolving symbols against unix.o"
--- a/usr/src/uts/sun4u/excalibur/platmod/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/excalibur/platmod/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,14 +18,17 @@
 #
 # CDDL HEADER END
 #
+
 #
-# uts/sun4u/excalibur/platmod/Makefile
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
 #
-#	This makefile drives the production of the sun4u excalibur platform module.
+
+#
+#	This makefile drives the production of the sun4u excalibur platform
+#	module.
 #
 #	sun4u implementation architecture dependent
 #
@@ -95,7 +97,7 @@
 LINT_LIB_DIR	= $(EXCALIBUR_LINT_LIB_DIR)
 
 $(PLATLIB):	$(BINARY)
-	${LD} -o $(PLATLIB) -G $(BINARY)
+	$(BUILD.SO) $(BINARY)
 
 $(SYM_MOD):	$(UNIX_O) $(PLATLIB)
 	@echo "resolving symbols against unix.o"
--- a/usr/src/uts/sun4u/fjlite/platmod/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/fjlite/platmod/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,12 +18,14 @@
 #
 # CDDL HEADER END
 #
+
 #
-# uts/sun4u/fjlite/platmod/Makefile
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 #	This makefile drives the production of the sun4u fjlite platform module.
 #
@@ -95,7 +96,7 @@
 LINT_LIB_DIR	= $(FJLITE_LINT_LIB_DIR)
 
 $(PLATLIB):	$(BINARY)
-	${LD} -o $(PLATLIB) -G $(BINARY)
+	$(BUILD.SO) $(BINARY)
 
 $(SYM_MOD):	$(UNIX_O) $(PLATLIB)
 	@echo "resolving symbols against unix.o"
--- a/usr/src/uts/sun4u/genunix/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/genunix/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,11 +18,14 @@
 #
 # CDDL HEADER END
 #
+
 #
 # Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 #	This makefile drives the production of the generic
 #	unix kernel module.
@@ -53,7 +55,6 @@
 PLATFORM	= sun4u
 LIBGEN		= $(OBJS_DIR)/libgenunix.so
 LIBSTUBS	= $(GENSTUBS_OBJS:%=$(OBJS_DIR)/%)
-SONAME		= $(MODULE)
 
 #
 #	Include common rules.
@@ -120,7 +121,7 @@
 install:  	$(INSTALL_DEPS)
 
 $(LIBGEN):	$(GENUNIX) $(LIBSTUBS)
-	$(LD) -o $@ -G -h $(SONAME) $(GENUNIX) $(LIBSTUBS)
+	$(BUILD.SO) $(GENUNIX) $(LIBSTUBS)
 
 $(IPCTF_TARGET) ipctf_target: FRC
 	@cd $(IPDRV_DIR); pwd; $(MAKE) ipctf.$(OBJS_DIR)
--- a/usr/src/uts/sun4u/grover/platmod/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/grover/platmod/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,12 +18,14 @@
 #
 # CDDL HEADER END
 #
+
 #
-# uts/sun4u/grover/platmod/Makefile
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 #	This makefile drives the production of the sun4u grover platform module.
 #
@@ -95,7 +96,7 @@
 LINT_LIB_DIR	= $(GROVER_LINT_LIB_DIR)
 
 $(PLATLIB):	$(BINARY)
-	${LD} -o $(PLATLIB) -G $(BINARY)
+	$(BUILD.SO) $(BINARY)
 
 $(SYM_MOD):	$(UNIX_O) $(PLATLIB)
 	@echo "resolving symbols against unix.o"
--- a/usr/src/uts/sun4u/hummingbird/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/hummingbird/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,12 +18,14 @@
 #
 # CDDL HEADER END
 #
+
 #
-# uts/sun4u/hummingbird/Makefile
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 #	This makefile drives the production of the sun4u UltraSPARC-IIe
 #	driver module.
@@ -99,7 +100,7 @@
 install:	$(INSTALL_DEPS)
 
 $(CPULIB):	$(BINARY)
-	$(LD) -o $(CPULIB) -G $(BINARY)
+	$(BUILD.SO) $(BINARY)
 
 $(SYM_MOD):	$(UNIX_O) $(CPULIB)
 	@echo "resolving symbols against unix.o"
--- a/usr/src/uts/sun4u/jalapeno/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/jalapeno/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,15 +18,17 @@
 #
 # CDDL HEADER END
 #
+
 #
-# uts/sun4u/jalapeno/Makefile
-#
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
 #
-#	This makefile drives the production of the sun4u UltraSPARC driver module.
+
+#
+#	This makefile drives the production of the sun4u UltraSPARC driver
+#	module.
 #
 #	sun4u implementation architecture dependent
 #
@@ -104,7 +105,7 @@
 install:	$(INSTALL_DEPS)
 
 $(CPULIB):	$(BINARY)
-	$(LD) -o $(CPULIB) -G $(BINARY)
+	$(BUILD.SO) $(BINARY)
 
 $(SYM_MOD):	$(UNIX_O) $(CPULIB)
 	@echo "resolving symbols against unix.o"
--- a/usr/src/uts/sun4u/javelin/platmod/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/javelin/platmod/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,16 +18,17 @@
 #
 # CDDL HEADER END
 #
+
 #
-# uts/sun4u/javelin/platmod/Makefile
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 #	This makefile drives the production of the sun4u javelin platmod module
 #
-#
 
 #
 #	Path to the base of the uts directory tree (usually /usr/src/uts).
@@ -94,7 +94,7 @@
 LINT_LIB_DIR	=$(JAVELIN_LINT_LIB_DIR)
 
 $(PLATLIB):	$(BINARY)
-	${LD} -o $(PLATLIB) -G $(BINARY) -h misc/platmod
+	$(BUILD.SO) $(BINARY)
 
 $(SYM_MOD):	$(UNIX_O) $(PLATLIB)
 	@echo "resolving symbols against unix.o"
--- a/usr/src/uts/sun4u/littleneck/platmod/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/littleneck/platmod/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,12 +18,14 @@
 #
 # CDDL HEADER END
 #
+
 #
-# uts/sun4u/littleneck/platmod/Makefile
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 #	This makefile drives the production of the sun4u lneck platform module.
 #
@@ -99,7 +100,7 @@
 LINT_LIB_DIR	= $(LITTLENECK_LINT_LIB_DIR)
 
 $(PLATLIB):	$(BINARY)
-	${LD} -o $(PLATLIB) -G $(BINARY) -h misc/platmod
+	$(BUILD.SO) $(BINARY)
 
 $(SYM_MOD):	$(UNIX_O) $(PLATLIB)
 	@echo "resolving symbols against unix.o"
--- a/usr/src/uts/sun4u/platmod/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/platmod/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,14 +18,17 @@
 #
 # CDDL HEADER END
 #
+
 #
-# uts/sun4u/platmod/Makefile
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
 #
-#	This makefile drives the production of the sun4u default platform module.
+
+#
+#	This makefile drives the production of the sun4u default platform
+#	module.
 #
 #	sun4u implementation architecture dependent
 #
@@ -90,7 +92,7 @@
 install:	$(INSTALL_DEPS)
 
 $(PLATLIB):	$(BINARY)
-	$(LD) -o $(PLATLIB) -G $(BINARY) -h misc/platmod
+	$(BUILD.SO) $(BINARY)
 
 #
 #	Include common targets.
--- a/usr/src/uts/sun4u/serengeti/cheetah/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/serengeti/cheetah/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,17 +18,18 @@
 #
 # CDDL HEADER END
 #
+
 #
-# uts/sun4u/serengeti/cheetah/Makefile
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#pragma	ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 #	This makefile drives the production of the Serengeti
 #	UltraSPARC driver module.
 #
-#
 
 #
 #	Path to the base of the uts directory tree (usually /usr/src/uts).
@@ -108,7 +108,7 @@
 install:	$(INSTALL_DEPS)
 
 $(CPULIB):	$(BINARY)
-	$(LD) -o $(CPULIB) -G $(BINARY)
+	$(BUILD.SO) $(BINARY)
 
 $(SYM_MOD):	$(UNIX_O) $(CPULIB)
 	@echo "resolving symbols against unix.o"
--- a/usr/src/uts/sun4u/serengeti/cheetahplus/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/serengeti/cheetahplus/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,17 +18,18 @@
 #
 # CDDL HEADER END
 #
+
 #
-# uts/sun4u/serengeti/cheetahplus/Makefile
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#pragma	ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 #	This makefile drives the production of the Serengeti
 #	UltraSPARC driver module.
 #
-#
 
 #
 #	Path to the base of the uts directory tree (usually /usr/src/uts).
@@ -113,7 +113,7 @@
 install:	$(INSTALL_DEPS)
 
 $(CPULIB):	$(BINARY)
-	$(LD) -o $(CPULIB) -G $(BINARY)
+	$(BUILD.SO) $(BINARY)
 
 $(SYM_MOD):	$(UNIX_O) $(CPULIB)
 	@echo "resolving symbols against unix.o"
--- a/usr/src/uts/sun4u/serengeti/unix/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/serengeti/unix/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,11 +18,14 @@
 #
 # CDDL HEADER END
 #
+
 #
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 #	This makefile drives the production of unix (and unix.o).
 #
@@ -169,7 +171,7 @@
 #	CPU_OBJ is defined to allow for building multiple CPU_OBJ's
 #
 $(CPULIB):	$(CPU_OBJ)
-	$(LD) -o $@ -G -h 'cpu/$$CPU' $(CPU_OBJ)
+	$(BUILD.SO) $(CPU_OBJ)
 
 #
 #	The global lint target builds the kernel lint library (llib-lunix.ln)
--- a/usr/src/uts/sun4u/serrano/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/serrano/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,13 +18,14 @@
 #
 # CDDL HEADER END
 #
-#
-# uts/sun4u/serrano/Makefile
+
 #
 # Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 #	This makefile drives the production of the SUNW,UltraSPARC-IIIi+ cpu
 #	module. This module uses the same source files as the Jalapeno module
@@ -105,7 +105,7 @@
 install:	$(INSTALL_DEPS)
 
 $(CPULIB):	$(BINARY)
-	$(LD) -o $(CPULIB) -G $(BINARY)
+	$(BUILD.SO) $(BINARY)
 
 $(SYM_MOD):	$(UNIX_O) $(CPULIB)
 	@echo "resolving symbols against unix.o"
--- a/usr/src/uts/sun4u/snowbird/platmod/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/snowbird/platmod/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,14 +18,17 @@
 #
 # CDDL HEADER END
 #
+
 #
-# uts/sun4u/snowbird/platmod/Makefile
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
 #
-#	This makefile drives the production of the sun4u snowbird platform module.
+
+#
+#	This makefile drives the production of the sun4u snowbird platform
+#	module.
 #
 #	sun4u implementation architecture dependent
 #
@@ -95,7 +97,7 @@
 LINT_LIB_DIR	= $(SNOWBIRD_LINT_LIB_DIR)
 
 $(PLATLIB):	$(BINARY)
-	${LD} -o $(PLATLIB) -G $(BINARY)
+	$(BUILD.SO) $(BINARY)
 
 $(SYM_MOD):	$(UNIX_O) $(PLATLIB)
 	@echo "resolving symbols against unix.o"
--- a/usr/src/uts/sun4u/spitfire/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/spitfire/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,14 +18,17 @@
 #
 # CDDL HEADER END
 #
+
 #
-# uts/sun4u/spitfire/Makefile
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
 #
-#	This makefile drives the production of the sun4u UltraSPARC driver module.
+
+#
+#	This makefile drives the production of the sun4u UltraSPARC driver
+#	module.
 #
 #	sun4u implementation architecture dependent
 #
@@ -99,7 +101,7 @@
 install:	$(INSTALL_DEPS)
 
 $(CPULIB):	$(BINARY)
-	$(LD) -o $(CPULIB) -G $(BINARY)
+	$(BUILD.SO) $(BINARY)
 
 $(SYM_MOD):	$(UNIX_O) $(CPULIB)
 	@echo "resolving symbols against unix.o"
--- a/usr/src/uts/sun4u/starcat/cheetah/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/starcat/cheetah/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,12 +18,14 @@
 #
 # CDDL HEADER END
 #
+
 #
-# uts/sun4u/starcat/cheetah/Makefile
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 #	This makefile drives the production of the Starcat specific
 #	UltraSPARC-III driver module.
@@ -104,7 +105,7 @@
 install:	$(INSTALL_DEPS)
 
 $(CPULIB):	$(BINARY)
-	$(LD) -o $(CPULIB) -G $(BINARY)
+	$(BUILD.SO) $(BINARY)
 
 $(SYM_MOD):	$(UNIX_O) $(CPULIB)
 	@echo "resolving symbols against unix.o"
--- a/usr/src/uts/sun4u/starcat/cheetahplus/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/starcat/cheetahplus/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,12 +18,14 @@
 #
 # CDDL HEADER END
 #
+
 #
-# uts/sun4u/starcat/cheetahplus/Makefile
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 #	This makefile drives the production of the Starcat specific
 #	UltraSPARC-III+ driver module.
@@ -110,7 +111,7 @@
 install:	$(INSTALL_DEPS)
 
 $(CPULIB):	$(BINARY)
-	$(LD) -o $(CPULIB) -G $(BINARY)
+	$(BUILD.SO) $(BINARY)
 
 $(SYM_MOD):	$(UNIX_O) $(CPULIB)
 	@echo "resolving symbols against unix.o"
--- a/usr/src/uts/sun4u/starcat/unix/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/starcat/unix/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,11 +18,14 @@
 #
 # CDDL HEADER END
 #
+
 #
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 #	This makefile drives the production of unix (and unix.o).
 #
@@ -169,7 +171,7 @@
 #	CPU_DIR is defined to allow for building multiple CPU_OBJ's
 #
 $(CPULIB):	$(CPU_OBJ)
-	$(LD) -o $@ -G -h 'cpu/$$CPU' $(CPU_OBJ)
+	$(BUILD.SO) $(CPU_OBJ)
 
 #
 #	The global lint target builds the kernel lint library (llib-lunix.ln)
--- a/usr/src/uts/sun4u/starfire/platmod/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/starfire/platmod/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,11 +18,14 @@
 #
 # CDDL HEADER END
 #
+
+#
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
 #
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
+
 #
 #	This makefile drives the production of the sun4u starfire platform
 #	module.
@@ -88,7 +90,7 @@
 install:	$(INSTALL_DEPS)
 
 $(PLATLIB):	$(BINARY)
-	$(LD) -o $(PLATLIB) -G $(BINARY) -h misc/platmod
+	$(BUILD.SO) $(BINARY)
 
 #
 #	Include common targets.
--- a/usr/src/uts/sun4u/starfire/spitfire/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/starfire/spitfire/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,12 +18,14 @@
 #
 # CDDL HEADER END
 #
+
 #
-# uts/sun4u/starfire/spitfire/Makefile
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 # This makefile drives the production of the sun4u UltraSPARC driver module.
 #
@@ -94,7 +95,7 @@
 install:	$(INSTALL_DEPS)
 
 $(CPULIB):	$(BINARY)
-	$(LD) -o $(CPULIB) -G $(BINARY)
+	$(BUILD.SO) $(BINARY)
 
 $(SYM_MOD):	$(UNIX_O) $(CPULIB)
 	@echo "resolving symbols against unix.o"
--- a/usr/src/uts/sun4u/starfire/unix/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/starfire/unix/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,11 +18,14 @@
 #
 # CDDL HEADER END
 #
+
 #
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 #	This makefile drives the production of unix (and unix.o).
 #
@@ -164,7 +166,7 @@
 #	CPU_OBJ is defined to allow for building multiple CPU_OBJ's
 #
 $(CPULIB):	$(CPU_OBJ)
-	$(LD) -o $@ -G -h 'cpu/$$CPU' $(CPU_OBJ)
+	$(BUILD.SO) $(CPU_OBJ)
 
 #
 #	The global lint target builds the kernel lint library (llib-lunix.ln)
--- a/usr/src/uts/sun4u/taco/platmod/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/taco/platmod/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,13 +18,14 @@
 #
 # CDDL HEADER END
 #
+
 #
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# uts/sun4u/taco/platmod/Makefile
+# ident	"%Z%%M%	%I%	%E% SMI"
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
+
 #
 #	This makefile drives the production of the sun4u taco platform module.
 #
@@ -96,7 +96,7 @@
 LINT_LIB_DIR	= $(TACO_LINT_LIB_DIR)
 
 $(PLATLIB):	$(BINARY)
-	${LD} -o $(PLATLIB) -G $(BINARY)
+	$(BUILD.SO) $(BINARY)
 
 $(SYM_MOD):	$(UNIX_O) $(PLATLIB)
 	@echo "resolving symbols against unix.o"
--- a/usr/src/uts/sun4u/tazmo/platmod/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/tazmo/platmod/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,12 +18,14 @@
 #
 # CDDL HEADER END
 #
+
 #
-# uts/sun4u/tazmo/platmod/Makefile
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 #	This makefile drives the production of the sun4u tazmo platform module.
 #
@@ -95,7 +96,7 @@
 LINT_LIB_DIR	= $(TAZMO_LINT_LIB_DIR)
 
 $(PLATLIB):	$(BINARY)
-	${LD} -o $(PLATLIB) -G $(BINARY)
+	$(BUILD.SO) $(BINARY)
 
 $(SYM_MOD):	$(UNIX_O) $(PLATLIB)
 	@echo "resolving symbols against unix.o"
--- a/usr/src/uts/sun4u/unix/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4u/unix/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,11 +18,14 @@
 #
 # CDDL HEADER END
 #
+
 #
-# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 #	This makefile drives the production of /unix (and unix.o).
 #
@@ -165,7 +167,7 @@
 #	CPU_OBJ is defined to allow for building multiple CPU_OBJ's
 #
 $(CPULIB):	$(CPU_OBJ)
-	$(LD) -o $@ -G -h 'cpu/$$CPU' $(CPU_OBJ)
+	$(BUILD.SO) $(CPU_OBJ)
 
 #
 #	The global lint target builds the kernel lint library (llib-lunix.ln)
--- a/usr/src/uts/sun4v/Makefile.rules	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4v/Makefile.rules	Tue Sep 20 15:07:36 2005 -0700
@@ -123,7 +123,7 @@
 	    $$1, $$1, $$1); }' > $(OBJS_DIR)/dtracestubs.s
 
 $(DTRACESTUBS):	$(DTRACESTUBS_O)
-	$(LD) -o $@ -G -h dtracestubs $(DTRACESTUBS_O)
+	$(BUILD.SO) $(DTRACESTUBS_O)
 
 #
 #	Section 1b: Lint `object' build rules
--- a/usr/src/uts/sun4v/generic/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4v/generic/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,12 +18,14 @@
 #
 # CDDL HEADER END
 #
+
 #
-# uts/sun4v/generic/Makefile
 # Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 #	This makefile drives the production of the Generic sun4v cpu module.
 #
@@ -99,7 +100,7 @@
 install:		$(INSTALL_DEPS)
 
 $(CPULIB):	$(BINARY)
-	$(LD) -o $(CPULIB) -G $(BINARY)
+	$(BUILD.SO) $(BINARY)
 
 $(SYM_MOD):	$(UNIX_O) $(CPULIB)
 	@echo "resolving symbols against unix.o"
--- a/usr/src/uts/sun4v/genunix/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4v/genunix/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,11 +18,14 @@
 #
 # CDDL HEADER END
 #
+
 #
 # Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 #	This makefile drives the production of the generic
 #	unix kernel module.
@@ -53,7 +55,6 @@
 PLATFORM	= sun4v
 LIBGEN		= $(OBJS_DIR)/libgenunix.so
 LIBSTUBS	= $(GENSTUBS_OBJS:%=$(OBJS_DIR)/%)
-SONAME		= $(MODULE)
 
 #
 #	Include common rules.
@@ -120,7 +121,7 @@
 install:  	$(INSTALL_DEPS)
 
 $(LIBGEN):	$(GENUNIX) $(LIBSTUBS)
-	$(LD) -o $@ -G -h $(SONAME) $(GENUNIX) $(LIBSTUBS)
+	$(BUILD.SO) $(GENUNIX) $(LIBSTUBS)
 
 $(IPCTF_TARGET) ipctf_target: FRC
 	@cd $(IPDRV_DIR); pwd; $(MAKE) ipctf.$(OBJS_DIR)
--- a/usr/src/uts/sun4v/niagara/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4v/niagara/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,12 +18,14 @@
 #
 # CDDL HEADER END
 #
+
 #
-# uts/sun4v/niagara/Makefile
 # Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 #	This makefile drives the production of the UltraSPARC-H20 cpu module.
 #
@@ -97,7 +98,7 @@
 install:	$(INSTALL_DEPS)
 
 $(CPULIB):	$(BINARY)
-	$(LD) -o $(CPULIB) -G $(BINARY)
+	$(BUILD.SO) $(BINARY)
 
 $(SYM_MOD):	$(UNIX_O) $(CPULIB)
 	@echo "resolving symbols against unix.o"
--- a/usr/src/uts/sun4v/ontario/platmod/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4v/ontario/platmod/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -18,11 +17,15 @@
 # information: Portions Copyright [yyyy] [name of copyright owner]
 #
 # CDDL HEADER END
-# uts/sun4v/ontario/platmod/Makefile
+#
+
+#
 # Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 #	This makefile drives the production of the sun4v ontario default 
 #	platform module.
@@ -101,7 +104,7 @@
 LINT_LIB_DIR	=$(ONTARIO_LINT_LIB_DIR)
 
 $(PLATLIB):	$(BINARY)
-	$(LD) -o $(PLATLIB) -G $(BINARY)
+	$(BUILD.SO) $(BINARY)
 
 $(SYM_MOD):	$(UNIX_O) $(PLATLIB)
 	@echo "resolving symbols against unix.o"
--- a/usr/src/uts/sun4v/platmod/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4v/platmod/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,12 +18,14 @@
 #
 # CDDL HEADER END
 #
+
 #
-# uts/sun4v/platmod/Makefile
 # Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 #	This makefile drives the production of the sun4v default platform module.
 #
@@ -90,7 +91,7 @@
 install:	$(INSTALL_DEPS)
 
 $(PLATLIB):	$(BINARY)
-	$(LD) -o $(PLATLIB) -G $(BINARY) -h misc/platmod
+	$(BUILD.SO) $(BINARY)
 
 #
 #	Include common targets.
--- a/usr/src/uts/sun4v/unix/Makefile	Tue Sep 20 14:52:33 2005 -0700
+++ b/usr/src/uts/sun4v/unix/Makefile	Tue Sep 20 15:07:36 2005 -0700
@@ -2,9 +2,8 @@
 # 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.
+# 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.
@@ -19,11 +18,14 @@
 #
 # CDDL HEADER END
 #
+
 #
 # Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
+#
+
 #
 #	This makefile drives the production of /unix (and unix.o).
 #
@@ -165,7 +167,7 @@
 #	CPU_OBJ is defined to allow for building multiple CPU_OBJ's
 #
 $(CPULIB):	$(CPU_OBJ)
-	$(LD) -o $@ -G -h 'cpu/$$CPU' $(CPU_OBJ)
+	$(BUILD.SO) $(CPU_OBJ)
 
 #
 #	The global lint target builds the kernel lint library (llib-lunix.ln)