summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorRichard Lowe <richlowe@richlowe.net>2018-02-11 21:47:18 +0000
committerRichard Lowe <richlowe@richlowe.net>2018-10-11 22:43:46 +0000
commite1bf37b1abeb6653a6e35e2bd6924131cced1efe (patch)
treee9a3d8a4d258db31c91c111dcede64a011e4055d /usr/src
parenta5d83f5b2c771c419ad216ce0358fbeee032fc32 (diff)
downloadillumos-joyent-e1bf37b1abeb6653a6e35e2bd6924131cced1efe.tar.gz
9884 cw(1) should use -fpic rather than -Kpic
Reviewed by: Jason King <jason.brian.king@gmail.com> Reviewed by: Andy Stormont <andyjstormont@gmail.com> Reviewed by: Toomas Soome <tsoome@me.com> Reviewed by: John Levon <john.levon@joyent.com> Approved by: Garrett D'Amore <garrett@damore.org>
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/Makefile.master29
-rw-r--r--usr/src/cmd/sgs/Makefile.com4
-rw-r--r--usr/src/cmd/sgs/rtld/sparc/Makefile2
-rw-r--r--usr/src/cmd/sgs/rtld/sparcv9/Makefile6
-rw-r--r--usr/src/lib/c_synonyms/amd64/Makefile4
-rw-r--r--usr/src/lib/c_synonyms/i386/Makefile4
-rw-r--r--usr/src/lib/c_synonyms/sparc/Makefile4
-rw-r--r--usr/src/lib/c_synonyms/sparcv9/Makefile4
-rw-r--r--usr/src/lib/efcode/engine/sparcv9/Makefile4
-rw-r--r--usr/src/lib/fm/libmdesc/Makefile.com4
-rw-r--r--usr/src/lib/gss_mechs/mech_krb5/Makefile2
-rw-r--r--usr/src/lib/libast/amd64/Makefile2
-rw-r--r--usr/src/lib/libast/i386/Makefile2
-rw-r--r--usr/src/lib/libast/sparc/Makefile2
-rw-r--r--usr/src/lib/libast/sparcv9/Makefile2
-rw-r--r--usr/src/lib/libbc/sparc/Makefile24
-rw-r--r--usr/src/lib/libc/capabilities/sun4u-opl/Makefile.com2
-rw-r--r--usr/src/lib/libc/capabilities/sun4u-us3-hwcap1/Makefile.com2
-rw-r--r--usr/src/lib/libc/capabilities/sun4u-us3-hwcap2/Makefile.com2
-rw-r--r--usr/src/lib/libc/capabilities/sun4u/Makefile.com2
-rw-r--r--usr/src/lib/libc/capabilities/sun4v-hwcap1/Makefile.com2
-rw-r--r--usr/src/lib/libc/capabilities/sun4v-hwcap2/Makefile.com2
-rw-r--r--usr/src/lib/libc/sparc/Makefile.com4
-rw-r--r--usr/src/lib/libc/sparcv9/Makefile.com4
-rw-r--r--usr/src/lib/libdtrace/sparc/Makefile2
-rw-r--r--usr/src/lib/libdtrace/sparcv9/Makefile2
-rw-r--r--usr/src/lib/libdtrace_jni/Makefile.com4
-rw-r--r--usr/src/lib/libndmp/sparcv9/Makefile6
-rw-r--r--usr/src/lib/libnsl/sparcv9/Makefile5
-rw-r--r--usr/src/lib/libresolv2/sparcv9/Makefile6
-rw-r--r--usr/src/lib/libtnfprobe/Makefile.com4
-rw-r--r--usr/src/lib/libzfs/sparcv9/Makefile3
-rw-r--r--usr/src/lib/libzfs_core/sparcv9/Makefile2
-rw-r--r--usr/src/lib/smbsrv/libmlsvc/sparc/Makefile3
-rw-r--r--usr/src/lib/smbsrv/libmlsvc/sparcv9/Makefile5
-rw-r--r--usr/src/lib/smbsrv/libsmbrp/sparcv9/Makefile3
-rw-r--r--usr/src/tools/cw/cw.c41
-rw-r--r--usr/src/ucbcmd/sbcp/Makefile2
38 files changed, 83 insertions, 124 deletions
diff --git a/usr/src/Makefile.master b/usr/src/Makefile.master
index b2eb30ec16..e23b888d46 100644
--- a/usr/src/Makefile.master
+++ b/usr/src/Makefile.master
@@ -890,30 +890,31 @@ CCMT= -mt
# 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
diff --git a/usr/src/cmd/sgs/Makefile.com b/usr/src/cmd/sgs/Makefile.com
index 6964761a4e..9230fd96de 100644
--- a/usr/src/cmd/sgs/Makefile.com
+++ b/usr/src/cmd/sgs/Makefile.com
@@ -66,8 +66,8 @@ CPPFLAGS = -I. -I../common -I../../include -I../../include/$(MACH) \
$(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)
diff --git a/usr/src/cmd/sgs/rtld/sparc/Makefile b/usr/src/cmd/sgs/rtld/sparc/Makefile
index d2630c52db..d3af26fc0b 100644
--- a/usr/src/cmd/sgs/rtld/sparc/Makefile
+++ b/usr/src/cmd/sgs/rtld/sparc/Makefile
@@ -68,7 +68,7 @@ include $(SRC)/cmd/sgs/rtld/Makefile.com
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
diff --git a/usr/src/cmd/sgs/rtld/sparcv9/Makefile b/usr/src/cmd/sgs/rtld/sparcv9/Makefile
index 0093a7b86e..d9863462a7 100644
--- a/usr/src/cmd/sgs/rtld/sparcv9/Makefile
+++ b/usr/src/cmd/sgs/rtld/sparcv9/Makefile
@@ -40,11 +40,11 @@ P_MACHOBJS= sparc_elf.o _setup.o
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 @@ include $(SRC)/lib/Makefile.lib.64
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)
diff --git a/usr/src/lib/c_synonyms/amd64/Makefile b/usr/src/lib/c_synonyms/amd64/Makefile
index 5cfacdba09..f7402f33aa 100644
--- a/usr/src/lib/c_synonyms/amd64/Makefile
+++ b/usr/src/lib/c_synonyms/amd64/Makefile
@@ -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
diff --git a/usr/src/lib/c_synonyms/i386/Makefile b/usr/src/lib/c_synonyms/i386/Makefile
index 0670d3021e..56e547b520 100644
--- a/usr/src/lib/c_synonyms/i386/Makefile
+++ b/usr/src/lib/c_synonyms/i386/Makefile
@@ -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
diff --git a/usr/src/lib/c_synonyms/sparc/Makefile b/usr/src/lib/c_synonyms/sparc/Makefile
index f9643fd890..93df1b115c 100644
--- a/usr/src/lib/c_synonyms/sparc/Makefile
+++ b/usr/src/lib/c_synonyms/sparc/Makefile
@@ -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
diff --git a/usr/src/lib/c_synonyms/sparcv9/Makefile b/usr/src/lib/c_synonyms/sparcv9/Makefile
index 13d51d128a..0f5cceeeb9 100644
--- a/usr/src/lib/c_synonyms/sparcv9/Makefile
+++ b/usr/src/lib/c_synonyms/sparcv9/Makefile
@@ -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
diff --git a/usr/src/lib/efcode/engine/sparcv9/Makefile b/usr/src/lib/efcode/engine/sparcv9/Makefile
index af568ee0b3..3673ac4986 100644
--- a/usr/src/lib/efcode/engine/sparcv9/Makefile
+++ b/usr/src/lib/efcode/engine/sparcv9/Makefile
@@ -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)
diff --git a/usr/src/lib/fm/libmdesc/Makefile.com b/usr/src/lib/fm/libmdesc/Makefile.com
index 7d3f814c59..c09447e182 100644
--- a/usr/src/lib/fm/libmdesc/Makefile.com
+++ b/usr/src/lib/fm/libmdesc/Makefile.com
@@ -50,8 +50,8 @@ LIBS = $(DYNLIB) $(LINTLIB)
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
diff --git a/usr/src/lib/gss_mechs/mech_krb5/Makefile b/usr/src/lib/gss_mechs/mech_krb5/Makefile
index 6d5fa74ac8..c725934855 100644
--- a/usr/src/lib/gss_mechs/mech_krb5/Makefile
+++ b/usr/src/lib/gss_mechs/mech_krb5/Makefile
@@ -39,7 +39,7 @@ include ../../Makefile.lib
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
diff --git a/usr/src/lib/libast/amd64/Makefile b/usr/src/lib/libast/amd64/Makefile
index 0419980509..baa59970af 100644
--- a/usr/src/lib/libast/amd64/Makefile
+++ b/usr/src/lib/libast/amd64/Makefile
@@ -38,7 +38,7 @@ OBJDIRS = \
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)
diff --git a/usr/src/lib/libast/i386/Makefile b/usr/src/lib/libast/i386/Makefile
index 309ec29f43..f601e12e04 100644
--- a/usr/src/lib/libast/i386/Makefile
+++ b/usr/src/lib/libast/i386/Makefile
@@ -37,7 +37,7 @@ OBJDIRS = \
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)
diff --git a/usr/src/lib/libast/sparc/Makefile b/usr/src/lib/libast/sparc/Makefile
index 63d22de006..54f6ad2f28 100644
--- a/usr/src/lib/libast/sparc/Makefile
+++ b/usr/src/lib/libast/sparc/Makefile
@@ -38,7 +38,7 @@ OBJDIRS = \
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)
diff --git a/usr/src/lib/libast/sparcv9/Makefile b/usr/src/lib/libast/sparcv9/Makefile
index 6a680ee6c6..ec4370867f 100644
--- a/usr/src/lib/libast/sparcv9/Makefile
+++ b/usr/src/lib/libast/sparcv9/Makefile
@@ -39,7 +39,7 @@ OBJDIRS = \
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)
diff --git a/usr/src/lib/libbc/sparc/Makefile b/usr/src/lib/libbc/sparc/Makefile
index c624b62c2f..b35b87a3f4 100644
--- a/usr/src/lib/libbc/sparc/Makefile
+++ b/usr/src/lib/libbc/sparc/Makefile
@@ -44,7 +44,7 @@ utime.o
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 @@ calloc.o malloc.o \
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 @@ creat.o execve.o getpgrp.o link.o mkdir.o \
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 @@ CERRWARN += -_gcc=-Wno-address
$(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 @@ BUILD.AR= $(RM) $@ ; \
$(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 @@ CLEANFILES= ../libc/yp/ypupdate_prot.c ../inc/include/rpcsvc/ypupdate_prot.h \
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 @@ s5pics:
# 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 @@ s5pics/yp_update.o : ../inc/include/rpcsvc/ypupdate_prot.h ../libc/yp/yp_update.
$(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)
diff --git a/usr/src/lib/libc/capabilities/sun4u-opl/Makefile.com b/usr/src/lib/libc/capabilities/sun4u-opl/Makefile.com
index 0080c16a0e..c50532689c 100644
--- a/usr/src/lib/libc/capabilities/sun4u-opl/Makefile.com
+++ b/usr/src/lib/libc/capabilities/sun4u-opl/Makefile.com
@@ -37,4 +37,4 @@ IFLAGS = -I$(SRC)/uts/$(GEN_PLATFORM) \
-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)
diff --git a/usr/src/lib/libc/capabilities/sun4u-us3-hwcap1/Makefile.com b/usr/src/lib/libc/capabilities/sun4u-us3-hwcap1/Makefile.com
index b459a6ac2d..1dab8dae63 100644
--- a/usr/src/lib/libc/capabilities/sun4u-us3-hwcap1/Makefile.com
+++ b/usr/src/lib/libc/capabilities/sun4u-us3-hwcap1/Makefile.com
@@ -39,4 +39,4 @@ MAPFILE-CAP += ../../$(TRG_PLATFORM)/common/mapfile-cap
AS_CPPFLAGS += -D__STDC__ -D_ASM -DPIC -D_REENTRANT -D$(MACH) $(IFLAGS) \
-DBSTORE_SIZE=256
-ASFLAGS = -P -K pic
+ASFLAGS = -P $(AS_PICFLAGS)
diff --git a/usr/src/lib/libc/capabilities/sun4u-us3-hwcap2/Makefile.com b/usr/src/lib/libc/capabilities/sun4u-us3-hwcap2/Makefile.com
index 039b50259c..6620a802f3 100644
--- a/usr/src/lib/libc/capabilities/sun4u-us3-hwcap2/Makefile.com
+++ b/usr/src/lib/libc/capabilities/sun4u-us3-hwcap2/Makefile.com
@@ -39,4 +39,4 @@ MAPFILE-CAP += ../../$(TRG_PLATFORM)/common/mapfile-cap
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)
diff --git a/usr/src/lib/libc/capabilities/sun4u/Makefile.com b/usr/src/lib/libc/capabilities/sun4u/Makefile.com
index 0d8a28bfa1..033f0dc43e 100644
--- a/usr/src/lib/libc/capabilities/sun4u/Makefile.com
+++ b/usr/src/lib/libc/capabilities/sun4u/Makefile.com
@@ -36,7 +36,7 @@ IFLAGS = -I$(SRC)/uts/$(GEN_PLATFORM) \
-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
diff --git a/usr/src/lib/libc/capabilities/sun4v-hwcap1/Makefile.com b/usr/src/lib/libc/capabilities/sun4v-hwcap1/Makefile.com
index 0b1a16be84..8e7800a6d2 100644
--- a/usr/src/lib/libc/capabilities/sun4v-hwcap1/Makefile.com
+++ b/usr/src/lib/libc/capabilities/sun4v-hwcap1/Makefile.com
@@ -38,7 +38,7 @@ IFLAGS = -I$(SRC)/uts/$(GEN_PLATFORM) \
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
diff --git a/usr/src/lib/libc/capabilities/sun4v-hwcap2/Makefile.com b/usr/src/lib/libc/capabilities/sun4v-hwcap2/Makefile.com
index af1273234c..a652b280be 100644
--- a/usr/src/lib/libc/capabilities/sun4v-hwcap2/Makefile.com
+++ b/usr/src/lib/libc/capabilities/sun4v-hwcap2/Makefile.com
@@ -38,7 +38,7 @@ IFLAGS = -I$(SRC)/uts/$(GEN_PLATFORM) \
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
diff --git a/usr/src/lib/libc/sparc/Makefile.com b/usr/src/lib/libc/sparc/Makefile.com
index 92efd03df5..3513856775 100644
--- a/usr/src/lib/libc/sparc/Makefile.com
+++ b/usr/src/lib/libc/sparc/Makefile.com
@@ -1130,7 +1130,7 @@ MAPFILES = $(LIBCDIR)/port/mapfile-vers
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 @@ $(STRETS:%=pics/%): $(LIBCBASE)/crt/stret.s
$(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
diff --git a/usr/src/lib/libc/sparcv9/Makefile.com b/usr/src/lib/libc/sparcv9/Makefile.com
index b756ad5ab2..39f4b4be28 100644
--- a/usr/src/lib/libc/sparcv9/Makefile.com
+++ b/usr/src/lib/libc/sparcv9/Makefile.com
@@ -1067,11 +1067,11 @@ $(DYNLIB) := BUILD.SO = $(LD) -o $@ -G $(DYNFLAGS) $(PICS) $(ALTPICS) $(EXTPICS)
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
diff --git a/usr/src/lib/libdtrace/sparc/Makefile b/usr/src/lib/libdtrace/sparc/Makefile
index 6065e14810..4c4ad06f89 100644
--- a/usr/src/lib/libdtrace/sparc/Makefile
+++ b/usr/src/lib/libdtrace/sparc/Makefile
@@ -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
diff --git a/usr/src/lib/libdtrace/sparcv9/Makefile b/usr/src/lib/libdtrace/sparcv9/Makefile
index a45f315e94..d22653cb31 100644
--- a/usr/src/lib/libdtrace/sparcv9/Makefile
+++ b/usr/src/lib/libdtrace/sparcv9/Makefile
@@ -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
diff --git a/usr/src/lib/libdtrace_jni/Makefile.com b/usr/src/lib/libdtrace_jni/Makefile.com
index 9d605b3c59..471746866f 100644
--- a/usr/src/lib/libdtrace_jni/Makefile.com
+++ b/usr/src/lib/libdtrace_jni/Makefile.com
@@ -46,8 +46,8 @@ SRCDIR = ../common
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
diff --git a/usr/src/lib/libndmp/sparcv9/Makefile b/usr/src/lib/libndmp/sparcv9/Makefile
index b84fb15f9e..c0e1bf7d54 100644
--- a/usr/src/lib/libndmp/sparcv9/Makefile
+++ b/usr/src/lib/libndmp/sparcv9/Makefile
@@ -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)
diff --git a/usr/src/lib/libnsl/sparcv9/Makefile b/usr/src/lib/libnsl/sparcv9/Makefile
index da1777943b..249857bc50 100644
--- a/usr/src/lib/libnsl/sparcv9/Makefile
+++ b/usr/src/lib/libnsl/sparcv9/Makefile
@@ -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 @@ include ../../Makefile.lib.64
# 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)
diff --git a/usr/src/lib/libresolv2/sparcv9/Makefile b/usr/src/lib/libresolv2/sparcv9/Makefile
index ceed393e0d..2095629575 100644
--- a/usr/src/lib/libresolv2/sparcv9/Makefile
+++ b/usr/src/lib/libresolv2/sparcv9/Makefile
@@ -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)
diff --git a/usr/src/lib/libtnfprobe/Makefile.com b/usr/src/lib/libtnfprobe/Makefile.com
index 9dd31dd6f6..f0fe5a2658 100644
--- a/usr/src/lib/libtnfprobe/Makefile.com
+++ b/usr/src/lib/libtnfprobe/Makefile.com
@@ -53,7 +53,7 @@ HDRS= com.h writer.h probe.h
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 @@ $(ROOTLIBDIR) $(ROOTHDRDIR):
$(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 $@
diff --git a/usr/src/lib/libzfs/sparcv9/Makefile b/usr/src/lib/libzfs/sparcv9/Makefile
index 24010f6fb4..fc812ba170 100644
--- a/usr/src/lib/libzfs/sparcv9/Makefile
+++ b/usr/src/lib/libzfs/sparcv9/Makefile
@@ -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)
diff --git a/usr/src/lib/libzfs_core/sparcv9/Makefile b/usr/src/lib/libzfs_core/sparcv9/Makefile
index c5b6ca49b4..fc812ba170 100644
--- a/usr/src/lib/libzfs_core/sparcv9/Makefile
+++ b/usr/src/lib/libzfs_core/sparcv9/Makefile
@@ -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)
diff --git a/usr/src/lib/smbsrv/libmlsvc/sparc/Makefile b/usr/src/lib/smbsrv/libmlsvc/sparc/Makefile
index afc42f3dbc..5f4cf20982 100644
--- a/usr/src/lib/smbsrv/libmlsvc/sparc/Makefile
+++ b/usr/src/lib/smbsrv/libmlsvc/sparc/Makefile
@@ -26,8 +26,7 @@ include ../Makefile.com
# 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
diff --git a/usr/src/lib/smbsrv/libmlsvc/sparcv9/Makefile b/usr/src/lib/smbsrv/libmlsvc/sparcv9/Makefile
index e18b286b0a..745535f9a9 100644
--- a/usr/src/lib/smbsrv/libmlsvc/sparcv9/Makefile
+++ b/usr/src/lib/smbsrv/libmlsvc/sparcv9/Makefile
@@ -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 @@ 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 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)
diff --git a/usr/src/lib/smbsrv/libsmbrp/sparcv9/Makefile b/usr/src/lib/smbsrv/libsmbrp/sparcv9/Makefile
index d138cfc574..89460e9b3c 100644
--- a/usr/src/lib/smbsrv/libsmbrp/sparcv9/Makefile
+++ b/usr/src/lib/smbsrv/libsmbrp/sparcv9/Makefile
@@ -29,8 +29,7 @@ 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 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)
diff --git a/usr/src/tools/cw/cw.c b/usr/src/tools/cw/cw.c
index de3a57dcb9..4e09752e79 100644
--- a/usr/src/tools/cw/cw.c
+++ b/usr/src/tools/cw/cw.c
@@ -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 @@ static void
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 @@ do_gcc(cw_ictx_t *ctx)
}
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 @@ do_gcc(cw_ictx_t *ctx)
}
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 @@ do_gcc(cw_ictx_t *ctx)
}
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 @@ do_gcc(cw_ictx_t *ctx)
}
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 @@ do_gcc(cw_ictx_t *ctx)
(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");
diff --git a/usr/src/ucbcmd/sbcp/Makefile b/usr/src/ucbcmd/sbcp/Makefile
index 8417665637..ce1bf79e32 100644
--- a/usr/src/ucbcmd/sbcp/Makefile
+++ b/usr/src/ucbcmd/sbcp/Makefile
@@ -41,7 +41,7 @@ LIBBC= ../../lib/libbc/sparc/libc.so.1.9
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