--- old/usr/src/Makefile.master	2018-10-11 01:49:36.914571501 +0000
+++ new/usr/src/Makefile.master	2018-10-11 01:49:36.932797662 +0000
@@ -890,30 +890,31 @@
 # Handle different PIC models on different ISAs
 # (May be overridden by lower-level Makefiles)
 
-sparc_C_PICFLAGS =	-K pic
-sparcv9_C_PICFLAGS =	-K pic
-i386_C_PICFLAGS =	-K pic
-amd64_C_PICFLAGS =	-K pic
+sparc_C_PICFLAGS =	-fpic
+sparcv9_C_PICFLAGS =	-fpic
+i386_C_PICFLAGS =	-fpic
+amd64_C_PICFLAGS =	-fpic
 C_PICFLAGS =		$($(MACH)_C_PICFLAGS)
 C_PICFLAGS64 =		$($(MACH64)_C_PICFLAGS)
 
-sparc_C_BIGPICFLAGS =	-K PIC
-sparcv9_C_BIGPICFLAGS =	-K PIC
-i386_C_BIGPICFLAGS =	-K PIC
-amd64_C_BIGPICFLAGS =	-K PIC
+sparc_C_BIGPICFLAGS =	-fPIC
+sparcv9_C_BIGPICFLAGS =	-fPIC
+i386_C_BIGPICFLAGS =	-fPIC
+amd64_C_BIGPICFLAGS =	-fPIC
 C_BIGPICFLAGS =		$($(MACH)_C_BIGPICFLAGS)
 C_BIGPICFLAGS64 =	$($(MACH64)_C_BIGPICFLAGS)
 
 # CC requires there to be no space between '-K' and 'pic' or 'PIC'.
-sparc_CC_PICFLAGS =	-Kpic
-sparcv9_CC_PICFLAGS =	-KPIC
-i386_CC_PICFLAGS =	-Kpic
-amd64_CC_PICFLAGS =	-Kpic
+# and does not support -f
+sparc_CC_PICFLAGS =	-_cc=-Kpic -_gcc=-fpic
+sparcv9_CC_PICFLAGS =	-_cc=-KPIC -_gcc=-fPIC
+i386_CC_PICFLAGS =	-_cc=-Kpic -_gcc=-fpic
+amd64_CC_PICFLAGS =	-_cc=-Kpic -_gcc=-fpic
 CC_PICFLAGS =		$($(MACH)_CC_PICFLAGS)
 CC_PICFLAGS64 =		$($(MACH64)_CC_PICFLAGS)
 
-AS_PICFLAGS=		$(C_PICFLAGS)
-AS_BIGPICFLAGS=		$(C_BIGPICFLAGS)
+AS_PICFLAGS=		-K pic
+AS_BIGPICFLAGS=		-K PIC
 
 #
 # Default label for CTF sections
--- old/usr/src/cmd/sgs/Makefile.com	2018-10-11 01:49:37.436644088 +0000
+++ new/usr/src/cmd/sgs/Makefile.com	2018-10-11 01:49:37.453796295 +0000
@@ -66,8 +66,8 @@
 		$(CPPFLAGS.master) -I$(ELFCAP)
 
 # PICS64 is unique to our environment
-$(PICS64) :=	sparc_CFLAGS += -xregs=no%appl -K pic
-$(PICS64) :=	sparcv9_CFLAGS += -xregs=no%appl -K pic
+$(PICS64) :=	sparc_CFLAGS += -xregs=no%appl $(C_PICFLAGS)
+$(PICS64) :=	sparcv9_CFLAGS += -xregs=no%appl $(C_PICFLAGS)
 $(PICS64) :=	CPPFLAGS += -DPIC -D_REENTRANT
 
 LDFLAGS +=	$(ZIGNORE)
--- old/usr/src/cmd/sgs/rtld/sparc/Makefile	2018-10-11 01:49:37.900112628 +0000
+++ new/usr/src/cmd/sgs/rtld/sparc/Makefile	2018-10-11 01:49:37.916442718 +0000
@@ -68,7 +68,7 @@
 
 CPPFLAGS +=	-I../../../../uts/sparc/krtld -DA_OUT
 CFLAGS +=	-xregs=no%appl
-ASFLAGS +=	-K pic
+ASFLAGS +=	$(AS_PICFLAGS)
 LINTFLAGS +=	-DA_OUT
 ADBGENCFLAGS +=	-erroff=%all
 ADBGENFLAGS +=	-milp32
--- old/usr/src/cmd/sgs/rtld/sparcv9/Makefile	2018-10-11 01:49:38.364047344 +0000
+++ new/usr/src/cmd/sgs/rtld/sparcv9/Makefile	2018-10-11 01:49:38.381564438 +0000
@@ -40,11 +40,11 @@
 
 CP_MACHOBJS=	common_sparc.o
 
-S_MACHOBJS=	
+S_MACHOBJS=
 
 P_ASOBJS=	boot.o		boot_elf.o	caller.o
 
