--- old/usr/src/Makefile.master	Tue Oct  1 11:19:20 2019
+++ new/usr/src/Makefile.master	Tue Oct  1 11:19:20 2019
@@ -1049,6 +1049,7 @@
 PATCH_DATE=	$(RELEASE_DATE)
 RELEASE_CM=	"@($(POUND_SIGN))SunOS $(RELEASE) $(PATCHID) $(PATCH_DATE)"
 DEV_CM=		"@($(POUND_SIGN))SunOS Internal Development: non-nightly build"
+UTS_LABEL=	$(RELEASE)
 
 PROCESS_COMMENT=  @?${MCS} -d -a $(RELEASE_CM) -a $(DEV_CM)
 $(RELEASE_BUILD)PROCESS_COMMENT=   @?${MCS} -d -a $(RELEASE_CM)
--- old/usr/src/cmd/mdb/Makefile.kmdb.targ	Tue Oct  1 11:19:21 2019
+++ new/usr/src/cmd/mdb/Makefile.kmdb.targ	Tue Oct  1 11:19:21 2019
@@ -22,6 +22,8 @@
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
+# Copyright 2019 Joyent, Inc.
+#
 
 ROOTTERMINFO = $(ROOTSHLIB)/terminfo
 
@@ -31,7 +33,7 @@
 
 $(PROG): $(PROG).core $(KCTLOBJS)
 	$(LD) -dy -r -o $@ $@.core -Nmisc/ctf $(KCTLOBJS)
-	$(CTFMERGE) -L VERSION -o $@ $(OBJS) $(KCTLOBJS)
+	$(CTFMERGE) -l "$(UTS_LABEL)" -o $@ $(OBJS) $(KCTLOBJS)
 	$(KMDB_FPTEST)
 	$(POST_PROCESS)
 	$(SETDYNFLAG) -f DF_1_IGNMULDEF,DF_1_NOKSYMS $@
--- old/usr/src/cmd/mdb/Makefile.module	Tue Oct  1 11:19:21 2019
+++ new/usr/src/cmd/mdb/Makefile.module	Tue Oct  1 11:19:21 2019
@@ -25,7 +25,7 @@
 # Copyright (c) 2013 by Delphix. All rights reserved.
 # Copyright (c) 2019 Carlos Neira <cneirabustos@gmail.com>
 # Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
-# Copyright (c) 2019, Joyent, Inc.
+# Copyright 2019 Joyent, Inc.
 #
 
 .KEEP_STATE:
@@ -211,7 +211,7 @@
 	$(STANDOBJS)
 	$(KMDB_LINKTEST_CMD)
 	$(KMDB_FPTEST_CMD)
-	$(CTFMERGE) -f -L VERSION -o $@ $(KMODOBJS)
+	$(CTFMERGE) -l "$(UTS_LABEL)" -o $@ $(KMODOBJS)
 	$(POST_PROCESS)
 	$(SETDYNFLAG) -f DF_1_NOKSYMS $@
 
--- old/usr/src/uts/Makefile.uts	Tue Oct  1 11:19:21 2019
+++ new/usr/src/uts/Makefile.uts	Tue Oct  1 11:19:21 2019
@@ -337,6 +337,17 @@
 	$(RM) $@; $(INS) -s -m $(CFILEMODE) -f $(@D) $(SRC_CONFFILE)
 
 #
+# By default, instead of $VERSION, we use $(UTS_LABEL), which is by
+# default set to $RELEASE aka "5.11".
+#
+# $VERSION changes when the git HEAD changes, leading to annoying merge
+# uniquification conflicts when doing partial builds during development.
+# The information from $VERSION is available via "buildversion" anyway.
+#
+CTFCVTFLAGS = -X -l "$(UTS_LABEL)"
+CTFMRGFLAGS += -l "$(UTS_LABEL)"
+
+#
 # The CTF merge of child kernel modules is performed against one of the genunix
 # modules.  For Intel builds, all modules will be used with a single genunix:
 # the one built in intel/genunix.  For SPARC builds, a given
