diff -aur testws_origonal/usr/src/Makefile.master testws/usr/src/Makefile.master
--- testws_origonal/usr/src/Makefile.master	2008-07-18 15:33:11.000000000 -0700
+++ testws/usr/src/Makefile.master	2008-07-24 23:02:56.729383043 -0700
@@ -319,7 +319,8 @@
 sparc_XARCH=		-xarch=v8
 sparcv9_XARCH=		-xarch=v9
 i386_XARCH=
-amd64_XARCH=		-xarch=amd64 -Ui386 -U__i386
+# amd64_XARCH=		-xarch=amd64 -Ui386 -U__i386
+amd64_XARCH=		-m64 -Ui386 -U__i386
 
 # assembler '-xarch' flag.  Different from compiler '-xarch' flag.
 sparc_AS_XARCH=		-xarch=v8plus

diff -aur testws_origonal/usr/src/cmd/mdb/demo/Makefile.amd64 testws/usr/src/cmd/mdb/demo/Makefile.amd64
--- testws_origonal/usr/src/cmd/mdb/demo/Makefile.amd64	2008-07-18 15:33:25.000000000 -0700
+++ testws/usr/src/cmd/mdb/demo/Makefile.amd64	2008-07-24 23:35:57.807357592 -0700
@@ -28,11 +28,13 @@
 CC = cc
 LINT = lint
 
-CFLAGS = -xarch=amd64
+# CFLAGS = -xarch=amd64
+CFLAGS = -m64
 CPPFLAGS =
 LDFLAGS =
 LIBS =
 
-LINTFLAGS = -Xarch=amd64
+# LINTFLAGS = -Xarch=amd64
+LINTFLAGS = -m64
 
 include ../Makefile.common

diff -aur testws_origonal/usr/src/cmd/sgs/nm/amd64/Makefile testws/usr/src/cmd/sgs/nm/amd64/Makefile
--- testws_origonal/usr/src/cmd/sgs/nm/amd64/Makefile	2008-07-18 15:33:24.000000000 -0700
+++ testws/usr/src/cmd/sgs/nm/amd64/Makefile	2008-07-25 00:57:32.859188075 -0700
@@ -43,7 +43,8 @@
 		-I$(SRCBASE)/uts/$(ARCH)/sys
 CPPFLAGS=	$(INCLIST) $(DEFLIST) $(CPPFLAGS.master)
 LDLIBS +=	$(CONVLIBDIR64) $(CONV_LIB) $(ELFLIBDIR) -lelf
-LINTFLAGS64 +=	-x $(LDLIBS) -Xarch=amd64
+# LINTFLAGS64 +=	-x $(LDLIBS) -Xarch=amd64
+LINTFLAGS64 +=	-x $(LDLIBS) -m64
 LINTSRCS=	$(SRCS)
 CLEANFILES +=	$(LINTOUTS)
 
diff -aur testws_origonal/usr/src/lib/libc/amd64/Makefile testws/usr/src/lib/libc/amd64/Makefile
--- testws_origonal/usr/src/lib/libc/amd64/Makefile	2008-07-18 15:33:00.000000000 -0700
+++ testws/usr/src/lib/libc/amd64/Makefile	2008-07-25 01:12:15.338848451 -0700
@@ -1086,7 +1086,8 @@
 
 $(LINTLIB):= SRCS=../port/llib-lc
 $(LINTLIB):= CPPFLAGS += -D_MSE_INT_H
-$(LINTLIB):= LINTFLAGS64=-nvx -Xarch=amd64
+# $(LINTLIB):= LINTFLAGS64=-nvx -Xarch=amd64
+$(LINTLIB):= LINTFLAGS64=-nvx -m64
 
 # object files that depend on inline template
 $(TIL:%=pics/%): $(LIBCBASE)/threads/amd64.il

diff -aur testws_origonal/usr/src/lib/libshell/misc/buildksh93.ksh testws/usr/src/lib/libshell/misc/buildksh93.ksh
--- testws_origonal/usr/src/lib/libshell/misc/buildksh93.ksh	2008-07-18 15:32:59.000000000 -0700
+++ testws/usr/src/lib/libshell/misc/buildksh93.ksh	2008-07-25 00:14:18.078858508 -0700
@@ -223,7 +223,8 @@
 
             case "${buildmode}" in
                 *.i386.32bit.suncc*)  HOSTTYPE="sol11.i386" CC="${BSUNCC99}"                    CC_SHAREDLIB="-G" CCFLAGS="${BSUNCC_CCFLAGS}"  ;;