-S_ASOBJS=	
+S_ASOBJS=
 
 CRTSRCS=	../../../../lib/crt/sparc
 CRTI=		pics/crti.o
@@ -68,7 +68,7 @@
 
 CPPFLAGS +=	-I../../../../uts/sparc/krtld
 CFLAGS +=	-xregs=no%appl
-ASFLAGS +=	-s -K pic -D__sparcv9 -D_ELF64 $(sparcv9_XARCH)
+ASFLAGS +=	-s $(AS_PICFLAGS) -D__sparcv9 -D_ELF64 $(sparcv9_XARCH)
 ADBGENFLAGS +=	-mlp64
 ADBGENCFLAGS +=	-erroff=%all
 ADBSUB=		$(ADBSUB64)
--- old/usr/src/lib/c_synonyms/amd64/Makefile	2018-10-11 01:49:38.828880350 +0000
+++ new/usr/src/lib/c_synonyms/amd64/Makefile	2018-10-11 01:49:38.846560892 +0000
@@ -22,10 +22,8 @@
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 
-ASFLAGS=	-K pic -P -D__STDC__ -D_ASM $(amd64_AS_XARCH)
+ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(amd64_AS_XARCH)
 
 include ../Makefile.com
 include ../../Makefile.lib.64
--- old/usr/src/lib/c_synonyms/i386/Makefile	2018-10-11 01:49:39.306044870 +0000
+++ new/usr/src/lib/c_synonyms/i386/Makefile	2018-10-11 01:49:39.325188470 +0000
@@ -22,10 +22,8 @@
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 
-ASFLAGS=	-K pic -P -D__STDC__ -D_ASM $(i386_AS_XARCH)
+ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(i386_AS_XARCH)
 
 include ../Makefile.com
 
--- old/usr/src/lib/c_synonyms/sparc/Makefile	2018-10-11 01:49:39.767469991 +0000
+++ new/usr/src/lib/c_synonyms/sparc/Makefile	2018-10-11 01:49:39.784872128 +0000
@@ -22,10 +22,8 @@
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 
-ASFLAGS=	-K pic -P -D__STDC__ -D_ASM $(sparc_AS_XARCH)
+ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(sparc_AS_XARCH)
 
 include ../Makefile.com
 
--- old/usr/src/lib/c_synonyms/sparcv9/Makefile	2018-10-11 01:49:40.257101775 +0000
+++ new/usr/src/lib/c_synonyms/sparcv9/Makefile	2018-10-11 01:49:40.274171457 +0000
@@ -22,10 +22,8 @@
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 
-ASFLAGS=	-K pic -P -D__STDC__ -D_ASM $(sparcv9_AS_XARCH)
+ASFLAGS=	$(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(sparcv9_AS_XARCH)
 
 include ../Makefile.com
 include ../../Makefile.lib.64
--- old/usr/src/lib/efcode/engine/sparcv9/Makefile	2018-10-11 01:49:40.713673015 +0000
+++ new/usr/src/lib/efcode/engine/sparcv9/Makefile	2018-10-11 01:49:40.731438274 +0000
@@ -23,12 +23,10 @@
 # Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 
 include ../Makefile.com
 include $(SRC)/lib/Makefile.lib.64
 
-sparcv9_C_PICFLAGS = -KPIC
+sparcv9_C_PICFLAGS = $(C_BIGPICFLAGS64)
 
 install: all $(ROOTLIBS64)
--- old/usr/src/lib/fm/libmdesc/Makefile.com	2018-10-11 01:49:41.171304662 +0000
+++ new/usr/src/lib/fm/libmdesc/Makefile.com	2018-10-11 01:49:41.187310074 +0000
@@ -50,8 +50,8 @@
 SRCDIR =	../common
 
 CPPFLAGS += -I../common -I.
-CFLAGS += $(CCVERBOSE) -K PIC
-CFLAGS64 += $(CCVERBOSE) -K PIC
+CFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS)
+CFLAGS64 += $(CCVERBOSE) $(C_BIGPICFLAGS64)
 LDLIBS += -lc
 
 LINTFLAGS += -erroff=E_BAD_PTR_CAST_ALIGN -v
--- old/usr/src/lib/gss_mechs/mech_krb5/Makefile	2018-10-11 01:49:41.614391538 +0000
+++ new/usr/src/lib/gss_mechs/mech_krb5/Makefile	2018-10-11 01:49:41.630555094 +0000
@@ -39,7 +39,7 @@
 
 GREP= find . \( -name SCCS -prune -o -name '*.[ch]' \) -print | sort | xargs grep
 
-sparcv9_C_PICFLAGS =  -K PIC
+sparcv9_C_PICFLAGS =  $(sparcv9_C_BIGPICFLAGS)
 TEXT_DOMAIN = SUNW_OST_NETRPC
 POFILE = mech_krb5.po
 POFILES = generic.po