@@ -354,26 +365,26 @@
 	$(UTSBASE)/$(CTFMERGE_GUDIR)/genunix/$(OBJS_DIR)/genunix
 
 #
-# Used to uniquify a non-genunix module against genunix. $VERSION is used
-# for the label.
+# Used to uniquify a non-genunix module against genunix.
 #
 # For the ease of developers dropping modules onto possibly unrelated systems,
 # you can set NO_GENUNIX_UNIQUIFY= in the environment to skip uniquifying
 # against genunix.
 #
+#
 NO_GENUNIX_UNIQUIFY=$(POUND_SIGN)
 CTFMERGE_GENUNIX_DFLAG=-d $(CTFMERGE_GENUNIX)
 $(NO_GENUNIX_UNIQUIFY)CTFMERGE_GENUNIX_DFLAG=
 
-CTFMERGE_UNIQUIFY_AGAINST_GENUNIX	= \
-	$(CTFMERGE) $(CTFMRGFLAGS) -L VERSION \
-	$(CTFMERGE_GENUNIX_DFLAG) -o $@ $(OBJECTS) $(CTFEXTRAOBJS)
+CTFMERGE_UNIQUIFY_AGAINST_GENUNIX = \
+	$(CTFMERGE) $(CTFMRGFLAGS) $(CTFMERGE_GENUNIX_DFLAG) \
+	-o $@ $(OBJECTS) $(CTFEXTRAOBJS)
 
 #
 # Used to merge the genunix module.
 #
-CTFMERGE_GENUNIX_MERGE		= \
-	$(CTFMERGE) $(CTFMRGFLAGS) -L VERSION -o $@ \
+CTFMERGE_GENUNIX_MERGE = \
+	$(CTFMERGE) $(CTFMRGFLAGS) -o $@ \
 	$(OBJECTS) $(CTFEXTRAOBJS) $(IPCTF_TARGET)
 
 #
@@ -662,11 +673,3 @@
 #
 USBDEVS_AWK =	$(SRC)/uts/common/io/usb/usbdevs2h.awk
 USBDEVS_DATA =	$(SRC)/uts/common/io/usb/usbdevs
-
-
-#
-# If we're using the newer CTF tools, then we need to make sure that we
-# are building with the private -X option to ctfconvert which allows us
-# to fixup the struct cpu to account for machcpu.
-#
-$(BUILD_NEW_CTF_TOOLS)CTFCVTFLAGS += -X
--- old/usr/src/uts/common/Makefile.rules	Tue Oct  1 11:19:22 2019
+++ new/usr/src/uts/common/Makefile.rules	Tue Oct  1 11:19:22 2019
@@ -1608,7 +1608,7 @@
 $(OBJS_DIR)/zlib_obj.o:		$(ZLIB_OBJS:%=$(OBJS_DIR)/%)
 	$(LD) -r -Breduce -M$(UTSBASE)/common/zmod/mapfile -o $@ \
 	    $(ZLIB_OBJS:%=$(OBJS_DIR)/%)
-	$(CTFMERGE) -t -f -L VERSION -o $@ $(ZLIB_OBJS:%=$(OBJS_DIR)/%)
+	$(CTFMERGE) $(CTFMRGFLAGS) -o $@ $(ZLIB_OBJS:%=$(OBJS_DIR)/%)
 
 $(OBJS_DIR)/%.o:		$(UTSBASE)/common/io/hxge/%.c
 	$(COMPILE.c) -o $@ $<
--- old/usr/src/uts/intel/klmmod/Makefile	Tue Oct  1 11:19:22 2019
+++ new/usr/src/uts/intel/klmmod/Makefile	Tue Oct  1 11:19:22 2019
@@ -24,7 +24,7 @@
 #
 # Copyright (c) 2012 by Delphix. All rights reserved.
 #
-# Copyright (c) 2018, Joyent, Inc.
+# Copyright 2019 Joyent, Inc.
 
 #
 #	Path to the base of the uts directory tree (usually /usr/src/uts).