-                *.i386.64bit.suncc*)  HOSTTYPE="sol11.i386" CC="${BSUNCC99} -xarch=amd64 -KPIC" CC_SHAREDLIB="-G" CCFLAGS="${BSUNCC_CCFLAGS}"  ;;
+#		*.i386.64bit.suncc*)  HOSTTYPE="sol11.i386" CC="${BSUNCC99} -xarch=amd64 -KPIC" CC_SHAREDLIB="-G" CCFLAGS="${BSUNCC_CCFLAGS}"  ;;
+                *.i386.64bit.suncc*)  HOSTTYPE="sol11.i386" CC="${BSUNCC99} -m64 -KPIC" CC_SHAREDLIB="-G" CCFLAGS="${BSUNCC_CCFLAGS}"  ;;
                 *.sparc.32bit.suncc*) HOSTTYPE="sol11.sun4" CC="${BSUNCC99}"                    CC_SHAREDLIB="-G" CCFLAGS="${BSUNCC_CCFLAGS}" BSUNCC_APP_CCFLAGS="${BSUNCC_APP_CCFLAGS_SPARC}" ;;
                 *.sparc.64bit.suncc*) HOSTTYPE="sol11.sun4" CC="${BSUNCC99} -xarch=v9 -KPIC"    CC_SHAREDLIB="-G" CCFLAGS="${BSUNCC_CCFLAGS}" BSUNCC_APP_CCFLAGS="${BSUNCC_APP_CCFLAGS_SPARC}" ;;
 
diff -aur testws_origonal/usr/src/tools/aw/aw.c testws/usr/src/tools/aw/aw.c
--- testws_origonal/usr/src/tools/aw/aw.c	2008-07-18 15:32:57.000000000 -0700
+++ testws/usr/src/tools/aw/aw.c	2008-07-25 00:49:24.402666353 -0700
@@ -46,6 +46,17 @@
  * We also add '-xarch=amd64' in case we need to feed the assembler
  * something different (or in case we need to invoke a different binary
  * altogether!)
+ *
+ * Rob_C (7/25/08) Warning Comment:
+ * I added Sun Studio 12 support in other parts of this source but I did not
+ * modify this file usr/src/tools/aw/aw.c except to add this warning:
+ * The Sun Studio 12 compiler deprecated '-xarch=amd64' and uses '-m64' 
+ * instead for the compiler, but the assembler only accepts '-xarch=amd64' and
+ * _NOT_ '-m64'. If the assembler (in future) also deprecates '-xarch' then
+ * there may be some coding gymnastics needed in this file since 'aw' accepts
+ * '-m' to wrap 'm4' and we do not want '-m64' to be parsed as '-m'.
+ * Once this is resolved the Sun staff are invited to remove this comment.
+ *
  */
 
 #include <sys/types.h>

diff -aur testws_origonal/usr/src/uts/Makefile.uts testws/usr/src/uts/Makefile.uts
--- testws_origonal/usr/src/uts/Makefile.uts	2008-07-18 15:33:06.000000000 -0700
+++ testws/usr/src/uts/Makefile.uts	2008-07-25 01:01:22.563107748 -0700
@@ -168,7 +168,8 @@
 LINTFLAGS_sparc_32	= $(LINTCCMODE) -nsxmuF -errtags=yes
 LINTFLAGS_sparc_64	= $(LINTFLAGS_sparc_32) -Xarch=v9
 LINTFLAGS_i386_32	= $(LINTCCMODE) -nsxmuF -errtags=yes
-LINTFLAGS_i386_64	= $(LINTFLAGS_i386_32) -Xarch=amd64
+# LINTFLAGS_i386_64	= $(LINTFLAGS_i386_32) -Xarch=amd64
+LINTFLAGS_i386_64	= $(LINTFLAGS_i386_32) -m64
 
 LINTFLAGS	= $(LINTFLAGS_$(MACH)_$(CLASS)) $(LINTTAGS)
 LINTFLAGS	+= $(C99LMODE)