--- old/usr/src/lib/libast/amd64/Makefile	2018-10-11 01:49:42.057485005 +0000
+++ new/usr/src/lib/libast/amd64/Makefile	2018-10-11 01:49:42.072869409 +0000
@@ -38,7 +38,7 @@
 include ../Makefile.com
 include ../../Makefile.lib.64
 
-# Use -KPIC since libast is too big for -Kpic on 64bit
+# Use big PIC since libast is too big for pic on 64bit
 # (and on 32bit it is close to the barrier)
 amd64_C_PICFLAGS = $(C_BIGPICFLAGS)
 
--- old/usr/src/lib/libast/i386/Makefile	2018-10-11 01:49:42.468114476 +0000
+++ new/usr/src/lib/libast/i386/Makefile	2018-10-11 01:49:42.484420725 +0000
@@ -37,7 +37,7 @@
 
 include ../Makefile.com
 
-# Use -KPIC since libast is too big for -Kpic on 64bit
+# Use big PIC since libast is too big for pic on 64bit
 # (and on 32bit it is close to the barrier)
 i386_C_PICFLAGS  = $(C_BIGPICFLAGS)
 
--- old/usr/src/lib/libast/sparc/Makefile	2018-10-11 01:49:42.905698510 +0000
+++ new/usr/src/lib/libast/sparc/Makefile	2018-10-11 01:49:42.921594333 +0000
@@ -38,7 +38,7 @@
 
 include ../Makefile.com
 
-# Use -KPIC since libast is too big for -Kpic on 64bit
+# Use big PIC since libast is too big for pic on 64bit
 # (and on 32bit it is close to the barrier)
 sparc_C_PICFLAGS = $(C_BIGPICFLAGS)
 
--- old/usr/src/lib/libast/sparcv9/Makefile	2018-10-11 01:49:43.348154864 +0000
+++ new/usr/src/lib/libast/sparcv9/Makefile	2018-10-11 01:49:43.365181212 +0000
@@ -39,7 +39,7 @@
 include ../Makefile.com
 include ../../Makefile.lib.64
 
-# Use -KPIC since libast is too big for -Kpic on 64bit
+# Use big PIC since libast is too big for pic on 64bit
 # (and on 32bit it is close to the barrier)
 sparcv9_C_PICFLAGS  = $(C_BIGPICFLAGS)
 
--- old/usr/src/lib/libbc/sparc/Makefile	2018-10-11 01:49:43.793453746 +0000
+++ new/usr/src/lib/libbc/sparc/Makefile	2018-10-11 01:49:43.809880509 +0000
@@ -44,7 +44,7 @@
 
 COMPAT4.1=\
 ftime.o     nice.o      rand.o      vlimit.o    vtimes.o    getpw.o times.o
- 
+
 COMPATSYS5=\
 nice.o      rand.o      getpw.o     times.o
 
@@ -97,14 +97,14 @@
 getpass.o localtime.o ttyslot.o
 
 GENCOMSPARC=\
-alloca.o   ffs.o insque.o    remque.o    isinf.o     base_conv.o 
+alloca.o   ffs.o insque.o    remque.o    isinf.o     base_conv.o
 
 GEN4.2=\
 nlist.o     timezone.o  sleep.o  system.o
 
 GENSYS5=\
 assert.o    nlist.o     sgetl.o    sleep.o      sputl.o     system.o \
-sighold.o   
+sighold.o
 
 STDIOCOM=\
 clrerr.o    ctermid.o   cuserid.o   doprnt.o    doscan.o    fdopen.o \
@@ -150,7 +150,7 @@
 mknod.o     open.o      readlink.o  rename.o    rmdir.o  \
 setpgrp.o   stat.o      symlink.o   truncate.o  unlink.o     \
 statfs.o    fcntl.o     read.o      write.o     readv.o \
-writev.o    setjmp.o	mount.o 
+writev.o    setjmp.o	mount.o
 
 SYS4.2SPARC=\
 getgroups.o setgroups.o
@@ -340,9 +340,9 @@
 $(DYNLIB4X) :=	SONAME = $(DYNLIB4X)
 $(DYNLIBS5) :=	SONAME = $(DYNLIBS5)
 
-pics/%.o:= ASFLAGS += -K pic -DPIC
-pics/%.o:= CPPFLAGS += -K pic -DPIC
-s5pics/%.o:= ASFLAGS += -K pic -DPIC
+pics/%.o:= ASFLAGS += $(AS_PICFLAGS) -DPIC
+pics/%.o:= CPPFLAGS += $(C_PICFLAGS) -DPIC
+s5pics/%.o:= ASFLAGS += $(AS_PICFLAGS) -DPIC
 DYNFLAGS += $(ZINTERPOSE)
 
 BUILD.s=  $(AS) $(ASFLAGS) $< -o $@
@@ -352,14 +352,14 @@
 	$(AR) q $@ $(OBJECTS:%=$(DIR)/%)
 
 # the TXTS macro is used for NSE bootstrapping.