@@ -56,7 +56,6 @@
 #
 LDFLAGS		+= -dy -Nstrmod/rpcmod -Nfs/nfs
 LDFLAGS		+= -M $(UTSBASE)/common/klm/mapfile-mod
-CTFMRGFLAGS	+= -f
 
 #
 # Code generated by rpcgen triggers the -Wswitch warning.
--- old/usr/src/uts/intel/klmops/Makefile	Tue Oct  1 11:19:22 2019
+++ new/usr/src/uts/intel/klmops/Makefile	Tue Oct  1 11:19:22 2019
@@ -23,12 +23,8 @@
 # Use is subject to license terms.
 #
 # Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright 2019 Joyent, Inc.
 #
-#	This makefile drives the production of the network lock manager client
-#	side module.
-#
-#	intel implementation architecture dependent
-#
 
 #
 #	Path to the base of the uts directory tree (usually /usr/src/uts).
@@ -60,7 +56,6 @@
 #
 LDFLAGS		+= -dy -Nstrmod/rpcmod -Nfs/nfs -Nmisc/klmmod
 LDFLAGS		+= -M $(UTSBASE)/common/klm/mapfile-ops
-CTFMRGFLAGS	+= -f
 
 #
 #	Default build targets.
--- old/usr/src/uts/intel/sda/Makefile	Tue Oct  1 11:19:23 2019
+++ new/usr/src/uts/intel/sda/Makefile	Tue Oct  1 11:19:23 2019
@@ -72,11 +72,9 @@
 
 #
 # dependency on blkdev module, scope limiting mapfile
-# Note that we have to allow CTFMERGE to use fuzzy matching
 #
 MAPFILE		= $(UTSBASE)/common/io/sdcard/impl/mapfile
 LDFLAGS		+= -dy -Ndrv/blkdev -B reduce -M $(MAPFILE)
-CTFMRGFLAGS	+= -f
 
 # needs work
 SMOFF += all_func_returns
--- old/usr/src/uts/sparc/klmmod/Makefile	Tue Oct  1 11:19:23 2019
+++ new/usr/src/uts/sparc/klmmod/Makefile	Tue Oct  1 11:19:23 2019
@@ -23,12 +23,8 @@
 # Use is subject to license terms.
 #
 # Copyright (c) 2012 by Delphix. All rights reserved.
+# Copyright 2019 Joyent, Inc.
 #
-#	This makefile drives the production of the server-side network lock
-#	manager kernel module.
-#
-#	sparc architecture dependent
-#
 
 #
 #	Path to the base of the uts directory tree (usually /usr/src/uts).
@@ -61,7 +57,6 @@
 CFLAGS		+= $(CCVERBOSE)
 LDFLAGS		+= -dy -Nstrmod/rpcmod -Nfs/nfs
 LDFLAGS		+= -M $(UTSBASE)/common/klm/mapfile-mod
-CTFMRGFLAGS	+= -f
 
 #
 # Code generated by rpcgen triggers the -Wswitch warning.
--- old/usr/src/uts/sparc/klmops/Makefile	Tue Oct  1 11:19:24 2019
+++ new/usr/src/uts/sparc/klmops/Makefile	Tue Oct  1 11:19:24 2019
@@ -23,12 +23,7 @@
 # Use is subject to license terms.
 #
 # Copyright (c) 2012 by Delphix. All rights reserved.
-#
-#	This makefile drives the production of the client-side network lock
-#	manager kernel module.
-#
-#	sparc architecture dependent
-#
+# Copyright 2019 Joyent, Inc.
 
 #
 #	Path to the base of the uts directory tree (usually /usr/src/uts).
@@ -61,7 +56,6 @@
 CFLAGS		+= $(CCVERBOSE)
 LDFLAGS		+= -dy -Nstrmod/rpcmod -Nfs/nfs
 LDFLAGS		+= -M $(UTSBASE)/common/klm/mapfile-ops
-CTFMRGFLAGS	+= -f
 
 #
 #	Default build targets.
