--- old/usr/src/Makefile.master	2018-12-07 21:21:44.626337614 +0000
+++ new/usr/src/Makefile.master	2018-12-07 21:21:44.643753327 +0000
@@ -486,14 +486,19 @@
 # Default debug format for Sun Studio 11 is dwarf, so force it to
 # generate stabs.
 #
-DEBUGFORMAT=	-xdebugformat=stabs
+DEBUGFORMAT=	-_cc=-xdebugformat=stabs -_gcc=-gdwarf-2
+
+#
+# Ask the compiler to include debugging information
+#
+CCGDEBUG= -g $(DEBUGFORMAT)
 
 #
 # 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 $(CSTD) $(CNOGLOBAL) $(CDWARFSTR)
-CTF_FLAGS_i386	= -g $(CSTD) $(CNOGLOBAL) $(CDWARFSTR)
+CTF_FLAGS_sparc	= $(CCGDEBUG) -Wc,-Qiselect-T1 $(CSTD) $(CNOGLOBAL)
+CTF_FLAGS_i386	= $(CCGDEBUG) $(CSTD) $(CNOGLOBAL)
 
 CTF_FLAGS_sparcv9	= $(CTF_FLAGS_sparc)
 CTF_FLAGS_amd64		= $(CTF_FLAGS_i386)
@@ -501,14 +506,14 @@
 # Sun Studio produces broken userland code when saving arguments.
 $(__GNUC)CTF_FLAGS_amd64 += $(SAVEARGS)
 
-CTF_FLAGS_32	= $(CTF_FLAGS_$(MACH)) $(DEBUGFORMAT)
-CTF_FLAGS_64	= $(CTF_FLAGS_$(MACH64)) $(DEBUGFORMAT)
+CTF_FLAGS_32	= $(CTF_FLAGS_$(MACH))
+CTF_FLAGS_64	= $(CTF_FLAGS_$(MACH64))
 CTF_FLAGS	= $(CTF_FLAGS_32)
 
 #
 # Flags used with genoffsets
 #
-GOFLAGS = $(CALLSYMS) $(CDWARFSTR)
+GOFLAGS = $(CALLSYMS)
 
 OFFSETS_CREATE = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
 	$(CW) --noecho $(CW_CC_COMPILERS) -- $(GOFLAGS) $(CFLAGS) $(CPPFLAGS)
@@ -569,8 +574,8 @@
 
 CSOURCEDEBUGFLAGS	=
 CCSOURCEDEBUGFLAGS	=
-$(SRCDBGBLD)CSOURCEDEBUGFLAGS	= -g -xs
-$(SRCDBGBLD)CCSOURCEDEBUGFLAGS	= -g -xs
+$(SRCDBGBLD)CSOURCEDEBUGFLAGS	= $(CCGDEBUG) -xs
+$(SRCDBGBLD)CCSOURCEDEBUGFLAGS	= $(CCGDEBUG) -xs
 
 CFLAGS=         $(COPTFLAG) $($(MACH)_CFLAGS) $(SPACEFLAG) $(CCMODE) \
 		$(ILDOFF) $(CERRWARN) $(CSTD) $(CCUNBOUND) $(IROPTFLAG) \
--- old/usr/src/cmd/backup/Makefile.targ	2018-12-07 21:21:45.134794753 +0000
+++ new/usr/src/cmd/backup/Makefile.targ	2018-12-07 21:21:45.150334372 +0000
@@ -19,18 +19,15 @@
 #
 # CDDL HEADER END
 #
-#
-# ident	"%Z%%M%	%I%	%E% SMI"
+
 #
 # Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# cmd/backup/Makefile.targ
-#
 
 # support for debugging
 debug:=		DUMPLIB= libdump_g.a
-debug:=		CFLAGS= -g $(XESS) -DDEBUG -DFDEBUG -DTDEBUG ${SBFLAGS}
+debug:=		CFLAGS= $(CCGDEBUG) $(XESS) -DDEBUG -DFDEBUG -DTDEBUG ${SBFLAGS}
 CFLAGS +=	$(XSTRCONST)
 DEBUGDIR=	.debug
 DEBUGOBJS=	$(OBJECTS:%=$(DEBUGDIR)/%)
--- old/usr/src/cmd/backup/dump/Makefile	2018-12-07 21:21:45.569286865 +0000
+++ new/usr/src/cmd/backup/dump/Makefile	2018-12-07 21:21:45.584345618 +0000
@@ -88,7 +88,7 @@
 
 .KEEP_STATE:
 
-all:		$(PRODUCT) 
+all:		$(PRODUCT)
 
 $(PROG):	$(OBJECTS) $$(LIBDUMP)
 	$(LINK.c) -o $@ $(OBJECTS) $(LDLIBS)
@@ -139,11 +139,6 @@
 	cp $(ROLLOBJS) .
 	pwd
 