-TXTS=	inc/SYS.h inc/PIC.h inc/machine/asm_linkage.h 
+TXTS=	inc/SYS.h inc/PIC.h inc/machine/asm_linkage.h
 
 LIBS = $(DYNLIB4X) $(DYNLIBS5)
 
 OBJECTS= $(COMPATCOM) $(COMPAT4.1) $(CRTSPARC) $(GENCOM) \
 $(GENCOMSPARC) $(GEN4.2) $(STDIOCOM) $(STDIO4.2) \
 $(INET) $(NET) $(NETSPARC) $(YP) \
-$(SYSCOM) $(SYSCOMSPARC) $(SYS4.2) 
+$(SYSCOM) $(SYSCOMSPARC) $(SYS4.2)
 
 #
 # Since this library is strictly for binary compability with ancient
@@ -381,7 +381,7 @@
 CLOBBERFILES= ../libc/compat/sys5/mkepoch
 
 # conditional assignments
-s5pics/%.o:= CPPFLAGS = -Dsparc -DS5EMUL -K pic -DPIC -I. -Iinc \
+s5pics/%.o:= CPPFLAGS = -Dsparc -DS5EMUL $(C_PICFLAGS) -DPIC -I. -Iinc \
 	-I../inc/5include -I../inc/include -I../inc/include/sys \
 	$(CPPFLAGS.master)
 
@@ -414,7 +414,7 @@
 
 # special cases
 PSEUDO_POBJS= $(PSEUDO_SRCS:%.s=pics/%.o)
-PSEUDO_PS5OBJS= $(PSEUDO_SRCS:%.s=s5pics/%.o) 
+PSEUDO_PS5OBJS= $(PSEUDO_SRCS:%.s=s5pics/%.o)
 
 $(PSEUDO_POBJS) $(PSEUDO_PS5OBJS):
 	@(echo '#include "SYS.h"'; \
@@ -451,7 +451,7 @@
 	$(POST_PROCESS_O)
 
 pics/ypupdate_prot.o s5pics/ypupdate_prot.o : ../inc/include/rpcsvc/ypupdate_prot.h\
-				../libc/yp/ypupdate_prot.c 
+				../libc/yp/ypupdate_prot.c
 	$(COMPILE.c) -o $@ ../libc/yp/ypupdate_prot.c
 	$(POST_PROCESS_O)
 
--- old/usr/src/lib/libc/capabilities/sun4u-opl/Makefile.com	2018-10-11 01:49:44.270647678 +0000
+++ new/usr/src/lib/libc/capabilities/sun4u-opl/Makefile.com	2018-10-11 01:49:44.289642686 +0000
@@ -37,4 +37,4 @@
 		-I$(ROOT)/usr/platform/$(GEN_PLATFORM)/include
 
 AS_CPPFLAGS +=	-D__STDC__ -D_ASM -DPIC -D_REENTRANT -D$(MACH) $(IFLAGS)
-ASFLAGS =	-P -K pic
+ASFLAGS =	-P $(AS_PICFLAGS)
--- old/usr/src/lib/libc/capabilities/sun4u-us3-hwcap1/Makefile.com	2018-10-11 01:49:44.725770913 +0000
+++ new/usr/src/lib/libc/capabilities/sun4u-us3-hwcap1/Makefile.com	2018-10-11 01:49:44.742195022 +0000
@@ -39,4 +39,4 @@
 
 AS_CPPFLAGS +=	-D__STDC__ -D_ASM -DPIC -D_REENTRANT -D$(MACH) $(IFLAGS) \
 		-DBSTORE_SIZE=256
-ASFLAGS =	-P -K pic
+ASFLAGS =	-P $(AS_PICFLAGS)
--- old/usr/src/lib/libc/capabilities/sun4u-us3-hwcap2/Makefile.com	2018-10-11 01:49:45.213313890 +0000
+++ new/usr/src/lib/libc/capabilities/sun4u-us3-hwcap2/Makefile.com	2018-10-11 01:49:45.230881109 +0000
@@ -39,4 +39,4 @@
 
 AS_CPPFLAGS +=	-D__STDC__ -D_ASM -DPIC -D_REENTRANT -D$(MACH) $(IFLAGS) \
 		-DBSTORE_SIZE=65536 -DPANTHER_ONLY
-ASFLAGS =	-P -K pic
+ASFLAGS =	-P $(AS_PICFLAGS)
--- old/usr/src/lib/libc/capabilities/sun4u/Makefile.com	2018-10-11 01:49:45.676867947 +0000
+++ new/usr/src/lib/libc/capabilities/sun4u/Makefile.com	2018-10-11 01:49:45.693643704 +0000
@@ -36,7 +36,7 @@
 		-I$(ROOT)/usr/platform/$(GEN_PLATFORM)/include
 
 AS_CPPFLAGS +=	-D__STDC__ -D_ASM -DPIC -D_REENTRANT -D$(MACH) $(IFLAGS)
-ASFLAGS =	-P -K pic
+ASFLAGS =	-P $(AS_PICFLAGS)
 
 # memcpy.s provides __align_cpy_1 as an alias for memcpy.  However, this isn't
 # a WEAK symbol, and hence ld(1)'s ability to cull duplicate local symbols with
--- old/usr/src/lib/libc/capabilities/sun4v-hwcap1/Makefile.com	2018-10-11 01:49:46.157007477 +0000
+++ new/usr/src/lib/libc/capabilities/sun4v-hwcap1/Makefile.com	2018-10-11 01:49:46.175075625 +0000
@@ -38,7 +38,7 @@
 
 AS_CPPFLAGS +=	-D__STDC__ -D_ASM -DPIC -D_REENTRANT -D$(MACH) $(IFLAGS) \
 		-DNIAGARA_IMPL
-ASFLAGS =	-P -K pic
+ASFLAGS =	-P $(AS_PICFLAGS)
 
 # memcpy.s provides __align_cpy_1 as an alias for memcpy.  However, this isn't
 # a WEAK symbol, and hence ld(1)'s ability to cull duplicate local symbols with
--- old/usr/src/lib/libc/capabilities/sun4v-hwcap2/Makefile.com	2018-10-11 01:49:46.626621728 +0000
+++ new/usr/src/lib/libc/capabilities/sun4v-hwcap2/Makefile.com	2018-10-11 01:49:46.643870843 +0000
@@ -38,7 +38,7 @@
 
 AS_CPPFLAGS +=	-D__STDC__ -D_ASM -DPIC -D_REENTRANT -D$(MACH) $(IFLAGS) \
 		-DNIAGARA2_IMPL
-ASFLAGS =	-P -K pic
+ASFLAGS =	-P $(AS_PICFLAGS)
 
 # memcpy.s provides __align_cpy_1 as an alias for memcpy.  However, this isn't
 # a WEAK symbol, and hence ld(1)'s ability to cull duplicate local symbols with
--- old/usr/src/lib/libc/sparc/Makefile.com	2018-10-11 01:49:47.104251318 +0000
+++ new/usr/src/lib/libc/sparc/Makefile.com	2018-10-11 01:49:47.121270480 +0000
@@ -1130,7 +1130,7 @@
 CFLAGS +=	$(EXTN_CFLAGS)
 CPPFLAGS=	-D_REENTRANT -Dsparc $(EXTN_CPPFLAGS) $(THREAD_DEBUG) \
 		-I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
-ASFLAGS=	$(EXTN_ASFLAGS) -K pic -P -D__STDC__ -D_ASM $(CPPFLAGS) $(sparc_AS_XARCH)
+ASFLAGS=	$(EXTN_ASFLAGS) $(AS_PICFLAGS) -P -D__STDC__ -D_ASM $(CPPFLAGS) $(sparc_AS_XARCH)
 
 # As a favor to the dtrace syscall provider, libc still calls the
 # old syscall traps that have been obsoleted by the *at() interfaces.
@@ -1382,7 +1382,7 @@
 	$(POST_PROCESS_O)
 
 $(LIBCBASE)/crt/_rtbootld.s:	$(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.c
-	$(CC) $(CPPFLAGS) $(CTF_FLAGS) -O -S -K pic \
+	$(CC) $(CPPFLAGS) $(CTF_FLAGS) -O -S $(C_PICFLAGS) \
 	    $(LIBCBASE)/crt/_rtld.c -o $(LIBCBASE)/crt/_rtld.s
 	$(CAT) $(LIBCBASE)/crt/_rtboot.s $(LIBCBASE)/crt/_rtld.s > $@
 	$(RM) $(LIBCBASE)/crt/_rtld.s
--- old/usr/src/lib/libc/sparcv9/Makefile.com	2018-10-11 01:49:47.657217438 +0000
+++ new/usr/src/lib/libc/sparcv9/Makefile.com	2018-10-11 01:49:47.674642043 +0000
@@ -1067,11 +1067,11 @@
 
 MAPFILES =	$(LIBCDIR)/port/mapfile-vers
 
-sparcv9_C_PICFLAGS= -K PIC
+sparcv9_C_PICFLAGS= $(sparcv9_C_BIGPICFLAGS)
 CFLAGS64 +=	$(EXTN_CFLAGS)
 CPPFLAGS=	-D_REENTRANT -Dsparc $(EXTN_CPPFLAGS) $(THREAD_DEBUG) \
 		-I$(LIBCBASE)/inc -I$(LIBCDIR)/inc $(CPPFLAGS.master)
-ASFLAGS=	$(EXTN_ASFLAGS) -K PIC -P -D__STDC__ -D_ASM -D__sparcv9 $(CPPFLAGS) \
+ASFLAGS=	$(EXTN_ASFLAGS) $(AS_BIGPICFLAGS) -P -D__STDC__ -D_ASM -D__sparcv9 $(CPPFLAGS) \
 		$(sparcv9_AS_XARCH)
 
 # As a favor to the dtrace syscall provider, libc still calls the
--- old/usr/src/lib/libdtrace/sparc/Makefile	2018-10-11 01:49:48.199470056 +0000
+++ new/usr/src/lib/libdtrace/sparc/Makefile	2018-10-11 01:49:48.217880090 +0000
@@ -23,7 +23,7 @@
 # Use is subject to license terms.
 #
 
-ASFLAGS += -D_ASM -K PIC -P
+ASFLAGS += -D_ASM $(AS_BIGPICFLAGS) -P
 
 include ../Makefile.com
 
--- old/usr/src/lib/libdtrace/sparcv9/Makefile	2018-10-11 01:49:48.676718203 +0000
+++ new/usr/src/lib/libdtrace/sparcv9/Makefile	2018-10-11 01:49:48.693299017 +0000
@@ -23,7 +23,7 @@
 # Use is subject to license terms.
 #
 
-ASFLAGS += -D_ASM -K PIC -P
+ASFLAGS += -D_ASM $(AS_BIGPICFLAGS) -P
 
 include ../Makefile.com
 include ../../Makefile.lib.64
--- old/usr/src/lib/libdtrace_jni/Makefile.com	2018-10-11 01:49:49.129372996 +0000
+++ new/usr/src/lib/libdtrace_jni/Makefile.com	2018-10-11 01:49:49.146692634 +0000
@@ -46,8 +46,8 @@
 CPPFLAGS += -I../common -I.
 CPPFLAGS += -I$(JAVA_ROOT)/include -I$(JAVA_ROOT)/include/solaris
 CPPFLAGS += -I../java/native
-CFLAGS += $(CCVERBOSE) -K PIC
-CFLAGS64 += $(CCVERBOSE) -K PIC
+CFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS)
+CFLAGS64 += $(CCVERBOSE) $(C_BIGPICFLAGS64)
 
 CERRWARN += -_gcc=-Wno-uninitialized
 
--- old/usr/src/lib/libndmp/sparcv9/Makefile	2018-10-11 01:49:49.611582192 +0000
+++ new/usr/src/lib/libndmp/sparcv9/Makefile	2018-10-11 01:49:49.628281914 +0000
@@ -11,10 +11,10 @@
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
 # are met:
-# 	- Redistributions of source code must retain the above copyright
+#	- Redistributions of source code must retain the above copyright
 #	  notice, this list of conditions and the following disclaimer.
 #
-# 	- Redistributions in binary form must reproduce the above copyright
+#	- Redistributions in binary form must reproduce the above copyright
 #	  notice, this list of conditions and the following disclaimer in
 #	  the documentation and/or other materials provided with the
 #	  distribution.
@@ -39,6 +39,6 @@
 include ../Makefile.com
 include $(SRC)/lib/Makefile.lib.64
 
-sparcv9_C_PICFLAGS= -K PIC
+sparcv9_C_PICFLAGS= $(sparcv9_C_BIGPICFLAGS)
 
 install: all $(ROOTLIBS64) $(ROOTLINKS64)
--- old/usr/src/lib/libnsl/sparcv9/Makefile	2018-10-11 01:49:50.063963577 +0000
+++ new/usr/src/lib/libnsl/sparcv9/Makefile	2018-10-11 01:49:50.081802023 +0000
@@ -23,8 +23,6 @@
 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 
 include ../Makefile.com
 include ../../Makefile.lib.64
@@ -33,7 +31,6 @@
 # the whole 64-bit library with PIC instead of "generically" compiling
 # large parts of the 32-bit library with PIC unnecessarily.
 
-sparcv9_C_PICFLAGS = -K PIC
-sparcv9_CC_PICFLAGS = -KPIC
+sparcv9_C_PICFLAGS = $(sparcv9_C_BIGPICFLAGS)
 
 install: all $(ROOTLIBS64) $(ROOTLINKS64)
--- old/usr/src/lib/libresolv2/sparcv9/Makefile	2018-10-11 01:49:50.516880640 +0000
+++ new/usr/src/lib/libresolv2/sparcv9/Makefile	2018-10-11 01:49:50.533546100 +0000
@@ -22,17 +22,15 @@
 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
 #
 
 include ../Makefile.com
 include ../../Makefile.lib.64
 
 # With the adition of BIND 8.3.3, the symbol table for 64 bit went over
-# the limit for Kpic, so we've added -KPIC here, for just the 64 bit 
+# the limit for Kpic, so we've added -KPIC here, for just the 64 bit
 # library. This avoids compiling the 32-bit library with PIC unnecessarily.
 
-sparcv9_C_PICFLAGS = -K PIC
-sparcv9_CC_PICFLAGS = -KPIC
+sparcv9_C_PICFLAGS = $(sparcv9_C_BIGPICFLAGS)
 
 install: all $(ROOTLIBS64) $(ROOTLINKS64)
--- old/usr/src/lib/libtnfprobe/Makefile.com	2018-10-11 01:49:50.964010872 +0000
+++ new/usr/src/lib/libtnfprobe/Makefile.com	2018-10-11 01:49:50.980112464 +0000
@@ -53,7 +53,7 @@
 ROOTHDRDIR=	$(ROOT)/usr/include/tnf
 ROOTHDRS=	$(HDRS:%=$(ROOTHDRDIR)/%)
 CHECKHDRS=	$(HDRS:%.h=%.check)
-$(ROOTHDRS) := 	FILEMODE = 0644
+$(ROOTHDRS) :=	FILEMODE = 0644
 CHECKHDRS =	$(HDRS:%.h=%.check)
 
 # Include .. first to pick up tnf_trace.h in current dir, Include UFSDIR to
@@ -87,7 +87,7 @@
 $(ROOTHDRDIR)/% : %
 	$(INS.file)
 
-#ASFLAGS=	-K pic -P -D_SYS_SYS_S -D_LOCORE -D_ASM -DPIC -DLOCORE $(CPPFLAGS)
+#ASFLAGS=	$(AS_PICFLAGS) -P -D_SYS_SYS_S -D_LOCORE -D_ASM -DPIC -DLOCORE $(CPPFLAGS)
 ASFLAGS=	-P -D_SYS_SYS_S -D_LOCORE -D_ASM -DPIC -DLOCORE $(CPPFLAGS)
 BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
 
--- old/usr/src/lib/libzfs/sparcv9/Makefile	2018-10-11 01:49:51.409065416 +0000
+++ new/usr/src/lib/libzfs/sparcv9/Makefile	2018-10-11 01:49:51.425341850 +0000
@@ -23,11 +23,10 @@
 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
 
 include ../Makefile.com
 include ../../Makefile.lib.64
 
-sparcv9_C_PICFLAGS= -K PIC
+sparcv9_C_PICFLAGS= $(sparcv9_C_BIGPICFLAGS)
 
 install: all $(ROOTLIBS64) $(ROOTLINKS64)
--- old/usr/src/lib/libzfs_core/sparcv9/Makefile	2018-10-11 01:49:51.835348344 +0000
+++ new/usr/src/lib/libzfs_core/sparcv9/Makefile	2018-10-11 01:49:51.851737638 +0000
@@ -27,6 +27,6 @@
 include ../Makefile.com
 include ../../Makefile.lib.64
 
-sparcv9_C_PICFLAGS= -K PIC
+sparcv9_C_PICFLAGS= $(sparcv9_C_BIGPICFLAGS)
 
 install: all $(ROOTLIBS64) $(ROOTLINKS64)
--- old/usr/src/lib/smbsrv/libmlsvc/sparc/Makefile	2018-10-11 01:49:52.293498651 +0000
+++ new/usr/src/lib/smbsrv/libmlsvc/sparc/Makefile	2018-10-11 01:49:52.310554668 +0000
@@ -26,8 +26,7 @@
 
 # With compiling with gcc, the symbol table goes over
 # the limit for Kpic, so we add -KPIC here.
-$(__GNUC)sparc_C_PICFLAGS =	-K PIC
-$(__GNUC)sparc_CC_PICFLAGS =	-KPIC
+$(__GNUC)sparc_C_PICFLAGS =	$(sparc_C_BIGPICFLAGS)
 
 DYNFLAGS +=	-R/usr/lib/smbsrv
 
--- old/usr/src/lib/smbsrv/libmlsvc/sparcv9/Makefile	2018-10-11 01:49:52.765870972 +0000
+++ new/usr/src/lib/smbsrv/libmlsvc/sparcv9/Makefile	2018-10-11 01:49:52.783054190 +0000
@@ -22,8 +22,6 @@
 # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-# ident	"%Z%%M%	%I%	%E% SMI"
-#
 
 MACH_LDLIBS +=	-L$(ROOT)/usr/lib/smbsrv/$(MACH64)
 
@@ -33,8 +31,7 @@
 # With the adition of BIND 8.3.3, the symbol table for 64 bit went over
 # the limit for Kpic, so we add -KPIC here, for just the 64 bit SPARC
 # library. This avoids compiling the 32-bit library with PIC unnecessarily.
-sparcv9_C_PICFLAGS =	-K PIC
-sparcv9_CC_PICFLAGS =	-KPIC
+sparcv9_C_PICFLAGS =	$(sparcv9_C_BIGPICFLAGS)
 
 DYNFLAGS +=	-R/usr/lib/smbsrv/$(MACH64)
 
--- old/usr/src/lib/smbsrv/libsmbrp/sparcv9/Makefile	2018-10-11 01:49:53.216435893 +0000
+++ new/usr/src/lib/smbsrv/libsmbrp/sparcv9/Makefile	2018-10-11 01:49:53.232882191 +0000
@@ -29,8 +29,7 @@
 # With the adition of BIND 8.3.3, the symbol table for 64 bit went over
 # the limit for Kpic, so we add -KPIC here, for just the 64 bit SPARC
 # library. This avoids compiling the 32-bit library with PIC unnecessarily.
-sparcv9_C_PICFLAGS =	-K PIC
-sparcv9_CC_PICFLAGS =	-KPIC
+sparcv9_C_PICFLAGS =	$(sparcv9_C_BIGPICFLAGS)
 
 $(ROOTLIBDIR64):
 	$(INS.dir)
--- old/usr/src/tools/cw/cw.c	2018-10-11 01:49:53.663288859 +0000
+++ new/usr/src/tools/cw/cw.c	2018-10-11 01:49:53.679685022 +0000
@@ -71,8 +71,6 @@
  * -I<dir>	Add <dir> to preprocessor #include file search path
  * -i		Passed to linker to ignore any LD_LIBRARY_PATH setting
  * -keeptmp	Keep temporary files created during compilation
- * -KPIC	Compile position independent code with 32-bit addresses
- * -Kpic	Compile position independent code
  * -L<dir>	Pass to linker to add <dir> to the library search path
  * -l<name>	Link with library lib<name>.a or lib<name>.so
  * -mc		Remove duplicate strings from .comment section of output files
@@ -180,8 +178,6 @@
  * -I<dir>			pass-thru
  * -i				pass-thru
  * -keeptmp			-save-temps
- * -KPIC			-fPIC
- * -Kpic			-fpic
  * -L<dir>			pass-thru
  * -l<name>			pass-thru
  * -mc				error
@@ -567,7 +563,7 @@
 do_gcc(cw_ictx_t *ctx)
 {
 	int c;
-	int pic = 0, nolibc = 0;
+	int nolibc = 0;
 	int in_output = 0, seen_o = 0, c_files = 0;
 	cw_op_t op = CW_O_LINK;
 	char *model = NULL;
@@ -703,6 +699,14 @@
 			}
 			error(arg);
 			break;
+		case 'f':
+			if ((strcmp(arg, "-fpic") == 0) ||
+			    (strcmp(arg, "-fPIC") == 0)) {
+				newae(ctx->i_ae, arg);
+				break;
+			}
+			error(arg);
+			break;
 		case 'g':
 			newae(ctx->i_ae, "-gdwarf-2");
 			break;
@@ -819,27 +823,6 @@
 			}
 			error(arg);
 			break;