-.debug/roll_log.o:
-	cd $(ROLLDIR) ; pwd ; $(MAKE) CFLAGS=-g
-	cp $(ROLLOBJS) .debug
-	pwd
-
 $(ROLLPOFILES): $(ROLLSRCS)
 	cd $(ROLLDIR) ; pwd ; $(MAKE) `echo $(ROLLPOFILES) | sed -e 's@$(ROLLDIR)/@@g'`
 	cp $(ROLLDIR)/*.po .
--- old/usr/src/cmd/backup/lib/Makefile	2018-12-07 21:21:46.014449534 +0000
+++ new/usr/src/cmd/backup/lib/Makefile	2018-12-07 21:21:46.032718880 +0000
@@ -77,7 +77,7 @@
 DEBUGS=		$(OBJECTS:%=.debug/%)
 $(GLIB):=	AROBJS = $(DEBUGS)
 $(GLIB):=	DIR = .debug
-$(GLIB):=	CFLAGS= -g $(XESS) -DDEBUG -DYYDEBUG ${SBFLAGS}
+$(GLIB):=	CFLAGS= $(CCGDEBUG) $(XESS) -DDEBUG -DYYDEBUG ${SBFLAGS}
 
 .KEEP_STATE:
 
@@ -120,4 +120,4 @@
 # include library targets
 include ../../../lib/Makefile.targ
 
-_msg: 		$(POFILE)
+_msg:		$(POFILE)
--- old/usr/src/cmd/cmd-inet/sbin/dhcpagent/Makefile	2018-12-07 21:21:46.484594303 +0000
+++ new/usr/src/cmd/cmd-inet/sbin/dhcpagent/Makefile	2018-12-07 21:21:46.510034855 +0000
@@ -41,10 +41,6 @@
 CERRWARN += -_gcc=-Wno-switch
 CERRWARN += -_gcc=-Wno-parentheses
 
-#
-# to compile a debug version, do a `make COPTFLAG="-g -XO0"'
-#
-
 CPPFLAGS  += -D_XOPEN_SOURCE=500 -D__EXTENSIONS__
 LDLIBS    += -lxnet -lnvpair -ldhcpagent -ldhcputil -linetutil -ldevinfo \
 	-ldlpi -lresolv -lsocket -lipadm
--- old/usr/src/cmd/file/Makefile	2018-12-07 21:21:46.954478532 +0000
+++ new/usr/src/cmd/file/Makefile	2018-12-07 21:21:46.971604229 +0000
@@ -46,8 +46,8 @@
 POFILE= file_all.po
 POFILES= $(SRCS:%.c=%.po)
 
-# The debug binary can be built using the flag
-# -D COPTFLAG=-g CGLOBALSTATIC=
+# The debug binary can be built using the flags
+# SOURCEDEBUG=yes CGLOBALSTATIC=
 # This will avoid the multiple symbols definition error
 # for static global variables in elf_read32.o and elf_read64.o
 
--- old/usr/src/cmd/fs.d/pcfs/fsck/Makefile	2018-12-07 21:21:47.408240468 +0000
+++ new/usr/src/cmd/fs.d/pcfs/fsck/Makefile	2018-12-07 21:21:47.424646838 +0000
@@ -48,11 +48,6 @@
 
 catalog:        $(POFILE)
 
-#
-# Uncomment the following two lines to build for dbx debugging
-#COPTFLAG = -g
-#COPTFLAG64 = -g
-#
 CPPFLAGS +=	-D_LARGEFILE64_SOURCE
 
 CERRWARN +=	-_gcc=-Wno-parentheses
--- old/usr/src/cmd/fs.d/smbclnt/mount/Makefile	2018-12-07 21:21:47.845762397 +0000
+++ new/usr/src/cmd/fs.d/smbclnt/mount/Makefile	2018-12-07 21:21:47.861670056 +0000
@@ -47,13 +47,7 @@
 
 LDLIBS += -lsmbfs
 
-CPPFLAGS += -I$(SRC)/uts/common -I$(SRC)/lib/libsmbfs 
-
-# uncomment these for dbx debugging
-#COPTFLAG = -g
-#CTF_FLAGS =
-#CTFCONVERT_O=
-#CTFMERGE_LIB=
+CPPFLAGS += -I$(SRC)/uts/common -I$(SRC)/lib/libsmbfs
 
 .KEEP_STATE:
 
@@ -67,5 +61,5 @@
 
 lint:	lint_SRCS
 
-clean:     
+clean:
 	$(RM) $(OBJS) $(POFILE)
--- old/usr/src/cmd/fs.d/smbclnt/smbiod/Makefile	2018-12-07 21:21:48.265395659 +0000
+++ new/usr/src/cmd/fs.d/smbclnt/smbiod/Makefile	2018-12-07 21:21:48.283207221 +0000
@@ -49,12 +49,6 @@
 # Debugging
 ${NOT_RELEASE_BUILD} CPPFLAGS += -DDEBUG
 
-# uncomment these for dbx debugging
-#COPTFLAG = -g
-#CTF_FLAGS =
-#CTFCONVERT_O=
-#CTFMERGE_LIB=
-
 all:	$(TYPEPROG)
 
 catalog:	$(POFILE)
--- old/usr/src/cmd/fs.d/smbclnt/smbutil/Makefile	2018-12-07 21:21:48.706830391 +0000
+++ new/usr/src/cmd/fs.d/smbclnt/smbutil/Makefile	2018-12-07 21:21:48.723003159 +0000
@@ -55,12 +55,6 @@
 # Debugging
 ${NOT_RELEASE_BUILD} CPPFLAGS += -DDEBUG
 
-# uncomment these for dbx debugging
-#COPTFLAG = -g
-#CTF_FLAGS =
-#CTFCONVERT_O=
-#CTFMERGE_LIB=
-
 # disable some of the less important lint
 LINTFLAGS	+= -erroff=E_FUNC_RET_ALWAYS_IGNOR2
 LINTFLAGS	+= -erroff=E_FUNC_RET_MAYBE_IGNORED2
--- old/usr/src/cmd/geniconvtbl/Makefile.com	2018-12-07 21:21:49.130996959 +0000
+++ new/usr/src/cmd/geniconvtbl/Makefile.com	2018-12-07 21:21:49.146122647 +0000
@@ -73,14 +73,13 @@
 ROOTITM32 =	$(ROOTDIRS32)/$(ITM)
 ROOTITM64 =	$(ROOTDIRS64)/$(ITM)
 
-#
-# definition for some useful target like clean, 
+# defined for some useful targets like clean,
 OBJS	= $(SRCSC1:%.c=%.o) $(YTABC:.c=.o) $(LEXYY:.c=.o)
 
 CHECKHDRS = $(HDRS%.h=%.check)
 
 CLOBBERFILES=	$(ITM) $(SRCYC)
-CLEANFILES = 	$(OBJS) $(YTABC) $(YTABH) $(LEXYY) $(YOUT) \
+CLEANFILES =	$(OBJS) $(YTABC) $(YTABH) $(LEXYY) $(YOUT) \
 		$(POFILES) $(POFILE)
 
 CPPFLAGS	+= -I. -I..
@@ -90,10 +89,10 @@
 CERRWARN	+= -_gcc=-Wno-unused-variable
 CERRWARN	+= -_gcc=-Wno-implicit-function-declaration
 YFLAGS		+= -d -v
-CFLAGS 		+= -D_FILE_OFFSET_BITS=64
+CFLAGS		+= -D_FILE_OFFSET_BITS=64
 
 $(ITM) :=	CFLAGS += $(GSHARED) $(C_PICFLAGS) $(ZTEXT) -h $@
-$(ITM) :=	CPPFLAGS += -D_REENTRANT 
+$(ITM) :=	CPPFLAGS += -D_REENTRANT
 $(ITM) :=	sparc_CFLAGS += -xregs=no%appl
 $(ITM) :=	sparcv9_CFLAGS += -xregs=no%appl
 
@@ -167,11 +166,7 @@
 clean:
 	$(RM) $(CLEANFILES)
 
-debug:
-	$(MAKE)	all COPTFLAG='' COPTFLAG64='' CFLAGS='-g -DDEBUG'
-
-
-%.o:	%.c 
+%.o:	%.c
 	$(COMPILE.c) $<
 
 %.o:	../%.c
@@ -180,7 +175,6 @@
 
 
 # install rule
-# 
 $(ROOTDIRS32)/%: $(ROOTDIRS32) %
 	-$(INS.file)
 
--- old/usr/src/cmd/hal/addons/cpufreq/Makefile	2018-12-07 21:21:49.537680288 +0000
+++ new/usr/src/cmd/hal/addons/cpufreq/Makefile	2018-12-07 21:21:49.553194710 +0000
@@ -37,7 +37,8 @@
 
 CPPFLAGS +=	$(HAL_DBUS_CPPFLAGS) $(HAL_GLIB_CPPFLAGS) $(HAL_CONFIG_CPPFLAGS)
 CPPFLAGS +=	-I$(ROOT)/usr/include/hal -I../../hald
-CPPFLAGS +=	-I$(ROOT)/usr/include/libpolkit -g
+CPPFLAGS +=	-I$(ROOT)/usr/include/libpolkit
+CFLAGS	+=	$(CCGDEBUG)
 CSTD =	$(CSTD_GNU99)
 
 .KEEP_STATE:
--- old/usr/src/cmd/idmap/idmap/Makefile	2018-12-07 21:21:49.965501300 +0000
+++ new/usr/src/cmd/idmap/idmap/Makefile	2018-12-07 21:21:49.981616365 +0000
@@ -26,7 +26,7 @@
 CLIENTOBJS =	idmap.o idmap_engine.o namemaps.o
 # idmap_clnt.o
 CLIENTSRCS =	$(CLIENTOBJS:%.o=%.c)
-POFILES = 	$(CLIENTOBJS:.o=.po)
+POFILES =	$(CLIENTOBJS:.o=.po)
 OBJS =		$(CLIENTOBJS)
 SRCS =		$(CLIENTSRCS)
 IDMAP_PROT_DIR =        $(SRC)/head/rpcsvc
@@ -41,7 +41,7 @@
 CERRWARN +=	-_gcc=-Wno-uninitialized
 CERRWARN +=	-_gcc=-Wno-address
 
-POFILE = 	$(PROG)_all.po
+POFILE =	$(PROG)_all.po
 LDLIBS +=	-lidmap -ladutils -lsldap -lldap
 FILEMODE =	0555
 
@@ -62,7 +62,7 @@
 all: $(PROG)
 
 $(PROG): $(OBJS)
-	$(LINK.c) -g -o $@ $(OBJS) $(LDLIBS)
+	$(LINK.c) $(CCGDEBUG) -o $@ $(OBJS) $(LDLIBS)
 	$(POST_PROCESS)
 
 $(POFILE): $(POFILES)
--- old/usr/src/cmd/idmap/nltest/Makefile	2018-12-07 21:21:50.423135094 +0000
+++ new/usr/src/cmd/idmap/nltest/Makefile	2018-12-07 21:21:50.439667444 +0000
@@ -27,13 +27,13 @@
 CLIENTOBJS =	nltest.o
 
 CLIENTSRCS =	$(CLIENTOBJS:%.o=%.c)
-POFILES = 	$(CLIENTOBJS:.o=.po)
+POFILES =	$(CLIENTOBJS:.o=.po)
 OBJS =		$(CLIENTOBJS)
 SRCS =		$(CLIENTSRCS)
 
 include ../../Makefile.cmd
 
-POFILE = 	$(PROG)_all.po
+POFILE =	$(PROG)_all.po
 LDLIBS +=	-lads -luuid
 FILEMODE =	0555
 
@@ -50,7 +50,7 @@
 all: $(PROG)
 
 $(PROG): $(OBJS)
-	$(LINK.c) -g -o $@ $(OBJS) $(LDLIBS)
+	$(LINK.c) $(CCGDEBUG) -o $@ $(OBJS) $(LDLIBS)
 	$(POST_PROCESS)
 
 $(POFILE): $(POFILES)
--- old/usr/src/cmd/idmap/test-getdc/Makefile	2018-12-07 21:21:50.869071467 +0000
+++ new/usr/src/cmd/idmap/test-getdc/Makefile	2018-12-07 21:21:50.885514903 +0000
@@ -27,11 +27,11 @@
 OBJS =		getdc_main.o
 
 SRCS =	$(OBJS:%.o=%.c)
-POFILES = 	$(OBJS:.o=.po)
+POFILES =	$(OBJS:.o=.po)
 
 include ../../Makefile.cmd
 
-POFILE = 	$(PROG)_all.po
+POFILE =	$(PROG)_all.po
 
 LDLIBS +=	-ladutils -lnsl -lumem
 LDFLAGS +=	-R'$$ORIGIN/../lib'
@@ -51,7 +51,7 @@
 all: $(PROG)
 
 $(PROG): $(OBJS) FRC
-	$(LINK.c) -g -o $@ $(OBJS) $(LDLIBS)
+	$(LINK.c) $(CCGDEBUG) -o $@ $(OBJS) $(LDLIBS)
 	$(POST_PROCESS)
 
 $(POFILE): $(POFILES)
--- old/usr/src/cmd/mdb/sun4u/Makefile.kmdb	2018-12-07 21:21:51.304991247 +0000
+++ new/usr/src/cmd/mdb/sun4u/Makefile.kmdb	2018-12-07 21:21:51.318632998 +0000
@@ -86,7 +86,7 @@
 %.fth: $(SRC)/cmd/mdb/sparc/kmdb/%.fdbg
 	grep '^#' <$< >$(<F).c
 	grep -v '^#' <$< >$(<F).tmp
-	$(CC) $(CTFSTABSCFLAGS) $(CPPFLAGS) -g -c -o $(<F).o $(<F).c
+	$(CC) $(CTFSTABSCFLAGS) $(CPPFLAGS) $(CCGDEBUG) -c -o $(<F).o $(<F).c
 	$(CTFCONVERT) $(CTFCVTFLAGS) $(<F).o
 	$(CTFSTABS) -t forth -i $(<F).tmp -o $@ $(<F).o
 	$(RM) $(<F).c $(<F).tmp $(<F).o
--- old/usr/src/cmd/mdb/sun4v/Makefile.kmdb	2018-12-07 21:21:51.736990199 +0000
+++ new/usr/src/cmd/mdb/sun4v/Makefile.kmdb	2018-12-07 21:21:51.752993951 +0000
@@ -95,7 +95,7 @@
 %.fth: $(SRC)/cmd/mdb/sparc/kmdb/%.fdbg
 	grep '^#' <$< >$(<F).c
 	grep -v '^#' <$< >$(<F).tmp
-	$(CC) $(CTFSTABSCFLAGS) $(CPPFLAGS) -g -c -o $(<F).o $(<F).c
+	$(CC) $(CTFSTABSCFLAGS) $(CPPFLAGS) $(CCGDEBUG) -c -o $(<F).o $(<F).c
 	$(CTFCONVERT) $(CTFCVTFLAGS) $(<F).o
 	$(CTFSTABS) -t forth -i $(<F).tmp -o $@ $(<F).o
 	$(RM) $(<F).c $(<F).tmp $(<F).o
--- old/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/Makefile	2018-12-07 21:21:52.201633780 +0000
+++ new/usr/src/cmd/print/printmgr/com/sun/admin/pm/server/Makefile	2018-12-07 21:21:52.218379927 +0000
@@ -34,7 +34,7 @@
 
 OBJECTS =	DoPrinterNS.o NS.o
 
-CLASSFILES = 	Printer.class \
+CLASSFILES =	Printer.class \
 		Host.class \
 		SysCommand.class \
 		NameService.class \
@@ -107,7 +107,7 @@
 # Build standalone programs for testing
 #
 NS: NS.c
-	$(CC) NS.c -g $(ILDOFF) -o NS -DMAIN=1 $(ENVLDLIBS1) $(ENVLIBS2) \
+	$(CC) NS.c $(CCGDEBUG) $(ILDOFF) -o NS -DMAIN=1 $(ENVLDLIBS1) $(ENVLIBS2) \
 	    -lprint -lnsl -lsocket
 
 lint: $(JNIHDR_FILES) lintcheck
--- old/usr/src/cmd/sort/Makefile.com	2018-12-07 21:21:52.659509885 +0000
+++ new/usr/src/cmd/sort/Makefile.com	2018-12-07 21:21:52.675912140 +0000
@@ -74,7 +74,7 @@
 include ../../Makefile.cmd
 
 SED =		sed
-DCFILE = 	$(PROG).dc
+DCFILE =	$(PROG).dc
 
 SPACEFLAG =
 SPACEFLAG64 =
@@ -90,10 +90,10 @@
 
 $(XPG4)	:=	CFLAGS += -DXPG4
 
-debug :=	SORT_DEBUG = -g -DDEBUG $(ILDOFF)
+debug :=	SORT_DEBUG = $(CCGDEBUG) -DDEBUG $(ILDOFF)
 debug :=	COPTFLAG =
 debug :=	COPTFLAG64 =
-stats	:=	SORT_DEBUG = -g -DSTATS -DDEBUG $(ILDOFF)
+stats	:=	SORT_DEBUG = $(CCGDEBUG) -DSTATS -DDEBUG $(ILDOFF)
 stats	:=	COPTFLAG =
 stats	:=	COPTFLAG64 =
 
--- old/usr/src/cmd/stmfproxy/stmfproxy/Makefile	2018-12-07 21:21:53.109070795 +0000
+++ new/usr/src/cmd/stmfproxy/stmfproxy/Makefile	2018-12-07 21:21:53.126317758 +0000
@@ -57,11 +57,6 @@
 LDLIBS += -lnsl -lstmf -lstmfproxy
 CPPFLAGS += -I. -I$(COMMONBASE)/cmdparse
 
-# Uncomment the following to help with debugging
-#CFLAGS += -g 
-#i386_COPTFLAG=
-#i386_CCOPTFLAG=
-
 .KEEP_STATE:
 
 $(PROG): $(OBJS)
--- old/usr/src/cmd/svc/svccfg/Makefile	2018-12-07 21:21:53.581947847 +0000
+++ new/usr/src/cmd/svc/svccfg/Makefile	2018-12-07 21:21:53.599098064 +0000
@@ -47,7 +47,7 @@
 		notify_params.o
 OBJS =		$(MYOBJS)
 
-POFILES = 	$(SRCS:%.c=%.po) \
+POFILES =	$(SRCS:%.c=%.po) \
 		svccfg_grammar.po \
 		svccfg_lex.po \
 		../common/manifest_find.po \
@@ -94,8 +94,6 @@
 LIBTECLA	= $(SRC)/lib/libtecla		# just for the header
 LIBUUTIL	= $(SRC)/lib/libuutil
 
-debug := COPTFLAG = -g
-
 lint := LINTFLAGS = -mux
 lint := SVCCFG_EXTRA_LIBS = -lscf -ll -luutil -lumem -lmd5 -lnvpair
 
--- old/usr/src/cmd/tnf/prex/Makefile.com	2018-12-07 21:21:54.040258933 +0000
+++ new/usr/src/cmd/tnf/prex/Makefile.com	2018-12-07 21:21:54.057189570 +0000
@@ -63,8 +63,6 @@
 LFLAGS=		-v
 # FOR normal makefile, uncomment the next line
 LDLIBS +=	-lgen -ltnfctl -lelf -lc
-# Uncomment the following line for a debug build
-# COPTFLAG =	-g -DDEBUG
 
 CFLAGS +=	$(CCVERBOSE)
 CERRWARN +=	-_gcc=-Wno-unused-label
@@ -110,7 +108,7 @@
 clean:
 	$(RM) $(OBJS) $(CLEANFILES)
 
-lint: $(OBJS) 
+lint: $(OBJS)
 	$(LINT.c) $(SRCS)
 
 include	../../../Makefile.targ
--- old/usr/src/cmd/zlook/Makefile.com	2018-12-07 21:21:54.490182767 +0000
+++ new/usr/src/cmd/zlook/Makefile.com	2018-12-07 21:21:54.507730321 +0000
@@ -30,8 +30,8 @@
 
 CSTD= $(CSTD_GNU99)
 C99LMODE= -Xc99=%all
-CFLAGS += -g $(CCVERBOSE)
-CFLAGS64 += -g $(CCVERBOSE)
+CFLAGS += $(CCGDEBUG) $(CCVERBOSE)
+CFLAGS64 += $(CCGDEBUG) $(CCVERBOSE)
 CPPFLAGS += -D_LARGEFILE64_SOURCE=1 -D_REENTRANT $(INCS)
 
 CERRWARN += -_gcc=-Wno-uninitialized
--- old/usr/src/lib/libc/sparc/Makefile.com	2018-12-07 21:21:54.921524983 +0000
+++ new/usr/src/lib/libc/sparc/Makefile.com	2018-12-07 21:21:54.938670844 +0000
@@ -1408,7 +1408,7 @@
 
 # assym.h build rules
 
-assym.h := CFLAGS += -g
+assym.h := CFLAGS += $(CCGDEBUG)
 
 GENASSYM_C = $(LIBCDIR)/$(MACH)/genassym.c
 
--- old/usr/src/lib/libc/sparcv9/Makefile.com	2018-12-07 21:21:55.413641950 +0000
+++ new/usr/src/lib/libc/sparcv9/Makefile.com	2018-12-07 21:21:55.429452784 +0000
@@ -1322,7 +1322,7 @@
 
 # assym.h build rules
 
-assym.h := CFLAGS64 += -g
+assym.h := CFLAGS64 += $(CCGDEBUG)
 
 GENASSYM_C = $(LIBCDIR)/$(MACH)/genassym.c
 
--- old/usr/src/lib/libexacct/Makefile.com	2018-12-07 21:21:55.884095268 +0000
+++ new/usr/src/lib/libexacct/Makefile.com	2018-12-07 21:21:55.899992301 +0000
@@ -35,18 +35,18 @@
 		$(LIB_OBJS:%.o=../common/%.c)
 
 LIBS =		$(DYNLIB) $(LINTLIB)
-LDLIBS += 	-lc
+LDLIBS +=	-lc
 
 SRCDIR =	../common
 $(LINTLIB) :=	SRCS = $(SRCDIR)/$(LINTSRC)
 
-CFLAGS += 	$(CCVERBOSE)
+CFLAGS +=	$(CCVERBOSE)
 CERRWARN +=	-_gcc=-Wno-uninitialized
 CPPFLAGS +=	-D_FILE_OFFSET_BITS=64
 
 debug :=	CPPFLAGS += -DLIBEXACCT_DEBUG
-debug :=	COPTFLAG = -g
-debug :=	COPTFLAG64 = -g
+debug :=	COPTFLAG = $(CCGDEBUG)
+debug :=	COPTFLAG64 = $(CCGDEBUG)
 
 .KEEP_STATE:
 
--- old/usr/src/lib/libsmbfs/Makefile.com	2018-12-07 21:21:56.307419137 +0000
+++ new/usr/src/lib/libsmbfs/Makefile.com	2018-12-07 21:21:56.322812452 +0000
@@ -76,7 +76,7 @@
 	ui-sun.o \
 	utf_str.o
 
-OBJ_CMN= smbfs_ntacl.o 
+OBJ_CMN= smbfs_ntacl.o
 
 OBJECTS= $(OBJ_LIB) $(OBJ_CMN)
 
@@ -97,7 +97,7 @@
 LDLIBS += -lsocket -lnsl -lc -lmd -lpkcs11 -lkrb5 -lsec -lidmap
 
 # normal warnings...
-CFLAGS	+=	$(CCVERBOSE) 
+CFLAGS	+=	$(CCVERBOSE)
 
 CERRWARN +=	-_gcc=-Wno-uninitialized
 CERRWARN +=	-_gcc=-Wno-unused-variable
@@ -110,12 +110,6 @@
 # Debugging
 ${NOT_RELEASE_BUILD} CPPFLAGS += -DDEBUG
 
-# uncomment these for dbx debugging
-#COPTFLAG = -g
-#CTF_FLAGS =
-#CTFCONVERT_O=
-#CTFMERGE_LIB=
-
 # Filter out the less important lint.
 # See lgrep.awk
 LGREP =	$(AWK) -f $(SRCDIR)/lgrep.awk
--- old/usr/src/lib/libtnfctl/Makefile.com	2018-12-07 21:21:56.759510821 +0000
+++ new/usr/src/lib/libtnfctl/Makefile.com	2018-12-07 21:21:56.775625231 +0000
@@ -65,13 +65,11 @@
 ROOTHDRDIR=	$(ROOT)/usr/include/tnf
 ROOTHDRS=	$(HDRS:%=$(ROOTHDRDIR)/%)
 CHECKHDRS=	$(HDRS:%.h=%.check)
-$(ROOTHDRS) := 	FILEMODE = 0644
+$(ROOTHDRS) :=	FILEMODE = 0644
 CHECKHDRS =	$(HDRS:%.h=%.check)
 
 LDLIBS +=	-lc -lelf
 
-# Uncomment the following line for a debug build
-# COPTFLAG =	-g -DDEBUG $(CCVERBOSE)
 CPPFLAGS +=	-I$(SRC)/lib/libtnfprobe -D_REENTRANT -I$(SRC)/cmd/sgs/include
 
 LINTFLAGS +=	-y
--- old/usr/src/lib/libzpool/Makefile.com	2018-12-07 21:21:57.211520645 +0000
+++ new/usr/src/lib/libzpool/Makefile.com	2018-12-07 21:21:57.228327860 +0000
@@ -66,8 +66,8 @@
 CSTD=	$(CSTD_GNU99)
 C99LMODE=	-Xc99=%all
 
-CFLAGS +=	-g $(CCVERBOSE) $(CNOGLOBAL)
-CFLAGS64 +=	-g $(CCVERBOSE)	$(CNOGLOBAL)
+CFLAGS +=	$(CCGDEBUG) $(CCVERBOSE) $(CNOGLOBAL)
+CFLAGS64 +=	$(CCGDEBUG) $(CCVERBOSE) $(CNOGLOBAL)
 LDLIBS +=	-lcmdutils -lumem -lavl -lnvpair -lz -lc -lsysevent -lmd \
 		-lfakekernel
 CPPFLAGS.first =	-I$(SRC)/lib/libfakekernel/common
--- old/usr/src/lib/smbsrv/libfksmbsrv/Makefile.com	2018-12-07 21:21:57.678693258 +0000
+++ new/usr/src/lib/smbsrv/libfksmbsrv/Makefile.com	2018-12-07 21:21:57.697660392 +0000
@@ -186,9 +186,9 @@
 include ../../Makefile.lib
 
 # Force SOURCEDEBUG
-CSOURCEDEBUGFLAGS	= -g
-CCSOURCEDEBUGFLAGS	= -g
-STRIP_STABS 	= :
+CSOURCEDEBUGFLAGS	= $(CCGDEBUG)
+CCSOURCEDEBUGFLAGS	= $(CCGDEBUG)
+STRIP_STABS	= :
 
 
 # Note: need our sys includes _before_ ENVCPPFLAGS, proto etc.
--- old/usr/src/lib/udapl/libdat/Makefile.com	2018-12-07 21:21:58.119129557 +0000
+++ new/usr/src/lib/udapl/libdat/Makefile.com	2018-12-07 21:21:58.135746967 +0000
@@ -23,8 +23,8 @@
 # Use is subject to license terms.
 #
 
-LIBRARY=       	libdat.a 
-VERS=          	.1 
+LIBRARY=	libdat.a
+VERS=		.1
 
 OBJECTS =	\
 	dat_dictionary.o \
@@ -36,16 +36,16 @@
 	dat_api.o \
 	udat.o	\
 	udat_api.o \
-	udat_sr_parser.o 
+	udat_sr_parser.o
 
 include ../../../Makefile.lib
 
-LIBS = 	$(DYNLIB) $(LINTLIB)
+LIBS =	$(DYNLIB) $(LINTLIB)
 LDLIBS += -lc
 
 SRCDIR =	../common
 
-CPPFLAGS +=     -I../include 
+CPPFLAGS +=     -I../include
 CFLAGS +=	$(CCVERBOSE)
 LINTFLAGS +=	-DDEBUG
 LINTFLAGS64 +=	-DDEBUG
@@ -54,8 +54,6 @@
 CERRWARN +=	-_gcc=-Wno-type-limits
 
 $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
-debug := COPTFLAG = -g
-debug := COPTFLAG64 = -g
 
 .KEEP_STATE:
 
--- old/usr/src/lib/udapl/udapl_tavor/Makefile.com	2018-12-07 21:21:58.555623984 +0000
+++ new/usr/src/lib/udapl/udapl_tavor/Makefile.com	2018-12-07 21:21:58.575758269 +0000
@@ -23,8 +23,8 @@
 # Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
 #
 
-LIBRARY=       	udapl_tavor.a 
-VERS=          	.1 
+LIBRARY=	udapl_tavor.a
+VERS=		.1
 
 LOCOBJS =	\
 	dapl_cno_create.o \
@@ -139,7 +139,7 @@
 
 SRCS = $(LOCOBJS:%.o=$(SRCDIR)/%.c) $(TAVOROBJS:%.o=$(TAVORSRCDIR)/%.c)
 
-CPPFLAGS +=	-I$(SRC)/lib/udapl/udapl_tavor/include 
+CPPFLAGS +=	-I$(SRC)/lib/udapl/udapl_tavor/include
 CPPFLAGS +=	-I$(SRC)/lib/udapl/udapl_tavor/tavor
 CPPFLAGS +=	-I$(SRC)/uts/common/sys/ib/clients/daplt
 CPPFLAGS +=	-I$(SRC)/uts/common
@@ -153,8 +153,6 @@
 CERRWARN +=	-_gcc=-Wno-switch
 
 $(NOT_RELEASE_BUILD)CPPFLAGS += -DDAPL_DBG
-debug := COPTFLAG = -g
-debug := COPTFLAG64 = -g
 
 .KEEP_STATE:
 
--- old/usr/src/tools/cw/cw.c	2018-12-07 21:21:58.978118954 +0000
+++ new/usr/src/tools/cw/cw.c	2018-12-07 21:21:58.993427386 +0000
@@ -37,7 +37,7 @@
  */
 
 /* If you modify this file, you must increment CW_VERSION */