-		case 'K':
-			if (arglen == 1) {
-				if ((arg = *++ctx->i_oldargv) == NULL ||
-				    *arg == '\0')
-					error("-K");
-				ctx->i_oldargc--;
-			} else {
-				arg += 2;
-			}
-			if (strcmp(arg, "pic") == 0) {
-				newae(ctx->i_ae, "-fpic");
-				pic = 1;
-				break;
-			}
-			if (strcmp(arg, "PIC") == 0) {
-				newae(ctx->i_ae, "-fPIC");
-				pic = 1;
-				break;
-			}
-			error("-K");
-			break;
 		case 'm':
 			if (strcmp(arg, "-mt") == 0) {
 				newae(ctx->i_ae, "-D_REENTRANT");
@@ -986,8 +969,6 @@
 			}
 			if (strncmp(arg, "-Wc,-xcode=", 11) == 0) {
 				xlate(ctx->i_ae, arg + 11, xcode_tbl);
-				if (strncmp(arg + 11, "pic", 3) == 0)
-					pic = 1;
 				break;
 			}
 			if (strncmp(arg, "-Wc,-Qiselect", 13) == 0) {
@@ -1064,8 +1045,6 @@
 				}
 				if (strncmp(arg, "-xcode=", 7) == 0) {
 					xlate(ctx->i_ae, arg + 7, xcode_tbl);
-					if (strncmp(arg + 7, "pic", 3) == 0)
-						pic = 1;
 					break;
 				}
 				if (strncmp(arg, "-xcrossfile", 11) == 0)
@@ -1288,7 +1267,7 @@
 	    (ctx->i_flags & CW_F_SHADOW))
 		exit(0);
 
-	if (model && !pic)
+	if (model != NULL)
 		newae(ctx->i_ae, model);
 	if (!nolibc)
 		newae(ctx->i_ae, "-lc");
--- old/usr/src/ucbcmd/sbcp/Makefile	2018-10-11 01:49:54.184905516 +0000
+++ new/usr/src/ucbcmd/sbcp/Makefile	2018-10-11 01:49:54.201698403 +0000
@@ -41,7 +41,7 @@
 LIBUCB=		../../ucblib/libucb/sparc/libucb.so.1
 
 # need libc/sparc/inc for PIC.h
-ASFLAGS=	-P -D_ASM -DPIC -K pic
+ASFLAGS=	-P -D_ASM -DPIC $(AS_PICFLAGS)
 LDFLAGS=	-R /usr/4lib:/usr/ucblib -e _start -G -t \
 		$(BLOCAL) $(ZNOVERSION) $(ZDEFS) $(ZTEXT) \
 		-I/usr/lib/ld.so.1