-#define	CW_VERSION	"3.0"
+#define	CW_VERSION	"4.0"
 
 /*
  * -#		Verbose mode
@@ -215,7 +215,6 @@
  * -xCC				ignore
  * -xchip=<c>			table
  * -xcode=<c>			table
- * -xdebugformat=<format>	ignore (always use dwarf-2 for gcc)
  * -xcrossfile[=<n>]		ignore
  * -xe				error
  * -xF				error
@@ -732,9 +731,6 @@
 			}
 			error(arg);
 			break;
-		case 'g':
-			newae(ctx->i_ae, "-gdwarf-2");
-			break;
 		case 'E':
 			if (arglen == 1) {
 				newae(ctx->i_ae, "-xc");
@@ -762,6 +758,7 @@
 			error(arg);
 			break;
 		case 'A':
+		case 'g':
 		case 'h':
 		case 'I':
 		case 'i':
@@ -1076,11 +1073,6 @@
 					break;
 				error(arg);
 				break;
-			case 'd':
-				if (strncmp(arg, "-xdebugformat=", 14) == 0)
-					break;
-				error(arg);
-				break;
 			case 'F':
 				/*
 				 * Compile for mapfile reordering, or unused
--- old/usr/src/uts/intel/cxgbe/cxgbe/Makefile	2018-12-07 21:21:59.483782529 +0000
+++ new/usr/src/uts/intel/cxgbe/cxgbe/Makefile	2018-12-07 21:21:59.499669245 +0000
@@ -43,7 +43,7 @@
 LINT_TARGET = $(MODULE).lint
 INSTALL_TARGET = $(BINARY) $(ROOTMODULE)
 
-CFLAGS += -g -I$(UTSBASE)/common/io/cxgbe -I$(UTSBASE)/common/io/cxgbe/common \
+CFLAGS += -I$(UTSBASE)/common/io/cxgbe -I$(UTSBASE)/common/io/cxgbe/common \
 	-I$(UTSBASE)/common/io/cxgbe/t4nex -I$(UTSBASE)/common/io/cxgbe/shared
 
 #
--- old/usr/src/uts/intel/cxgbe/t4nex/Makefile	2018-12-07 21:21:59.899433754 +0000
+++ new/usr/src/uts/intel/cxgbe/t4nex/Makefile	2018-12-07 21:21:59.918048542 +0000
@@ -47,7 +47,7 @@
 LINT_TARGET = $(MODULE).lint
 INSTALL_TARGET = $(BINARY) $(ROOTMODULE)
 
-CFLAGS += -g -I$(UTSBASE)/common/io/cxgbe -I$(UTSBASE)/common/io/cxgbe/common \
+CFLAGS += -I$(UTSBASE)/common/io/cxgbe -I$(UTSBASE)/common/io/cxgbe/common \
 	-I$(UTSBASE)/common/io/cxgbe/t4nex -I$(UTSBASE)/common/io/cxgbe/shared \
 	-I$(UTSBASE)/common/io/cxgbe/firmware
 
