diff options
author | John Sonnenschein <johns@joyent.com> | 2012-11-07 22:04:45 +0000 |
---|---|---|
committer | John Sonnenschein <johns@joyent.com> | 2012-11-07 22:04:45 +0000 |
commit | ad2a40e16d2bee59cfe84f89db3ce92b9f15adff (patch) | |
tree | bc8e23c4588b29e4602a54b72dbe2f1d8786468d | |
parent | b5f683274309a9c6f46eea8ce5d0cca514d977a8 (diff) | |
parent | 7c45eec5760d4195b6b85770e7ac51c380adfb8a (diff) | |
download | illumos-joyent-ad2a40e16d2bee59cfe84f89db3ce92b9f15adff.tar.gz |
Illumos sync
1874 files changed, 13989 insertions, 3111 deletions
@@ -1,4 +1,4 @@ -illumos gate README - Sept 12, 2010. +illumos gate README - Sep 16, 2012. This is the illumos gate. This is the illumos source tree. It contains the following subdirectories: @@ -12,7 +12,7 @@ the following subdirectories: Integration Rules: - All changes must have been reviewed, and approved by and advocate + All changes must have been reviewed, and approved by an advocate (below). A code review may be performed by someone other than the advocate, but the final integration should still be approved by the advocate. @@ -24,27 +24,26 @@ Integration Rules: All changes must adhere to typical ON style and quality rules. For example, pass full cstyle, applicable lint rules, etc. - All commits must include either a CDDL license, unless - approved otherwise by the gatekeeper, or the modified code - already carries a different license. Exceptions shall require - the approval of the gatekeeper. + All new code must be licensed under CDDL, and modifications to existing + code may not alter the original license terms. Integrations of code + from upstream sources that use another liberal open source license are + permissible, subject to approval of the advocates or developer council. + Exceptions to this policy shall require the approval of the developer + council. - Hg commits should have comments of the following form: + Commits should have comments of the following form: 1234 This is a sample bug report synopsis - 4567 If you have a second bug synopsis... - Reviewed by: codereviewer@somewhere.net - Approved by: gatekeeper@somewhere.else.com + 4567 If you have a second bug synopsis… + Reviewed by: Frodo Baggins <frodo.baggins@underhill.net> + Reviewed by: Legolas <elf-coder@mirkwood.org> + Approved by: Gandalf The Grey <rti-advocate@white-council.com> Each commit must have at least one bug id that is listed in the illumos-gate project at www.illumos.org. -Branches: - - Please talk to the gatekeeper about personal branches. In general, - they will be allowed as long as we don't go *too* wild on them. - -Gatekeeper: garrett@nexenta.com (Interim) -IRC channel: #illumos on irc.freenode.net -Mailing list: developer@lists.illumos.org +RTI Advocates: advocates@lists.illumos.org +Developer Council: developer-council@lists.illumos.org +IRC channel: #illumos on irc.freenode.net +Mailing list: developer@lists.illumos.org diff --git a/usr/src/Makefile.master b/usr/src/Makefile.master index c225c7a49d..eba667bf3a 100644 --- a/usr/src/Makefile.master +++ b/usr/src/Makefile.master @@ -127,29 +127,11 @@ $(TONICBUILD)CLOSEDROOT= $(ROOT)-closed # compiler is primary, and control the versions of the given compilers to be # used. They also allow compiler-version specific Makefile fragments. # -# __SSNEXT when set to the empty string enables options specific to the 'next' -# version of the Sun Studio compiler. -# -# __GNUC3 when the empty string uses and refers to GCC 3.x, it is the default. -# __GNUC4 when the empty string uses and refers to GCC 4.x. __GNUC= $(POUND_SIGN) $(__GNUC)__SUNC= $(POUND_SIGN) __GNUC64= $(__GNUC) -__SSNEXT= $(POUND_SIGN) - -__GNUC3= -__GNUC4= $(POUND_SIGN) -$(__GNUC4)__GNUC3= $(POUND_SIGN) - -# set __GNUC4 in the environment to build with GCC 4.4 These two variables are -# operative even when __GNUC is not, as they affect flags that will be used by -# the shadow compile. -__GNUC3= -__GNUC4= $(POUND_SIGN) -$(__GNUC4)__GNUC3= $(POUND_SIGN) - # CLOSED is the root of the tree that contains source which isn't released # as open source CLOSED= $(SRC)/../closed @@ -167,11 +149,12 @@ SFWINCDIR= $(SFW_ROOT)/include SFWLIBDIR= $(SFW_ROOT)/lib SFWLIBDIR64= $(SFW_ROOT)/lib/$(MACH64) -$(__GNUC3)GCC_ROOT= $(SFW_ROOT) -$(__GNUC4)GCC_ROOT= /opt/gcc/4.4.4 +GCC_ROOT= /opt/gcc/4.4.4 GCCLIBDIR= $(GCC_ROOT)/lib GCCLIBDIR64= $(GCC_ROOT)/lib/$(MACH64) +DOCBOOK_XSL_ROOT= /usr/share/sgml/docbook/xsl-stylesheets + RPCGEN= /usr/bin/rpcgen STABS= $(ONBLD_TOOLS)/bin/$(MACH)/stabs ELFEXTRACT= $(ONBLD_TOOLS)/bin/$(MACH)/elfextract @@ -219,9 +202,8 @@ CTFFINDMOD= $(ONBLD_TOOLS)/bin/ctffindmod XREF= $(ONBLD_TOOLS)/bin/xref FIND= /usr/bin/find PERL= /usr/bin/perl -PYTHON_24= /usr/bin/python2.4 PYTHON_26= /usr/bin/python2.6 -PYTHON= $(PYTHON_24) +PYTHON= $(PYTHON_26) SORT= /usr/bin/sort TOUCH= /usr/bin/touch WC= /usr/bin/wc @@ -358,12 +340,16 @@ CCABS32= -Wc,-xcode=abs32 # # generate v9 code which tolerates callers using the v7 ABI, for the sake of # system calls. -$(__GNUC4)CC32BITCALLERS= -_gcc=-massume-32bit-callers +CC32BITCALLERS= -_gcc=-massume-32bit-callers # GCC, especially, is increasingly beginning to auto-inline functions and # sadly does so separately not under the general -fno-inline-functions -$(__GNUC4)CCNOAUTOINLINE= -_gcc=-fno-inline-small-functions \ - -_gcc=-fno-inline-functions-called-once +# Additionally, we wish to prevent optimisations which cause GCC to clone +# functions -- in particular, these may cause unhelpful symbols to be +# emitted instead of function names +CCNOAUTOINLINE= -_gcc=-fno-inline-small-functions \ + -_gcc=-fno-inline-functions-called-once \ + -_gcc=-fno-ipa-cp # One optimization the compiler might perform is to turn this: # #pragma weak foo @@ -430,9 +416,19 @@ CERRWARN = -errtags=yes -errwarn=%all CERRWARN += -erroff=E_EMPTY_TRANSLATION_UNIT CERRWARN += -erroff=E_STATEMENT_NOT_REACHED -# Normally cw(1) would translate -v into a set of options including these -# but as they're GCC 4.x specific, we can't do that -$(__GNUC4)CERRWARN += -_gcc=-Wno-address -_gcc=-Wno-array-bounds +CERRWARN += -_gcc=-Wno-missing-braces +CERRWARN += -_gcc=-Wno-sign-compare +CERRWARN += -_gcc=-Wno-unknown-pragmas +CERRWARN += -_gcc=-Wno-unused-parameter +CERRWARN += -_gcc=-Wno-missing-field-initializers + +# Unfortunately, this option can misfire very easily and unfixably. +CERRWARN += -_gcc=-Wno-array-bounds + +# DEBUG v. -nd make for frequent unused variables, empty conditions, etc. in +# -nd builds +$(RELEASE_BUILD)CERRWARN += -_gcc=-Wno-unused +$(RELEASE_BUILD)CERRWARN += -_gcc=-Wno-empty-body # # turn warnings into errors (C++) @@ -502,7 +498,16 @@ DEBUGFORMAT= -xdebugformat=stabs # CTF_FLAGS_sparc = -g -Wc,-Qiselect-T1 $(C99MODE) $(CNOGLOBAL) $(CDWARFSTR) CTF_FLAGS_i386 = -g $(C99MODE) $(CNOGLOBAL) $(CDWARFSTR) -CTF_FLAGS = $(CTF_FLAGS_$(MACH)) $(DEBUGFORMAT) + +CTF_FLAGS_sparcv9 = $(CTF_FLAGS_sparc) +CTF_FLAGS_amd64 = $(CTF_FLAGS_i386) + +# 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 = $(CTF_FLAGS_32) # # Flags used with genoffsets diff --git a/usr/src/Makefile.master.64 b/usr/src/Makefile.master.64 index 42bc62e679..5bfd0e6b76 100644 --- a/usr/src/Makefile.master.64 +++ b/usr/src/Makefile.master.64 @@ -37,6 +37,8 @@ LINK.c= $(LINK64.c) LINK.cc= $(LINK64.cc) LINT.c= $(LINT64.c) +CTF_FLAGS= $(CTF_FLAGS_64) + OFFSETS_CREATE= $(OFFSETS_CREATE64) # @@ -83,8 +85,7 @@ MAPFILECLASS= -64 CCNEEDED = -lCrun $(__GNUC64)CCNEEDED = -L$(GCCLIBDIR) -R$(GCCLIBDIR) -lstdc++ -$(__GNUC64)$(__GNUC3)CCNEEDED += -lgcc_s_$(MACH64) -$(__GNUC64)$(__GNUC4)CCNEEDED += -lgcc_s +$(__GNUC64)CCNEEDED += -lgcc_s BUILDCCC.SO= $(CCC) $(CCFLAGS) -o $@ $(GSHARED) $(DYNFLAGS) \ $(PICS) $(EXTPICS) $(LDLIBS) $(CCNEEDED) diff --git a/usr/src/cmd/abi/appcert/static_prof/Makefile.com b/usr/src/cmd/abi/appcert/static_prof/Makefile.com index 3d9f48b25c..98d2d4f524 100644 --- a/usr/src/cmd/abi/appcert/static_prof/Makefile.com +++ b/usr/src/cmd/abi/appcert/static_prof/Makefile.com @@ -23,8 +23,6 @@ # Copyright (c) 1997-2000 by Sun Microsystems, Inc. # All rights reserved. # -#ident "%Z%%M% %I% %E% SMI" -# # cmd/abi/appcert/static_prof/Makefile.com # @@ -35,6 +33,8 @@ SRCS = $(PROG:%=../%.c) # CPPFLAGS = -I.. CFLAGS += $(LDLIBS) +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-parentheses LDLIBS = -lelf LINTFLAGS = -nmxsuF -errtags=yes diff --git a/usr/src/cmd/abi/spectrans/parser/Makefile.targ b/usr/src/cmd/abi/spectrans/parser/Makefile.targ index c00da5548c..59837ab138 100644 --- a/usr/src/cmd/abi/spectrans/parser/Makefile.targ +++ b/usr/src/cmd/abi/spectrans/parser/Makefile.targ @@ -23,10 +23,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# -# cmd/abi/spectrans/util/Makefile.targ -# .KEEP_STATE: @@ -45,6 +41,10 @@ LINTFLAGS += -xsuF -errtags=yes CLEANFILES += $(LINTOUT) CLOBBERFILES += $(LINTLIB) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + objs/%.o: ../%.c $(COMPILE.c) -o $@ $< $(POST_PROCESS_O) diff --git a/usr/src/cmd/abi/spectrans/spec2map/Makefile.targ b/usr/src/cmd/abi/spectrans/spec2map/Makefile.targ index eba87b10e7..fe7c3a7883 100644 --- a/usr/src/cmd/abi/spectrans/spec2map/Makefile.targ +++ b/usr/src/cmd/abi/spectrans/spec2map/Makefile.targ @@ -20,12 +20,9 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1997-1999 by Sun Microsystems, Inc. # All rights reserved. # -# cmd/abi/spectrans/spec2map/Makefile.targ .KEEP_STATE: @@ -37,3 +34,5 @@ OBJECTS = xlator.o \ util.o include ../../Makefile.cmd + +CERRWARN += -_gcc=-Wno-switch diff --git a/usr/src/cmd/abi/spectrans/spec2trace/Makefile.targ b/usr/src/cmd/abi/spectrans/spec2trace/Makefile.targ index 18d83707af..2ff10bcdaa 100644 --- a/usr/src/cmd/abi/spectrans/spec2trace/Makefile.targ +++ b/usr/src/cmd/abi/spectrans/spec2trace/Makefile.targ @@ -20,12 +20,9 @@ # CDDL HEADER END # # -#pragma ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1997-1999 by Sun Microsystems, Inc. # All rights reserved. # -# cmd/abi/spectrans/spec2trace/Makefile.targ .KEEP_STATE: @@ -45,6 +42,11 @@ OBJECTS = trace.o \ include ../../Makefile.cmd +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-label + parseproto := RM = @echo keeping # do not remove generated C code parseproto := COPTFLAG = -g -DDEBUG -DMEM_DEBUG -DTRACE parseproto: parseproto.o diff --git a/usr/src/cmd/acct/Makefile b/usr/src/cmd/acct/Makefile index 5ff39fa0d6..6db56fbdcf 100644 --- a/usr/src/cmd/acct/Makefile +++ b/usr/src/cmd/acct/Makefile @@ -88,6 +88,11 @@ $(LIBACCTD)/accton := FILEMODE= 04755 $(ETCINITPROG) := FILEMODE= 0744 $(ETCACCTPROG) := FILEMODE= 0644 +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-address + .KEEP_STATE: .PARALLEL: $(ALL) diff --git a/usr/src/cmd/acct/lib/Makefile b/usr/src/cmd/acct/lib/Makefile index 162b3c99d2..c7e94d6c0d 100644 --- a/usr/src/cmd/acct/lib/Makefile +++ b/usr/src/cmd/acct/lib/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989 by Sun Microsystems, Inc. # # @@ -34,6 +32,9 @@ SRCS= $(OBJS:%.o=%.c) include ../../Makefile.cmd CPPFLAGS = -D_LTYPES -I.. $(CPPFLAGS.master) +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-extra .KEEP_STATE: diff --git a/usr/src/cmd/acctadm/Makefile b/usr/src/cmd/acctadm/Makefile index be6466cd3f..6055a32f2b 100644 --- a/usr/src/cmd/acctadm/Makefile +++ b/usr/src/cmd/acctadm/Makefile @@ -35,6 +35,8 @@ include ../Makefile.cmd ROOTMANIFESTDIR = $(ROOTSVCSYSTEM) CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses LDLIBS += -lexacct -lscf -lsecdb -ldladm POFILE = acctadm.po XGETFLAGS = -a -x acctadm.xcl diff --git a/usr/src/cmd/addbadsec/Makefile b/usr/src/cmd/addbadsec/Makefile index 5afbc88995..a4d48dbad2 100644 --- a/usr/src/cmd/addbadsec/Makefile +++ b/usr/src/cmd/addbadsec/Makefile @@ -32,6 +32,8 @@ include ../Makefile.cmd CPPFLAGS += -D_EXTVTOC +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/allocate/Makefile b/usr/src/cmd/allocate/Makefile index 789730c4b7..41339cdde6 100644 --- a/usr/src/cmd/allocate/Makefile +++ b/usr/src/cmd/allocate/Makefile @@ -27,6 +27,11 @@ ETCTSOLFILES = devalloc_defaults include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-clobbered + ROOTSEC = $(ROOTETC)/security ROOTSECDEV = $(ROOTSEC)/dev ROOTSECLIB = $(ROOTSEC)/lib diff --git a/usr/src/cmd/amt/Makefile.com b/usr/src/cmd/amt/Makefile.com index d3519687af..a3a7691e4c 100644 --- a/usr/src/cmd/amt/Makefile.com +++ b/usr/src/cmd/amt/Makefile.com @@ -20,13 +20,9 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# cmd/amt/Makefile.com -# PROG= amt OBJS= amt.o @@ -39,6 +35,8 @@ LDLIBS += -lelf LINTFLAGS += -erroff=E_NAME_USED_NOT_DEF2 LINTFLAGS64 += -erroff=E_NAME_USED_NOT_DEF2 +CERRWARN += -_gcc=-Wno-uninitialized + CLEANFILES += $(PROG) $(OBJS) .KEEP_STATE: diff --git a/usr/src/cmd/ast/msgcc/Makefile b/usr/src/cmd/ast/msgcc/Makefile index a5f1f24df5..1198c6184f 100644 --- a/usr/src/cmd/ast/msgcc/Makefile +++ b/usr/src/cmd/ast/msgcc/Makefile @@ -47,6 +47,10 @@ CPPFLAGS = \ CFLAGS += \ $(ASTCFLAGS) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-empty-body +CERRWARN += -_gcc=-Wno-uninitialized + LDLIBS += -last msgcpp := LDLIBS += -lpp diff --git a/usr/src/cmd/audio/audioctl/Makefile b/usr/src/cmd/audio/audioctl/Makefile index 8d6a9212a7..f9c6b65c8b 100644 --- a/usr/src/cmd/audio/audioctl/Makefile +++ b/usr/src/cmd/audio/audioctl/Makefile @@ -30,6 +30,7 @@ include ../../Makefile.cmd LDLIBS += -ldevinfo CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/cmd/audio/audioplay/Makefile b/usr/src/cmd/audio/audioplay/Makefile index a60da712f1..f899ec0e32 100644 --- a/usr/src/cmd/audio/audioplay/Makefile +++ b/usr/src/cmd/audio/audioplay/Makefile @@ -23,9 +23,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" -# -# Makefile for cmd/audio/audioplay PROG= audioplay @@ -40,6 +37,8 @@ LDLIBS += -laudio -lm LDFLAGS += -L../utilities CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized LINTFLAGS += -m -v -u $(LDFLAGS) diff --git a/usr/src/cmd/audio/audiorecord/Makefile b/usr/src/cmd/audio/audiorecord/Makefile index f1b2d8aaa5..910d48f955 100644 --- a/usr/src/cmd/audio/audiorecord/Makefile +++ b/usr/src/cmd/audio/audiorecord/Makefile @@ -23,9 +23,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# -# Makefile for cmd/audio/audiorecord PROG= audiorecord @@ -40,6 +37,7 @@ LDLIBS += -laudio -lm LDFLAGS += -L../utilities CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses LINTFLAGS += -m -v -u $(LDFLAGS) diff --git a/usr/src/cmd/audio/utilities/Makefile b/usr/src/cmd/audio/utilities/Makefile index bc50c948af..40da0a01f5 100644 --- a/usr/src/cmd/audio/utilities/Makefile +++ b/usr/src/cmd/audio/utilities/Makefile @@ -33,6 +33,9 @@ INCLUDES += -I../include CPPFLAGS += $(INCLUDES) CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses LINTFLAGS += -m -v -u diff --git a/usr/src/cmd/auditconfig/Makefile b/usr/src/cmd/auditconfig/Makefile index fa563ae5b9..54d9e8e6b0 100644 --- a/usr/src/cmd/auditconfig/Makefile +++ b/usr/src/cmd/auditconfig/Makefile @@ -38,6 +38,8 @@ POFILE = $(PROG).po MSGFILES = $(SRCS) CPPFLAGS += -I$(LIBBSM) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses .KEEP_STATE: diff --git a/usr/src/cmd/auditd/Makefile b/usr/src/cmd/auditd/Makefile index 3a3df0394f..be82c21abc 100644 --- a/usr/src/cmd/auditd/Makefile +++ b/usr/src/cmd/auditd/Makefile @@ -37,6 +37,8 @@ AUDITD = $(SRC)/cmd/auditd CPPFLAGS += -D_REENTRANT CPPFLAGS += -I$(LIBBSM) -I$(AUDITD) +CERRWARN += -_gcc=-Wno-parentheses + LDLIBS += -lbsm -lsecdb OBJS = auditd.o doorway.o queue.o diff --git a/usr/src/cmd/auditreduce/Makefile b/usr/src/cmd/auditreduce/Makefile index 4808a0d28e..e84d51d229 100644 --- a/usr/src/cmd/auditreduce/Makefile +++ b/usr/src/cmd/auditreduce/Makefile @@ -41,6 +41,9 @@ MSGFILES = $(SRCS) CPPFLAGS += -I$(TABLEDIR) -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 LDLIBS += -lnsl -lbsm -lscf -ltsol +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/auditstat/Makefile b/usr/src/cmd/auditstat/Makefile index 5f91b34739..99328ef576 100644 --- a/usr/src/cmd/auditstat/Makefile +++ b/usr/src/cmd/auditstat/Makefile @@ -41,6 +41,8 @@ POFILE = $(PROG).po LDLIBS += -lbsm CPPFLAGS += -I$(STATCOMMONDIR) +CERRWARN += -_gcc=-Wno-extra + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/auths/Makefile b/usr/src/cmd/auths/Makefile index 131eee0687..8e9d3c9c49 100644 --- a/usr/src/cmd/auths/Makefile +++ b/usr/src/cmd/auths/Makefile @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= auths SRCS= $(PROG:%=%.c) @@ -31,6 +29,8 @@ AUTHS= auths include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-parentheses + ROOTBINAUTHS = $(AUTHS:%=$(ROOTBIN)/%) .KEEP_STATE: diff --git a/usr/src/cmd/autopush/Makefile b/usr/src/cmd/autopush/Makefile index d5bc8d8051..4ff7a09068 100644 --- a/usr/src/cmd/autopush/Makefile +++ b/usr/src/cmd/autopush/Makefile @@ -23,14 +23,14 @@ # Copyright 1989,2003 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= autopush ROOTFS_PROG= $(PROG) include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(ROOTFS_PROG) diff --git a/usr/src/cmd/avs/dsbitmap/Makefile b/usr/src/cmd/avs/dsbitmap/Makefile index b00d148bf6..2b9380995e 100644 --- a/usr/src/cmd/avs/dsbitmap/Makefile +++ b/usr/src/cmd/avs/dsbitmap/Makefile @@ -35,7 +35,8 @@ OBJS= dsbitmap.o SRCS= $(OBJS:%.o=%.c) POFILE= $(OBJS:%.o=%.po) -CFLAGS += -v +CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += -lunistat -ladm LINTFLAGS += -Xa -n -s -x -m -u -Dlint -errhdr=%user LINTFLAGS += -erroff=E_SEC_PRINTF_VAR_FMT diff --git a/usr/src/cmd/avs/dscfg/Makefile b/usr/src/cmd/avs/dscfg/Makefile index 78f6879106..9b4a1eff03 100644 --- a/usr/src/cmd/avs/dscfg/Makefile +++ b/usr/src/cmd/avs/dscfg/Makefile @@ -38,7 +38,9 @@ SUBDIRS= etc OBJS= dscfg.o -CFLAGS += -v -D_SYSCALL32 +CFLAGS += $(CCVERBOSE) -D_SYSCALL32 +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-address LDLIBS += -ldscfg -lunistat LINTFLAGS += -Xa -n -s -x -m -u -Dlint -errhdr=%user -D_SYSCALL32 LINTFLAGS += -erroff=E_NOP_ELSE_STMT -erroff=E_FUNC_SET_NOT_USED diff --git a/usr/src/cmd/avs/dscfglockd/Makefile b/usr/src/cmd/avs/dscfglockd/Makefile index 08c1a0a171..3d7c3e008e 100644 --- a/usr/src/cmd/avs/dscfglockd/Makefile +++ b/usr/src/cmd/avs/dscfglockd/Makefile @@ -40,7 +40,8 @@ POFILES= $(OBJS:%.o=%.po) dscfgcli := LDLIBS += -ldscfg -lnsl dscfglockd := LDLIBS += -lunistat -ldscfg -lsocket -lnsl -CFLAGS += -v -D_RDC_ -D_SYSCALL32 +CFLAGS += $(CCVERBOSE) -D_RDC_ -D_SYSCALL32 +CERRWARN += -_gcc=-Wno-switch LINTFLAGS += -Xa -n -s -x -m -u -Dlint -errhdr=%user -D_RDC_ -D_SYSCALL32 LINTFLAGS += -DDEBUG -erroff=E_SEC_SCANF_UNBOUNDED_COPY LINTDIR = $(KBASE)/lintdir diff --git a/usr/src/cmd/avs/dsstat/Makefile b/usr/src/cmd/avs/dsstat/Makefile index f5da5be4d6..11ddd8c9a9 100644 --- a/usr/src/cmd/avs/dsstat/Makefile +++ b/usr/src/cmd/avs/dsstat/Makefile @@ -39,8 +39,12 @@ OBJS= dsstat.o ii_stats.o sndr_stats.o sdbc_stats.o \ multi_stats.o common.o report.o SRCS= $(OBJS:%.o=%.c) -CFLAGS += -v -LDLIBS += -lkstat +CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-clobbered +LDLIBS += -L/usr/lib -lkstat LINTFLAGS += -Xa -n -s -x -m -u -Dlint -errhdr=%user LINTFLAGS += -erroff=E_SEC_PRINTF_VAR_FMT -erroff=E_SEC_SPRINTF_UNBOUNDED_COPY LINTDIR = $(KBASE)/lintdir diff --git a/usr/src/cmd/avs/dsw/Makefile b/usr/src/cmd/avs/dsw/Makefile index 8667b2feba..7dced4b925 100644 --- a/usr/src/cmd/avs/dsw/Makefile +++ b/usr/src/cmd/avs/dsw/Makefile @@ -51,10 +51,13 @@ POFILE = dsw_all.po SRCS= $(OBJS:%.o=%.c) POFILES= $(OBJS:%.o=%.po) -CFLAGS += -v -D_DSW_ +CFLAGS += $(CCVERBOSE) -D_DSW_ LINTFLAGS += -Xa -n -s -x -m -u -Dlint -errhdr=%user -D_DSW_ -DDEBUG LINTFLAGS += -erroff=E_SEC_SCANF_UNBOUNDED_COPY LINTFLAGS += -erroff=E_SEC_PRINTF_VAR_FMT +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized all := TARGET= all install := TARGET= install diff --git a/usr/src/cmd/avs/errgen/Makefile b/usr/src/cmd/avs/errgen/Makefile index a0d41ede51..f37035c367 100644 --- a/usr/src/cmd/avs/errgen/Makefile +++ b/usr/src/cmd/avs/errgen/Makefile @@ -31,6 +31,7 @@ PROG= $(DYNPROG) OBJS= errgen.o CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-switch LINTFLAGS += -erroff=E_SEC_SPRINTF_UNBOUNDED_COPY .KEEP_STATE: diff --git a/usr/src/cmd/avs/ncall/Makefile b/usr/src/cmd/avs/ncall/Makefile index c9c6d78735..30bffc0513 100644 --- a/usr/src/cmd/avs/ncall/Makefile +++ b/usr/src/cmd/avs/ncall/Makefile @@ -46,7 +46,8 @@ LINTFLAGS += -erroff=E_NAME_USED_NOT_DEF2 LINTFLAGS += -erroff=E_BAD_FORMAT_ARG_TYPE2 LINTFLAGS += -erroff=E_FUNC_RET_ALWAYS_IGNOR2 LINTDIR = $(KBASE)/lintdir -CFLAGS += -v -D_SYSCALL32 -D__NCALL__ +CFLAGS += $(CCVERBOSE) -D_SYSCALL32 -D__NCALL__ +CERRWARN += -_gcc=-Wno-uninitialized ROOTLINK = $(ROOTLIB)/$(PROG) all := TARGET= all diff --git a/usr/src/cmd/avs/rdc/Makefile b/usr/src/cmd/avs/rdc/Makefile index 92c2586136..1148884422 100644 --- a/usr/src/cmd/avs/rdc/Makefile +++ b/usr/src/cmd/avs/rdc/Makefile @@ -55,13 +55,16 @@ sndrboot := LDLIBS += -lrdc -lunistat -ldscfg sndrd := LDLIBS += -lrdc -lnsl sndrsyncd := LDLIBS += -lrdc -ldscfg -lunistat -CFLAGS += -v -D_RDC_ -D_SYSCALL32 +CFLAGS += $(CCVERBOSE) -D_RDC_ -D_SYSCALL32 LINTFLAGS += -Xa -n -s -x -m -u -Dlint -errhdr=%user -D_RDC_ -D_SYSCALL32 LINTFLAGS += -DDEBUG LINTFLAGS += -erroff=E_SEC_SPRINTF_UNBOUNDED_COPY LINTFLAGS += -erroff=E_SEC_SCANF_UNBOUNDED_COPY LINTFLAGS += -erroff=E_SEC_PRINTF_VAR_FMT LINTFLAGS += -erroff=E_FUNC_SET_NOT_USED +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized POFILE = rdc_all.po POFILES = sndradm.po sndrboot.po ROOTLIBLINKS = $(ROOTLIB)/sndrd $(ROOTLIB)/sndrsyncd diff --git a/usr/src/cmd/avs/sdbc/Makefile b/usr/src/cmd/avs/sdbc/Makefile index d14f03cb96..97cc48f5a1 100644 --- a/usr/src/cmd/avs/sdbc/Makefile +++ b/usr/src/cmd/avs/sdbc/Makefile @@ -59,7 +59,7 @@ sd_stats := LDLIBS += -lunistat -lcurses sd_diag := LDLIBS += -lnsctl sdbc_dynmem := LDLIBS += -lkstat -CFLAGS += -v -D_SCM_ -D_SD_8K_BLKSIZE -D_SYSCALL32 +CFLAGS += $(CCVERBOSE) -D_SCM_ -D_SD_8K_BLKSIZE -D_SYSCALL32 CPPFLAGS += -DNSC_MULTI_TERABYTE LINTFLAGS += -Xa -n -s -x -m -u -Dlint -errhdr=%user LINTFLAGS += -D_SCM_ -D_SD_8K_BLKSIZE -D_SYSCALL32 @@ -68,6 +68,7 @@ LINTFLAGS += -erroff=E_SEC_SPRINTF_UNBOUNDED_COPY LINTFLAGS += -erroff=E_SEC_SCANF_UNBOUNDED_COPY LINTFLAGS += -erroff=E_SEC_FORBIDDEN_WARN_ASCFTIME LINTFLAGS += -DDEBUG +CERRWARN += -_gcc=-Wno-uninitialized ROOTLINK = $(ROOTUSRSBIN)/scmadm all := TARGET= all diff --git a/usr/src/cmd/awk/Makefile b/usr/src/cmd/awk/Makefile index a437a67e97..f0261a4bf2 100644 --- a/usr/src/cmd/awk/Makefile +++ b/usr/src/cmd/awk/Makefile @@ -20,13 +20,10 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" # # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# cmd/awk/Makefile -# # NOTE: awk is oawk. @@ -38,6 +35,13 @@ OBJS= $(OBJ2) $(OBJ1) SRCS= $(OBJ1:%.o=%.c) include ../Makefile.cmd + +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized + # # Message catalog # diff --git a/usr/src/cmd/awk_xpg4/Makefile b/usr/src/cmd/awk_xpg4/Makefile index 55d83ec956..79a85e8d04 100644 --- a/usr/src/cmd/awk_xpg4/Makefile +++ b/usr/src/cmd/awk_xpg4/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -43,6 +41,9 @@ include ../Makefile.cmd CPPFLAGS += -D_FILE_OFFSET_BITS=64 CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized YFLAGS += -d LDLIBS += -lm CLEANFILES= awk.c y.tab.h diff --git a/usr/src/cmd/backup/Makefile.backup b/usr/src/cmd/backup/Makefile.backup index 6c6093396f..17d8986bf6 100644 --- a/usr/src/cmd/backup/Makefile.backup +++ b/usr/src/cmd/backup/Makefile.backup @@ -39,6 +39,11 @@ LINTFLAGS= -errchk=%all,longptr64 -errhdr=%user -F -m \ #CSTYLEFLAGS= -c -h -p -v -P CSTYLEFLAGS= -h -p -P +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-clobbered + UFSROOTETC= $(ROOT)/etc UFSROOTUSR= $(ROOT)/usr UFSROOTUSRLIB= $(UFSROOTUSR)/lib diff --git a/usr/src/cmd/backup/dump/Makefile b/usr/src/cmd/backup/dump/Makefile index 849fbf4ef7..775127419f 100644 --- a/usr/src/cmd/backup/dump/Makefile +++ b/usr/src/cmd/backup/dump/Makefile @@ -67,6 +67,11 @@ GLOBAL= ../../../head CPPFLAGS= -I$(LOCAL) -I$(GENERAL) -I$(GLOBAL) -DPARTIAL \ -I$(ROLLDIR) $(CPPFLAGS.master) \ -D_LARGEFILE64_SOURCE=1 +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-extra LIBDUMP= ../lib/libdump.a LINTLIBDUMP= ../lib/llib-ldump.ln -lkstat LDLIBS += $(BSTATIC) -L../lib -ldump $(BDYNAMIC) \ diff --git a/usr/src/cmd/backup/lib/Makefile b/usr/src/cmd/backup/lib/Makefile index 9d02a60649..678c18d78c 100644 --- a/usr/src/cmd/backup/lib/Makefile +++ b/usr/src/cmd/backup/lib/Makefile @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libdump.a @@ -65,6 +63,10 @@ POFILES= $(OBJECTS:.o=.po) GENERAL= ../include GLOBAL= ../../../head CPPFLAGS= -I$(GENERAL) -I$(GLOBAL) $(CPPFLAGS.master) +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable LINTOUT= lint.out CLEANFILES= $(OBJECTS) $(LINTOUT) $(LINTLIB) $(DEBUGS) *.ln \ $(YSRC) $(LIBRARY) diff --git a/usr/src/cmd/bart/Makefile b/usr/src/cmd/bart/Makefile index eee36ba33e..e36bbe26cd 100644 --- a/usr/src/cmd/bart/Makefile +++ b/usr/src/cmd/bart/Makefile @@ -19,10 +19,9 @@ # CDDL HEADER END # # -#pragma ident "%Z%%M% %I% %E% SMI" -# # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. +# PROG= bart SRCS= rules.c create.c compare.c main.c lutbl.c @@ -30,7 +29,10 @@ OBJS= rules.o create.o compare.o main.o lutbl.o BART= bart include ../Makefile.cmd + LDLIBS += -lsec -lmd +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized # # for messaging catalog diff --git a/usr/src/cmd/bc/Makefile b/usr/src/cmd/bc/Makefile index 54e11a7fe0..e910d2cd59 100644 --- a/usr/src/cmd/bc/Makefile +++ b/usr/src/cmd/bc/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2003 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -37,6 +35,10 @@ CLOBBERFILES= $(LIBB) include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label + $(XPG6EXOBJS) := CFLAGS += -DXPG6 ROOTLIBB= $(LIBB:%=$(ROOTLIB)/%) $(ROOTLIBB) := FILEMODE = $(LIBFILEMODE) diff --git a/usr/src/cmd/bdiff/Makefile b/usr/src/cmd/bdiff/Makefile index 6e38d145f9..9ce2350115 100644 --- a/usr/src/cmd/bdiff/Makefile +++ b/usr/src/cmd/bdiff/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989, 1996 by Sun Microsystems, Inc. # All rights reserved. # @@ -32,7 +30,8 @@ include ../Makefile.cmd FILEMODE= 755 -CPPFLAGS +=-D_FILE_OFFSET_BITS=64 +CPPFLAGS += -D_FILE_OFFSET_BITS=64 +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/cmd/beadm/Makefile b/usr/src/cmd/beadm/Makefile index 7516dec014..8ea7ac8cae 100644 --- a/usr/src/cmd/beadm/Makefile +++ b/usr/src/cmd/beadm/Makefile @@ -31,6 +31,7 @@ POFILE= beadm.po include ../Makefile.cmd LDLIBS += -lnvpair -lbe +CERRWARN += -_gcc=-Wno-parentheses $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG diff --git a/usr/src/cmd/bfs/Makefile b/usr/src/cmd/bfs/Makefile index bc9004cbc0..fe0b1185b7 100644 --- a/usr/src/cmd/bfs/Makefile +++ b/usr/src/cmd/bfs/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989 by Sun Microsystems, Inc. # @@ -30,6 +28,9 @@ PROG= bfs include ../Makefile.cmd LDLIBS += -lgen +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/cmd/bnu/Makefile.inc b/usr/src/cmd/bnu/Makefile.inc index b98f99e34e..a8642655c2 100644 --- a/usr/src/cmd/bnu/Makefile.inc +++ b/usr/src/cmd/bnu/Makefile.inc @@ -22,10 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# -# This file is included by Makefile. The idea is to unclutter it (Makefile). -# SRCS = account.c anlwrk.c bnuconvert.c callers.c \ chremdir.c cntrl.c conn.c cpmv.c ct.c \ @@ -43,7 +39,13 @@ SRCS = account.c anlwrk.c bnuconvert.c callers.c \ uuglist.c uuname.c uusched.c uustat.c uux.c \ uuxqt.c versys.c xio.c xqt.c \ ../chmod/common.c - + +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-extra +CERRWARN += -_gcc=-Wno-implicit-function-declaration TLILIB = -lnsl -lsocket PAMLIB = -lpam diff --git a/usr/src/cmd/boot/bootadm/Makefile b/usr/src/cmd/boot/bootadm/Makefile index 2b0d2cb358..e3f67930ff 100644 --- a/usr/src/cmd/boot/bootadm/Makefile +++ b/usr/src/cmd/boot/bootadm/Makefile @@ -46,6 +46,10 @@ CFLAGS += $(XSTRCONST) CPPFLAGS += -D_FILE_OFFSET_BITS=64 CPPFLAGS += -I../../../uts/common -I../../../common +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label + LINTFLAGS += -erroff=E_INCONS_ARG_DECL2 LINTFLAGS += -erroff=E_INCONS_VAL_TYPE_DECL2 LINTFLAGS += -erroff=E_NAME_DEF_NOT_USED2 diff --git a/usr/src/cmd/boot/common/mboot_extra.c b/usr/src/cmd/boot/common/mboot_extra.c index d8f5fa346d..170d638bb5 100644 --- a/usr/src/cmd/boot/common/mboot_extra.c +++ b/usr/src/cmd/boot/common/mboot_extra.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. */ #include <stdio.h> @@ -107,7 +108,7 @@ find_multiboot(char *buffer, uint32_t buf_size, uint32_t *mboot_off) * + payload chunks), find the extended information structure. */ bblk_einfo_t * -find_einfo(char *extra) +find_einfo(char *extra, uint32_t size) { bb_header_ext_t *ext_header; bblk_einfo_t *einfo; @@ -116,6 +117,12 @@ find_einfo(char *extra) assert(extra != NULL); ext_header = (bb_header_ext_t *)extra; + if (ext_header->size > size) { + BOOT_DEBUG("Unable to find extended versioning information, " + "data size too big\n"); + return (NULL); + } + cksum = compute_checksum(extra + sizeof (bb_header_ext_t), ext_header->size); BOOT_DEBUG("Extended information header checksum is %x\n", cksum); diff --git a/usr/src/cmd/boot/common/mboot_extra.h b/usr/src/cmd/boot/common/mboot_extra.h index ba60351718..fb48c52a69 100644 --- a/usr/src/cmd/boot/common/mboot_extra.h +++ b/usr/src/cmd/boot/common/mboot_extra.h @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. */ #ifndef _MBOOT_EXTRA_H @@ -46,7 +47,7 @@ typedef struct _bb_extra_header { } bb_header_ext_t; uint32_t compute_checksum(char *, uint32_t); -bblk_einfo_t *find_einfo(char *); +bblk_einfo_t *find_einfo(char *, uint32_t); int find_multiboot(char *, uint32_t, uint32_t *); void add_einfo(char *, char *, bblk_hs_t *, uint32_t); int compare_bootblocks(char *, char *, char **); diff --git a/usr/src/cmd/boot/installboot/Makefile b/usr/src/cmd/boot/installboot/Makefile index 5dc4eb13b5..e2fcf37f84 100644 --- a/usr/src/cmd/boot/installboot/Makefile +++ b/usr/src/cmd/boot/installboot/Makefile @@ -40,6 +40,7 @@ C99MODE= -xc99=%all C99LMODE= -Xc99=%all LINTFLAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/cmd/boot/installboot/installboot.c b/usr/src/cmd/boot/installboot/installboot.c index cab6670608..2a4f48fd18 100644 --- a/usr/src/cmd/boot/installboot/installboot.c +++ b/usr/src/cmd/boot/installboot/installboot.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. */ #include <stdio.h> @@ -252,6 +253,8 @@ read_bootblock_from_disk(int dev_fd, ib_bootblock_t *bblock) bblock->mboot = (multiboot_header_t *)(bblock->buf + bblock->mboot_off + BBLK_DATA_RSVD_SIZE); bblock->extra = (char *)bblock->mboot + sizeof (multiboot_header_t); + bblock->extra_size = bblock->buf_size - bblock->mboot_off + - BBLK_DATA_RSVD_SIZE - sizeof (multiboot_header_t); return (BC_SUCCESS); } @@ -279,7 +282,7 @@ is_update_necessary(ib_data_t *data, char *updt_str) return (B_TRUE); } - einfo = find_einfo(bblock_disk.extra); + einfo = find_einfo(bblock_disk.extra, bblock_disk.extra_size); if (einfo == NULL) { BOOT_DEBUG("No extended information available\n"); return (B_TRUE); @@ -716,7 +719,7 @@ handle_getinfo(char *progname, char **argv) goto out_dev; } - einfo = find_einfo(bblock->extra); + einfo = find_einfo(bblock->extra, bblock->extra_size); if (einfo == NULL) { retval = BC_NOEINFO; (void) fprintf(stderr, gettext("No extended information " @@ -817,7 +820,7 @@ handle_mirror(char *progname, char **argv) goto out_devs; } - einfo_curr = find_einfo(bblock_curr->extra); + einfo_curr = find_einfo(bblock_curr->extra, bblock_curr->extra_size); if (einfo_curr != NULL) updt_str = einfo_get_string(einfo_curr); diff --git a/usr/src/cmd/boot/installboot/installboot.h b/usr/src/cmd/boot/installboot/installboot.h index 7b558b3846..2fa7ad2561 100644 --- a/usr/src/cmd/boot/installboot/installboot.h +++ b/usr/src/cmd/boot/installboot/installboot.h @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. */ #ifndef _INSTALLBOOT_H @@ -52,6 +53,7 @@ typedef struct _ib_bootblock { uint32_t mboot_off; uint32_t buf_size; uint32_t file_size; + uint32_t extra_size; } ib_bootblock_t; typedef struct _ib_data { diff --git a/usr/src/cmd/boot/installgrub/Makefile b/usr/src/cmd/boot/installgrub/Makefile index bf3d73ab70..4cc69eccd5 100644 --- a/usr/src/cmd/boot/installgrub/Makefile +++ b/usr/src/cmd/boot/installgrub/Makefile @@ -36,6 +36,9 @@ SBINLINKS= $(PROG) include ../Makefile.com CPPFLAGS += -I$(SRC)/uts/i86pc -I$(SRC)/uts/intel -I$(SRC)/uts/common +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += -lmd5 diff --git a/usr/src/cmd/boot/installgrub/installgrub.c b/usr/src/cmd/boot/installgrub/installgrub.c index 3df067420c..c27dca802b 100644 --- a/usr/src/cmd/boot/installgrub/installgrub.c +++ b/usr/src/cmd/boot/installgrub/installgrub.c @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2012 Milan Jurik. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. */ #include <stdio.h> @@ -403,7 +404,7 @@ handle_getinfo(char *progname, char **argv) goto out_dev; } - einfo = find_einfo(stage2->extra); + einfo = find_einfo(stage2->extra, stage2->extra_size); if (einfo == NULL) { retval = BC_NOEINFO; (void) fprintf(stderr, gettext("No extended information " @@ -501,7 +502,7 @@ handle_mirror(char *progname, char **argv) goto out_devs; } - einfo_curr = find_einfo(stage2_curr->extra); + einfo_curr = find_einfo(stage2_curr->extra, stage2_curr->extra_size); if (einfo_curr != NULL) updt_str = einfo_get_string(einfo_curr); @@ -1221,6 +1222,7 @@ read_stage2_from_disk(int dev_fd, ig_stage2_t *stage2) stage2->mboot_off = mboot_off; stage2->mboot = (multiboot_header_t *)(stage2->buf + stage2->mboot_off); stage2->extra = stage2->buf + P2ROUNDUP(stage2->file_size, 8); + stage2->extra_size = stage2->buf_size - P2ROUNDUP(stage2->file_size, 8); return (BC_SUCCESS); } @@ -1251,7 +1253,7 @@ is_update_necessary(ig_data_t *data, char *updt_str) * Look for the extended information structure in the extra payload * area. */ - einfo = find_einfo(stage2_disk.extra); + einfo = find_einfo(stage2_disk.extra, stage2_disk.extra_size); if (einfo == NULL) { BOOT_DEBUG("No extended information available\n"); return (B_TRUE); diff --git a/usr/src/cmd/boot/installgrub/installgrub.h b/usr/src/cmd/boot/installgrub/installgrub.h index e23d1c35d7..af6e60b973 100644 --- a/usr/src/cmd/boot/installgrub/installgrub.h +++ b/usr/src/cmd/boot/installgrub/installgrub.h @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. */ #ifndef _INSTALLGRUB_H @@ -53,6 +54,7 @@ typedef struct _stage2_data { multiboot_header_t *mboot; uint32_t mboot_off; uint32_t file_size; + uint32_t extra_size; uint32_t buf_size; uint32_t first_sector; uint32_t pcfs_first_sectors[2]; diff --git a/usr/src/cmd/boot/mbr/Makefile b/usr/src/cmd/boot/mbr/Makefile index 510257daac..8f18eaee27 100644 --- a/usr/src/cmd/boot/mbr/Makefile +++ b/usr/src/cmd/boot/mbr/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" -# BOOTPROG= mbr @@ -32,6 +30,8 @@ SRCS = $(OBJS:.o=.c) include ../Makefile.com +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: all: $(BOOTPROG) diff --git a/usr/src/cmd/cal/Makefile b/usr/src/cmd/cal/Makefile index c058060156..0cf3f27ba5 100644 --- a/usr/src/cmd/cal/Makefile +++ b/usr/src/cmd/cal/Makefile @@ -20,12 +20,9 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# cmd/cal/Makefile PROG= cal @@ -35,6 +32,8 @@ SED= sed DCFILE= $(PROG).dc CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/cmd/calendar/Makefile b/usr/src/cmd/calendar/Makefile index b65401d925..04aa6c8869 100644 --- a/usr/src/cmd/calendar/Makefile +++ b/usr/src/cmd/calendar/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989 by Sun Microsystems, Inc. # @@ -31,6 +29,8 @@ CLOBBERFILES = $(SHFILE) include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-implicit-function-declaration + .KEEP_STATE: all: $(PROG) $(SHFILES) diff --git a/usr/src/cmd/captoinfo/Makefile b/usr/src/cmd/captoinfo/Makefile index 562f9690fa..45313d00dd 100644 --- a/usr/src/cmd/captoinfo/Makefile +++ b/usr/src/cmd/captoinfo/Makefile @@ -23,8 +23,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= captoinfo @@ -36,6 +34,7 @@ include ../Makefile.cmd LDFLAGS += $(MAPFILE.INT:%=-M%) LDLIBS += -lcurses CPPFLAGS += -I../../lib/libcurses/screen +CERRWARN += -_gcc=-Wno-parentheses .KEEP_STATE: diff --git a/usr/src/cmd/cdrw/Makefile b/usr/src/cmd/cdrw/Makefile index 64e935b95c..cfda1f13c4 100644 --- a/usr/src/cmd/cdrw/Makefile +++ b/usr/src/cmd/cdrw/Makefile @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= cdrw @@ -39,6 +37,8 @@ SRCS= $(OBJS:.o=.c) LDLIBS += -lhal -lsecdb NONLINTLDLIBS = -ldbus-1 CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses CPPFLAGS += -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(HAL_DBUS_CPPFLAGS) LINTFLAGS += -um diff --git a/usr/src/cmd/chmod/Makefile b/usr/src/cmd/chmod/Makefile index 5e6b3fe6c4..00788f1205 100644 --- a/usr/src/cmd/chmod/Makefile +++ b/usr/src/cmd/chmod/Makefile @@ -19,13 +19,9 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# cmd/chmod/Makefile -# PROG= chmod OBJS= $(PROG).o common.o @@ -36,6 +32,8 @@ POFILES= $(OBJS:%.o=%.po) include ../Makefile.cmd CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized CPPFLAGS += -D_FILE_OFFSET_BITS=64 diff --git a/usr/src/cmd/cmd-crypto/cryptoadm/Makefile b/usr/src/cmd/cmd-crypto/cryptoadm/Makefile index e2cf6ee838..1f421601fc 100644 --- a/usr/src/cmd/cmd-crypto/cryptoadm/Makefile +++ b/usr/src/cmd/cmd-crypto/cryptoadm/Makefile @@ -40,6 +40,8 @@ POFILES = $(OBJS:%.o=%.po) POFILE = $(PROG)_all.po CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses LDLIBS += -lcryptoutil diff --git a/usr/src/cmd/cmd-crypto/decrypt/Makefile.com b/usr/src/cmd/cmd-crypto/decrypt/Makefile.com index adcb7d6f0b..f549085acf 100644 --- a/usr/src/cmd/cmd-crypto/decrypt/Makefile.com +++ b/usr/src/cmd/cmd-crypto/decrypt/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG = decrypt @@ -40,6 +38,9 @@ CFLAGS += $(CCVERBOSE) CFLAGS64 += $(CCVERBOSE) CPPFLAGS += -D_FILE_OFFSET_BITS=64 +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + LDLIBS += -lkmf -lpkcs11 -lcryptoutil .KEEP_STATE: diff --git a/usr/src/cmd/cmd-crypto/digest/Makefile.com b/usr/src/cmd/cmd-crypto/digest/Makefile.com index 72e88d10a7..ecc0652cee 100644 --- a/usr/src/cmd/cmd-crypto/digest/Makefile.com +++ b/usr/src/cmd/cmd-crypto/digest/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG = digest @@ -40,6 +38,8 @@ CFLAGS += $(CCVERBOSE) CFLAGS64 += $(CCVERBOSE) CPPFLAGS +=-D_FILE_OFFSET_BITS=64 +CERRWARN += -_gcc=-Wno-uninitialized + LDLIBS += -lkmf -lpkcs11 -lcryptoutil .KEEP_STATE: diff --git a/usr/src/cmd/cmd-crypto/pktool/Makefile b/usr/src/cmd/cmd-crypto/pktool/Makefile index d0430a4107..d33a9d5cc9 100644 --- a/usr/src/cmd/cmd-crypto/pktool/Makefile +++ b/usr/src/cmd/cmd-crypto/pktool/Makefile @@ -52,6 +52,8 @@ CPPFLAGS += -I. -I$(KMFDIR)/include -I$(ADJUNCT_PROTO)/usr/include/libxml2 \ -I$(KMFDIR)/ber_der/inc CFLAGS += $(CCVERBOSE) -DDEBUG +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label LDLIBS += -lkmf -lpkcs11 -lcryptoutil diff --git a/usr/src/cmd/cmd-inet/lib/ipmgmtd/Makefile b/usr/src/cmd/cmd-inet/lib/ipmgmtd/Makefile index 73ec4241c2..199f92807a 100644 --- a/usr/src/cmd/cmd-inet/lib/ipmgmtd/Makefile +++ b/usr/src/cmd/cmd-inet/lib/ipmgmtd/Makefile @@ -38,6 +38,9 @@ ROOTCFGDIR= $(ROOTETC)/ipadm ROOTCFGFILES= $(CFGFILES:%=$(ROOTCFGDIR)/%) ROOTMANIFESTDIR= $(ROOTSVCNETWORK) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + $(ROOTCFGFILES) := OWNER= ipadm $(ROOTCFGFILES) := GROUP= sys $(ROOTCFGFILES) := FILEMODE= 644 diff --git a/usr/src/cmd/cmd-inet/lib/nwamd/Makefile b/usr/src/cmd/cmd-inet/lib/nwamd/Makefile index fadaa28d85..28648b59bc 100644 --- a/usr/src/cmd/cmd-inet/lib/nwamd/Makefile +++ b/usr/src/cmd/cmd-inet/lib/nwamd/Makefile @@ -55,6 +55,11 @@ LDLIBS += -ldhcpagent -ldhcputil -ldladm -ldlpi -lgen \ -linetutil -lipadm -lkstat -lnsl -lnvpair -lnwam \ -lsecdb -lscf -lsocket -lsysevent -lumem -luutil +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-label + # # Instrument with CTF data to ease debugging. # diff --git a/usr/src/cmd/cmd-inet/sbin/dhcpagent/Makefile b/usr/src/cmd/cmd-inet/sbin/dhcpagent/Makefile index 5bc7b56a2b..34c68c967b 100644 --- a/usr/src/cmd/cmd-inet/sbin/dhcpagent/Makefile +++ b/usr/src/cmd/cmd-inet/sbin/dhcpagent/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" -# PROG = dhcpagent ROOTFS_PROG = $(PROG) @@ -39,6 +37,9 @@ SRCS = $(OBJS:%.o=%.c) POFILES = $(OBJS:%.o=%.po) XGETFLAGS += -a -x dhcpagent.xcl +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses + # # to compile a debug version, do a `make COPTFLAG="-g -XO0"' # diff --git a/usr/src/cmd/cmd-inet/usr.bin/Makefile b/usr/src/cmd/cmd-inet/usr.bin/Makefile index 9f44242ae9..3b01f3f109 100644 --- a/usr/src/cmd/cmd-inet/usr.bin/Makefile +++ b/usr/src/cmd/cmd-inet/usr.bin/Makefile @@ -67,6 +67,9 @@ ROOTSUIDPROG= $(SUIDPROG:%=$(ROOTBIN)/%) $(ROOTSUIDPROG) := FILEMODE= 04555 CPPFLAGS += -DSYSV -DSTRNET -DBSD_COMP -I$(CMDINETCOMMONDIR) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-function # Eventually just plain CFLAGS should be += -v, but not until all in # PROGS are lint clean. diff --git a/usr/src/cmd/cmd-inet/usr.bin/chat/Makefile b/usr/src/cmd/cmd-inet/usr.bin/chat/Makefile index 00a487f022..23766b3a65 100644 --- a/usr/src/cmd/cmd-inet/usr.bin/chat/Makefile +++ b/usr/src/cmd/cmd-inet/usr.bin/chat/Makefile @@ -2,8 +2,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= chat OBJS= chat.o @@ -13,6 +11,8 @@ include ../../../Makefile.cmd CPPFLAGS += -DSOL2 LDFLAGS += $(MAPFILE.NGB:%=-M%) +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-trigraphs .KEEP_STATE: diff --git a/usr/src/cmd/cmd-inet/usr.bin/ftp/Makefile b/usr/src/cmd/cmd-inet/usr.bin/ftp/Makefile index 9bbee08d18..91b9e2e0d7 100644 --- a/usr/src/cmd/cmd-inet/usr.bin/ftp/Makefile +++ b/usr/src/cmd/cmd-inet/usr.bin/ftp/Makefile @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG = ftp DEFAULTFILES = ftp.dfl @@ -41,6 +39,11 @@ CPPFLAGS += -D_FILE_OFFSET_BITS=64 \ -I$(SRC)/lib/gss_mechs/mech_krb5/include \ -I$(SRC)/uts/common/gssapi/mechs/krb5/include +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-address + LDLIBS += -lsocket -lnsl -lgss # ftp defines its own delete and glob - localize all symbols to prevent a diff --git a/usr/src/cmd/cmd-inet/usr.bin/nc/Makefile b/usr/src/cmd/cmd-inet/usr.bin/nc/Makefile index 97e4d49863..e67f95d52c 100644 --- a/usr/src/cmd/cmd-inet/usr.bin/nc/Makefile +++ b/usr/src/cmd/cmd-inet/usr.bin/nc/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" -# PROG= nc OBJS= atomicio.o netcat.o socks.o strtonum.o @@ -33,6 +31,7 @@ SRCS= $(OBJS:%.o=%.c) include ../../../Makefile.cmd LDLIBS += -lresolv -lsocket +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/cmd/cmd-inet/usr.bin/nca/Makefile b/usr/src/cmd/cmd-inet/usr.bin/nca/Makefile index 75d8f85858..d993fb7ec5 100644 --- a/usr/src/cmd/cmd-inet/usr.bin/nca/Makefile +++ b/usr/src/cmd/cmd-inet/usr.bin/nca/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -47,6 +45,7 @@ LINTFLAGS += $(_EXTN) INC_PATH += ../../../../uts/common/inet/nca -I. CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses CPPFLAGS += -I$(INC_PATH) .KEEP_STATE: diff --git a/usr/src/cmd/cmd-inet/usr.bin/netstat/Makefile b/usr/src/cmd/cmd-inet/usr.bin/netstat/Makefile index 47d36f1c36..10f743130a 100644 --- a/usr/src/cmd/cmd-inet/usr.bin/netstat/Makefile +++ b/usr/src/cmd/cmd-inet/usr.bin/netstat/Makefile @@ -46,6 +46,8 @@ OBJS= $(LOCALOBJS) $(COMMONOBJS) $(STAT_COMMON_OBJS) SRCS= $(LOCALSRCS) $(COMMONSRCS) $(STAT_COMMON_SRCS) CPPFLAGS += -DNDEBUG -I$(CMDINETCOMMONDIR) -I$(STATCOMMONDIR) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses LDLIBS += -ldhcpagent -lsocket -lnsl -lkstat -ltsnet -ltsol .KEEP_STATE: diff --git a/usr/src/cmd/cmd-inet/usr.bin/pppd/Makefile b/usr/src/cmd/cmd-inet/usr.bin/pppd/Makefile index 57b30cf3b5..324a3c4897 100644 --- a/usr/src/cmd/cmd-inet/usr.bin/pppd/Makefile +++ b/usr/src/cmd/cmd-inet/usr.bin/pppd/Makefile @@ -50,6 +50,8 @@ OBJS += chap_ms.o EXOBJS += mschap_test.o CLOBBERFILES += mschap_test +CERRWARN += -_gcc=-Wno-uninitialized + # This is used *only* for testing the portability of the libraries # required for MS-CHAPv1. It is not needed in any normal system and # is not built by default. diff --git a/usr/src/cmd/cmd-inet/usr.bin/pppdump/Makefile b/usr/src/cmd/cmd-inet/usr.bin/pppdump/Makefile index 2e7b195b37..c8a1732e45 100644 --- a/usr/src/cmd/cmd-inet/usr.bin/pppdump/Makefile +++ b/usr/src/cmd/cmd-inet/usr.bin/pppdump/Makefile @@ -11,6 +11,11 @@ include ../../../Makefile.cmd CPPFLAGS += -DPPP_DEFS_IN_NET +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/cmd-inet/usr.bin/rdist/Makefile b/usr/src/cmd/cmd-inet/usr.bin/rdist/Makefile index 54381cfe6d..358b559a48 100644 --- a/usr/src/cmd/cmd-inet/usr.bin/rdist/Makefile +++ b/usr/src/cmd/cmd-inet/usr.bin/rdist/Makefile @@ -47,6 +47,14 @@ CPPFLAGS += -I. -I$(CMDINETCOMMONDIR) \ -I$(SRC)/lib/gss_mechs/mech_krb5/include \ -I$(SRC)/lib/gss_mechs/mech_krb5/include/krb5 +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-uninitialized + ROOTSYMLINK= $(ROOT)/usr/ucb/$(PROG) # conditional assignments diff --git a/usr/src/cmd/cmd-inet/usr.bin/talk/Makefile b/usr/src/cmd/cmd-inet/usr.bin/talk/Makefile index 0c96c11a97..4c17b1bbf4 100644 --- a/usr/src/cmd/cmd-inet/usr.bin/talk/Makefile +++ b/usr/src/cmd/cmd-inet/usr.bin/talk/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -40,6 +38,7 @@ POFILE= talk.po # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized CPPFLAGS += -DSYSV -DSTRNET -DBSD_COMP LDLIBS += -lcurses -lsocket -lnsl diff --git a/usr/src/cmd/cmd-inet/usr.bin/telnet/Makefile b/usr/src/cmd/cmd-inet/usr.bin/telnet/Makefile index 8d5643aad2..967e6a1b6d 100644 --- a/usr/src/cmd/cmd-inet/usr.bin/telnet/Makefile +++ b/usr/src/cmd/cmd-inet/usr.bin/telnet/Makefile @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= telnet OBJS= telnet.o commands.o main.o network.o ring.o \ @@ -45,6 +43,12 @@ include ../../../Makefile.cmd CPPFLAGS += -DKLUDGELINEMODE -DUSE_TERMIO -DENV_HACK -DOLD_ENVIRON CPPFLAGS += $(AUTH_INCLUDES) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-extra +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-label LDLIBS += -lsocket -lnsl -ltermlib LDLIBS += -lmech_krb5 LDFLAGS += $(KRUNPATH) -L$(ROOT)$(KLIBDIR_DO) -L$(ROOT)$(KLIBDIR_GL) diff --git a/usr/src/cmd/cmd-inet/usr.bin/tftp/Makefile b/usr/src/cmd/cmd-inet/usr.bin/tftp/Makefile index cf900fa602..d2b5c4d87c 100644 --- a/usr/src/cmd/cmd-inet/usr.bin/tftp/Makefile +++ b/usr/src/cmd/cmd-inet/usr.bin/tftp/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989,2001 by Sun Microsystems, Inc. # All rights reserved. # @@ -34,6 +32,8 @@ include ../../../Makefile.cmd include ../../Makefile.cmd-inet CPPFLAGS += -DSYSV -DSTRNET -DBSD_COMP -I$(CMDINETCOMMONDIR) +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-parentheses LDLIBS += -lsocket -lnsl .KEEP_STATE: diff --git a/usr/src/cmd/cmd-inet/usr.lib/dsvclockd/Makefile b/usr/src/cmd/cmd-inet/usr.lib/dsvclockd/Makefile index 194afd44e6..f6c8f79b0c 100644 --- a/usr/src/cmd/cmd-inet/usr.lib/dsvclockd/Makefile +++ b/usr/src/cmd/cmd-inet/usr.lib/dsvclockd/Makefile @@ -23,8 +23,6 @@ # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG = dsvclockd OBJS = dsvclockd.o container.o datastore.o @@ -37,6 +35,7 @@ POFILES = $(OBJS:.o=.po) LDLIBS += -ldhcputil -ldhcpsvc CPPFLAGS += -D_REENTRANT +CERRWARN += -_gcc=-Wno-parentheses XGETFLAGS += -a .KEEP_STATE: diff --git a/usr/src/cmd/cmd-inet/usr.lib/ilbd/Makefile b/usr/src/cmd/cmd-inet/usr.lib/ilbd/Makefile index 4a4c482e3a..d00653d4eb 100644 --- a/usr/src/cmd/cmd-inet/usr.lib/ilbd/Makefile +++ b/usr/src/cmd/cmd-inet/usr.lib/ilbd/Makefile @@ -49,6 +49,10 @@ CPPFLAGS += -D_FILE_OFFSET_BITS=64 -I$(CMDINETCOMMONDIR) -D_REENTRANT CPPFLAGS += -I$(LIB_INC) CPPFLAGS += -I$(SRC)/uts/common +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label + C99MODE = $(C99_ENABLE) # I18n diff --git a/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilb/Makefile b/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilb/Makefile index e70830e8e8..30504eb2f5 100644 --- a/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilb/Makefile +++ b/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilb/Makefile @@ -36,6 +36,8 @@ all: $(PROG) include ../../Makefile.lib +CERRWARN += -_gcc=-Wno-uninitialized + ROOTLIBINETILB = $(ROOTLIBINET)/ilb ROOTLIBINETILBPROG = $(PROG:%=$(ROOTLIBINETILB)/%) diff --git a/usr/src/cmd/cmd-inet/usr.lib/in.dhcpd/Makefile b/usr/src/cmd/cmd-inet/usr.lib/in.dhcpd/Makefile index 3290764f9d..4b8b6a3678 100644 --- a/usr/src/cmd/cmd-inet/usr.lib/in.dhcpd/Makefile +++ b/usr/src/cmd/cmd-inet/usr.lib/in.dhcpd/Makefile @@ -55,6 +55,10 @@ LDLIBS += $(NSU_DIR)/rfc2136.so.1 -ldhcpsvc -ldhcputil -linetutil \ -lsocket -lnsl -lmtmalloc -lresolv lint := LDLIBS = $(LDLIBS.cmd) -ldhcpsvc -ldhcputil -linetutil -lsocket -lnsl +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses + # # Debugging support; toggle on if needed. # diff --git a/usr/src/cmd/cmd-inet/usr.lib/in.mpathd/Makefile b/usr/src/cmd/cmd-inet/usr.lib/in.mpathd/Makefile index f3ce9fae4b..7f08f59b90 100644 --- a/usr/src/cmd/cmd-inet/usr.lib/in.mpathd/Makefile +++ b/usr/src/cmd/cmd-inet/usr.lib/in.mpathd/Makefile @@ -46,6 +46,8 @@ CPPFLAGS += -D_XOPEN_SOURCE=600 -D__EXTENSIONS__ LDLIBS += -lsocket -lnsl -lsysevent -lnvpair -lipmp -linetutil -ldlpi LINTFLAGS += -erroff=E_INCONS_ARG_DECL2 -erroff=E_INCONS_ARG_USED2 +CERRWARN += -_gcc=-Wno-uninitialized + # # Instrument in.mpathd with CTF data to ease debugging. # diff --git a/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/Makefile b/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/Makefile index 542c79feb0..bc2815c8d7 100644 --- a/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/Makefile +++ b/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/Makefile @@ -56,6 +56,9 @@ LINTFLAGS += -erroff=E_INCONS_ARG_DECL2 -erroff=E_INCONS_VAL_TYPE_DECL2 # perfect would require a bigger rewrite. LINTFLAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + CTFCONVERT_HOOK = && $(CTFCONVERT_O) CTFMERGE_HOOK = && $(CTFMERGE) -L VERSION -o $@ $(OBJS) $(OBJS) := CFLAGS += $(CTF_FLAGS) diff --git a/usr/src/cmd/cmd-inet/usr.lib/inetd/Makefile b/usr/src/cmd/cmd-inet/usr.lib/inetd/Makefile index 69a32aa834..2065957edf 100644 --- a/usr/src/cmd/cmd-inet/usr.lib/inetd/Makefile +++ b/usr/src/cmd/cmd-inet/usr.lib/inetd/Makefile @@ -39,6 +39,9 @@ ROOTMANIFESTDIR= $(ROOTSVCNETWORK) CPPFLAGS += -D_FILE_OFFSET_BITS=64 -I$(CMDINETCOMMONDIR) -D_REENTRANT $(RELEASE_BUILD)CPPFLAGS += -DNDEBUG +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-label + LDLIBS += -lsocket -lnsl -lrestart -lscf -lcontract -linetutil \ -lwrap -linetsvc -luutil -lumem -lbsm diff --git a/usr/src/cmd/cmd-inet/usr.lib/mdnsd/Makefile b/usr/src/cmd/cmd-inet/usr.lib/mdnsd/Makefile index 5fde5a13c7..8fd9bcaf64 100644 --- a/usr/src/cmd/cmd-inet/usr.lib/mdnsd/Makefile +++ b/usr/src/cmd/cmd-inet/usr.lib/mdnsd/Makefile @@ -48,6 +48,10 @@ MDNSFLAGS= -DNOT_HAVE_DAEMON -DNOT_HAVE_SA_LEN \ include ../../../Makefile.cmd +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-uninitialized + ROOTMANIFESTDIR= $(ROOTSVCNETWORKDNS) $(ROOTMANIFEST) := FILEMODE= 444 diff --git a/usr/src/cmd/cmd-inet/usr.lib/ncaconfd/Makefile b/usr/src/cmd/cmd-inet/usr.lib/ncaconfd/Makefile index 40216bd60d..81233c5994 100644 --- a/usr/src/cmd/cmd-inet/usr.lib/ncaconfd/Makefile +++ b/usr/src/cmd/cmd-inet/usr.lib/ncaconfd/Makefile @@ -20,13 +20,9 @@ # CDDL HEADER END # # -# ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 2000 by Sun Microsystems, Inc. # All rights reserved. # -# cmd/cmd-inet/usr.lib/ncad/Makefile -# PROG = ncaconfd @@ -40,6 +36,8 @@ include ../Makefile.lib LDLIBS += -lsocket -lnsl CPPFLAGS += -I$(SRC)/uts/common/inet/nca +CERRWARN += -_gcc=-Wno-uninitialized + POFILE = ${PROG}.po install: all $(ROOTLIBINETPROG) diff --git a/usr/src/cmd/cmd-inet/usr.lib/vrrpd/Makefile b/usr/src/cmd/cmd-inet/usr.lib/vrrpd/Makefile index 664c09c922..12a621d55f 100644 --- a/usr/src/cmd/cmd-inet/usr.lib/vrrpd/Makefile +++ b/usr/src/cmd/cmd-inet/usr.lib/vrrpd/Makefile @@ -47,6 +47,8 @@ CPPFLAGS += -D_XOPEN_SOURCE=600 -D__EXTENSIONS__ LDLIBS += -lvrrpadm -lsocket -lnsl -ldladm -linetutil -lipadm -lsysevent -lnvpair -lsecdb LINTFLAGS += -erroff=E_INCONS_ARG_DECL2 -erroff=E_INCONS_ARG_USED2 +CERRWARN += -_gcc=-Wno-uninitialized + # # Instrument vrrpd with CTF data to ease debugging. # diff --git a/usr/src/cmd/cmd-inet/usr.lib/wanboot/Makefile.com b/usr/src/cmd/cmd-inet/usr.lib/wanboot/Makefile.com index b7472d34ae..aa9d03f162 100644 --- a/usr/src/cmd/cmd-inet/usr.lib/wanboot/Makefile.com +++ b/usr/src/cmd/cmd-inet/usr.lib/wanboot/Makefile.com @@ -23,12 +23,12 @@ # Copyright 2003 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# include $(SRC)/cmd/Makefile.cmd ROOTCMDDIR = $(ROOT)/usr/lib/inet/wanboot CMNCRYPTDIR = ../../../../../common/net/wanboot/crypt +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: diff --git a/usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/lib/Makefile b/usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/lib/Makefile index a29bdf1caf..5ac8ee0d63 100644 --- a/usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/lib/Makefile +++ b/usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/lib/Makefile @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= dhcpmgr.a VERS= .1 @@ -48,6 +46,9 @@ CPPFLAGS += -I../com/sun/dhcpmgr/bridge \ -I$(SRC)/common/net/dhcp \ -I. +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized + LDLIBS += -ldhcpsvc -ldhcputil -linetutil -lscf -lsocket -lresolv -lnsl -lc # definitions for i18n diff --git a/usr/src/cmd/cmd-inet/usr.sbin/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/Makefile index 44ba61f7c1..3ad19659c5 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/Makefile +++ b/usr/src/cmd/cmd-inet/usr.sbin/Makefile @@ -104,6 +104,15 @@ COMMONOBJS= addr_match.o kcmd.o store_forw_creds.o COMMONSRCS= $(COMMONOBJS:%.o=$(CMDINETCOMMONDIR)/%.c) SRCS+= $(COMMONSRCS) +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-extra +CERRWARN += -_gcc=-Wno-address + # # Message catalog # diff --git a/usr/src/cmd/cmd-inet/usr.sbin/htable/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/htable/Makefile index 259836d39b..ca3917bdac 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/htable/Makefile +++ b/usr/src/cmd/cmd-inet/usr.sbin/htable/Makefile @@ -20,11 +20,8 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989 by Sun Microsystems, Inc. # -# cmd/cmd-inet/usr.sbin/htable/Makefile PROG= htable OBJS= htable.o parse.o scan.o @@ -36,6 +33,11 @@ CPPFLAGS += -DSYSV -DSTRNET -DBSD_COMP LDLIBS += -lsocket -lnsl YFLAGS += -d +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ifconfig/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/ifconfig/Makefile index 9144fb1439..2f5b321f63 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/ifconfig/Makefile +++ b/usr/src/cmd/cmd-inet/usr.sbin/ifconfig/Makefile @@ -37,6 +37,8 @@ COMMONSRCS= $(CMDINETCOMMONDIR)/$(COMMONOBJS:%.o=%.c) SRCS= $(LOCALSRCS) $(COMMONSRCS) CPPFLAGS += -I$(CMDINETCOMMONDIR) -I$(SRC)/common/net/dhcp +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses LDLIBS += -ldhcpagent -ldlpi -linetutil -lipmp -ldladm -lipadm LINTFLAGS += -m diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/Makefile index 5b4954d341..a3afee1f15 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/Makefile +++ b/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/Makefile @@ -35,6 +35,10 @@ include ../../Makefile.cmd-inet LDLIBS += -lcmdutils -lsocket -lnsl -lilb -linetutil -lkstat CPPFLAGS += -I$(SRC)/lib/libilb/common -I$(SRC)/uts/common +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + C99MODE = $(C99_ENABLE) POFILES = $(OBJS:%.o=%.po) diff --git a/usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/Makefile index c20b6fe882..c28648fb35 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/Makefile +++ b/usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/Makefile @@ -46,6 +46,14 @@ CPPFLAGS += -DBSD_COMP -D_FILE_OFFSET_BITS=64 -DINET6 -DSOLARIS_BSM_AUDIT \ LDLIBS += -lsocket -lnsl -lpam -lbsm -lsendfile -lgss YFLAGS += -d +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-address + in.ftpd := LDFLAGS += $(MAPFILE.NGB:%=-M%) # tcov output relies on atexit(3C) registered functions being called, so stop diff --git a/usr/src/cmd/cmd-inet/usr.sbin/in.rdisc/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/in.rdisc/Makefile index 63f1fb1fb6..4a001e9c16 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/in.rdisc/Makefile +++ b/usr/src/cmd/cmd-inet/usr.sbin/in.rdisc/Makefile @@ -21,8 +21,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= in.rdisc MANIFEST= rdisc.xml @@ -35,6 +33,7 @@ ROOTMANIFESTDIR= $(ROOTSVCNETWORKROUTING) LDLIBS += -lsocket -lnsl CPPFLAGS += -DSYSV -DBSD_COMP +CERRWARN += -_gcc=-Wno-extra .KEEP_STATE: diff --git a/usr/src/cmd/cmd-inet/usr.sbin/in.routed/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/in.routed/Makefile index ad125b5a3f..8159456d34 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/in.routed/Makefile +++ b/usr/src/cmd/cmd-inet/usr.sbin/in.routed/Makefile @@ -37,6 +37,8 @@ LINTFLAGS += -erroff=E_FUNC_DECL_VAR_ARG2 -erroff=E_INCONS_VAL_TYPE_DECL2 \ CPPFLAGS += $(_D_XOPEN_EXTN) CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += -lxnet -lmd -lsocket CLEAN_FILES += $(ROUTEDOBJS) $(RTQUERYOBJS) CLOBBERFILES += $(ROUTEDPROG) $(RTQUERYPROG) diff --git a/usr/src/cmd/cmd-inet/usr.sbin/in.talkd/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/in.talkd/Makefile index 0d9a813d9f..27e0ea85ab 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/in.talkd/Makefile +++ b/usr/src/cmd/cmd-inet/usr.sbin/in.talkd/Makefile @@ -19,8 +19,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -36,6 +34,8 @@ ROOTMANIFESTDIR= $(ROOTSVCNETWORK) $(ROOTMANIFEST) := FILEMODE= 444 CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += -lsocket -lnsl .KEEP_STATE: diff --git a/usr/src/cmd/cmd-inet/usr.sbin/inetadm/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/inetadm/Makefile index a682c85296..55cbbf7aab 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/inetadm/Makefile +++ b/usr/src/cmd/cmd-inet/usr.sbin/inetadm/Makefile @@ -23,7 +23,6 @@ # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" PROG = inetadm SRCS = inetadm.c @@ -33,6 +32,8 @@ OBJS = $(SRCS:%.c=%.o) include ../../../Makefile.cmd LDLIBS += -lscf -luutil -linetsvc +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized lint := LINTFLAGS = -ux diff --git a/usr/src/cmd/cmd-inet/usr.sbin/inetconv/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/inetconv/Makefile index 4de2d22645..acd230f592 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/inetconv/Makefile +++ b/usr/src/cmd/cmd-inet/usr.sbin/inetconv/Makefile @@ -23,14 +23,13 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG = inetconv include ../../../Makefile.cmd LDLIBS += -lscf -linetsvc +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ipadm/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/ipadm/Makefile index 94b41cfaaa..57ae86b9e6 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/ipadm/Makefile +++ b/usr/src/cmd/cmd-inet/usr.sbin/ipadm/Makefile @@ -39,6 +39,8 @@ COMMONSRCS= $(CMDINETCOMMONDIR)/$(COMMONOBJS:%.o=%.c) SRCS= $(LOCALSRCS) $(COMMONSRCS) CPPFLAGS += -I$(CMDINETCOMMONDIR) +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += -linetutil -lipadm -lnvpair LINTFLAGS += -m diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ipmpstat/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/ipmpstat/Makefile index fb30e8af09..f070273015 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/ipmpstat/Makefile +++ b/usr/src/cmd/cmd-inet/usr.sbin/ipmpstat/Makefile @@ -29,6 +29,7 @@ ROOTUSRSBINLINKS = $(PROG:%=$(ROOTUSRSBIN)/%) include $(SRC)/cmd/Makefile.cmd C99MODE = $(C99_ENABLE) +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += -lipmp -lsocket -lsysevent -lnvpair -linetutil XGETFLAGS += -a -x $(PROG).xcl diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ipqosconf/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/ipqosconf/Makefile index 605ef68f99..28dd4654f6 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/ipqosconf/Makefile +++ b/usr/src/cmd/cmd-inet/usr.sbin/ipqosconf/Makefile @@ -51,6 +51,9 @@ $(ROOTLIBIPQOSCONFTYPES) := FILEMODE= 0444 #pull in prototype for strtok_r CPPFLAGS += -D__EXTENSIONS__ +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += -lsocket -lnsl -lnvpair -lipp diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/Makefile index e82bfdf215..2433e90df6 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/Makefile +++ b/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/Makefile @@ -55,6 +55,9 @@ CLOBBERFILES += $(PROG) $(POFILES) CLEANFILES += $(PROG) $(POFILES) CPPFLAGS += -DSYSV -DBSD_COMP -I$(CMDINETCOMMONDIR) -I. +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch CFLAGS += $(XSTRCONST) LDLIBS += -lipsecutil -lnsl diff --git a/usr/src/cmd/cmd-inet/usr.sbin/kssl/kssladm/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/kssl/kssladm/Makefile index cf51abee85..4abf5b25f6 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/kssl/kssladm/Makefile +++ b/usr/src/cmd/cmd-inet/usr.sbin/kssl/kssladm/Makefile @@ -42,6 +42,8 @@ ROOTUSRLIBPROG = $(PROG:%=$(ROOTLIB)/%) .KEEP_STATE: CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-address LDLIBS += -lkmf -lpkcs11 -lcryptoutil -lnsl -lsocket diff --git a/usr/src/cmd/cmd-inet/usr.sbin/nwamadm/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/nwamadm/Makefile index d98073fe6d..87c91b39eb 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/nwamadm/Makefile +++ b/usr/src/cmd/cmd-inet/usr.sbin/nwamadm/Makefile @@ -33,6 +33,9 @@ include ../../../Makefile.cmd XGETFLAGS += -a -x $(PROG).xcl LDLIBS += -linetutil -lnsl -lnwam -lumem -lscf +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/cmd-inet/usr.sbin/nwamcfg/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/nwamcfg/Makefile index 7f32e692ee..627a311076 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/nwamcfg/Makefile +++ b/usr/src/cmd/cmd-inet/usr.sbin/nwamcfg/Makefile @@ -36,6 +36,12 @@ LDLIBS += -ll -ltecla -lnwam -lumem YFLAGS += -d -b nwamcfg_grammar CLEANFILES += nwamcfg_lex.c nwamcfg_grammar.tab.c nwamcfg_grammar.tab.h +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-implicit-function-declaration + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ping/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/ping/Makefile index 0d5c086124..88f36be473 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/ping/Makefile +++ b/usr/src/cmd/cmd-inet/usr.sbin/ping/Makefile @@ -48,6 +48,8 @@ CPPFLAGS += -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ # when running lint. LINTFLAGS += -erroff=E_INCONS_VAL_TYPE_DECL2 -erroff=E_INCONS_ARG_DECL2 +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: .PARALLEL: diff --git a/usr/src/cmd/cmd-inet/usr.sbin/routeadm/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/routeadm/Makefile index 69f1177a5f..bd235b77b9 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/routeadm/Makefile +++ b/usr/src/cmd/cmd-inet/usr.sbin/routeadm/Makefile @@ -49,6 +49,8 @@ $(ROOTSVCMANIFESTS) := FILEMODE= 444 ROOTUSRSBINLINKS= $(PROG:%=$(ROOTUSRSBIN)/%) CPPFLAGS += -I../../../../common/svc -I$(CMDINETCOMMONDIR) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG LDLIBS += -lscf -luutil -lsocket diff --git a/usr/src/cmd/cmd-inet/usr.sbin/snoop/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/snoop/Makefile index 49a846e411..cfd939e905 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/snoop/Makefile +++ b/usr/src/cmd/cmd-inet/usr.sbin/snoop/Makefile @@ -49,6 +49,15 @@ include ../../../Makefile.cmd CPPFLAGS += -I. -I$(SRC)/common/net/dhcp LDLIBS += -ldhcputil -ldlpi -lsocket -lnsl -ltsol LDFLAGS += $(MAPFILE.NGB:%=-M%) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-function .KEEP_STATE: diff --git a/usr/src/cmd/cmd-inet/usr.sbin/traceroute/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/traceroute/Makefile index f2913a2ed4..b3fa1a473a 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/traceroute/Makefile +++ b/usr/src/cmd/cmd-inet/usr.sbin/traceroute/Makefile @@ -52,6 +52,9 @@ CPPFLAGS += -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ LINTFLAGS += -erroff=E_FUNC_DECL_VAR_ARG2 -erroff=E_INCONS_ARG_DECL2 \ -erroff=E_INCONS_ARG_USED2 -erroff=E_INCONS_VAL_TYPE_DECL2 +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-clobbered + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/cmd-inet/usr.sbin/wificonfig/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/wificonfig/Makefile index 41d2b6eb42..b5732647eb 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/wificonfig/Makefile +++ b/usr/src/cmd/cmd-inet/usr.sbin/wificonfig/Makefile @@ -23,10 +23,6 @@ # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# -# cmd/cmd-inet/usr.sbin/wificonfig/Makefile -# PROG= wificonfig OBJS= wificonfig.o @@ -38,6 +34,8 @@ LDLIBS += -lsecdb $(ROOTSBIN)/wificonfig := FILEMODE = 04755 ROOTUSRSBINLINKS = $(ROOTUSRSBIN)/$(PROG) +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-parentheses .KEEP_STATE: diff --git a/usr/src/cmd/compress/Makefile b/usr/src/cmd/compress/Makefile index ea306d8cc2..310337fb1f 100644 --- a/usr/src/cmd/compress/Makefile +++ b/usr/src/cmd/compress/Makefile @@ -1,5 +1,4 @@ # -# # CDDL HEADER START # # The contents of this file are subject to the terms of the @@ -19,9 +18,7 @@ # # CDDL HEADER END # -# -#ident "%Z%%M% %I% %E% SMI" # # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. @@ -36,6 +33,8 @@ include ../Makefile.cmd .KEEP_STATE: CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-clobbered CPPFLAGS += -D_FILE_OFFSET_BITS=64 -I $(SRC)/common/util LINTFLAGS += -u diff --git a/usr/src/cmd/consadm/Makefile.com b/usr/src/cmd/consadm/Makefile.com index 9eb1226b74..135b5d9a8f 100644 --- a/usr/src/cmd/consadm/Makefile.com +++ b/usr/src/cmd/consadm/Makefile.com @@ -33,6 +33,7 @@ OBJS= $(COMMONOBJS) include ../../Makefile.cmd CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized CPPFLAGS += FILEMODE = 0555 diff --git a/usr/src/cmd/cpc/cpustat/Makefile b/usr/src/cmd/cpc/cpustat/Makefile index bddb25db49..1bf30678cd 100644 --- a/usr/src/cmd/cpc/cpustat/Makefile +++ b/usr/src/cmd/cpc/cpustat/Makefile @@ -36,6 +36,7 @@ STAT_COMMON_SRCS = $(STAT_COMMON_OBJS:%.o=$(STATCOMMONDIR)/%.c) SRCS += $(STAT_COMMON_SRCS) CFLAGS += $(CCVERBOSE) $(CTF_FLAGS) +CERRWARN += -_gcc=-Wno-uninitialized CPPFLAGS += -D_REENTRANT -I$(SRC)/lib/libcpc/common -I$(STATCOMMONDIR) LDLIBS += -lcpc -lkstat diff --git a/usr/src/cmd/cpio/Makefile b/usr/src/cmd/cpio/Makefile index 8fccb059c4..3acc24cebd 100644 --- a/usr/src/cmd/cpio/Makefile +++ b/usr/src/cmd/cpio/Makefile @@ -29,6 +29,8 @@ SRCS= $(OBJS:%.o=%.c) include ../Makefile.cmd CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DSOLARIS_PRIVS +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += -lsec -lcmdutils -lnvpair XGETFLAGS += -a -x cpio.xcl diff --git a/usr/src/cmd/cron/Makefile b/usr/src/cmd/cron/Makefile index ce64d5a69b..c9ffeadffe 100644 --- a/usr/src/cmd/cron/Makefile +++ b/usr/src/cmd/cron/Makefile @@ -33,6 +33,11 @@ ROOTMANIFESTDIR = $(ROOTSVCSYSTEM) ROOTMETHOD = $(ROOTLIBSVCMETHOD)/svc-cron CPPFLAGS += -D_FILE_OFFSET_BITS=64 -I $(SRC)/common/util +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-value ROOTVAR = $(ROOT)/var diff --git a/usr/src/cmd/cron/cron.c b/usr/src/cmd/cron/cron.c index 5dd41f63e7..347b03287a 100644 --- a/usr/src/cmd/cron/cron.c +++ b/usr/src/cmd/cron/cron.c @@ -3111,7 +3111,7 @@ logit(int cc, struct runinfo *rp, int rc) if (cc == BCHAR) (void) printf("%c CMD: %s\n", cc, next_event->cmd); (void) strftime(timebuf, sizeof (timebuf), FORMAT, localtime(&t)); - (void) printf("%c %.8s %u %c %s", + (void) printf("%c %s %u %c %s", cc, (rp->rusr)->name, rp->pid, QUE(rp->que), timebuf); if ((ret = TSTAT(rc)) != 0) (void) printf(" ts=%d", ret); diff --git a/usr/src/cmd/cron/cron.h b/usr/src/cmd/cron/cron.h index ae8d2142de..93e21e7b41 100644 --- a/usr/src/cmd/cron/cron.h +++ b/usr/src/cmd/cron/cron.h @@ -26,6 +26,8 @@ #ifndef _CRON_H #define _CRON_H +#include <unistd.h> + /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ @@ -53,8 +55,11 @@ extern "C" { #define RCODE(x) (((x)>>8)&0377) #define TSTAT(x) ((x)&0377) -#define FLEN 15 -#define LLEN 9 +/* This constant must be at least sysconf(_SC_LOGIN_NAME_MAX) in size */ +#define UNAMESIZE 32 /* max chars in a user name */ + +#define FLEN UNAMESIZE +#define LLEN UNAMESIZE /* * structure used for passing messages from the at and crontab commands to cron @@ -88,7 +93,6 @@ struct message { #define ENV_HOME "HOME=" #define CTLINESIZE 1000 /* max chars in a crontab line */ -#define UNAMESIZE 20 /* max chars in a user name */ extern int allowed(char *, char *, char *); extern int days_in_mon(int, int); diff --git a/usr/src/cmd/cron/funcs.c b/usr/src/cmd/cron/funcs.c index aa479fcbde..f907d439cb 100644 --- a/usr/src/cmd/cron/funcs.c +++ b/usr/src/cmd/cron/funcs.c @@ -172,8 +172,8 @@ cron_sendmsg(char action, char *login, char *fname, char etype) } pmsg->etype = etype; pmsg->action = action; - (void) strncpy(pmsg->fname, fname, FLEN); - (void) strncpy(pmsg->logname, login, LLEN); + (void) strlcpy(pmsg->fname, fname, FLEN); + (void) strlcpy(pmsg->logname, login, LLEN); if ((i = write(msgfd, pmsg, sizeof (struct message))) < 0) (void) fprintf(stderr, gettext("error in message send\n")); else if (i != sizeof (struct message)) diff --git a/usr/src/cmd/csh/i386/Makefile b/usr/src/cmd/csh/i386/Makefile index 36ee788fc0..5f05c1b91f 100644 --- a/usr/src/cmd/csh/i386/Makefile +++ b/usr/src/cmd/csh/i386/Makefile @@ -24,6 +24,16 @@ CPPFLAGS += -I../../sh CPPFLAGS += -D_FILE_OFFSET_BITS=64 LDLIBS += -lcurses +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-implicit-int +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-extra + MAPFILES = ../mapfile-intf $(MAPFILE.NGB) LDFLAGS += $(MAPFILES:%=-M%) diff --git a/usr/src/cmd/csh/sparc/Makefile b/usr/src/cmd/csh/sparc/Makefile index 37c536f83e..df03abd8a7 100644 --- a/usr/src/cmd/csh/sparc/Makefile +++ b/usr/src/cmd/csh/sparc/Makefile @@ -22,6 +22,16 @@ DEFS = -DVFORK -DFILEC -DBSD_COMP -DFIVE # No TELL when MBCHAR CPPFLAGS= -I. $(DEFS) $(MBCHAR) $(CPPFLAGS.master) CPPFLAGS += -I../../sh CPPFLAGS += -D_FILE_OFFSET_BITS=64 +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-implicit-int +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-extra + LDLIBS += -lcurses MAPFILES = ../mapfile-intf $(MAPFILE.NGB) diff --git a/usr/src/cmd/csplit/Makefile b/usr/src/cmd/csplit/Makefile index d5f55c341e..66e008958a 100644 --- a/usr/src/cmd/csplit/Makefile +++ b/usr/src/cmd/csplit/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989,1996 by Sun Microsystems, Inc. # All rights reserved. # @@ -34,6 +32,9 @@ LDLIBS += -lgen XGETFLAGS += -a -x csplit.xcl CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/ctrun/Makefile b/usr/src/cmd/ctrun/Makefile index 118c11a8d8..318c7e0874 100644 --- a/usr/src/cmd/ctrun/Makefile +++ b/usr/src/cmd/ctrun/Makefile @@ -24,13 +24,13 @@ # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" - PROG= ctrun include ../Makefile.cmd -CFLAGS += -v +CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += -lcontract -luutil .KEEP_STATE: diff --git a/usr/src/cmd/ctstat/Makefile b/usr/src/cmd/ctstat/Makefile index 8f84632dc6..85bac9d29a 100644 --- a/usr/src/cmd/ctstat/Makefile +++ b/usr/src/cmd/ctstat/Makefile @@ -36,7 +36,8 @@ STAT_COMMON_SRCS = $(STAT_COMMON_OBJS:%.o=$(STATCOMMONDIR)/%.c) SRCS += $(STAT_COMMON_SRCS) CPPFLAGS += -I$(STATCOMMONDIR) -CFLAGS += -v +CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses LDLIBS += -lcontract -luutil .KEEP_STATE: diff --git a/usr/src/cmd/ctwatch/Makefile b/usr/src/cmd/ctwatch/Makefile index 3ec60bcd16..ac93abb983 100644 --- a/usr/src/cmd/ctwatch/Makefile +++ b/usr/src/cmd/ctwatch/Makefile @@ -24,13 +24,12 @@ # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" - PROG= ctwatch include ../Makefile.cmd -CFLAGS += -v +CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses LDLIBS += -lcontract -luutil .KEEP_STATE: diff --git a/usr/src/cmd/cvcd/sparc/sun4u/starcat/Makefile b/usr/src/cmd/cvcd/sparc/sun4u/starcat/Makefile index 69d5697a4e..05c02a9d28 100644 --- a/usr/src/cmd/cvcd/sparc/sun4u/starcat/Makefile +++ b/usr/src/cmd/cvcd/sparc/sun4u/starcat/Makefile @@ -42,6 +42,8 @@ FILEMODE= 0755 ROOTPSMPROG = $(ROOT_PSM_LIB_DIR)/$(PROG) CPPFLAGS = -I$(USR_PSM_INCL_DIR) -I$(SRC)/uts/sun4u/starcat $(CPPFLAGS.master) +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += -lsocket diff --git a/usr/src/cmd/cvcd/sparc/sun4u/starfire/Makefile b/usr/src/cmd/cvcd/sparc/sun4u/starfire/Makefile index 2e383ae249..1ec26f96d7 100644 --- a/usr/src/cmd/cvcd/sparc/sun4u/starfire/Makefile +++ b/usr/src/cmd/cvcd/sparc/sun4u/starfire/Makefile @@ -42,6 +42,7 @@ FILEMODE= 0700 ROOTPSMPROG = $(ROOT_PSM_LIB_DIR)/$(PROG) CPPFLAGS = -I$(USR_PSM_INCL_DIR) $(CPPFLAGS.master) +CERRWARN += -_gcc=-Wno-unused-variable LDLIBS += -lsocket -lnsl diff --git a/usr/src/cmd/date/date.c b/usr/src/cmd/date/date.c index d09be9c501..617de3b8a5 100644 --- a/usr/src/cmd/date/date.c +++ b/usr/src/cmd/date/date.c @@ -24,7 +24,7 @@ * Use is subject to license terms. */ /* - * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. */ /* * Copyright (c) 2012, Joyent, Inc. All rights reserved. @@ -70,7 +70,7 @@ static struct utmpx wtmpx[2] = { {"", "", NTIME_MSG, 0, NEW_TIME, 0, 0, 0} }; static char *usage = - "usage:\tdate [-u] mmddHHMM[[cc]yy][.SS]\n\tdate [-u] [+format]\n" + "usage:\tdate [-u] mmddHHMM[[cc]yy][.SS]\n\tdate [-Ru] [+format]\n" "\tdate -a [-]sss[.fff]\n"; static int uflag = 0; static int Rflag = 0; diff --git a/usr/src/cmd/dc/Makefile b/usr/src/cmd/dc/Makefile index 942c4fd993..50f4a4e60f 100644 --- a/usr/src/cmd/dc/Makefile +++ b/usr/src/cmd/dc/Makefile @@ -19,8 +19,6 @@ # CDDL HEADER END # # -# ident "%Z%%M% %I% %E% SMI" -# # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -34,6 +32,10 @@ XPG6EXOBJS= exobjs.xpg6/dc.o include ../Makefile.cmd LDFLAGS += $(MAPFILE.NGB:%=-M%) +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/cmd/dcs/sparc/sun4u/Makefile b/usr/src/cmd/dcs/sparc/sun4u/Makefile index 76ff6c0a22..909bfa3040 100644 --- a/usr/src/cmd/dcs/sparc/sun4u/Makefile +++ b/usr/src/cmd/dcs/sparc/sun4u/Makefile @@ -89,6 +89,8 @@ LINT_FLAGS= -c -Nlevel=4 -Ncheck $($(CONCURR_MODE)_FLAGS) XGETFLAGS += -a -s -x $(PROG).xcl +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized # # LIBRARIES: diff --git a/usr/src/cmd/dd/Makefile b/usr/src/cmd/dd/Makefile index 8e056a6230..4088622905 100644 --- a/usr/src/cmd/dd/Makefile +++ b/usr/src/cmd/dd/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -31,6 +29,7 @@ PROG= dd include ../Makefile.cmd CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized CPPFLAGS += -D_FILE_OFFSET_BITS=64 .KEEP_STATE: diff --git a/usr/src/cmd/deroff/Makefile b/usr/src/cmd/deroff/Makefile index 6f79a1a4d9..6f08eb2b86 100644 --- a/usr/src/cmd/deroff/Makefile +++ b/usr/src/cmd/deroff/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989 by Sun Microsystems, Inc. # @@ -29,6 +27,10 @@ PROG= deroff include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/devctl/Makefile b/usr/src/cmd/devctl/Makefile index ca84aa1ca2..98ba25c5c8 100644 --- a/usr/src/cmd/devctl/Makefile +++ b/usr/src/cmd/devctl/Makefile @@ -23,8 +23,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= devctl @@ -33,6 +31,7 @@ include ../Makefile.cmd .KEEP_STATE: CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses LDLIBS += -ldevice -l devinfo all: $(PROG) diff --git a/usr/src/cmd/devfsadm/Makefile.com b/usr/src/cmd/devfsadm/Makefile.com index 11fa66238e..fe4363e13b 100644 --- a/usr/src/cmd/devfsadm/Makefile.com +++ b/usr/src/cmd/devfsadm/Makefile.com @@ -94,6 +94,10 @@ LINTFLAGS += -erroff=E_NAME_USED_NOT_DEF2 LINTFLAGS += -erroff=E_NAME_DEF_NOT_USED2 LINTFLAGS += -erroff=E_NAME_MULTIPLY_DEF2 +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-parentheses + # Define the dependencies required by devfsadm and all shared objects. LDLIBS += -ldevinfo devfsadm := LDLIBS += -lgen -lsysevent -lnvpair -lzonecfg -lbsm diff --git a/usr/src/cmd/devinfo/Makefile b/usr/src/cmd/devinfo/Makefile index ac2ca7c8a7..58b5c56131 100644 --- a/usr/src/cmd/devinfo/Makefile +++ b/usr/src/cmd/devinfo/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.3.3.1 */ -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -34,6 +32,7 @@ include ../Makefile.cmd LDLIBS += -ladm -lefi CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/cmd/devmgmt/cmds/Makefile b/usr/src/cmd/devmgmt/cmds/Makefile index 6fff60a376..56bd277ec8 100644 --- a/usr/src/cmd/devmgmt/cmds/Makefile +++ b/usr/src/cmd/devmgmt/cmds/Makefile @@ -20,13 +20,9 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# cmd/devmgmt/cmds/Makefile -# include ../../Makefile.cmd @@ -39,6 +35,9 @@ PROG = devattr devreserv getvol putdgrp devfree getdev listdgrp getdgrp \ LDLIBS += -ladm +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: .PARALLEL: $(PROG) diff --git a/usr/src/cmd/dfs.cmds/dfshares/Makefile b/usr/src/cmd/dfs.cmds/dfshares/Makefile index ba59eaae5f..7134e8e4d7 100644 --- a/usr/src/cmd/dfs.cmds/dfshares/Makefile +++ b/usr/src/cmd/dfs.cmds/dfshares/Makefile @@ -20,12 +20,8 @@ # CDDL HEADER END # # -# ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989 by Sun Microsystems, Inc. # -# cmd/dfs.cmds/dfshares/Makefile -# PROG= dfshares @@ -37,6 +33,9 @@ CFLAGS += -s include ../../Makefile.cmd +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/dfs.cmds/general/Makefile b/usr/src/cmd/dfs.cmds/general/Makefile index c2d36aa4b2..d646d4142e 100644 --- a/usr/src/cmd/dfs.cmds/general/Makefile +++ b/usr/src/cmd/dfs.cmds/general/Makefile @@ -20,13 +20,9 @@ # CDDL HEADER END # # -# ident "%Z%%M% %I% %E% SMI" -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# cmd/dfs.cmds/general/Makefile -# # "general" is intended to be a generic way to invoke a filesystem-specific # command, but at the moment, only /usr/sbin/unshare uses this facility. # Until someone else needs this functionality, this will be turned off @@ -46,6 +42,8 @@ CFLAGS += -s include ../../Makefile.cmd +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/dfs.cmds/sharectl/Makefile.com b/usr/src/cmd/dfs.cmds/sharectl/Makefile.com index f890e6eb97..1651a72089 100644 --- a/usr/src/cmd/dfs.cmds/sharectl/Makefile.com +++ b/usr/src/cmd/dfs.cmds/sharectl/Makefile.com @@ -19,8 +19,6 @@ # CDDL HEADER END # # -# ident "%Z%%M% %I% %E% SMI" -# # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -42,6 +40,8 @@ MYCPPFLAGS = -I.. -I../../sharemgr CPPFLAGS += $(MYCPPFLAGS) LDLIBS += -lshare -lumem +CERRWARN += -_gcc=-Wno-uninitialized + SRCS = $(SHARECTL_SRC) OBJS = $(SHARECTL_OBJ) MODS = $(SHARECTL_MOD) diff --git a/usr/src/cmd/dfs.cmds/sharemgr/Makefile.com b/usr/src/cmd/dfs.cmds/sharemgr/Makefile.com index 4e9364a9c7..49272439c6 100644 --- a/usr/src/cmd/dfs.cmds/sharemgr/Makefile.com +++ b/usr/src/cmd/dfs.cmds/sharemgr/Makefile.com @@ -43,6 +43,8 @@ LDLIBS += -lshare -lscf -lsecdb -lumem all install := LDLIBS += -lxml2 LINTFLAGS += -u +CERRWARN += -_gcc=-Wno-uninitialized + POFILES = $(SRCS:.c=.po) POFILE = sharemgr.po diff --git a/usr/src/cmd/diff/Makefile b/usr/src/cmd/diff/Makefile index d5443bb3d3..cfa0ab04d2 100644 --- a/usr/src/cmd/diff/Makefile +++ b/usr/src/cmd/diff/Makefile @@ -19,8 +19,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -31,6 +29,11 @@ BINDIFF= diff LIBDIFFH= diffh include ../Makefile.cmd + +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-address + # # for messaging catalog # diff --git a/usr/src/cmd/diff3/Makefile b/usr/src/cmd/diff3/Makefile index 7f542ea840..01de31d8cb 100644 --- a/usr/src/cmd/diff3/Makefile +++ b/usr/src/cmd/diff3/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989 by Sun Microsystems, Inc. # @@ -31,6 +29,8 @@ CLOBBERFILES = $(SHFILES) include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: all: $(PROG) $(SHFILES) diff --git a/usr/src/cmd/dis/Makefile b/usr/src/cmd/dis/Makefile index 3d07482c10..56721a28af 100644 --- a/usr/src/cmd/dis/Makefile +++ b/usr/src/cmd/dis/Makefile @@ -22,7 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" PROG= dis OBJS= dis_target.o dis_main.o dis_util.o dis_list.o @@ -31,6 +30,7 @@ SRCS= $(OBJS:%.o=%.c) include ../Makefile.cmd LDLIBS += -ldisasm -luutil -lelf +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/cmd/dispadmin/Makefile b/usr/src/cmd/dispadmin/Makefile index 513dca10b4..65f7e7301c 100644 --- a/usr/src/cmd/dispadmin/Makefile +++ b/usr/src/cmd/dispadmin/Makefile @@ -39,6 +39,7 @@ PROGS= $(PROG) $(RT) $(TS) $(IA) $(FSS) $(FX) $(SDC) include ../Makefile.cmd CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized ROOTDIR= $(ROOT)/usr/lib/class ROOTDIRS= $(ROOTDIR) \ diff --git a/usr/src/cmd/dladm/Makefile b/usr/src/cmd/dladm/Makefile index 657ceee889..143086e26a 100644 --- a/usr/src/cmd/dladm/Makefile +++ b/usr/src/cmd/dladm/Makefile @@ -37,6 +37,10 @@ LDLIBS += -L$(ROOT)/lib -lsocket LDLIBS += -ldladm -ldlpi -lkstat -lsecdb -lbsm -linetutil -ldevinfo LDLIBS += $(ZLAZYLOAD) -lrstp $(ZNOLAZYLOAD) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # For headers from librstp. LINTFLAGS += -erroff=E_TRAILING_COMMA_IN_ENUM diff --git a/usr/src/cmd/dlmgmtd/Makefile b/usr/src/cmd/dlmgmtd/Makefile index 1eb82565c9..ee51fd8cd2 100644 --- a/usr/src/cmd/dlmgmtd/Makefile +++ b/usr/src/cmd/dlmgmtd/Makefile @@ -40,6 +40,9 @@ $(ROOTCFGDIR)/datalink.conf := FILEMODE= 644 LDLIBS += -ldladm -ldlpi -lavl -lnvpair -lsysevent -lcontract +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Instrument dlmgmtd with CTF data to ease debugging. # diff --git a/usr/src/cmd/dlstat/Makefile b/usr/src/cmd/dlstat/Makefile index 8885dbc5a0..c37982a686 100644 --- a/usr/src/cmd/dlstat/Makefile +++ b/usr/src/cmd/dlstat/Makefile @@ -30,6 +30,11 @@ ROOTFS_PROG= $(PROG) include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized + XGETFLAGS += -a -x $(PROG).xcl LDLIBS += -L$(ROOT)/lib LDLIBS += -ldladm -linetutil diff --git a/usr/src/cmd/drd/Makefile b/usr/src/cmd/drd/Makefile index 862c8102b4..fe417b2028 100644 --- a/usr/src/cmd/drd/Makefile +++ b/usr/src/cmd/drd/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # Makefile definitions for sun4v DR Daemon (drd) # @@ -63,6 +63,8 @@ LINT_FLAGS= -c -Nlevel=4 -Ncheck XGETFLAGS += -a -s -x $(PROG).xcl +CERRWARN += -_gcc=-Wno-parentheses + # # LIBRARIES: diff --git a/usr/src/cmd/dtrace/test/cmd/baddof/Makefile b/usr/src/cmd/dtrace/test/cmd/baddof/Makefile index bb7a746db7..4162cda817 100644 --- a/usr/src/cmd/dtrace/test/cmd/baddof/Makefile +++ b/usr/src/cmd/dtrace/test/cmd/baddof/Makefile @@ -23,7 +23,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" include $(SRC)/cmd/Makefile.cmd @@ -39,6 +38,8 @@ LDLIBS += -ldtrace SRCS = baddof CMDS = $(SRCS:%=$(ROOTBIN)/%) +CERRWARN += -_gcc=-Wno-implicit-function-declaration + $(CMDS) := FILEMODE = 0555 all: $(SRCS) diff --git a/usr/src/cmd/dtrace/test/cmd/badioctl/Makefile b/usr/src/cmd/dtrace/test/cmd/badioctl/Makefile index 6c3257df0b..789bd0510e 100644 --- a/usr/src/cmd/dtrace/test/cmd/badioctl/Makefile +++ b/usr/src/cmd/dtrace/test/cmd/badioctl/Makefile @@ -23,7 +23,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" include $(SRC)/cmd/Makefile.cmd @@ -38,6 +37,9 @@ LDLIBS = $(LDLIBS.cmd) SRCS = badioctl CMDS = $(SRCS:%=$(ROOTBIN)/%) +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-variable + $(CMDS) := FILEMODE = 0555 all: $(SRCS) diff --git a/usr/src/cmd/dtrace/test/tst/Makefile.com b/usr/src/cmd/dtrace/test/tst/Makefile.com index e3cfd0ad0d..d4b787d5ec 100644 --- a/usr/src/cmd/dtrace/test/tst/Makefile.com +++ b/usr/src/cmd/dtrace/test/tst/Makefile.com @@ -60,6 +60,12 @@ $(ROOT_EXES) := FILEMODE = 0555 # in an arms race with increasingly belligerent optimizers. COPTFLAG= -xO0 +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable + all: $(EXES) clean lint: diff --git a/usr/src/cmd/du/Makefile b/usr/src/cmd/du/Makefile index 4ddc1646ef..35b414e6cd 100644 --- a/usr/src/cmd/du/Makefile +++ b/usr/src/cmd/du/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -32,6 +30,8 @@ XPG4PROG= du include ../Makefile.cmd CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized $(XPG4) := CFLAGS += -DXPG4 CPPFLAGS += -D_FILE_OFFSET_BITS=64 POFILE = du_cmd.po diff --git a/usr/src/cmd/ed/Makefile b/usr/src/cmd/ed/Makefile index 8dbd627997..a5f6cef95a 100644 --- a/usr/src/cmd/ed/Makefile +++ b/usr/src/cmd/ed/Makefile @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= ed XPG4PROG= ed @@ -40,6 +38,10 @@ POFILES= $(EDOBJ:%.o=%.po) include ../Makefile.cmd CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized $(XPG4) := CFLAGS += -DXPG4 $(XPG6) := CFLAGS += -DXPG6 -I$(SRC)/lib/libc/inc lint := LDLIBS += -lgen -lcrypt diff --git a/usr/src/cmd/eeprom/Makefile.com b/usr/src/cmd/eeprom/Makefile.com index 2c2399bb89..248528cc9c 100644 --- a/usr/src/cmd/eeprom/Makefile.com +++ b/usr/src/cmd/eeprom/Makefile.com @@ -37,6 +37,10 @@ DIRMODE = 755 OBJS = error.o +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-implicit-function-declaration + LINT_OBJS = $(OBJS:%.o=%.ln) SOURCES = $(OBJS:%.o=%.c) diff --git a/usr/src/cmd/egrep/Makefile b/usr/src/cmd/egrep/Makefile index 3f2dc324c6..fde0fabcbe 100644 --- a/usr/src/cmd/egrep/Makefile +++ b/usr/src/cmd/egrep/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -31,6 +29,10 @@ PROG= egrep include ../Makefile.cmd CPPFLAGS += -D_FILE_OFFSET_BITS=64 +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-label .KEEP_STATE: diff --git a/usr/src/cmd/eqn/eqn.d/Makefile b/usr/src/cmd/eqn/eqn.d/Makefile index 597a9649da..8b9dfcf422 100644 --- a/usr/src/cmd/eqn/eqn.d/Makefile +++ b/usr/src/cmd/eqn/eqn.d/Makefile @@ -1,11 +1,7 @@ # -# ident "%Z%%M% %I% %E% SMI" -# # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# cmd/eqn/eqn.d/Makefile -# include ../../Makefile.cmd @@ -35,6 +31,10 @@ YFLAGS = -d CPPFLAGS = -I. -I.. $(CPPFLAGS.master) LDFLAGS += $(MAPFILE.NGB:%=-M%) +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all : $(PROG) diff --git a/usr/src/cmd/eqn/neqn.d/Makefile b/usr/src/cmd/eqn/neqn.d/Makefile index 2eccf34578..2863de2874 100644 --- a/usr/src/cmd/eqn/neqn.d/Makefile +++ b/usr/src/cmd/eqn/neqn.d/Makefile @@ -1,11 +1,7 @@ # -# ident "%Z%%M% %I% %E% SMI" -# # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# cmd/eqn/neqn.d/Makefile -# include ../../Makefile.cmd @@ -30,6 +26,10 @@ YFLAGS = -d CPPFLAGS = -DNEQN -I. -I.. $(CPPFLAGS.master) LDFLAGS += $(MAPFILE.NGB:%=-M%) +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label + # # for message catalog # @@ -45,7 +45,7 @@ $(PROG) : $(OBJS) $(MAPFILE.NGB) $(POST_PROCESS) catalog: $(POFILE) - + $(POFILE): $(POFILES) $(RM) $@ cat $(POFILES) > $@ diff --git a/usr/src/cmd/expr/Makefile b/usr/src/cmd/expr/Makefile index 8d8aeaa732..dbc390fce5 100644 --- a/usr/src/cmd/expr/Makefile +++ b/usr/src/cmd/expr/Makefile @@ -36,6 +36,8 @@ SRCS= expr.c compile.c include ../Makefile.cmd CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-extra $(XPG4) := CFLAGS += -DXPG4 $(XPG6) := CFLAGS += -DXPG6 diff --git a/usr/src/cmd/exstr/Makefile b/usr/src/cmd/exstr/Makefile index 574a7e80a2..3123493743 100644 --- a/usr/src/cmd/exstr/Makefile +++ b/usr/src/cmd/exstr/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989 by Sun Microsystems, Inc. # @@ -29,6 +27,8 @@ PROG= exstr include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-extra + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/factor/Makefile b/usr/src/cmd/factor/Makefile index 89d6691ab8..05bccd0c85 100644 --- a/usr/src/cmd/factor/Makefile +++ b/usr/src/cmd/factor/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989 by Sun Microsystems, Inc. # @@ -30,6 +28,7 @@ PROG= factor include ../Makefile.cmd LDLIBS += -lm +CERRWARN += -_gcc=-Wno-implicit-function-declaration .KEEP_STATE: diff --git a/usr/src/cmd/fcinfo/Makefile b/usr/src/cmd/fcinfo/Makefile index a824667d71..ebe3fc72cd 100644 --- a/usr/src/cmd/fcinfo/Makefile +++ b/usr/src/cmd/fcinfo/Makefile @@ -47,6 +47,8 @@ include ../Makefile.cmd POFILE = fcinfo_cmd.po POFILES = fcinfo.po fcinfo-list.po fcadm-list.po printAttrs.po fcoeadm.po +CERRWARN += -_gcc=-Wno-unused-variable + ROOTMANIFESTDIR= $(ROOTSVCNETWORK) LDLIBS += -lHBAAPI diff --git a/usr/src/cmd/fdformat/Makefile b/usr/src/cmd/fdformat/Makefile index 8a04df934e..13a5204cad 100644 --- a/usr/src/cmd/fdformat/Makefile +++ b/usr/src/cmd/fdformat/Makefile @@ -32,6 +32,8 @@ include ../Makefile.cmd LDLIBS += -lvolmgt LINTFLAGS += -um +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: # diff --git a/usr/src/cmd/fgrep/Makefile b/usr/src/cmd/fgrep/Makefile index a5ac396dcd..26d8ef046c 100644 --- a/usr/src/cmd/fgrep/Makefile +++ b/usr/src/cmd/fgrep/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989,1996 by Sun Microsystems, Inc. # All rights reserved. # @@ -31,7 +29,7 @@ PROG= fgrep include ../Makefile.cmd CPPFLAGS += -D_FILE_OFFSET_BITS=64 - +CERRWARN += -_gcc=-Wno-parentheses .KEEP_STATE: diff --git a/usr/src/cmd/file/Makefile b/usr/src/cmd/file/Makefile index e7e7f2b9b2..0c9f5dd3fd 100644 --- a/usr/src/cmd/file/Makefile +++ b/usr/src/cmd/file/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" -# PROG= file XPG4PROG= file @@ -39,6 +37,9 @@ SRCS= file.c elf_read.c magicutils.c $(ELFCAP)/elfcap.c include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits + POFILE= file_all.po POFILES= $(SRCS:%.c=%.po) diff --git a/usr/src/cmd/file/elf_read.c b/usr/src/cmd/file/elf_read.c index 5711ef3a63..7ccf8e2bb3 100644 --- a/usr/src/cmd/file/elf_read.c +++ b/usr/src/cmd/file/elf_read.c @@ -30,8 +30,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * ELF files can exceed 2GB in size. A standard 32-bit program * like 'file' cannot read past 2GB, and will be unable to see @@ -458,6 +456,8 @@ process_shdr(Elf_Info *EI) cap_off = shdr->sh_offset; if (shdr->sh_type == SHT_SUNW_cap) { + char capstr[128]; + if (shdr->sh_size == 0 || shdr->sh_entsize == 0) { (void) fprintf(stderr, ELF_ERR_ELFCAP1, File, EI->file); @@ -477,14 +477,28 @@ process_shdr(Elf_Info *EI) return (ELF_READ_FAIL); } - if (Chdr.c_tag != CA_SUNW_NULL) { - (void) elfcap_tag_to_str( - ELFCAP_STYLE_UC, Chdr.c_tag, - Chdr.c_un.c_val, EI->cap_str, - sizeof (EI->cap_str), - ELFCAP_FMT_SNGSPACE, mac); - } cap_off += csize; + + /* + * Each capatibility group is terminated with + * CA_SUNW_NULL. Groups other than the first + * represent symbol capabilities, and aren't + * interesting here. + */ + if (Chdr.c_tag == CA_SUNW_NULL) + break; + + (void) elfcap_tag_to_str(ELFCAP_STYLE_UC, + Chdr.c_tag, Chdr.c_un.c_val, capstr, + sizeof (capstr), ELFCAP_FMT_SNGSPACE, + mac); + + if ((*EI->cap_str != '\0') && (*capstr != '\0')) + (void) strlcat(EI->cap_str, " ", + sizeof (EI->cap_str)); + + (void) strlcat(EI->cap_str, capstr, + sizeof (EI->cap_str)); } } diff --git a/usr/src/cmd/filebench/Makefile.com b/usr/src/cmd/filebench/Makefile.com index 5059a5e516..0f0a51c654 100644 --- a/usr/src/cmd/filebench/Makefile.com +++ b/usr/src/cmd/filebench/Makefile.com @@ -54,6 +54,13 @@ LINTFLAGS += -erroff=E_FUNC_ARG_UNUSED -erroff=E_NAME_DEF_NOT_USED2 \ -erroff=E_NAME_USED_NOT_DEF2 -erroff=E_INCONS_ARG_DECL2 LINTFLAGS64 += -erroff=E_FUNC_ARG_UNUSED -erroff=E_NAME_DEF_NOT_USED2 \ -erroff=E_NAME_USED_NOT_DEF2 -erroff=E_INCONS_ARG_DECL2 + +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-function + LINTFILES = $(SRCS:%.c=%.ln) CLEANFILES += parser_gram.c parser_gram.h parser_lex.c y.tab.h y.tab.c diff --git a/usr/src/cmd/filesync/Makefile b/usr/src/cmd/filesync/Makefile index 2e8e0fbc36..23ab3239fe 100644 --- a/usr/src/cmd/filesync/Makefile +++ b/usr/src/cmd/filesync/Makefile @@ -32,6 +32,9 @@ include ../Makefile.cmd LDLIBS += -lgen +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + FILEMODE= 0555 .KEEP_STATE: diff --git a/usr/src/cmd/find/Makefile b/usr/src/cmd/find/Makefile index dfdb210815..b7765acf17 100644 --- a/usr/src/cmd/find/Makefile +++ b/usr/src/cmd/find/Makefile @@ -19,8 +19,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -37,6 +35,10 @@ include ../Makefile.cmd $(XPG4) := CFLAGS += -DXPG4 CPPFLAGS += -D_FILE_OFFSET_BITS=64 -I $(SRC)/common/util +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + LINTFLAGS += -u LDLIBS += -lsec diff --git a/usr/src/cmd/flowstat/Makefile b/usr/src/cmd/flowstat/Makefile index 5cb3eb4025..7e0ee8bfb2 100644 --- a/usr/src/cmd/flowstat/Makefile +++ b/usr/src/cmd/flowstat/Makefile @@ -35,6 +35,9 @@ XGETFLAGS += -a -x $(PROG).xcl LDLIBS += -L$(ROOT)/lib LDLIBS += -ldladm -linetutil +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-uninitialized + ROOTCFGDIR= $(ROOTETC)/dladm .KEEP_STATE: diff --git a/usr/src/cmd/fm/eversholt/Makefile.esc.com b/usr/src/cmd/fm/eversholt/Makefile.esc.com index 02cd6ed2b0..5d3c49703a 100644 --- a/usr/src/cmd/fm/eversholt/Makefile.esc.com +++ b/usr/src/cmd/fm/eversholt/Makefile.esc.com @@ -22,11 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# -# include makefile for eversholt common files -# -# FMADIR = $(SRC)/cmd/fm EVERDIR = $(FMADIR)/eversholt @@ -48,7 +43,11 @@ LINTFLAGS = -mnux $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG CPPFLAGS += -I$(EVERCMNSRC) -I. -CFLAGS += -v +CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch CTFCONVO = $(CTFCONVERT_O) CTFMRG = $(CTFMERGE) -L VERSION -o $@ $(OBJS) diff --git a/usr/src/cmd/fm/fmd/Makefile.fmd b/usr/src/cmd/fm/fmd/Makefile.fmd index 4180d9c155..67182fa4d1 100644 --- a/usr/src/cmd/fm/fmd/Makefile.fmd +++ b/usr/src/cmd/fm/fmd/Makefile.fmd @@ -116,6 +116,11 @@ CPPFLAGS += -I. -I../common CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT CFLAGS += $(CTF_FLAGS) $(CCVERBOSE) $(XSTRCONST) LINTFLAGS += -mu +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-clobbered $(PROG) := LDFLAGS += -R/usr/lib/fm $(PROG) := LDLIBS += -L$(ROOTLIB)/fm -ltopo -ldiagcode -lsysevent -lsmbios \ diff --git a/usr/src/cmd/fm/fmdump/Makefile.com b/usr/src/cmd/fm/fmdump/Makefile.com index 4a146eb124..fbd90d9ea1 100644 --- a/usr/src/cmd/fm/fmdump/Makefile.com +++ b/usr/src/cmd/fm/fmdump/Makefile.com @@ -38,6 +38,8 @@ CFLAGS += $(CTF_FLAGS) $(CCVERBOSE) $(XSTRCONST) LDLIBS += -L$(ROOT)/usr/lib/fm -lfmd_log -lnvpair -ltopo -lfmd_msg LDFLAGS += -R/usr/lib/fm LINTFLAGS += -mnu +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized .NO_PARALLEL: .PARALLEL: $(OBJS) $(LINTFILES) diff --git a/usr/src/cmd/fm/fminject/Makefile.com b/usr/src/cmd/fm/fminject/Makefile.com index 32f33dfc81..c6b60be1cb 100644 --- a/usr/src/cmd/fm/fminject/Makefile.com +++ b/usr/src/cmd/fm/fminject/Makefile.com @@ -23,7 +23,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" .KEEP_STATE: .SUFFIXES: @@ -50,6 +49,11 @@ CLEANFILES += inj_grammar.c inj_grammar.h inj_lex.c y.tab.h y.tab.c CPPFLAGS += -I. -I../common CFLAGS += $(CCVERBOSE) $(CTF_FLAGS) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable LDLIBS += -L$(ROOT)/usr/lib/fm -lfmd_log -lsysevent -lnvpair -lumem LDFLAGS += -R/usr/lib/fm LINTFLAGS = -mnux diff --git a/usr/src/cmd/fm/ipmitopo/Makefile.com b/usr/src/cmd/fm/ipmitopo/Makefile.com index 60439e5e75..003331dba6 100644 --- a/usr/src/cmd/fm/ipmitopo/Makefile.com +++ b/usr/src/cmd/fm/ipmitopo/Makefile.com @@ -41,6 +41,8 @@ CFLAGS += $(CTF_FLAGS) $(CCVERBOSE) $(XSTRCONST) LDLIBS += -lipmi -lnvpair LINTFLAGS += -mnu +CERRWARN += -_gcc=-Wno-uninitialized + .NO_PARALLEL: .PARALLEL: $(OBJS) $(LINTFILES) diff --git a/usr/src/cmd/fm/modules/SUNW,SPARC-Enterprise/event-transport/Makefile b/usr/src/cmd/fm/modules/SUNW,SPARC-Enterprise/event-transport/Makefile index c45119ca68..c9a3f21f3f 100644 --- a/usr/src/cmd/fm/modules/SUNW,SPARC-Enterprise/event-transport/Makefile +++ b/usr/src/cmd/fm/modules/SUNW,SPARC-Enterprise/event-transport/Makefile @@ -22,7 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" PLATFORMS = SUNW,SPARC-Enterprise @@ -34,3 +33,4 @@ XPORTLIBS = -lsocket -lnsl -ldscp include ../../common/event-transport/Makefile.etm +CERRWARN += -_gcc=-Wno-parentheses diff --git a/usr/src/cmd/fm/modules/common/disk-monitor/Makefile b/usr/src/cmd/fm/modules/common/disk-monitor/Makefile index 252f0d3e4d..4ee7343d45 100644 --- a/usr/src/cmd/fm/modules/common/disk-monitor/Makefile +++ b/usr/src/cmd/fm/modules/common/disk-monitor/Makefile @@ -22,7 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" MODULE = disk-monitor CLASS = common @@ -35,3 +34,4 @@ LINTFLAGS += -I. -I$(SRC)/lib/fm/topo/modules/common/disk -L$(ROOT)/usr/lib/fm CFLAGS += -I. -I$(SRC)/lib/fm/topo/modules/common/disk LDLIBS += -lsysevent -lnvpair -lsmbios -lcfgadm -ltopo -luutil -lipmi LDFLAGS += -L$(ROOT)/usr/lib/fm -R/usr/lib/fm +CERRWARN += -_gcc=-Wno-uninitialized diff --git a/usr/src/cmd/fm/modules/common/eversholt/Makefile b/usr/src/cmd/fm/modules/common/eversholt/Makefile index 7e049fe437..c71726062e 100644 --- a/usr/src/cmd/fm/modules/common/eversholt/Makefile +++ b/usr/src/cmd/fm/modules/common/eversholt/Makefile @@ -22,7 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" # # eft.so (the eversholt DE) # @@ -44,6 +43,11 @@ DMOD_SRCS = eft_mdb.c include ../../Makefile.plugin CPPFLAGS += -DFMAPLUGIN -I$(EVERSRCDIR) -I. +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-implicit-function-declaration $(PROG) := LDFLAGS += -R/usr/lib/fm $(PROG) := LDLIBS += -L$(ROOTLIB)/fm -ltopo diff --git a/usr/src/cmd/fm/modules/common/fabric-xlate/Makefile b/usr/src/cmd/fm/modules/common/fabric-xlate/Makefile index 5a53739a25..ef2fd7530d 100644 --- a/usr/src/cmd/fm/modules/common/fabric-xlate/Makefile +++ b/usr/src/cmd/fm/modules/common/fabric-xlate/Makefile @@ -37,3 +37,7 @@ LINTFLAGS += -I$(INCDIRS) LDFLAGS += -L$(ROOT)/usr/lib/fm -R/usr/lib/fm LDLIBS += -luutil -lxml2 -L$(ROOTLIB)/fm -ltopo + +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized diff --git a/usr/src/cmd/fm/modules/common/io-retire/Makefile b/usr/src/cmd/fm/modules/common/io-retire/Makefile index 6ad3386fee..65fa4da1f4 100644 --- a/usr/src/cmd/fm/modules/common/io-retire/Makefile +++ b/usr/src/cmd/fm/modules/common/io-retire/Makefile @@ -22,7 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" MODULE = io-retire CLASS = common @@ -31,3 +30,4 @@ SRCS = rio_main.c include ../../Makefile.plugin LDLIBS += -ldevinfo +CERRWARN += -_gcc=-Wno-parentheses diff --git a/usr/src/cmd/fm/modules/common/ip-transport/Makefile b/usr/src/cmd/fm/modules/common/ip-transport/Makefile index 39b9459e53..84f01180ab 100644 --- a/usr/src/cmd/fm/modules/common/ip-transport/Makefile +++ b/usr/src/cmd/fm/modules/common/ip-transport/Makefile @@ -24,7 +24,6 @@ # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = ip-transport CLASS = common @@ -33,3 +32,4 @@ SRCS = ip.c include ../../Makefile.plugin LDLIBS += -lsocket -lnsl +CERRWARN += -_gcc=-Wno-uninitialized diff --git a/usr/src/cmd/fm/modules/common/sw-diag-response/software-diagnosis/Makefile b/usr/src/cmd/fm/modules/common/sw-diag-response/software-diagnosis/Makefile index 816132fe18..4317a71857 100644 --- a/usr/src/cmd/fm/modules/common/sw-diag-response/software-diagnosis/Makefile +++ b/usr/src/cmd/fm/modules/common/sw-diag-response/software-diagnosis/Makefile @@ -49,3 +49,5 @@ CFLAGS += $(INCS) LINTFLAGS += $(INCS) LDLIBS += -L$(ROOTLIB)/fm -ltopo -luutil -luuid -lkstat LDFLAGS += -R/usr/lib/fm +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized diff --git a/usr/src/cmd/fm/modules/sun4u/cpumem-diagnosis/Makefile b/usr/src/cmd/fm/modules/sun4u/cpumem-diagnosis/Makefile index 851f541ee7..f54dc1ada9 100644 --- a/usr/src/cmd/fm/modules/sun4u/cpumem-diagnosis/Makefile +++ b/usr/src/cmd/fm/modules/sun4u/cpumem-diagnosis/Makefile @@ -22,7 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" ARCH = sun4u @@ -43,3 +42,7 @@ INCDIRS += $(SRC)/lib/fm/libfmd_adm/sparcv9 include ../../sun4/cpumem-diagnosis/Makefile.cpumem LDLIBS += -L$(ROOT)/usr/lib/fm -lfmd_adm LDFLAGS += -R/usr/lib/fm + +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-char-subscripts diff --git a/usr/src/cmd/fm/modules/sun4v/cpumem-diagnosis/Makefile b/usr/src/cmd/fm/modules/sun4v/cpumem-diagnosis/Makefile index f7ee88f4db..a44e656a47 100644 --- a/usr/src/cmd/fm/modules/sun4v/cpumem-diagnosis/Makefile +++ b/usr/src/cmd/fm/modules/sun4v/cpumem-diagnosis/Makefile @@ -22,7 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" ARCH = sun4v @@ -36,3 +35,6 @@ include ../../sun4/cpumem-diagnosis/Makefile.cpumem LDLIBS += -L$(ROOTLIB)/fm -lmdesc -lldom LDFLAGS += -R/usr/lib/fm + +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses diff --git a/usr/src/cmd/fm/modules/sun4v/etm/Makefile b/usr/src/cmd/fm/modules/sun4v/etm/Makefile index d4d21abf5e..2ea2e79af5 100644 --- a/usr/src/cmd/fm/modules/sun4v/etm/Makefile +++ b/usr/src/cmd/fm/modules/sun4v/etm/Makefile @@ -38,3 +38,7 @@ LDLIBS += -L$(ROOT)/usr/lib/fm -lldom -ltopo LDFLAGS += -R/usr/lib/fm DYNFLAGS += -R/usr/lib + +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized diff --git a/usr/src/cmd/fm/modules/sun4v/generic-mem/Makefile b/usr/src/cmd/fm/modules/sun4v/generic-mem/Makefile index 010344c850..21e2c40b62 100644 --- a/usr/src/cmd/fm/modules/sun4v/generic-mem/Makefile +++ b/usr/src/cmd/fm/modules/sun4v/generic-mem/Makefile @@ -52,6 +52,8 @@ GMEM_VERSION = "1.0" LDLIBS += -L$(ROOTLIB)/fm -ltopo LDFLAGS += -R/usr/lib/fm CPPFLAGS += $(INCDIRS:%=-I%) -DGMEM_VERSION='$(GMEM_VERSION)' -D$(ARCH) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses %.o: $(GENERIC_MEM)/%.c $(COMPILE.c) -o $@ $< diff --git a/usr/src/cmd/fm/notify/smtp-notify/Makefile.com b/usr/src/cmd/fm/notify/smtp-notify/Makefile.com index d969986fb4..d8861ea62b 100644 --- a/usr/src/cmd/fm/notify/smtp-notify/Makefile.com +++ b/usr/src/cmd/fm/notify/smtp-notify/Makefile.com @@ -52,6 +52,8 @@ LDLIBS += -L$(ROOT)/usr/lib/fm -lnvpair -lfmevent -lfmd_msg -lfmnotify \ LDFLAGS += -R/usr/lib/fm LINTFLAGS += -mnu +CERRWARN += -_gcc=-Wno-parentheses + .NO_PARALLEL: .PARALLEL: $(OBJS) $(LINTFILES) diff --git a/usr/src/cmd/fm/notify/snmp-notify/Makefile.com b/usr/src/cmd/fm/notify/snmp-notify/Makefile.com index ff6b3b5a38..13c78c7ea2 100644 --- a/usr/src/cmd/fm/notify/snmp-notify/Makefile.com +++ b/usr/src/cmd/fm/notify/snmp-notify/Makefile.com @@ -50,6 +50,8 @@ LDLIBS += -L$(ROOT)/usr/lib/fm -lnvpair -lfmevent -lfmd_msg -lfmnotify \ LDFLAGS += -R/usr/lib/fm LINTFLAGS += -mnu +CERRWARN += -_gcc=-Wno-parentheses + .NO_PARALLEL: .PARALLEL: $(OBJS) $(LINTFILES) diff --git a/usr/src/cmd/fm/schemes/cpu/amd64/Makefile b/usr/src/cmd/fm/schemes/cpu/amd64/Makefile index 257526a284..6f3caca2f4 100644 --- a/usr/src/cmd/fm/schemes/cpu/amd64/Makefile +++ b/usr/src/cmd/fm/schemes/cpu/amd64/Makefile @@ -23,8 +23,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# include ../../Makefile.com include $(SRC)/Makefile.master.64 @@ -34,6 +32,7 @@ LDFLAGS += -lkstat \ -L$(ROOTLIB)/fm/$(MACH64) -ltopo LDFLAGS += -R/usr/lib/fm/$(MACH64) +CERRWARN += -_gcc=-Wno-parentheses include ../../Makefile.targ diff --git a/usr/src/cmd/fm/schemes/cpu/i386/Makefile b/usr/src/cmd/fm/schemes/cpu/i386/Makefile index 59a8be49ae..28e1415bf3 100644 --- a/usr/src/cmd/fm/schemes/cpu/i386/Makefile +++ b/usr/src/cmd/fm/schemes/cpu/i386/Makefile @@ -23,8 +23,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# include ../../Makefile.com @@ -33,6 +31,8 @@ LDLIBS += -lkstat \ -L$(ROOTLIB)/fm -ltopo LDFLAGS += -R/usr/lib/fm +CERRWARN += -_gcc=-Wno-parentheses + include ../../Makefile.targ install: all $(ROOTPROG) diff --git a/usr/src/cmd/fm/schemes/cpu/sparc/Makefile b/usr/src/cmd/fm/schemes/cpu/sparc/Makefile index faa1f86434..35d2336a56 100644 --- a/usr/src/cmd/fm/schemes/cpu/sparc/Makefile +++ b/usr/src/cmd/fm/schemes/cpu/sparc/Makefile @@ -23,8 +23,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# include ../../Makefile.com @@ -34,6 +32,8 @@ LDLIBS += -lkstat \ -L$(ROOTLIB)/fm -ltopo LDFLAGS += -R/usr/lib/fm +CERRWARN += -_gcc=-Wno-parentheses + include ../../Makefile.targ install: all $(ROOTPROG) diff --git a/usr/src/cmd/fm/schemes/cpu/sparcv9/Makefile b/usr/src/cmd/fm/schemes/cpu/sparcv9/Makefile index cfb2d7dc5e..321e124237 100644 --- a/usr/src/cmd/fm/schemes/cpu/sparcv9/Makefile +++ b/usr/src/cmd/fm/schemes/cpu/sparcv9/Makefile @@ -23,8 +23,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# include ../../Makefile.com include $(SRC)/Makefile.master.64 @@ -34,6 +32,8 @@ LDLIBS += -lkstat \ -L$(ROOTLIB)/fm/$(MACH64) -ltopo LDFLAGS += -R/usr/lib/fm/$(MACH64) +CERRWARN += -_gcc=-Wno-parentheses + include ../../Makefile.targ install: all $(ROOTPROG64) diff --git a/usr/src/cmd/fmt/Makefile b/usr/src/cmd/fmt/Makefile index b94afa3821..21938536d6 100644 --- a/usr/src/cmd/fmt/Makefile +++ b/usr/src/cmd/fmt/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -# ident "%Z%%M% %I% %E% SMI" -# # Copyright 2003 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -35,6 +33,9 @@ SRCS= $(OBJS:%.o=%.c) include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/fmtmsg/Makefile b/usr/src/cmd/fmtmsg/Makefile index c99807ce23..c5ae7e2c1f 100644 --- a/usr/src/cmd/fmtmsg/Makefile +++ b/usr/src/cmd/fmtmsg/Makefile @@ -19,20 +19,19 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" - PROG= fmtmsg OBJS= main.o SRCS= $(OBJS:%.o=%.c) include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/format/Makefile b/usr/src/cmd/format/Makefile index f96a6bb61e..f04050cd7c 100644 --- a/usr/src/cmd/format/Makefile +++ b/usr/src/cmd/format/Makefile @@ -44,6 +44,11 @@ DATA= format.dat include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-clobbered + SRCS= $(OBJS:.o=.c) ROOTSYMLINK= $(ROOTETCPROG) diff --git a/usr/src/cmd/fruadm/Makefile b/usr/src/cmd/fruadm/Makefile index ed48cfc06b..8150fdea6c 100644 --- a/usr/src/cmd/fruadm/Makefile +++ b/usr/src/cmd/fruadm/Makefile @@ -33,6 +33,7 @@ include $(SRC)/Makefile.psm FRULIBS = -L$(SRC)/lib/libfru/$(MACH) -lfru CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-switch CPPFLAGS += -I$(SRC)/lib/libfru/include LINTFLAGS += -u LDLIBS += $(FRULIBS) -lm diff --git a/usr/src/cmd/fs.d/Makefile b/usr/src/cmd/fs.d/Makefile index b8491f1a26..a34d351e8c 100644 --- a/usr/src/cmd/fs.d/Makefile +++ b/usr/src/cmd/fs.d/Makefile @@ -78,6 +78,13 @@ SYMUSRBIN2USRSBIN= $(USRBIN2USRSBIN:%=$(ROOTBIN)/%) SYMDEVNM= $(ROOTUSRSBIN)/devnm CPPFLAGS += -D_LARGEFILE64_SOURCE + +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-function + %.xpg4.o := CPPFLAGS += -DXPG4 $(SPPROG) := LDLIBS += -lkstat diff --git a/usr/src/cmd/fs.d/autofs/Makefile b/usr/src/cmd/fs.d/autofs/Makefile index c3193c3089..4326e1c1a3 100644 --- a/usr/src/cmd/fs.d/autofs/Makefile +++ b/usr/src/cmd/fs.d/autofs/Makefile @@ -88,6 +88,14 @@ $(TYPEPROG) := LDLIBS += -lrpcsvc -lsocket -lnsl -lsldap -lkstat -lscf CFLAGS += $(CCVERBOSE) -D_FILE_OFFSET_BITS=64 CPPFLAGS= -I. -I.. -I../nfs/lib $(CPPFLAGS.master) -D_REENTRANT \ $(MALLOC_DEBUG) + +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-function + OBJS= $(AUTOOBJS) $(MOUNTOBJS) $(TYPEOBJS) \ $(SHAREOBJS) $(UNSHAREOBJS) diff --git a/usr/src/cmd/fs.d/cachefs/Makefile.cachefs b/usr/src/cmd/fs.d/cachefs/Makefile.cachefs index d7eb1363eb..4b7bc57fb3 100644 --- a/usr/src/cmd/fs.d/cachefs/Makefile.cachefs +++ b/usr/src/cmd/fs.d/cachefs/Makefile.cachefs @@ -20,10 +20,9 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989,2001 by Sun Microsystems, Inc. # All rights reserved. +# CACHEFSDIR= $(SRC)/cmd/fs.d/$(FSTYPE)/common @@ -52,6 +51,12 @@ CFSLIB= $(CACHEFSDIR)/$(LIBRARY) CFSLIBMT= $(CACHEFSDIR)/$(LIBRARYMT) LDLIBS += $(CFSLIB) +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-function + $(LIBPROG): $(OBJS) $(LINK.c) -o $@ $(OBJS) $(LDLIBS) $(POST_PROCESS) diff --git a/usr/src/cmd/fs.d/dev/Makefile b/usr/src/cmd/fs.d/dev/Makefile index 8da5c545a1..db59d04876 100644 --- a/usr/src/cmd/fs.d/dev/Makefile +++ b/usr/src/cmd/fs.d/dev/Makefile @@ -21,8 +21,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# FSTYPE= dev PROG= mount @@ -38,3 +36,5 @@ $(ROOTLIBFSTYPE)/%: $(ROOTLIBFSTYPE) % include ../Makefile.fstype include ../Makefile.mount include ../Makefile.mount.targ + +CERRWARN += -_gcc=-Wno-parentheses diff --git a/usr/src/cmd/fs.d/hsfs/fstyp/Makefile b/usr/src/cmd/fs.d/hsfs/fstyp/Makefile index 85a26afd04..507915db15 100644 --- a/usr/src/cmd/fs.d/hsfs/fstyp/Makefile +++ b/usr/src/cmd/fs.d/hsfs/fstyp/Makefile @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# FSTYP_VERS=1 FSTYPE= hsfs @@ -62,6 +60,8 @@ SRCS= ${LIBPROG:%.so.$(FSTYP_VERS)=%.c} CPPFLAGS += -DFSTYP_VERS=${FSTYP_VERS} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +CERRWARN += -_gcc=-Wno-switch + .KEEP_STATE: all: $(LIBPROG) diff --git a/usr/src/cmd/fs.d/hsfs/labelit/Makefile b/usr/src/cmd/fs.d/hsfs/labelit/Makefile index 0dbe28c9df..fdf2c43912 100644 --- a/usr/src/cmd/fs.d/hsfs/labelit/Makefile +++ b/usr/src/cmd/fs.d/hsfs/labelit/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989 by Sun Microsystems, Inc. # @@ -31,6 +29,10 @@ ATTMK= $(LIBPROG) include ../../Makefile.fstype +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-variable + lint := PROG = $(LIBPROG) lint: lint_PROG diff --git a/usr/src/cmd/fs.d/hsfs/mount/Makefile b/usr/src/cmd/fs.d/hsfs/mount/Makefile index 50a6f3b30e..9afcfc72f1 100644 --- a/usr/src/cmd/fs.d/hsfs/mount/Makefile +++ b/usr/src/cmd/fs.d/hsfs/mount/Makefile @@ -23,8 +23,6 @@ # Copyright 2003 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# FSTYPE= hsfs LIBPROG= mount @@ -40,3 +38,5 @@ $(ROOTLIBFSTYPE)/%: $(ROOTLIBFSTYPE) % include ../../Makefile.fstype include ../../Makefile.mount include ../../Makefile.mount.targ + +CERRWARN += -_gcc=-Wno-unused-variable diff --git a/usr/src/cmd/fs.d/nfs/dfmounts/Makefile b/usr/src/cmd/fs.d/nfs/dfmounts/Makefile index c287ccf025..bd6ae76dd7 100644 --- a/usr/src/cmd/fs.d/nfs/dfmounts/Makefile +++ b/usr/src/cmd/fs.d/nfs/dfmounts/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.12 */ -# # Copyright (c) 1989 by Sun Microsystems, Inc. # @@ -42,6 +40,9 @@ POFILE= dfmounts.po LDLIBS += -lrpcsvc -lnsl +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses + $(LIBPROG): $(OBJS) $(LINK.c) -o $@ $(OBJS) $(LDLIBS) $(POST_PROCESS) diff --git a/usr/src/cmd/fs.d/nfs/dfshares/Makefile b/usr/src/cmd/fs.d/nfs/dfshares/Makefile index 7c2bc29ce4..ffda5d11cb 100644 --- a/usr/src/cmd/fs.d/nfs/dfshares/Makefile +++ b/usr/src/cmd/fs.d/nfs/dfshares/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.12 */ -# # Copyright (c) 1989 by Sun Microsystems, Inc. # @@ -35,6 +33,9 @@ OBJS= $(LIBPROG).o SRCS= $(OBJS:%.o=%.c) LDLIBS += -lrpcsvc -lnsl +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses $(LIBPROG): $(OBJS) $(LINK.c) -o $@ $(OBJS) $(LDLIBS) diff --git a/usr/src/cmd/fs.d/nfs/mount/Makefile b/usr/src/cmd/fs.d/nfs/mount/Makefile index 4c6fb4686a..dd28ff761d 100644 --- a/usr/src/cmd/fs.d/nfs/mount/Makefile +++ b/usr/src/cmd/fs.d/nfs/mount/Makefile @@ -42,6 +42,13 @@ SRCS= $(LIBPROG).c $(FSLIBSRC) ../lib/nfs_sec.c ../lib/replica.c \ UNCHECKED_HDRS= webnfs.h +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-address +CERRWARN += -_gcc=-Wno-unused-function + # # Message catalog # diff --git a/usr/src/cmd/fs.d/nfs/mountd/Makefile b/usr/src/cmd/fs.d/nfs/mountd/Makefile index b4271cc5f3..f71a8b4816 100644 --- a/usr/src/cmd/fs.d/nfs/mountd/Makefile +++ b/usr/src/cmd/fs.d/nfs/mountd/Makefile @@ -39,6 +39,15 @@ DOBJ = $(DSRC:%.d=%.o) LDLIBS += -lrpcsvc -lnsl -lbsm -lsocket -ltsnet -ltsol -lnvpair -lscf CPPFLAGS += -D_REENTRANT -I../lib +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-address +CERRWARN += -_gcc=-Wno-unused-function + $(TYPEPROG): $(OBJS) $(COMPILE.d) -s $(DSRC) -o $(DOBJ) $(OBJS) $(LINK.c) -o $@ $(DOBJ) $(OBJS) $(LDLIBS) diff --git a/usr/src/cmd/fs.d/nfs/nfs4cbd/Makefile b/usr/src/cmd/fs.d/nfs/nfs4cbd/Makefile index 96921e3359..4c6f4dca16 100644 --- a/usr/src/cmd/fs.d/nfs/nfs4cbd/Makefile +++ b/usr/src/cmd/fs.d/nfs/nfs4cbd/Makefile @@ -20,12 +20,9 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# cmd/fs.d/nfs/nfs4cbd/Makefile FSTYPE= nfs TYPEPROG= nfs4cbd @@ -39,6 +36,10 @@ LDLIBS += -lnsl CPPFLAGS += -I. -I../.. -I../lib CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-extra + .KEEP_STATE: all: $(TYPEPROG) diff --git a/usr/src/cmd/fs.d/nfs/nfsd/Makefile b/usr/src/cmd/fs.d/nfs/nfsd/Makefile index 14cc63869b..90a77dcbef 100644 --- a/usr/src/cmd/fs.d/nfs/nfsd/Makefile +++ b/usr/src/cmd/fs.d/nfs/nfsd/Makefile @@ -37,7 +37,10 @@ SRCS= $(LOCAL:%.o=%.c) ../lib/nfs_tbind.c ../lib/thrpool.c ../lib/daemon.c \ ../lib/smfcfg.c CPPFLAGS += -I../lib - +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-extra $(TYPEPROG): $(OBJS) $(CC) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS) diff --git a/usr/src/cmd/fs.d/nfs/nfslog/Makefile b/usr/src/cmd/fs.d/nfs/nfslog/Makefile index c8d5ec9127..243574f744 100644 --- a/usr/src/cmd/fs.d/nfs/nfslog/Makefile +++ b/usr/src/cmd/fs.d/nfs/nfslog/Makefile @@ -22,9 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# -# cmd/fs.d/nfs/nfslog/Makefile FSTYPE= nfs TYPEPROG= nfslogd @@ -41,6 +38,10 @@ OBJS= $(LOCAL) $(COMMON) SRCS= $(LOCAL:%.o=%.c) $(COMMON:%.o=../lib/%.c) LDLIBS += -lsocket -lnsl CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-type-limits CPPFLAGS += -D_FILE_OFFSET_BITS=64 # diff --git a/usr/src/cmd/fs.d/nfs/nfsmapid/Makefile b/usr/src/cmd/fs.d/nfs/nfsmapid/Makefile index 7d29271eb0..6afd2bb495 100644 --- a/usr/src/cmd/fs.d/nfs/nfsmapid/Makefile +++ b/usr/src/cmd/fs.d/nfs/nfsmapid/Makefile @@ -39,6 +39,10 @@ DOBJ = $(DSRC:%.d=%.o) OBJS = nfsmapid.o nfsmapid_server.o $(COMMON) CPPFLAGS += -I../lib -D_POSIX_PTHREAD_SEMANTICS +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized all: $(TYPEPROG) $(TESTPROG) diff --git a/usr/src/cmd/fs.d/nfs/nfsref/Makefile b/usr/src/cmd/fs.d/nfs/nfsref/Makefile index fa5d58460d..9f5b8e73a3 100644 --- a/usr/src/cmd/fs.d/nfs/nfsref/Makefile +++ b/usr/src/cmd/fs.d/nfs/nfsref/Makefile @@ -34,6 +34,8 @@ CFLAGS += $(CCVERBOSE) -I../lib OBJS= nfsref.o ref_subr.o SRCS= nfsref.c +CERRWARN += -_gcc=-Wno-unused-variable + LDLIBS += -lreparse -lnvpair -lnsl -lumem $(PROG): $(OBJS) diff --git a/usr/src/cmd/fs.d/nfs/nfsstat/Makefile b/usr/src/cmd/fs.d/nfs/nfsstat/Makefile index a5000c80c8..1fe48838f6 100644 --- a/usr/src/cmd/fs.d/nfs/nfsstat/Makefile +++ b/usr/src/cmd/fs.d/nfs/nfsstat/Makefile @@ -41,6 +41,7 @@ SRCS += $(STAT_COMMON_SRCS) OBJS += $(STAT_COMMON_OBJS) CPPFLAGS += -I$(STATCOMMONDIR) +CERRWARN += -_gcc=-Wno-parentheses LDLIBS += -lkstat -lnsl $(PROG): $(OBJS) diff --git a/usr/src/cmd/fs.d/nfs/rquotad/Makefile b/usr/src/cmd/fs.d/nfs/rquotad/Makefile index aa6f6965d4..e75afe3a9b 100644 --- a/usr/src/cmd/fs.d/nfs/rquotad/Makefile +++ b/usr/src/cmd/fs.d/nfs/rquotad/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989 by Sun Microsystems, Inc. # @@ -36,6 +34,8 @@ SRCS= $(OBJS:%.o=%.c) XFILE= $(ROOT)/usr/include/rpcsvc/rquota.x CPPFLAGS += -D_LARGEFILE64_SOURCE +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-variable LDLIBS += -lnsl $(TYPEPROG): $(OBJS) diff --git a/usr/src/cmd/fs.d/nfs/showmount/Makefile b/usr/src/cmd/fs.d/nfs/showmount/Makefile index 2400dc8c18..7974fd5cdc 100644 --- a/usr/src/cmd/fs.d/nfs/showmount/Makefile +++ b/usr/src/cmd/fs.d/nfs/showmount/Makefile @@ -20,11 +20,8 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" /* */ -# # Copyright (c) 1989 by Sun Microsystems, Inc. # -# cmd/fs.d/nfs/showmount/Makefile FSTYPE= nfs LIBPROG= showmount @@ -45,6 +42,11 @@ POFILE= showmount.po LDLIBS += -lrpcsvc -lnsl +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized + $(LIBPROG): $(OBJS) $(LINK.c) -o $@ $(OBJS) $(LDLIBS) $(POST_PROCESS) diff --git a/usr/src/cmd/fs.d/nfs/statd/Makefile b/usr/src/cmd/fs.d/nfs/statd/Makefile index 709454b57a..1e55770f83 100644 --- a/usr/src/cmd/fs.d/nfs/statd/Makefile +++ b/usr/src/cmd/fs.d/nfs/statd/Makefile @@ -23,10 +23,6 @@ # Copyright 1990-2003 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# -# cmd/fs.d/nfs/statd/Makefile -# FSTYPE= nfs TYPEPROG= statd @@ -35,6 +31,10 @@ ATTMK= $(TYPEPROG) include ../../Makefile.fstype CPPFLAGS += -D_REENTRANT -DSUN_THREADS +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + OBJS= sm_svc.o sm_proc.o sm_statd.o selfcheck.o SRCS= sm_svc.c sm_proc.c sm_statd.c ../lib/selfcheck.c diff --git a/usr/src/cmd/fs.d/pcfs/fsck/Makefile b/usr/src/cmd/fs.d/pcfs/fsck/Makefile index deecc57ceb..dbe2df4a98 100644 --- a/usr/src/cmd/fs.d/pcfs/fsck/Makefile +++ b/usr/src/cmd/fs.d/pcfs/fsck/Makefile @@ -19,12 +19,9 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# cmd/fs.d/pcfs/fsck/Makefile FSTYPE= pcfs LIBPROG= fsck @@ -58,6 +55,10 @@ catalog: $(POFILE) # CPPFLAGS += -D_LARGEFILE64_SOURCE +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized + # # We need to tell lint not to complain about the routines # we are grabbing from the kernel as being undefined. diff --git a/usr/src/cmd/fs.d/pcfs/mkfs/Makefile b/usr/src/cmd/fs.d/pcfs/mkfs/Makefile index 4edca7e6fc..6a3a05acf9 100644 --- a/usr/src/cmd/fs.d/pcfs/mkfs/Makefile +++ b/usr/src/cmd/fs.d/pcfs/mkfs/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1998 by Sun Microsystems, Inc. # All rights reserved. # @@ -42,6 +40,7 @@ POFILE= mkfs.po catalog: $(POFILE) CPPFLAGS += -D_LARGEFILE64_SOURCE +CERRWARN += -_gcc=-Wno-parentheses $(LIBPROG): $(OBJS) $(LINK.c) -o $@ $(OBJS) $(LDLIBS) diff --git a/usr/src/cmd/fs.d/pcfs/mount/Makefile b/usr/src/cmd/fs.d/pcfs/mount/Makefile index 2da6037e9c..bb29ed53d8 100644 --- a/usr/src/cmd/fs.d/pcfs/mount/Makefile +++ b/usr/src/cmd/fs.d/pcfs/mount/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2003 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -32,3 +30,5 @@ LIBPROG= mount include ../../Makefile.fstype include ../../Makefile.mount include ../../Makefile.mount.targ + +CERRWARN += -_gcc=-Wno-uninitialized diff --git a/usr/src/cmd/fs.d/reparsed/Makefile b/usr/src/cmd/fs.d/reparsed/Makefile index 9df265a3c9..e61d7140f4 100644 --- a/usr/src/cmd/fs.d/reparsed/Makefile +++ b/usr/src/cmd/fs.d/reparsed/Makefile @@ -37,6 +37,7 @@ POFILE= $(TYPEPROG).po CLOBBERFILES += $(TYPEPROG) CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-variable C99MODE= $(C99_ENABLE) LDLIBS += -lreparse -lnsl diff --git a/usr/src/cmd/fs.d/smbclnt/chacl/Makefile b/usr/src/cmd/fs.d/smbclnt/chacl/Makefile index a791c7b07a..52a9d04112 100644 --- a/usr/src/cmd/fs.d/smbclnt/chacl/Makefile +++ b/usr/src/cmd/fs.d/smbclnt/chacl/Makefile @@ -35,6 +35,8 @@ SRCS= $(LIBPROG).c $(FSLIBSRC) LDLIBS += -lsmbfs -lsec CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-label C99MODE= $(C99_ENABLE) CLOBBERFILES += $(LIBPROG) diff --git a/usr/src/cmd/fs.d/smbclnt/lsacl/Makefile b/usr/src/cmd/fs.d/smbclnt/lsacl/Makefile index 4fbb347a73..fad9235ecd 100644 --- a/usr/src/cmd/fs.d/smbclnt/lsacl/Makefile +++ b/usr/src/cmd/fs.d/smbclnt/lsacl/Makefile @@ -35,6 +35,7 @@ SRCS= $(LIBPROG).c $(FSLIBSRC) LDLIBS += -lsmbfs -lsec CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-label C99MODE= $(C99_ENABLE) CLOBBERFILES += $(LIBPROG) diff --git a/usr/src/cmd/fs.d/smbclnt/mount/Makefile b/usr/src/cmd/fs.d/smbclnt/mount/Makefile index 7dc0011dd3..0124840e23 100644 --- a/usr/src/cmd/fs.d/smbclnt/mount/Makefile +++ b/usr/src/cmd/fs.d/smbclnt/mount/Makefile @@ -41,6 +41,8 @@ CLOBBERFILES += $(LIBPROG) $(ROOTLIBFSTYPE)/mount := FILEMODE= 04555 CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label C99MODE= $(C99_ENABLE) LDLIBS += -lsmbfs diff --git a/usr/src/cmd/fs.d/smbclnt/test/Makefile b/usr/src/cmd/fs.d/smbclnt/test/Makefile index 09e2ebdda9..40f12dfc39 100644 --- a/usr/src/cmd/fs.d/smbclnt/test/Makefile +++ b/usr/src/cmd/fs.d/smbclnt/test/Makefile @@ -36,6 +36,7 @@ SRCS= $(LIBPROG).c $(FSLIBSRC) LDLIBS += -lsmbfs CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-variable C99MODE= $(C99_ENABLE) CLOBBERFILES += $(LIBPROG) diff --git a/usr/src/cmd/fs.d/tmpfs/Makefile b/usr/src/cmd/fs.d/tmpfs/Makefile index 6e6f0de398..61599e70f4 100644 --- a/usr/src/cmd/fs.d/tmpfs/Makefile +++ b/usr/src/cmd/fs.d/tmpfs/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2003 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -32,3 +30,5 @@ LIBPROG= mount include ../Makefile.fstype include ../Makefile.mount include ../Makefile.mount.targ + +CERRWARN += -_gcc=-Wno-uninitialized diff --git a/usr/src/cmd/fs.d/udfs/fsck/Makefile b/usr/src/cmd/fs.d/udfs/fsck/Makefile index e76104ddc7..f3870fba38 100644 --- a/usr/src/cmd/fs.d/udfs/fsck/Makefile +++ b/usr/src/cmd/fs.d/udfs/fsck/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1999 by Sun Microsystems, Inc. # All rights reserved. # @@ -39,6 +37,9 @@ UDFSDIR= ../mkfs UDFSOBJS= udfslib.o #UDFSSRCS= $(UDFSOBJS:%.o=%.c) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + OBJS= $(FSCKOBJS) $(UDFSOBJS) SRCS= $(FSCKSRCS) $(UDFSSRCS) ../mkfs/udfslib.c diff --git a/usr/src/cmd/fs.d/udfs/fsdb/Makefile b/usr/src/cmd/fs.d/udfs/fsdb/Makefile index ebfb304eb9..4da2706c79 100644 --- a/usr/src/cmd/fs.d/udfs/fsdb/Makefile +++ b/usr/src/cmd/fs.d/udfs/fsdb/Makefile @@ -19,8 +19,6 @@ # CDDL HEADER END # # -#pragma ident "%Z%%M% %I% %E% SMI" -# # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -44,6 +42,13 @@ YFLAGS = "-d" LINTFLAGS += -erroff=E_STATIC_UNUSED LINTFLAGS64 += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-unused-function + SRCS= fsdb.c ud_lib.c fsdb : fsdb_yacc.o fsdb_lex.o ud_lib.o fsdb.o $(MAPFILES) diff --git a/usr/src/cmd/fs.d/udfs/fstyp/Makefile b/usr/src/cmd/fs.d/udfs/fstyp/Makefile index 55164e69cb..454d7f43c1 100644 --- a/usr/src/cmd/fs.d/udfs/fstyp/Makefile +++ b/usr/src/cmd/fs.d/udfs/fstyp/Makefile @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# FSTYP_VERS=1 FSTYPE= udfs @@ -38,6 +36,9 @@ MAPFILES = CFLAGS += $(C_PICFLAGS) DYNLIB= $(LIBPROG) +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized + LDLIBS += -lnvpair -ladm -lc LINTFLAGS += -erroff=E_STATIC_UNUSED -erroff=E_NAME_DEF_NOT_USED2 diff --git a/usr/src/cmd/fs.d/udfs/labelit/Makefile b/usr/src/cmd/fs.d/udfs/labelit/Makefile index 6d058fab42..e0bfc31b25 100644 --- a/usr/src/cmd/fs.d/udfs/labelit/Makefile +++ b/usr/src/cmd/fs.d/udfs/labelit/Makefile @@ -19,8 +19,6 @@ # CDDL HEADER END # # -#pragma ident "%Z%%M% %I% %E% SMI" -# # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -38,6 +36,9 @@ CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 LINTFLAGS += -xerroff=E_STATIC_UNUSED LINTFLAGS64 += -xerroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized + labelit : labelit.o ud_lib.o $(LINK.c) -o $@ labelit.o ud_lib.o $(LDLIBS) $(POST_PROCESS) diff --git a/usr/src/cmd/fs.d/udfs/mkfs/Makefile b/usr/src/cmd/fs.d/udfs/mkfs/Makefile index 753b5a2a55..e235f01963 100644 --- a/usr/src/cmd/fs.d/udfs/mkfs/Makefile +++ b/usr/src/cmd/fs.d/udfs/mkfs/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1999,2001 by Sun Microsystems, Inc. # All rights reserved. # @@ -47,6 +45,9 @@ UDFSDIR= ../../../../uts/common/fs/ufs #UDFSOBJS= ufs_subr.o ufs_tables.o UDFSOBJS= +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + OBJS= $(MKFSOBJS) $(UDFSOBJS) SRCS= $(OBJS:%.o=%.c) diff --git a/usr/src/cmd/fs.d/ufs/df/Makefile b/usr/src/cmd/fs.d/ufs/df/Makefile index 548ea3ea95..5b579980b9 100644 --- a/usr/src/cmd/fs.d/ufs/df/Makefile +++ b/usr/src/cmd/fs.d/ufs/df/Makefile @@ -23,8 +23,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# FSTYPE= ufs LIBPROG= df @@ -37,6 +35,11 @@ OBJS= df.o CPPFLAGS += -D_LARGEFILE64_SOURCE LDLIBS += -ladm +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-function + # for messaging catalogue file # POFILE= df.po diff --git a/usr/src/cmd/fs.d/ufs/edquota/Makefile b/usr/src/cmd/fs.d/ufs/edquota/Makefile index 103bcace92..1f29704147 100644 --- a/usr/src/cmd/fs.d/ufs/edquota/Makefile +++ b/usr/src/cmd/fs.d/ufs/edquota/Makefile @@ -20,12 +20,9 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989,1996 by Sun Microsystems, Inc. # All rights reserved. # -# cmd/fs.d/ufs/edquota/Makefile FSTYPE= ufs LIBPROG= edquota @@ -37,6 +34,7 @@ LINKVALUE= ../lib/fs/$(FSTYPE)/$(LIBPROG) include ../../Makefile.fstype CPPFLAGS += -D_LARGEFILE64_SOURCE +CERRWARN += -_gcc=-Wno-parentheses lint: lint_PROG $(ROOTUSRSBIN)/$(LIBPROG): diff --git a/usr/src/cmd/fs.d/ufs/ff/Makefile b/usr/src/cmd/fs.d/ufs/ff/Makefile index 5425b7c5cd..2c12941ec9 100644 --- a/usr/src/cmd/fs.d/ufs/ff/Makefile +++ b/usr/src/cmd/fs.d/ufs/ff/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989,1996 by Sun Microsystems, Inc. # All rights reserved. # @@ -38,6 +36,8 @@ SRCS= $(LIBPROG).c $(ROLLSRCS) CPPFLAGS += -D_LARGEFILE64_SOURCE +CERRWARN += -_gcc=-Wno-uninitialized + $(LIBPROG): $(OBJS) $(LINK.c) -o $@ $(OBJS) $(LDLIBS) $(POST_PROCESS) diff --git a/usr/src/cmd/fs.d/ufs/fsck/Makefile b/usr/src/cmd/fs.d/ufs/fsck/Makefile index 33200494df..9562fdedb2 100644 --- a/usr/src/cmd/fs.d/ufs/fsck/Makefile +++ b/usr/src/cmd/fs.d/ufs/fsck/Makefile @@ -19,12 +19,9 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# cmd/fs.d/ufs/fsck/Makefile FSTYPE= ufs LIBPROG= fsck @@ -50,6 +47,10 @@ SRCS= $(FSCKSRCS) $(UFSSRCS) $(ROLLSRCS) $(FSLIBSRC) CPPFLAGS += -D_LARGEFILE64_SOURCE -I../../ -I../../../../lib/libadm/inc LDLIBS += -lefi -lavl +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-uninitialized + $(LIBPROG): $(OBJS) $(LINK.c) -o $@ $(OBJS) $(LDLIBS) $(CTFMERGE_HOOK) $(POST_PROCESS) diff --git a/usr/src/cmd/fs.d/ufs/fsdb/Makefile b/usr/src/cmd/fs.d/ufs/fsdb/Makefile index 6ab2866e98..05dfa205dd 100644 --- a/usr/src/cmd/fs.d/ufs/fsdb/Makefile +++ b/usr/src/cmd/fs.d/ufs/fsdb/Makefile @@ -20,10 +20,9 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989,2001 by Sun Microsystems, Inc. # All rights reserved. +# FSTYPE= ufs LIBPROG= fsdb @@ -32,6 +31,12 @@ include ../../Makefile.fstype CPPFLAGS += -D_LARGEFILE64_SOURCE +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized + SRCS= $(LIBPROG).c lint: lint_SRCS diff --git a/usr/src/cmd/fs.d/ufs/fssnap/Makefile b/usr/src/cmd/fs.d/ufs/fssnap/Makefile index 50c73e5bb1..155ad227e8 100644 --- a/usr/src/cmd/fs.d/ufs/fssnap/Makefile +++ b/usr/src/cmd/fs.d/ufs/fssnap/Makefile @@ -23,8 +23,6 @@ # Copyright 2003 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# FSTYPE= ufs LIBPROG= fssnap @@ -41,6 +39,10 @@ OBJS= $(FSSNAPOBJS) $(TOPOBJS) SRCS= $(FSSNAPSRCS) $(TOPSRCS) CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += -lkstat -ldevinfo # message catalog diff --git a/usr/src/cmd/fs.d/ufs/mkfs/Makefile b/usr/src/cmd/fs.d/ufs/mkfs/Makefile index a14f423d07..6b10524058 100644 --- a/usr/src/cmd/fs.d/ufs/mkfs/Makefile +++ b/usr/src/cmd/fs.d/ufs/mkfs/Makefile @@ -19,8 +19,6 @@ # CDDL HEADER END # # -# ident "%Z%%M% %I% %E% SMI" -# # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -36,6 +34,11 @@ OBJS= $(LIBPROG).o $(ROLLOBJS) $(FSLIB) SRCS= $(LIBPROG).c $(ROLLSRCS) $(FSLIBSRC) MKFSOBJS= mkfs.o +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-empty-body +CERRWARN += -_gcc=-Wno-uninitialized + # for messaging catalog # POFILE= mkfs.po diff --git a/usr/src/cmd/fs.d/ufs/mount/Makefile b/usr/src/cmd/fs.d/ufs/mount/Makefile index abe90d6f68..1e7fca4a4e 100644 --- a/usr/src/cmd/fs.d/ufs/mount/Makefile +++ b/usr/src/cmd/fs.d/ufs/mount/Makefile @@ -22,9 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# -# cmd/fs.d/ufs/mount/Makefile FSTYPE= ufs PROG= mount @@ -41,5 +38,6 @@ include ../../Makefile.fstype include ../../Makefile.mount CPPFLAGS += -D_LARGEFILE64_SOURCE +CERRWARN += -_gcc=-Wno-parentheses include ../../Makefile.mount.targ diff --git a/usr/src/cmd/fs.d/ufs/newfs/Makefile b/usr/src/cmd/fs.d/ufs/newfs/Makefile index 583ff1f97d..e740669879 100644 --- a/usr/src/cmd/fs.d/ufs/newfs/Makefile +++ b/usr/src/cmd/fs.d/ufs/newfs/Makefile @@ -20,12 +20,9 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# cmd/fs.d/ufs/newfs/Makefile FSTYPE= ufs LIBPROG= newfs @@ -38,6 +35,9 @@ include ../../Makefile.fstype CPPFLAGS += -I../../ -D_LARGEFILE64_SOURCE LDLIBS += -ladm -lefi +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + OBJS= $(LIBPROG).o $(FSLIB) SRCS= $(LIBPROG).c $(FSLIBSRC) diff --git a/usr/src/cmd/fs.d/ufs/quota/Makefile b/usr/src/cmd/fs.d/ufs/quota/Makefile index 3f0fb8544c..3c2b6bc313 100644 --- a/usr/src/cmd/fs.d/ufs/quota/Makefile +++ b/usr/src/cmd/fs.d/ufs/quota/Makefile @@ -39,6 +39,10 @@ XFILE= $(ROOT)/usr/include/rpcsvc/rquota.x CPPFLAGS += -I $(ROOT)/usr/include/sys -D_LARGEFILE64_SOURCE LDLIBS += -lnsl +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses + FILEMODE= 04555 $(LIBPROG): $(OBJS) diff --git a/usr/src/cmd/fs.d/ufs/quotacheck/Makefile b/usr/src/cmd/fs.d/ufs/quotacheck/Makefile index 448d9f93cb..cb302325e4 100644 --- a/usr/src/cmd/fs.d/ufs/quotacheck/Makefile +++ b/usr/src/cmd/fs.d/ufs/quotacheck/Makefile @@ -20,12 +20,9 @@ # CDDL HEADER END # # -# ident "%Z%%M% %I% %E% SMI" -# # Copyright 2003 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# cmd/fs.d/ufs/quotacheck/Makefile FSTYPE= ufs LIBPROG= quotacheck @@ -42,6 +39,9 @@ FSOBJS= preenlib.o FSSRCS= ../../preenlib.c SRCS= $(OBJS:.o=.c) +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-type-limits + lint: lint_PROG $(FSOBJS): $(FSSRCS) diff --git a/usr/src/cmd/fs.d/ufs/quotaon/Makefile b/usr/src/cmd/fs.d/ufs/quotaon/Makefile index 25a59643b9..b53e3dd85a 100644 --- a/usr/src/cmd/fs.d/ufs/quotaon/Makefile +++ b/usr/src/cmd/fs.d/ufs/quotaon/Makefile @@ -49,6 +49,9 @@ include ../../Makefile.fstype $(ROOTINIT_SCRIPT) := FILEMODE = 0744 CPPFLAGS += -D_LARGEFILE64_SOURCE +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function + lint: lint_PROG $(ROOTLIBFSTYPE)/$(QUOTAOFF): $(ROOTLIBFSTYPE)/$(LIBPROG) diff --git a/usr/src/cmd/fs.d/ufs/repquota/Makefile b/usr/src/cmd/fs.d/ufs/repquota/Makefile index 8be1477321..600ca6b373 100644 --- a/usr/src/cmd/fs.d/ufs/repquota/Makefile +++ b/usr/src/cmd/fs.d/ufs/repquota/Makefile @@ -20,12 +20,9 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989,1996 by Sun Microsystems, Inc. # All rights reserved. # -# cmd/fs.d/ufs/repquota/Makefile FSTYPE= ufs LIBPROG= repquota @@ -37,6 +34,10 @@ LINKVALUE= ../lib/fs/$(FSTYPE)/$(LIBPROG) include ../../Makefile.fstype CPPFLAGS += -D_LARGEFILE64_SOURCE + +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized + lint: lint_PROG $(ROOTUSRSBIN)/$(LIBPROG): diff --git a/usr/src/cmd/fs.d/ufs/roll_log/Makefile b/usr/src/cmd/fs.d/ufs/roll_log/Makefile index f5f2d4efff..26f4e03e18 100644 --- a/usr/src/cmd/fs.d/ufs/roll_log/Makefile +++ b/usr/src/cmd/fs.d/ufs/roll_log/Makefile @@ -20,12 +20,9 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1996,1997 by Sun Microsystems, Inc. # All rights reserved. # -# cmd/fs.d/ufs/roll_log include ../../Makefile.fstype @@ -33,6 +30,8 @@ INCLUDES= roll_log.h SRCS= roll_log.c OBJS= $(SRCS:%.c=$(MACH)/%.o) +CERRWARN += -_gcc=-Wno-switch + CLOBBERFILES= $(OBJS) .KEEP_STATE: diff --git a/usr/src/cmd/fs.d/ufs/tunefs/Makefile b/usr/src/cmd/fs.d/ufs/tunefs/Makefile index e5cc12f8f9..858ea7c3d3 100644 --- a/usr/src/cmd/fs.d/ufs/tunefs/Makefile +++ b/usr/src/cmd/fs.d/ufs/tunefs/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989,1996, by Sun Microsystems, Inc. # All rights reserved. # @@ -38,6 +36,9 @@ include ../../Makefile.fstype LDLIBS += -ladm CPPFLAGS += -D_LARGEFILE64_SOURCE +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + lint: lint_PROG $(ROOTUSRSBIN)/$(LIBPROG): FRC diff --git a/usr/src/cmd/fs.d/ufs/volcopy/Makefile b/usr/src/cmd/fs.d/ufs/volcopy/Makefile index 7a4ec018e6..9da5b17da5 100644 --- a/usr/src/cmd/fs.d/ufs/volcopy/Makefile +++ b/usr/src/cmd/fs.d/ufs/volcopy/Makefile @@ -23,8 +23,6 @@ # Copyright 1989,2003 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# FSTYPE= ufs LIBPROG= volcopy @@ -32,14 +30,17 @@ ATTMK= $(LIBPROG) include ../../Makefile.fstype +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized + +LDLIBS += -lmapmalloc + # for messaging catalog # -POFILE= volcopy.po -XGETFLAGS += -a -x volcopy.xcl +POFILE= volcopy.po +XGETFLAGS += -a -x volcopy.xcl catalog: $(POFILE) - -LDLIBS += -lmapmalloc - lint: lint_PROG diff --git a/usr/src/cmd/fuser/Makefile b/usr/src/cmd/fuser/Makefile index e2d937c724..8d4fee880a 100644 --- a/usr/src/cmd/fuser/Makefile +++ b/usr/src/cmd/fuser/Makefile @@ -23,14 +23,12 @@ # Copyright 2003 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# -# cmd/fuser/Makefile PROG= fuser include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-parentheses LDLIBS += -lkstat -ldevinfo ROOTSYMLINK= $(ROOTETCPROG) diff --git a/usr/src/cmd/fwflash/Makefile.com b/usr/src/cmd/fwflash/Makefile.com index b4bd85b8a5..5f0873b244 100644 --- a/usr/src/cmd/fwflash/Makefile.com +++ b/usr/src/cmd/fwflash/Makefile.com @@ -28,6 +28,10 @@ CLOSED= $(SRC)/../closed +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-address + ROOTUSR= $(ROOT)/usr ROOTUSRINCLD= $(ROOTUSR)/include ROOTUSRINCLDFWFLASH= $(ROOTUSRINCLD)/fwflash diff --git a/usr/src/cmd/gencat/Makefile b/usr/src/cmd/gencat/Makefile index ed163b419e..f5ccbe0e45 100644 --- a/usr/src/cmd/gencat/Makefile +++ b/usr/src/cmd/gencat/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989 by Sun Microsystems, Inc. # @@ -32,6 +30,9 @@ SRCS= $(OBJS:%.o=%.c) include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-value + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/geniconvtbl/Makefile.com b/usr/src/cmd/geniconvtbl/Makefile.com index fbaee1ae2a..389ce98098 100644 --- a/usr/src/cmd/geniconvtbl/Makefile.com +++ b/usr/src/cmd/geniconvtbl/Makefile.com @@ -21,9 +21,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# -# cmd/geniconvtbl/Makefile.com $(NOT_NATIVE)NATIVE_BUILD = $(POUND_SIGN) @@ -87,6 +84,11 @@ CLEANFILES = $(OBJS) $(YTABC) $(YTABH) $(LEXYY) $(YOUT) \ $(POFILES) $(POFILE) CPPFLAGS += -I. -I.. +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-implicit-function-declaration YFLAGS += -d -v CFLAGS += -D_FILE_OFFSET_BITS=64 diff --git a/usr/src/cmd/genmsg/Makefile b/usr/src/cmd/genmsg/Makefile index 45713eb235..aafd07c843 100644 --- a/usr/src/cmd/genmsg/Makefile +++ b/usr/src/cmd/genmsg/Makefile @@ -22,9 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# -# cmd/genmsg/Makefile include ../Makefile.cmd @@ -37,6 +34,10 @@ LEXSRCS= genmsg.l LEXINTSRCS= lex.yy.c LEXOBJS= lex.yy.o +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable + LDLIBS += -ll YFLAGS = -d CPPFLAGS = -I../head $(CPPFLAGS.master) diff --git a/usr/src/cmd/getconf/Makefile b/usr/src/cmd/getconf/Makefile index 8fb8d5d192..ed93052eec 100644 --- a/usr/src/cmd/getconf/Makefile +++ b/usr/src/cmd/getconf/Makefile @@ -23,7 +23,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" PROG= getconf XPG4PROG= getconf @@ -38,6 +37,7 @@ include ../Makefile.cmd XPG4EXOBJS += values-xpg4.o CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses # XPG4 $(XPG4) := CFLAGS += -D_XOPEN_SOURCE -I$(SRC)/lib/libc/inc diff --git a/usr/src/cmd/getent/Makefile b/usr/src/cmd/getent/Makefile index bb2dfd5caa..4b6e79c992 100644 --- a/usr/src/cmd/getent/Makefile +++ b/usr/src/cmd/getent/Makefile @@ -23,13 +23,14 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= getent include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-implicit-function-declaration + OBJECTS= \ dogetethers.o \ dogetgr.o \ diff --git a/usr/src/cmd/getfacl/Makefile b/usr/src/cmd/getfacl/Makefile index 9eb8b4320e..575c1bd3cb 100644 --- a/usr/src/cmd/getfacl/Makefile +++ b/usr/src/cmd/getfacl/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -# ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1993,2001 by Sun Microsystems, Inc. # All rights reserved. # @@ -30,6 +28,9 @@ PROG= getfacl include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/grep/grep.c b/usr/src/cmd/grep/grep.c index 62a4527529..edc83be3e6 100644 --- a/usr/src/cmd/grep/grep.c +++ b/usr/src/cmd/grep/grep.c @@ -52,6 +52,9 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> +#include <ftw.h> +#include <limits.h> +#include <sys/param.h> static const char *errstr[] = { "Range endpoint too large.", @@ -73,6 +76,7 @@ static const char *errstr[] = { #define errmsg(msg, arg) (void) fprintf(stderr, gettext(msg), arg) #define BLKSIZE 512 #define GBUFSIZ 8192 +#define MAX_DEPTH 1000 static int temp; static long long lnum; @@ -83,6 +87,8 @@ static int nflag; static int bflag; static int lflag; static int cflag; +static int rflag; +static int Rflag; static int vflag; static int sflag; static int iflag; @@ -93,13 +99,16 @@ static int errflg; static int nfile; static long long tln; static int nsucc; +static int outfn = 0; static int nlflag; static char *ptr, *ptrend; static char *expbuf; -static void execute(char *); +static void execute(const char *, int); static void regerr(int); -static int succeed(char *); +static void prepare(const char *); +static int recursive(const char *, const struct stat *, int, struct FTW *); +static int succeed(const char *); int main(int argc, char **argv) @@ -114,7 +123,7 @@ main(int argc, char **argv) #endif (void) textdomain(TEXT_DOMAIN); - while ((c = getopt(argc, argv, "hqblcnsviyw")) != -1) + while ((c = getopt(argc, argv, "hqblcnRrsviyw")) != -1) switch (c) { case 'h': hflag++; @@ -131,6 +140,12 @@ main(int argc, char **argv) case 'n': nflag++; break; + case 'R': + Rflag++; + /* FALLTHROUGH */ + case 'r': + rflag++; + break; case 'b': bflag++; break; @@ -152,7 +167,8 @@ main(int argc, char **argv) } if (errflg || (optind >= argc)) { - errmsg("Usage: grep [-c|-l|-q] -hbnsviw pattern file . . .\n", + errmsg("Usage: grep [-c|-l|-q] [-r|-R] -hbnsviw " + "pattern file . . .\n", (char *)NULL); exit(2); } @@ -190,16 +206,80 @@ main(int argc, char **argv) regerr(regerrno); if (--argc == 0) - execute(NULL); + execute(NULL, 0); else while (argc-- > 0) - execute(*++argv); + prepare(*++argv); return (nsucc == 2 ? 2 : (nsucc == 0 ? 1 : 0)); } static void -execute(char *file) +prepare(const char *path) +{ + struct stat st; + int walkflags = FTW_CHDIR; + char *buf = NULL; + + if (rflag) { + if (stat(path, &st) != -1 && + (st.st_mode & S_IFMT) == S_IFDIR) { + outfn = 1; + + /* + * Add trailing slash if arg + * is directory, to resolve symlinks. + */ + if (path[strlen(path) - 1] != '/') { + (void) asprintf(&buf, "%s/", path); + if (buf != NULL) + path = buf; + } + + /* + * Search through subdirs if path is directory. + * Don't follow symlinks if Rflag is not set. + */ + if (!Rflag) + walkflags |= FTW_PHYS; + + if (nftw(path, recursive, MAX_DEPTH, walkflags) != 0) { + if (!sflag) + errmsg("grep: can't open %s\n", path); + nsucc = 2; + } + return; + } + } + execute(path, 0); +} + +static int +recursive(const char *name, const struct stat *statp, int info, struct FTW *ftw) +{ + /* + * process files and follow symlinks if Rflag set. + */ + if (info != FTW_F) { + if (!sflag && + (info == FTW_SLN || info == FTW_DNR || info == FTW_NS)) { + /* report broken symlinks and unreadable files */ + errmsg("grep: can't open %s\n", name); + } + return (0); + } + + /* skip devices and pipes if Rflag is not set */ + if (!Rflag && !S_ISREG(statp->st_mode)) + return (0); + + /* pass offset to relative name from FTW_CHDIR */ + execute(name, ftw->base); + return (0); +} + +static void +execute(const char *file, int base) { char *lbuf, *p; long count; @@ -221,7 +301,7 @@ execute(char *file) if (file == NULL) temp = 0; - else if ((temp = open(file, O_RDONLY)) == -1) { + else if ((temp = open(file + base, O_RDONLY)) == -1) { if (!sflag) errmsg("grep: can't open %s\n", file); nsucc = 2; @@ -235,6 +315,7 @@ execute(char *file) if (cflag && !qflag) { if (nfile > 1 && !hflag && file) (void) fprintf(stdout, "%s:", file); + if (!rflag) (void) fprintf(stdout, "%lld\n", tln); } return; @@ -329,14 +410,15 @@ execute(char *file) (void) close(temp); if (cflag && !qflag) { - if (nfile > 1 && !hflag && file) + if (!hflag && file && (nfile > 1 || + (rflag && outfn))) (void) fprintf(stdout, "%s:", file); (void) fprintf(stdout, "%lld\n", tln); } } static int -succeed(char *f) +succeed(const char *f) { int nchars; nsucc = (nsucc == 2) ? 2 : 1; @@ -359,9 +441,10 @@ succeed(char *f) return (1); } - if (nfile > 1 && !hflag) + if (!hflag && (nfile > 1 || (rflag && outfn))) { /* print filename */ (void) fprintf(stdout, "%s:", f); + } if (bflag) /* print block number */ diff --git a/usr/src/cmd/grep_xpg4/Makefile b/usr/src/cmd/grep_xpg4/Makefile index d9dd84c032..fb7c7d1a58 100644 --- a/usr/src/cmd/grep_xpg4/Makefile +++ b/usr/src/cmd/grep_xpg4/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -33,6 +31,9 @@ EFILE= egrep include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + ROOTXPG4LINKS = $(ROOTXPG4BIN)/$(FFILE) $(ROOTXPG4BIN)/$(EFILE) CFLAGS += $(CCVERBOSE) diff --git a/usr/src/cmd/grep_xpg4/grep.c b/usr/src/cmd/grep_xpg4/grep.c index 2fa6506254..8bfd8d7ef9 100644 --- a/usr/src/cmd/grep_xpg4/grep.c +++ b/usr/src/cmd/grep_xpg4/grep.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * grep - pattern matching program - combined grep, egrep, and fgrep. * Based on MKS grep command, with XCU & Solaris mods. @@ -36,6 +34,8 @@ * */ +/* Copyright 2012 Nexenta Systems, Inc. All rights reserved. */ + #include <string.h> #include <stdlib.h> #include <ctype.h> @@ -51,9 +51,12 @@ #include <errno.h> #include <unistd.h> #include <wctype.h> +#include <ftw.h> +#include <sys/param.h> #define BSIZE 512 /* Size of block for -b */ #define BUFSIZE 8192 /* Input buffer size */ +#define MAX_DEPTH 1000 /* how deep to recurse */ #define M_CSETSIZE 256 /* singlebyte chars */ static int bmglen; /* length of BMG pattern */ @@ -70,6 +73,8 @@ typedef struct _PATTERN { static PATTERN *patterns; static char errstr[128]; /* regerror string buffer */ static int regflags = 0; /* regcomp options */ +static int matched = 0; /* return of the grep() */ +static int errors = 0; /* count of errors */ static uchar_t fgrep = 0; /* Invoked as fgrep */ static uchar_t egrep = 0; /* Invoked as egrep */ static uchar_t nvflag = 1; /* Print matching lines */ @@ -78,6 +83,7 @@ static uchar_t iflag; /* Case insensitve matching */ static uchar_t hflag; /* Supress printing of filename */ static uchar_t lflag; /* Print file names of matches */ static uchar_t nflag; /* Precede lines by line number */ +static uchar_t rflag; /* Search directories recursively */ static uchar_t bflag; /* Preccede matches by block number */ static uchar_t sflag; /* Suppress file error messages */ static uchar_t qflag; /* Suppress standard output */ @@ -85,6 +91,7 @@ static uchar_t wflag; /* Search for expression as a word */ static uchar_t xflag; /* Anchoring */ static uchar_t Eflag; /* Egrep or -E flag */ static uchar_t Fflag; /* Fgrep or -F flag */ +static uchar_t Rflag; /* Like rflag, but follow symlinks */ static uchar_t outfn; /* Put out file name */ static char *cmdname; @@ -94,13 +101,16 @@ static size_t outbuflen, prntbuflen; static char *prntbuf; static wchar_t *outline; -static void addfile(char *fn); +static void addfile(const char *fn); static void addpattern(char *s); static void fixpatterns(void); static void usage(void); -static int grep(int, char *); +static int grep(int, const char *); static void bmgcomp(char *, int); static char *bmgexec(char *, char *); +static int recursive(const char *, const struct stat *, int, struct FTW *); +static void process_path(const char *); +static void process_file(const char *, int); /* * mainline for grep @@ -109,10 +119,8 @@ int main(int argc, char **argv) { char *ap; - int matched = 0; int c; int fflag = 0; - int errors = 0; int i, n_pattern = 0, n_file = 0; char **pattern_list = NULL; char **file_list = NULL; @@ -147,7 +155,7 @@ main(int argc, char **argv) } } - while ((c = getopt(argc, argv, "vwchilnbse:f:qxEFI")) != EOF) { + while ((c = getopt(argc, argv, "vwchilnrbse:f:qxEFIR")) != EOF) { switch (c) { case 'v': /* POSIX: negate matches */ nvflag = 0; @@ -170,6 +178,10 @@ main(int argc, char **argv) nflag++; break; + case 'r': /* Solaris: search recursively */ + rflag++; + break; + case 'b': /* Solaris: Write file block numbers */ bflag++; break; @@ -230,6 +242,11 @@ main(int argc, char **argv) Fflag++; break; + case 'R': /* Solaris: like rflag, but follow symlinks */ + Rflag++; + rflag++; + break; + default: usage(); } @@ -334,21 +351,7 @@ main(int argc, char **argv) if (argc > 2 && hflag == 0) outfn = 1; /* Print filename on match line */ for (argv++; *argv != NULL; argv++) { - int fd; - - if ((fd = open(*argv, O_RDONLY)) == -1) { - errors = 1; - if (sflag) - continue; - (void) fprintf(stderr, gettext( - "%s: can't open \"%s\"\n"), - cmdname, *argv); - continue; - } - matched |= grep(fd, *argv); - (void) close(fd); - if (ferror(stdout)) - break; + process_path(*argv); } } /* @@ -362,11 +365,110 @@ main(int argc, char **argv) return (matched ? 0 : 1); } +static void +process_path(const char *path) +{ + struct stat st; + int walkflags = FTW_CHDIR; + char *buf = NULL; + + if (rflag) { + if (stat(path, &st) != -1 && + (st.st_mode & S_IFMT) == S_IFDIR) { + outfn = 1; /* Print filename */ + + /* + * Add trailing slash if arg + * is directory, to resolve symlinks. + */ + if (path[strlen(path) - 1] != '/') { + (void) asprintf(&buf, "%s/", path); + if (buf != NULL) + path = buf; + } + + /* + * Search through subdirs if path is directory. + * Don't follow symlinks if Rflag is not set. + */ + if (!Rflag) + walkflags |= FTW_PHYS; + + if (nftw(path, recursive, MAX_DEPTH, walkflags) != 0) { + if (!sflag) + (void) fprintf(stderr, + gettext("%s: can't open \"%s\"\n"), + cmdname, path); + errors = 1; + } + return; + } + } + process_file(path, 0); +} + +/* + * Read and process all files in directory recursively. + */ +static int +recursive(const char *name, const struct stat *statp, int info, struct FTW *ftw) +{ + /* + * Process files and follow symlinks if Rflag set. + */ + if (info != FTW_F) { + /* Report broken symlinks and unreadable files */ + if (!sflag && + (info == FTW_SLN || info == FTW_DNR || info == FTW_NS)) { + (void) fprintf(stderr, + gettext("%s: can't open \"%s\"\n"), cmdname, name); + } + return (0); + } + + + /* Skip devices and pipes if Rflag is not set */ + if (!Rflag && !S_ISREG(statp->st_mode)) + return (0); + /* Pass offset to relative name from FTW_CHDIR */ + process_file(name, ftw->base); + return (0); +} + +/* + * Opens file and call grep function. + */ +static void +process_file(const char *name, int base) +{ + int fd; + + if ((fd = open(name + base, O_RDONLY)) == -1) { + errors = 1; + if (!sflag) /* Silent mode */ + (void) fprintf(stderr, gettext( + "%s: can't open \"%s\"\n"), + cmdname, name); + return; + } + matched |= grep(fd, name); + (void) close(fd); + + if (ferror(stdout)) { + (void) fprintf(stderr, gettext( + "%s: error writing to stdout\n"), + cmdname); + (void) fflush(stdout); + exit(2); + } + +} + /* * Add a file of strings to the pattern list. */ static void -addfile(char *fn) +addfile(const char *fn) { FILE *fp; char *inbuf; @@ -528,7 +630,7 @@ fixpatterns(void) size_t n; n = strlen(pp->pattern) + 1; if ((pp->wpattern = - malloc(sizeof (wchar_t) * n)) == NULL) { + malloc(sizeof (wchar_t) * n)) == NULL) { (void) fprintf(stderr, gettext("%s: out of memory\n"), cmdname); @@ -538,7 +640,7 @@ fixpatterns(void) (size_t)-1) { (void) fprintf(stderr, gettext("%s: failed to convert " - "\"%s\" to wide-characters\n"), + "\"%s\" to wide-characters\n"), cmdname, pp->pattern); exit(2); } @@ -579,7 +681,7 @@ fixpatterns(void) (void) regerror(rv, &pp->re, errstr, sizeof (errstr)); (void) fprintf(stderr, gettext("%s: RE error in %s: %s\n"), - cmdname, pp->pattern, errstr); + cmdname, pp->pattern, errstr); exit(2); } free(pp->pattern); @@ -675,7 +777,7 @@ istrdup(const char *s1) * and check for a match on each line. */ static int -grep(int fd, char *fn) +grep(int fd, const char *fn) { PATTERN *pp; off_t data_len; /* length of the data chunk */ @@ -740,11 +842,11 @@ grep(int fd, char *fn) if (count < 0) { /* read error */ if (cflag) { - if (outfn) { + if (outfn && !rflag) { (void) fprintf(stdout, "%s:", fn); } - if (!qflag) { + if (!qflag && !rflag) { (void) fprintf(stdout, "%lld\n", matches); } @@ -859,7 +961,7 @@ L_start_process: * need to handle xflag if specified */ if (xflag && (line_len != bmglen || - strcmp(bmgpat, ptr) != 0)) { + strcmp(bmgpat, ptr) != 0)) { /* didn't match */ pp = NULL; } else { @@ -915,7 +1017,7 @@ L_start_process: for (pp = patterns; pp; pp = pp->next) { if (outline[0] == pp->wpattern[0] && wcscmp(outline, - pp->wpattern) == 0) { + pp->wpattern) == 0) { /* matched */ break; } @@ -1056,43 +1158,46 @@ usage(void) if (egrep || fgrep) { (void) fprintf(stderr, gettext("Usage:\t%s"), cmdname); (void) fprintf(stderr, - gettext(" [-c|-l|-q] [-bhinsvx] " - "pattern_list [file ...]\n")); + gettext(" [-c|-l|-q] [-r|-R] [-bhinsvx] " + "pattern_list [file ...]\n")); (void) fprintf(stderr, "\t%s", cmdname); (void) fprintf(stderr, - gettext(" [-c|-l|-q] [-bhinsvx] [-e pattern_list]... " - "[-f pattern_file]... [file...]\n")); + gettext(" [-c|-l|-q] [-r|-R] [-bhinsvx] " + "[-e pattern_list]... " + "[-f pattern_file]... [file...]\n")); } else { (void) fprintf(stderr, gettext("Usage:\t%s"), cmdname); (void) fprintf(stderr, - gettext(" [-c|-l|-q] [-bhinsvwx] " - "pattern_list [file ...]\n")); + gettext(" [-c|-l|-q] [-r|-R] [-bhinsvwx] " + "pattern_list [file ...]\n")); (void) fprintf(stderr, "\t%s", cmdname); (void) fprintf(stderr, - gettext(" [-c|-l|-q] [-bhinsvwx] [-e pattern_list]... " - "[-f pattern_file]... [file...]\n")); + gettext(" [-c|-l|-q] [-r|-R] [-bhinsvwx] " + "[-e pattern_list]... " + "[-f pattern_file]... [file...]\n")); (void) fprintf(stderr, "\t%s", cmdname); (void) fprintf(stderr, - gettext(" -E [-c|-l|-q] [-bhinsvx] " - "pattern_list [file ...]\n")); + gettext(" -E [-c|-l|-q] [-r|-R] [-bhinsvx] " + "pattern_list [file ...]\n")); (void) fprintf(stderr, "\t%s", cmdname); (void) fprintf(stderr, - gettext(" -E [-c|-l|-q] [-bhinsvx] [-e pattern_list]... " - "[-f pattern_file]... [file...]\n")); + gettext(" -E [-c|-l|-q] [-r|-R] [-bhinsvx] " + "[-e pattern_list]... " + "[-f pattern_file]... [file...]\n")); (void) fprintf(stderr, "\t%s", cmdname); (void) fprintf(stderr, - gettext(" -F [-c|-l|-q] [-bhinsvx] " - "pattern_list [file ...]\n")); + gettext(" -F [-c|-l|-q] [-r|-R] [-bhinsvx] " + "pattern_list [file ...]\n")); (void) fprintf(stderr, "\t%s", cmdname); (void) fprintf(stderr, gettext(" -F [-c|-l|-q] [-bhinsvx] [-e pattern_list]... " - "[-f pattern_file]... [file...]\n")); + "[-f pattern_file]... [file...]\n")); } exit(2); /* NOTREACHED */ diff --git a/usr/src/cmd/groups/Makefile b/usr/src/cmd/groups/Makefile index 522945a8d8..22812f5968 100644 --- a/usr/src/cmd/groups/Makefile +++ b/usr/src/cmd/groups/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989 by Sun Microsystems, Inc. # @@ -29,6 +27,8 @@ PROG= groups include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/grpck/Makefile b/usr/src/cmd/grpck/Makefile index 596b9992be..3a06b0d9cd 100644 --- a/usr/src/cmd/grpck/Makefile +++ b/usr/src/cmd/grpck/Makefile @@ -20,17 +20,15 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1990 by Sun Microsystems, Inc. # -# cmd/grpck/Makefile -# PROG= grpck include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-unused-variable + RELUSRSBIN= ../usr/sbin ROOTSYMLINK= $(ROOTETC)/$(PROG) diff --git a/usr/src/cmd/gss/gssd/Makefile b/usr/src/cmd/gss/gssd/Makefile index 18b4bcdfca..16bac17941 100644 --- a/usr/src/cmd/gss/gssd/Makefile +++ b/usr/src/cmd/gss/gssd/Makefile @@ -70,6 +70,11 @@ DIRS= $(ROOTLIB) CPPFLAGS += -I$(SRC)/uts/common/gssapi/include COPTFLAG += $(XESS) #-I$(KINCDIR) +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + LDLIBS += -lgss -lnsl gssd := MAPFILES = $(MAPFILE.INT) $(MAPFILE.NGB) diff --git a/usr/src/cmd/hal/Makefile.hal b/usr/src/cmd/hal/Makefile.hal index 260d1c466f..fc3a54f617 100644 --- a/usr/src/cmd/hal/Makefile.hal +++ b/usr/src/cmd/hal/Makefile.hal @@ -63,3 +63,10 @@ HAL_GLIB_CPPFLAGS = -I$(ADJUNCT_PROTO)/usr/include/glib-2.0 \ HAL_GETTEXT_PACKAGE = $(TEXT_DOMAIN) +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-extra +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-address +CERRWARN += -_gcc=-Wno-unused-function diff --git a/usr/src/cmd/halt/Makefile b/usr/src/cmd/halt/Makefile index fb22435c48..3eb9fddfc7 100644 --- a/usr/src/cmd/halt/Makefile +++ b/usr/src/cmd/halt/Makefile @@ -47,6 +47,8 @@ CPPFLAGS += -I../../lib/libzpool/common CPPFLAGS += -I../../lib/libscf/inc CPPFLAGS += -I../../uts/common/fs/zfs +CERRWARN += -_gcc=-Wno-unused-label + LDLIBS += -lbsm -lscf -lzfs -lgen LDLIBS_i386 += -lgrubmgmt LDLIBS += $(LDLIBS_$(MACH)) diff --git a/usr/src/cmd/hotplugd/Makefile b/usr/src/cmd/hotplugd/Makefile index 405d183d21..2a7be28033 100644 --- a/usr/src/cmd/hotplugd/Makefile +++ b/usr/src/cmd/hotplugd/Makefile @@ -43,6 +43,8 @@ ROOTMANIFESTDIR= $(ROOTSVCSYSTEM) $(ROOTMANIFEST) := FILEMODE= 444 CPPFLAGS += -I$(SRC)/lib/libhotplug/common +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += -ldevinfo -lhotplug -lnvpair -lsecdb -lrcm -lbsm .KEEP_STATE: diff --git a/usr/src/cmd/id/Makefile b/usr/src/cmd/id/Makefile index e81b8c03e2..e6c3eef31a 100644 --- a/usr/src/cmd/id/Makefile +++ b/usr/src/cmd/id/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -31,6 +29,9 @@ XPG4PROG= id include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: CFLAGS += $(CCVERBOSE) diff --git a/usr/src/cmd/idmap/idmap/Makefile b/usr/src/cmd/idmap/idmap/Makefile index fa12170f8a..17e3e1574d 100644 --- a/usr/src/cmd/idmap/idmap/Makefile +++ b/usr/src/cmd/idmap/idmap/Makefile @@ -33,6 +33,14 @@ IDMAP_PROT_DIR = $(SRC)/head/rpcsvc include ../../Makefile.cmd +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-address + POFILE = $(PROG)_all.po LDLIBS += -lidmap -ladutils -lsldap -lldap FILEMODE = 0555 diff --git a/usr/src/cmd/idmap/idmapd/Makefile b/usr/src/cmd/idmap/idmapd/Makefile index 14f41b73c7..f1aef3d137 100644 --- a/usr/src/cmd/idmap/idmapd/Makefile +++ b/usr/src/cmd/idmap/idmapd/Makefile @@ -55,6 +55,10 @@ SQLITELINT = $(ROOT)/usr/lib/llib-lsqlite.ln include ../../Makefile.cmd +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + TEXT_DOMAIN = SUNW_OST_OSLIB XGETTEXT = $(GNUXGETTEXT) XGETFLAGS = --foreign-user --strict -n -E --width=72 \ @@ -77,7 +81,7 @@ INCS += -I. -I../../../lib/libidmap/common\ $(OBJS) := CPPFLAGS += $(INCS) -D_REENTRANT $(POFILE) := CPPFLAGS += $(INCS) -CFLAGS += -v +CFLAGS += $(CCVERBOSE) LDLIBS += -lsecdb \ -lsocket \ -lnsl \ diff --git a/usr/src/cmd/init/Makefile b/usr/src/cmd/init/Makefile index 1a4d7c7bb8..a867a0e780 100644 --- a/usr/src/cmd/init/Makefile +++ b/usr/src/cmd/init/Makefile @@ -32,6 +32,8 @@ DEFAULTFILES= init.dfl include ../Makefile.cmd LDLIBS += -lpam -lbsm -lcontract -lscf +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized LINTFLAGS += -erroff=E_NAME_USED_NOT_DEF2 CLOBBERFILES= $(STATIC) diff --git a/usr/src/cmd/intrstat/Makefile.com b/usr/src/cmd/intrstat/Makefile.com index e766172423..6c25d6f020 100644 --- a/usr/src/cmd/intrstat/Makefile.com +++ b/usr/src/cmd/intrstat/Makefile.com @@ -38,6 +38,7 @@ SRCS += $(STAT_COMMON_SRCS) CPPFLAGS += -I$(STATCOMMONDIR) CFLAGS += $(CCVERBOSE) CFLAGS64 += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += -ldtrace FILEMODE = 0555 diff --git a/usr/src/cmd/ipf/Makefile.ipf b/usr/src/cmd/ipf/Makefile.ipf index 472785cf8b..fa151be780 100644 --- a/usr/src/cmd/ipf/Makefile.ipf +++ b/usr/src/cmd/ipf/Makefile.ipf @@ -34,3 +34,10 @@ KERNELIPF= $(SRC)/uts/common/inet/pfil CPPFLAGS += -I$(COMMONIPF) -I$(KERNELIPF) -DSUNDDI -DUSE_INET6 \ -DSOLARIS2=$(RELEASE_MINOR) +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-empty-body diff --git a/usr/src/cmd/isainfo/Makefile b/usr/src/cmd/isainfo/Makefile index c1958322df..4089921bfb 100644 --- a/usr/src/cmd/isainfo/Makefile +++ b/usr/src/cmd/isainfo/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" -# PROG= isainfo @@ -36,6 +34,7 @@ include ../Makefile.cmd CPPFLAGS += -I$(ELFCAP) -I../../uts/common CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-type-limits .KEEP_STATE: diff --git a/usr/src/cmd/iscsiadm/Makefile b/usr/src/cmd/iscsiadm/Makefile index c9585b3190..0249e9d347 100644 --- a/usr/src/cmd/iscsiadm/Makefile +++ b/usr/src/cmd/iscsiadm/Makefile @@ -37,6 +37,12 @@ LDLIBS += -lnsl -ldevinfo -lima CPPFLAGS += -DSOLARIS CPPFLAGS += -I. +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + FILEMODE= 0555 .KEEP_STATE: diff --git a/usr/src/cmd/isns/isnsadm/Makefile b/usr/src/cmd/isns/isnsadm/Makefile index 1eaf479984..e121b27ff0 100644 --- a/usr/src/cmd/isns/isnsadm/Makefile +++ b/usr/src/cmd/isns/isnsadm/Makefile @@ -37,6 +37,9 @@ POFILES = $(OBJS:%.o=%.po) LINTFLAGS += -xerroff=E_BAD_FORMAT_STR2 +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/isns/isnsd/Makefile b/usr/src/cmd/isns/isnsd/Makefile index 054beb31d4..aaecd2ae6f 100644 --- a/usr/src/cmd/isns/isnsd/Makefile +++ b/usr/src/cmd/isns/isnsd/Makefile @@ -58,6 +58,11 @@ LINTFLAGS += -xerroff=E_BAD_PTR_CAST_ALIGN LINTFLAGS += -xerroff=E_NAME_USED_NOT_DEF2 LINTFLAGS += -xerroff=E_CASE_FALLTHRU +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-ignored-qualifiers +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-implicit-function-declaration + obj.o := CERRWARN += -erroff=E_CONST_OBJ_SHOULD_HAVE_INITIZR obj.o := CERRWARN += -erroff=E_IMPLICIT_DECL_FUNC_RETURN_INT diff --git a/usr/src/cmd/kbd/Makefile b/usr/src/cmd/kbd/Makefile index 7bcc2244b5..935ff52681 100644 --- a/usr/src/cmd/kbd/Makefile +++ b/usr/src/cmd/kbd/Makefile @@ -33,6 +33,7 @@ ROOTMANIFESTDIR = $(ROOTSVCSYSTEM) PROG = kbd CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += -lscf all: $(PROG) diff --git a/usr/src/cmd/keyserv/Makefile b/usr/src/cmd/keyserv/Makefile index a02e26fcbb..946579dfd2 100644 --- a/usr/src/cmd/keyserv/Makefile +++ b/usr/src/cmd/keyserv/Makefile @@ -67,6 +67,13 @@ $(ROOTKEYSERVDFLT) := FILEMODE= 444 CPPFLAGS += -I. -I$(SRC)/lib/libnsl/include -I$(SRC)/lib/libsldap/common \ -D_REENTRANT +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-address +CERRWARN += -_gcc=-Wno-unused-function + LDLIBS += -lnsl chkey := LDLIBS += -lsldap keyserv := LDLIBS += -lmp diff --git a/usr/src/cmd/krb5/kadmin/cli/Makefile b/usr/src/cmd/krb5/kadmin/cli/Makefile index 8775328c49..ea7dc52f6d 100644 --- a/usr/src/cmd/krb5/kadmin/cli/Makefile +++ b/usr/src/cmd/krb5/kadmin/cli/Makefile @@ -2,8 +2,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= kadmin kadmin.local SHFILES= k5srvutil @@ -33,6 +31,12 @@ CPPFLAGS += -I$(SRC)/uts/common/gssapi/include/ \ -I$(SRC)/lib/krb5 \ -I$(SRC)/lib/gss_mechs/mech_krb5/include $(DEFS) +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable + COPTFLAG += $(XESS) #-I$(KINCDIR) SHAREDLIBS = -lmech_krb5 -lss diff --git a/usr/src/cmd/krb5/kadmin/dbutil/Makefile b/usr/src/cmd/krb5/kadmin/dbutil/Makefile index cf9479aeac..9590430b9c 100644 --- a/usr/src/cmd/krb5/kadmin/dbutil/Makefile +++ b/usr/src/cmd/krb5/kadmin/dbutil/Makefile @@ -2,8 +2,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= kdb5_util @@ -37,6 +35,11 @@ CPPFLAGS += -I. -I$(SRC)/lib/gss_mechs/mech_krb5/include/kerberosIV \ -DUSE_KADM5_API_VERSION=2 COPTFLAG += $(XESS) #-I$(KINCDIR) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-implicit-function-declaration + LDFLAGS += $(KRUNPATH) $(KERBRUNPATH) LDLIBS += -L $(ROOT_KLIBDIR) -L $(KRB5LIB) -lkadm5srv -lkdb \ -lmech_krb5 -lnsl diff --git a/usr/src/cmd/krb5/kadmin/gui/native/Makefile.com b/usr/src/cmd/krb5/kadmin/gui/native/Makefile.com index bd5e19d6bd..a4651e8604 100644 --- a/usr/src/cmd/krb5/kadmin/gui/native/Makefile.com +++ b/usr/src/cmd/krb5/kadmin/gui/native/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libkadmin.a VERS= .1 @@ -47,6 +45,10 @@ CPPFLAGS += -I../ -I$(SRC)/lib/krb5 \ -I$(SRC)/uts/common/gssapi/mechs/krb5/include \ -I$(JAVA_ROOT)/include -I$(JAVA_ROOT)/include/solaris +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function + LDLIBS += $(KMECHLIB) -L$(ROOT)/$(KERBLIBDIR) -lkadm5clnt -lsocket -lc DYNFLAGS += $(KRUNPATH) $(KERBRUNPATH) diff --git a/usr/src/cmd/krb5/kadmin/kclient/Makefile b/usr/src/cmd/krb5/kadmin/kclient/Makefile index 4e76e4054b..bcc097899c 100644 --- a/usr/src/cmd/krb5/kadmin/kclient/Makefile +++ b/usr/src/cmd/krb5/kadmin/kclient/Makefile @@ -60,6 +60,10 @@ CPPFLAGS += -I$(SRC)/uts/common/gssapi/include \ -I$(SRC)/uts/common/gssapi/include \ -I$(SRC)/uts/common/gssapi/mechs/krb5/include +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-function + ksetpw:= LDFLAGS += $(KRUNPATH) kdyndns:= LDFLAGS += -R/usr/lib/smbsrv ksmb:= LDFLAGS += -R/usr/lib/smbsrv diff --git a/usr/src/cmd/krb5/kadmin/kdcmgr/Makefile b/usr/src/cmd/krb5/kadmin/kdcmgr/Makefile index 88a7aedfef..0bbbba7255 100644 --- a/usr/src/cmd/krb5/kadmin/kdcmgr/Makefile +++ b/usr/src/cmd/krb5/kadmin/kdcmgr/Makefile @@ -21,10 +21,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# -# Makefile for Kerberos server-install utility. -# PROG= kdcmgr KLPROG= klookup @@ -38,6 +34,9 @@ include ../../../Makefile.cmd POFILE= $(SSRCS:%.sh=%.po) +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-uninitialized + LDLIBS += -lresolv -lnsl .KEEP_STATE: diff --git a/usr/src/cmd/krb5/kadmin/kpasswd/Makefile b/usr/src/cmd/krb5/kadmin/kpasswd/Makefile index 945fbdd7cb..7ace844269 100644 --- a/usr/src/cmd/krb5/kadmin/kpasswd/Makefile +++ b/usr/src/cmd/krb5/kadmin/kpasswd/Makefile @@ -2,8 +2,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= kpasswd @@ -33,6 +31,10 @@ CPPFLAGS += -I$(SRC)/lib/gss_mechs/mech_krb5/include \ COPTFLAG += $(XESS) #-I$(KINCDIR) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function + LDFLAGS += $(KRUNPATH) $(KERBRUNPATH) LDLIBS += -L $(KRB5LIBDIR) LDLIBS += $(KMECHLIB) $(KCLNTLIB) diff --git a/usr/src/cmd/krb5/kadmin/ktutil/Makefile b/usr/src/cmd/krb5/kadmin/ktutil/Makefile index 9c9417d1de..652f88110c 100644 --- a/usr/src/cmd/krb5/kadmin/ktutil/Makefile +++ b/usr/src/cmd/krb5/kadmin/ktutil/Makefile @@ -2,8 +2,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= ktutil @@ -27,6 +25,9 @@ CPPFLAGS += -I$(SRC)/uts/common/gssapi/include \ -DHAVE_TIMEZONE COPTFLAG += $(XESS) #-I$(KINCDIR) +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-function + LDFLAGS += $(KRUNPATH) $(KERBRUNPATH) LDLIBS += $(KMECHLIB) $(ROOT)$(KERBLIBDIR)/libss.so diff --git a/usr/src/cmd/krb5/kadmin/server/Makefile b/usr/src/cmd/krb5/kadmin/server/Makefile index 0fbf9e5b8e..6e8e7c25f9 100644 --- a/usr/src/cmd/krb5/kadmin/server/Makefile +++ b/usr/src/cmd/krb5/kadmin/server/Makefile @@ -42,6 +42,11 @@ CPPFLAGS += -I. -I$(SRC)/uts/common/gssapi/mechs/krb5/include \ COPTFLAG += $(XESS) #-I$(KINCDIR) +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-function + LDFLAGS += $(KRUNPATH) $(KERBRUNPATH) LDLIBS += -lgss -L$(KRB5LIB) \ -lmech_krb5 -lkadm5srv -lkdb -lnsl -lresolv -lbsm -lpam -lsocket diff --git a/usr/src/cmd/krb5/kdestroy/Makefile b/usr/src/cmd/krb5/kdestroy/Makefile index ba3d4515a8..fe8cb0f058 100644 --- a/usr/src/cmd/krb5/kdestroy/Makefile +++ b/usr/src/cmd/krb5/kdestroy/Makefile @@ -2,8 +2,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= kdestroy @@ -14,6 +12,9 @@ SRCS = kdestroy.c krpc_sys.c include ../../Makefile.cmd include $(SRC)/lib/gss_mechs/mech_krb5/Makefile.mech_krb5 +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses + POFILE = kdestroy.po POFILES = generic.po diff --git a/usr/src/cmd/krb5/kinit/Makefile b/usr/src/cmd/krb5/kinit/Makefile index 8603af381e..8aaaac2990 100644 --- a/usr/src/cmd/krb5/kinit/Makefile +++ b/usr/src/cmd/krb5/kinit/Makefile @@ -2,8 +2,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= kinit @@ -15,6 +13,10 @@ DEFS = -DHAVE_LIBSOCKET=1 -DHAVE_LIBNSL=1 -DHAVE_PWD_H=1 -DHAVE_COMPILE=1 -DHAV include ../../Makefile.cmd include $(SRC)/lib/gss_mechs/mech_krb5/Makefile.mech_krb5 +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-parentheses + POFILE = kinit.po POFILES = generic.po diff --git a/usr/src/cmd/krb5/klist/Makefile b/usr/src/cmd/krb5/klist/Makefile index f28e8a4367..4485ade155 100644 --- a/usr/src/cmd/krb5/klist/Makefile +++ b/usr/src/cmd/krb5/klist/Makefile @@ -26,6 +26,7 @@ CPPFLAGS += -I$(SRC)/lib/gss_mechs/mech_krb5/include \ LDFLAGS += $(KRUNPATH) LDLIBS += $(KMECHLIB) +CERRWARN += -_gcc=-Wno-unused-function $(GPROGS) := CPPFLAGS += -DSYSV -DSunOS=50 diff --git a/usr/src/cmd/krb5/kproplog/Makefile b/usr/src/cmd/krb5/kproplog/Makefile index 9fa8ab9c7b..6cade7d181 100644 --- a/usr/src/cmd/krb5/kproplog/Makefile +++ b/usr/src/cmd/krb5/kproplog/Makefile @@ -2,8 +2,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG = kproplog @@ -35,6 +33,10 @@ CPPFLAGS += -I. -I$(SRC)/lib/krb5 \ -I$(SRC)/lib/gss_mechs/mech_krb5/include \ -I$(SRC)/uts/common/gssapi/mechs/krb5/include +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-implicit-function-declaration + all: $(PROG) $(PROG): $(OBJS) $(DERIVED_OBJS) diff --git a/usr/src/cmd/krb5/krb5kdc/Makefile b/usr/src/cmd/krb5/krb5kdc/Makefile index 72d02fb2d2..ac3e00b0f3 100644 --- a/usr/src/cmd/krb5/krb5kdc/Makefile +++ b/usr/src/cmd/krb5/krb5kdc/Makefile @@ -42,7 +42,7 @@ ROOTMANIFESTDIR= $(ROOTSVCNETWORKSECURITY) CFLAGS += $(CCOPTS) $(DEFS) $(LOCALINCLUDE) # The SET macros in network.c will be mis-optimized if GCC believes it # may rely on undefined signed overflow behaviour. -$(__GNUC4)CFLAGS += -_gcc=-fno-strict-overflow +CFLAGS += -_gcc=-fno-strict-overflow CPPFLAGS += \ -I$(SRC)/lib/gss_mechs/mech_krb5/include \ @@ -50,6 +50,12 @@ CPPFLAGS += \ -I$(SRC)/uts/common/gssapi/mechs/krb5/include \ -DHAVE_SYSLOG_H=1 +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses + LDFLAGS += $(KRUNPATH) $(KERBRUNPATH) LDLIBS += -L$(ROOT_KLIBDIR) -L$(KRB5LIB) \ -lmech_krb5 -lkdb -lkadm5srv -lnsl -lsocket -lbsm -lc diff --git a/usr/src/cmd/krb5/kwarn/Makefile b/usr/src/cmd/krb5/kwarn/Makefile index c2dcc058ce..7dc7c8dc7a 100644 --- a/usr/src/cmd/krb5/kwarn/Makefile +++ b/usr/src/cmd/krb5/kwarn/Makefile @@ -23,8 +23,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# TESTPROG = kwarndtest @@ -53,6 +51,11 @@ POFILES = generic.po COPTFLAG += $(XESS) #-I$(KINCDIR) CPPFLAGS += -D_REENTRANT +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses + CPPFLAGS += -I../../lib/gss_mechs/mech_krb5/include \ -I$(SRC)/lib/gss_mechs/mech_krb5 \ -I$(SRC)/lib/gss_mechs/mech_krb5/include \ diff --git a/usr/src/cmd/krb5/ldap_util/Makefile b/usr/src/cmd/krb5/ldap_util/Makefile index d6b323cbdb..261ef5e89e 100644 --- a/usr/src/cmd/krb5/ldap_util/Makefile +++ b/usr/src/cmd/krb5/ldap_util/Makefile @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= kdb5_ldap_util @@ -62,6 +60,11 @@ CPPFLAGS += \ -I../kwarn \ $(DEFS) +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-implicit-function-declaration + LDFLAGS += $(KRUNPATH) $(KERBRUNPATH) LDLIBS += -L $(ROOT_KLIBDIR) -L $(KRB5LIB) -lkadm5srv -lkdb -lkdb_ldap \ -lmech_krb5 diff --git a/usr/src/cmd/krb5/slave/Makefile b/usr/src/cmd/krb5/slave/Makefile index 592a6f08c0..ffae1e2c8b 100644 --- a/usr/src/cmd/krb5/slave/Makefile +++ b/usr/src/cmd/krb5/slave/Makefile @@ -2,8 +2,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG1=kprop PROG2=kpropd @@ -57,6 +55,14 @@ CPPFLAGS += -I. \ -I$(SRC)/lib/krb5/kadm5 \ -I$(SRC)/uts/common/gssapi/mechs/krb5/include +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-address + LDFLAGS += $(KRUNPATH) $(KERBRUNPATH) LDLIBS += -lmech_krb5 -lsocket $(PROG1) := LDLIBS += -L$(KRB5LIB) -lkadm5srv diff --git a/usr/src/cmd/ksh/Makefile.com b/usr/src/cmd/ksh/Makefile.com index 75685dfa18..8716f4eb9d 100644 --- a/usr/src/cmd/ksh/Makefile.com +++ b/usr/src/cmd/ksh/Makefile.com @@ -59,6 +59,7 @@ CFLAGS64 += \ $(ASTCFLAGS64) # Workaround for CR#6628728 ("|memcntl()| prototype not available for C99/XPG6") +pmain.o := CERRWARN += -_gcc=-Wno-implicit-function-declaration pmain.o := CERRWARN += -erroff=E_NO_IMPLICIT_DECL_ALLOWED .KEEP_STATE: diff --git a/usr/src/cmd/ksh/builtins/Makefile b/usr/src/cmd/ksh/builtins/Makefile index 40bde75ea2..e4c0e8aa7a 100644 --- a/usr/src/cmd/ksh/builtins/Makefile +++ b/usr/src/cmd/ksh/builtins/Makefile @@ -90,8 +90,8 @@ ROOTALIASPROG= $(ALIASPROG:%=$(ROOTBIN)/%) include ../../Makefile.cmd $(SPARC_BLD)include ../../Makefile.cmd.64 - FILEMODE= 555 +CERRWARN += -_gcc=-Wno-parentheses .KEEP_STATE: diff --git a/usr/src/cmd/latencytop/Makefile.com b/usr/src/cmd/latencytop/Makefile.com index a50d7a1c76..32e74087c8 100644 --- a/usr/src/cmd/latencytop/Makefile.com +++ b/usr/src/cmd/latencytop/Makefile.com @@ -34,6 +34,9 @@ CFLAGS64 += $(CCVERBOSE) CPPFLAGS += -DEMBED_CONFIGS -I$(ADJUNCT_PROTO)/usr/include/glib-2.0 \ -I$(ADJUNCT_PROTO)/usr/lib/glib-2.0/include +CERRWARN += -_gcc=-Wno-uninitialized + +CPPFLAGS += -DEMBED_CONFIGS -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include C99MODE = $(C99_ENABLE) LDLIBS += -lcurses -ldtrace all install := LDLIBS += -lglib-2.0 diff --git a/usr/src/cmd/ldap/Makefile.com b/usr/src/cmd/ldap/Makefile.com index ac19112be5..a50e846b61 100644 --- a/usr/src/cmd/ldap/Makefile.com +++ b/usr/src/cmd/ldap/Makefile.com @@ -83,6 +83,12 @@ ROOTVAR_LDAP= $(ROOT)/var/ldap LINTFLAGS += -erroff=E_INCONS_ARG_DECL2 LINTFLAGS += -erroff=E_INCONS_VAL_TYPE_DECL2 +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized + all:= TARGET= all install:= TARGET= install clean:= TARGET= clean diff --git a/usr/src/cmd/ldapcachemgr/Makefile b/usr/src/cmd/ldapcachemgr/Makefile index 46f61f28b8..12574d5c68 100644 --- a/usr/src/cmd/ldapcachemgr/Makefile +++ b/usr/src/cmd/ldapcachemgr/Makefile @@ -51,6 +51,10 @@ CPPFLAGS += -D_REENTRANT -DSUN_THREADS \ -I$(SRC)/lib/libldap5/include/ldap \ -I$(SRC)/lib/libc/port/gen +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # Message files POFILE= ldap_cachemgr.po POFILES= ${OBJS:%.o=%.po} diff --git a/usr/src/cmd/ldmad/Makefile b/usr/src/cmd/ldmad/Makefile index 2cb1906509..9e9e30fc19 100644 --- a/usr/src/cmd/ldmad/Makefile +++ b/usr/src/cmd/ldmad/Makefile @@ -65,6 +65,7 @@ INCS += -I$(ROOT)/usr/platform/sun4v/include/sys INCS += -I$(SRC)/uts/sun4v CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(INCS) C99MODE = $(C99_ENABLE) +CERRWARN += -_gcc=-Wno-uninitialized LINTFLAGS += -erroff=E_BAD_PTR_CAST_ALIGN diff --git a/usr/src/cmd/link/Makefile b/usr/src/cmd/link/Makefile index 5fa3027851..d9f3e9f5d1 100644 --- a/usr/src/cmd/link/Makefile +++ b/usr/src/cmd/link/Makefile @@ -23,8 +23,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= link XPG4PROG= link @@ -36,6 +34,8 @@ clean $(XPG4) := OBJS += values-xpg4.o FILEMODE= 0555 +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: all: $(PROG) $(XPG4) diff --git a/usr/src/cmd/listen/Makefile b/usr/src/cmd/listen/Makefile index 5fa1bfe3c2..902064e388 100644 --- a/usr/src/cmd/listen/Makefile +++ b/usr/src/cmd/listen/Makefile @@ -57,6 +57,12 @@ LDFLAGS += $(MAPFILE.NGB:%=-M%) LINTFLAGS = -b -x FILEMODE= 0755 +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-empty-body +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + $(LIBSAFD)/% : % $(INS.file) diff --git a/usr/src/cmd/loadkeys/Makefile b/usr/src/cmd/loadkeys/Makefile index 21f1542c4d..e41a5d823b 100644 --- a/usr/src/cmd/loadkeys/Makefile +++ b/usr/src/cmd/loadkeys/Makefile @@ -22,10 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# -# cmd/loadkeys/Makefile -# PROG= loadkeys dumpkeys sparc_SUBDIRS= type_4 type_6 type_101 @@ -41,6 +37,11 @@ EXTRA_INSTALL_TARGETS= $($(MACH)_EXTRA_INSTALL_TARGETS) include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: .PARALLEL: $(SUBDIRS) diff --git a/usr/src/cmd/localedef/Makefile b/usr/src/cmd/localedef/Makefile index 85889634e0..9acfe6dfbf 100644 --- a/usr/src/cmd/localedef/Makefile +++ b/usr/src/cmd/localedef/Makefile @@ -27,9 +27,13 @@ HDRS = localedef.h SRCS = $(OBJS:%.o=%.c) CPPFLAGS += -I $(SRC)/lib/libc/port/locale +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label LDLIBS += -lgen LDLIBS += -lavl YFLAGS = -d -b parser + CLEANFILES = $(OBJS) parser.tab.c parser.tab.h CLEANFILES += \ UTF-8.cm UTF-8.ct \ diff --git a/usr/src/cmd/localedef/ctype.c b/usr/src/cmd/localedef/ctype.c index b76ff3d41b..996cd963c7 100644 --- a/usr/src/cmd/localedef/ctype.c +++ b/usr/src/cmd/localedef/ctype.c @@ -211,6 +211,7 @@ dump_ctype(void) _FileRuneEntry *ct = NULL; _FileRuneEntry *lo = NULL; _FileRuneEntry *up = NULL; + wchar_t wc; (void) memset(&rl, 0, sizeof (rl)); last_ct = NULL; @@ -223,11 +224,19 @@ dump_ctype(void) (void) memcpy(rl.magic, _FILE_RUNE_MAGIC_1, 8); (void) strncpy(rl.encoding, get_wide_encoding(), sizeof (rl.encoding)); - for (ctn = avl_first(&ctypes); ctn; ctn = AVL_NEXT(&ctypes, ctn)) { + /* + * Initialize the identity map. + */ + for (wc = 0; (unsigned)wc < _CACHED_RUNES; wc++) { + rl.maplower[wc] = wc; + rl.mapupper[wc] = wc; + } - wchar_t wc = ctn->wc; + for (ctn = avl_first(&ctypes); ctn; ctn = AVL_NEXT(&ctypes, ctn)) { int conflict = 0; + wc = ctn->wc; + /* * POSIX requires certain portable characters have * certain types. Add them if they are missing. @@ -305,8 +314,10 @@ dump_ctype(void) */ if ((unsigned)wc < _CACHED_RUNES) { rl.runetype[wc] = ctn->ctype; - rl.maplower[wc] = ctn->tolower ? ctn->tolower : wc; - rl.mapupper[wc] = ctn->toupper ? ctn->toupper : wc; + if (ctn->tolower) + rl.maplower[wc] = ctn->tolower; + if (ctn->toupper) + rl.mapupper[wc] = ctn->toupper; continue; } diff --git a/usr/src/cmd/lockstat/Makefile.com b/usr/src/cmd/lockstat/Makefile.com index ce70c62218..54ec4d5853 100644 --- a/usr/src/cmd/lockstat/Makefile.com +++ b/usr/src/cmd/lockstat/Makefile.com @@ -32,6 +32,7 @@ include ../../Makefile.cmd LDLIBS += -lelf -lkstat -ldtrace CFLAGS += $(CCVERBOSE) CFLAGS64 += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized LINTFLAGS += -xerroff=E_SEC_SPRINTF_UNBOUNDED_COPY LINTFLAGS64 += -xerroff=E_SEC_SPRINTF_UNBOUNDED_COPY diff --git a/usr/src/cmd/lofiadm/Makefile b/usr/src/cmd/lofiadm/Makefile index 66aa669b2f..07d01206a2 100644 --- a/usr/src/cmd/lofiadm/Makefile +++ b/usr/src/cmd/lofiadm/Makefile @@ -37,6 +37,9 @@ include ../Makefile.cmd CPPFLAGS += -I $(SRC)/common/crypto -I $(SRC)/common/lzma LDLIBS += -ldevinfo -lpkcs11 -lcryptoutil +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + LINTFLAGS += -erroff=E_NAME_USED_NOT_DEF2 .KEEP_STATE: diff --git a/usr/src/cmd/logadm/Makefile b/usr/src/cmd/logadm/Makefile index b997fe6ead..246f7b6ef8 100644 --- a/usr/src/cmd/logadm/Makefile +++ b/usr/src/cmd/logadm/Makefile @@ -33,6 +33,9 @@ CONFIGFILE= logadm.conf include ../Makefile.cmd CPPFLAGS += -D_FILE_OFFSET_BITS=64 +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-uninitialized XGETFLAGS += -a -x logadm.xcl $(ROOTETC)/$(CONFIGFILE):= FILEMODE= 644 diff --git a/usr/src/cmd/logins/Makefile b/usr/src/cmd/logins/Makefile index 5fd1f63cc9..d9df94c5b9 100644 --- a/usr/src/cmd/logins/Makefile +++ b/usr/src/cmd/logins/Makefile @@ -20,12 +20,8 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1990 by Sun Microsystems, Inc. # -# cmd/logins/Makefile -# PROG= logins PKGINFO= pkginfo @@ -34,6 +30,9 @@ TXTS= $(PKGINFO) include ../Makefile.cmd TEXT_DOMAIN= SUNW_OST_ADMIN +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + FILEMODE= 0750 .KEEP_STATE: diff --git a/usr/src/cmd/look/Makefile b/usr/src/cmd/look/Makefile index 0b25de3ad0..6ba55dd43b 100644 --- a/usr/src/cmd/look/Makefile +++ b/usr/src/cmd/look/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989 by Sun Microsystems, Inc. # @@ -37,6 +35,8 @@ ROOTDATA= $(DATA:%=$(ROOTDATADIR)/%) #DIRS= $(ROOTLIB) $(ROOTDATADIR) DIRS= $(ROOTDATADIR) +CERRWARN += -_gcc=-Wno-implicit-function-declaration + FILEMODE= 755 $(ROOTDATADIR)/$(DATA):= FILEMODE=444 diff --git a/usr/src/cmd/ls/Makefile.com b/usr/src/cmd/ls/Makefile.com index cc3ca0ad81..d16e1ce5a8 100644 --- a/usr/src/cmd/ls/Makefile.com +++ b/usr/src/cmd/ls/Makefile.com @@ -35,6 +35,8 @@ include ../../Makefile.cmd LDLIBS += -lsec -lnvpair -lcmdutils -lcurses CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized $(XPG4) := CFLAGS += -DXPG4 # Include all XPG4 changes in the XPG6 version diff --git a/usr/src/cmd/luxadm/Makefile b/usr/src/cmd/luxadm/Makefile index dc58795386..75bb1db5f7 100644 --- a/usr/src/cmd/luxadm/Makefile +++ b/usr/src/cmd/luxadm/Makefile @@ -23,8 +23,6 @@ # Use is subject to license terms. # -# - PROG = luxadm COBJS = adm.o fchba.o lux_util.o fabric_conf.o @@ -39,6 +37,11 @@ POFILE = luxadm.po include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-address + sparc_LDLIBS = -la5k -lg_fc -ldevid -lkstat -ldevinfo i386_LDLIBS = LDLIBS += $($(MACH)_LDLIBS) diff --git a/usr/src/cmd/lvm/Makefile.lvm b/usr/src/cmd/lvm/Makefile.lvm index f09bb005d0..8b93647d90 100644 --- a/usr/src/cmd/lvm/Makefile.lvm +++ b/usr/src/cmd/lvm/Makefile.lvm @@ -23,8 +23,6 @@ # Copyright 2000-2003 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# # # Libraries and utilities go here. @@ -33,6 +31,13 @@ RPCGENFLAGS = -C -M $(DEFINES) RPCGENFLAGS_SERVER = $(RPCGENFLAGS) -s circuit_n CPPFLAGS += -D_FILE_OFFSET_BITS=64 +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-unused-value # # Lint flags we use for volume management. diff --git a/usr/src/cmd/lvm/metassist/Makefile.env b/usr/src/cmd/lvm/metassist/Makefile.env index 598e2eba8b..77cc84aaa5 100644 --- a/usr/src/cmd/lvm/metassist/Makefile.env +++ b/usr/src/cmd/lvm/metassist/Makefile.env @@ -23,8 +23,10 @@ # Copyright 2003 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# # Define DEBUG when running nightly DEBUG build $(NOT_RELEASE_BUILD) CPPFLAGS += -DDEBUG +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-value diff --git a/usr/src/cmd/mail/Makefile b/usr/src/cmd/mail/Makefile index 1767d857be..0bd18f5023 100644 --- a/usr/src/cmd/mail/Makefile +++ b/usr/src/cmd/mail/Makefile @@ -19,7 +19,6 @@ # CDDL HEADER END # # -# # Copyright 2009 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -71,6 +70,11 @@ EDITPATH= \ -e 's!VAR_MAIL!/var/mail!g' < $? > $@ CPPFLAGS = -DSVR4 -I. $(CPPFLAGS.master) +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-extra LDLIBS += -lmail -lsocket diff --git a/usr/src/cmd/mailx/Makefile b/usr/src/cmd/mailx/Makefile index ef3be971b6..5def4e8c67 100644 --- a/usr/src/cmd/mailx/Makefile +++ b/usr/src/cmd/mailx/Makefile @@ -62,6 +62,10 @@ $(ROOTMAILXRC) := FILEMODE = 0644 $(ROOTUCBMAILRC) := FILEMODE = 0644 CPPFLAGS= -Ihdr -DUSG -DOPTIM $(CPPFLAGS.master) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-clobbered LINTFLAGS= -hb LDLIBS += -lmail LDFLAGS += $(MAPFILE.NGB:%=-M%) diff --git a/usr/src/cmd/man/src/Makefile b/usr/src/cmd/man/src/Makefile index 179e974249..32135e8093 100644 --- a/usr/src/cmd/man/src/Makefile +++ b/usr/src/cmd/man/src/Makefile @@ -47,6 +47,10 @@ ROOTLIBPROG = $(LIBPROG:%=$(ROOTLIB)/%) ROOTLIBSHELL = $(LIBSHELL:%=$(ROOTLIB)/%) ROOTLNKPROG = $(LNKPROG:%=$(ROOTBIN)/%) +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable + # for messaging catalog files POFILE= src.po POFILES= $(SRCS:%.c=%.po) diff --git a/usr/src/cmd/mdb/Makefile.kmdb b/usr/src/cmd/mdb/Makefile.kmdb index 7532739aee..e997e5917f 100644 --- a/usr/src/cmd/mdb/Makefile.kmdb +++ b/usr/src/cmd/mdb/Makefile.kmdb @@ -99,6 +99,13 @@ ALLLINTFLAGS = $(LINTFLAGS) \ -xerroff=E_INCONS_VAL_TYPE_DECL2 \ -xerroff=E_INCONS_VAL_TYPE_USED2 +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses + MAPFILE = mapfile MAPFILE_INTERMEDIATE = $(MAPFILE).i MAPFILE_TEMPLATE = ../../../common/kmdb/mapfile_skel diff --git a/usr/src/cmd/mdb/Makefile.libstand b/usr/src/cmd/mdb/Makefile.libstand index d260ff4680..471fea3834 100644 --- a/usr/src/cmd/mdb/Makefile.libstand +++ b/usr/src/cmd/mdb/Makefile.libstand @@ -23,8 +23,6 @@ # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# .KEEP_STATE: .SUFFIXES: @@ -73,6 +71,8 @@ LINTFLAGS += -n -errtags=yes CLINTFILES = $(SRCS:%.c=%.ln) LINTFILES = $(CLINTFILES:%.s=%.ln) +CERRWARN += -_gcc=-Wno-parentheses + LIB = libstand.a COBJS = $(SRCS:%.c=%.o) OBJS = $(COBJS:%.s=%.o) diff --git a/usr/src/cmd/mdb/Makefile.libstandctf b/usr/src/cmd/mdb/Makefile.libstandctf index 4b9d5a76de..7d4c8fbf0d 100644 --- a/usr/src/cmd/mdb/Makefile.libstandctf +++ b/usr/src/cmd/mdb/Makefile.libstandctf @@ -22,7 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" .KEEP_STATE: @@ -59,6 +58,8 @@ LINTFILES = $(OBJS:%.o=%.ln) LINTFLAGS += -n -errtags=yes +CERRWARN += -_gcc=-Wno-uninitialized + .NO_PARALLEL: .PARALLEL: $(OBJS) diff --git a/usr/src/cmd/mdb/Makefile.mdb b/usr/src/cmd/mdb/Makefile.mdb index 1d87ac199f..f331a43fda 100644 --- a/usr/src/cmd/mdb/Makefile.mdb +++ b/usr/src/cmd/mdb/Makefile.mdb @@ -99,6 +99,13 @@ C99LMODE= -Xc99=%all LDLIBS += -lcurses -lkvm -lproc -lrtld_db -lctf -lumem -ldisasm -lscf +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable + # # -erroff=E_INCONS_ARG_DECL2 works around a problem where lint gets confused # about how struct mdb_tgt_gregset is used in mdb_tgt_stack_f() and diff --git a/usr/src/cmd/mdb/Makefile.mdb_ks b/usr/src/cmd/mdb/Makefile.mdb_ks index fa3fa546f1..464f89c9a4 100644 --- a/usr/src/cmd/mdb/Makefile.mdb_ks +++ b/usr/src/cmd/mdb/Makefile.mdb_ks @@ -23,8 +23,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# # # mdb_ks, as used in kmdb, requires some special care and feeding during the @@ -57,3 +55,4 @@ MAPFILE = # kmod/mdb_ks.o := CPPFLAGS += -D_mdb_init=mdb_ks_init -D_mdb_fini=mdb_ks_fini +CERRWARN += -_gcc=-Wno-type-limits diff --git a/usr/src/cmd/mdb/common/kmdb/kmdb_stubs.c b/usr/src/cmd/mdb/common/kmdb/kmdb_stubs.c index 1b82d15662..804f85aba4 100644 --- a/usr/src/cmd/mdb/common/kmdb/kmdb_stubs.c +++ b/usr/src/cmd/mdb/common/kmdb/kmdb_stubs.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Stubs for basic system services otherwise unavailable to the debugger. */ @@ -33,7 +31,6 @@ #include <unistd.h> #include <libproc.h> #include <sys/time.h> -#include <sys/utsname.h> #include <kmdb/kmdb_dpi.h> #include <kmdb/kmdb_promif.h> @@ -179,12 +176,3 @@ exit(int status) kmdb_dpi_reboot(); #endif } - -#if defined(__i386) && !defined(__amd64) -/*ARGSUSED*/ -int -_nuname(struct utsname *buf) -{ - return (-1); -} -#endif diff --git a/usr/src/cmd/mdb/common/kmdb/mapfile_skel b/usr/src/cmd/mdb/common/kmdb/mapfile_skel index 46ea67e874..bbf6767bf3 100644 --- a/usr/src/cmd/mdb/common/kmdb/mapfile_skel +++ b/usr/src/cmd/mdb/common/kmdb/mapfile_skel @@ -49,11 +49,6 @@ SYMBOL_SCOPE { /* There should be only one - ours */ errno; /* variable */ - /* <sys/utsname.h> implictly references this on x86 */ -#if defined(__i386) && !defined(__amd64) - _nuname; -#endif - mdb_tgt_aread; mdb_dis_create; mdb_dis_destroy; diff --git a/usr/src/cmd/mdb/common/modules/mdb_ds/mdb_ds.c b/usr/src/cmd/mdb/common/modules/mdb_ds/mdb_ds.c index bca314efdd..f600e5c9b1 100644 --- a/usr/src/cmd/mdb/common/modules/mdb_ds/mdb_ds.c +++ b/usr/src/cmd/mdb/common/modules/mdb_ds/mdb_ds.c @@ -24,23 +24,12 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * MDB developer support module. This module is loaded automatically when the * proc target is initialized and the target is mdb itself. In the future, we * should document these facilities in the answerbook to aid module developers. */ -/* - * The mere inclusion of sys/utsname.h causes _uname() and uname() to be - * defined on Intel, along with an external reference to _nuname(). Since we - * don't actually use uname (or utsname, for that matter) in this dmod, we'll - * prevent its inclusion. - */ -#define _SYS_UTSNAME_H -struct utsname; - #define _MDB #include <mdb/mdb_modapi.h> #include <mdb/mdb_frame.h> diff --git a/usr/src/cmd/mdb/common/modules/zfs/zfs.c b/usr/src/cmd/mdb/common/modules/zfs/zfs.c index d907a5057a..022f1b9b95 100644 --- a/usr/src/cmd/mdb/common/modules/zfs/zfs.c +++ b/usr/src/cmd/mdb/common/modules/zfs/zfs.c @@ -905,7 +905,8 @@ arc_print(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) const char *suffix; static const char *bytestats[] = { - "p", "c", "c_min", "c_max", "size", NULL + "p", "c", "c_min", "c_max", "size", "duplicate_buffers_size", + NULL }; static const char *extras[] = { diff --git a/usr/src/cmd/mdb/i86pc/modules/unix/amd64/Makefile b/usr/src/cmd/mdb/i86pc/modules/unix/amd64/Makefile index 08cbabf3e1..8d36fb01e5 100644 --- a/usr/src/cmd/mdb/i86pc/modules/unix/amd64/Makefile +++ b/usr/src/cmd/mdb/i86pc/modules/unix/amd64/Makefile @@ -22,7 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = unix.so MDBTGT = kvm @@ -39,3 +38,8 @@ CPPFLAGS += -DMP -D_MACHDEP CPPFLAGS += -I../../../../common CPPFLAGS += -I$(SRC)/uts/i86pc CPPFLAGS += -I$(SRC)/uts/intel + +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized diff --git a/usr/src/cmd/mdb/i86pc/modules/unix/ia32/Makefile b/usr/src/cmd/mdb/i86pc/modules/unix/ia32/Makefile index 8121af9b49..ad756f82e9 100644 --- a/usr/src/cmd/mdb/i86pc/modules/unix/ia32/Makefile +++ b/usr/src/cmd/mdb/i86pc/modules/unix/ia32/Makefile @@ -22,7 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = unix.so MDBTGT = kvm @@ -38,3 +37,8 @@ CPPFLAGS += -DMP -D_MACHDEP CPPFLAGS += -I../../../../common CPPFLAGS += -I$(SRC)/uts/i86pc CPPFLAGS += -I$(SRC)/uts/intel + +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized diff --git a/usr/src/cmd/mdb/i86xpv/modules/unix/amd64/Makefile b/usr/src/cmd/mdb/i86xpv/modules/unix/amd64/Makefile index 8a6331ac3d..dd8ea3d585 100644 --- a/usr/src/cmd/mdb/i86xpv/modules/unix/amd64/Makefile +++ b/usr/src/cmd/mdb/i86xpv/modules/unix/amd64/Makefile @@ -22,7 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = unix.so MDBTGT = kvm @@ -43,3 +42,8 @@ CPPFLAGS += -I$(SRC)/uts/common CPPFLAGS += -I$(SRC)/uts/i86xpv CPPFLAGS += -I$(SRC)/uts/i86pc CPPFLAGS += -I$(SRC)/uts/intel + +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized diff --git a/usr/src/cmd/mdb/i86xpv/modules/unix/ia32/Makefile b/usr/src/cmd/mdb/i86xpv/modules/unix/ia32/Makefile index 20e40d0faa..fd0ad9ee04 100644 --- a/usr/src/cmd/mdb/i86xpv/modules/unix/ia32/Makefile +++ b/usr/src/cmd/mdb/i86xpv/modules/unix/ia32/Makefile @@ -22,7 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = unix.so MDBTGT = kvm @@ -42,3 +41,8 @@ CPPFLAGS += -I$(SRC)/uts/common CPPFLAGS += -I$(SRC)/uts/i86xpv CPPFLAGS += -I$(SRC)/uts/i86pc CPPFLAGS += -I$(SRC)/uts/intel + +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized diff --git a/usr/src/cmd/mdb/intel/Makefile.libstand b/usr/src/cmd/mdb/intel/Makefile.libstand index f7c386163d..69abf9db8d 100644 --- a/usr/src/cmd/mdb/intel/Makefile.libstand +++ b/usr/src/cmd/mdb/intel/Makefile.libstand @@ -23,12 +23,8 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# -SRCS += \ - stat.c \ - uname.c +SRCS += stat.c %.o: ../../libstand/%.c $(COMPILE.c) $< diff --git a/usr/src/cmd/mdb/intel/amd64/Makefile.kmdb b/usr/src/cmd/mdb/intel/amd64/Makefile.kmdb index 324572a024..278724bb74 100644 --- a/usr/src/cmd/mdb/intel/amd64/Makefile.kmdb +++ b/usr/src/cmd/mdb/intel/amd64/Makefile.kmdb @@ -22,8 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# KMDBML += \ kaif_invoke.s \ @@ -31,6 +29,15 @@ KMDBML += \ KMDBSRCS += \ kmdb_makecontext.c \ - mdb_amd64util.c + mdb_amd64util.c \ + saveargs.c + +%.o: $(SRC)/common/saveargs/%.c + $(COMPILE.c) $< + $(CTFCONVERT_O) + +%.ln: $(SRC)/common/saveargs/%.c + $(LINT.c) -c $< SACPPFLAGS = -D__$(MACH64) -U__$(MACH) +CPPFLAGS += -I$(SRC)/common/saveargs diff --git a/usr/src/cmd/mdb/intel/amd64/fcip/Makefile b/usr/src/cmd/mdb/intel/amd64/fcip/Makefile index 7ba9baa3b6..4621e40161 100644 --- a/usr/src/cmd/mdb/intel/amd64/fcip/Makefile +++ b/usr/src/cmd/mdb/intel/amd64/fcip/Makefile @@ -36,3 +36,5 @@ include ../../../Makefile.module CPPFLAGS += -I$(SRC)/uts/common LINTFLAGS64 += -erroff=E_STATIC_UNUSED + +CERRWARN += -_gcc=-Wno-unused-function diff --git a/usr/src/cmd/mdb/intel/amd64/fctl/Makefile b/usr/src/cmd/mdb/intel/amd64/fctl/Makefile index 2aa2cfaafa..155470c49f 100644 --- a/usr/src/cmd/mdb/intel/amd64/fctl/Makefile +++ b/usr/src/cmd/mdb/intel/amd64/fctl/Makefile @@ -42,4 +42,8 @@ LINTFLAGS64 += -erroff=E_FUNC_SET_NOT_USED LINTFLAGS64 += -erroff=E_FUNC_ARG_UNUSED LINTFLAGS64 += -erroff=E_SEC_SPRINTF_UNBOUNDED_COPY # if optimization is on, compiler asserts -COPTFLAG64 = -v +COPTFLAG64 = $(CCVERBOSE) + +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses diff --git a/usr/src/cmd/mdb/intel/amd64/genunix/Makefile b/usr/src/cmd/mdb/intel/amd64/genunix/Makefile index 02b6ae84a8..fb372b267b 100644 --- a/usr/src/cmd/mdb/intel/amd64/genunix/Makefile +++ b/usr/src/cmd/mdb/intel/amd64/genunix/Makefile @@ -24,7 +24,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = genunix.so MDBTGT = kvm @@ -67,3 +66,9 @@ CPPFLAGS += -I$(SRC)/uts/common # Needed to find include file mutex_impl.h CPPFLAGS += -I$(SRC)/uts/intel + +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits diff --git a/usr/src/cmd/mdb/intel/amd64/idm/Makefile b/usr/src/cmd/mdb/intel/amd64/idm/Makefile index 063dbb4145..c68aa1c1dc 100644 --- a/usr/src/cmd/mdb/intel/amd64/idm/Makefile +++ b/usr/src/cmd/mdb/intel/amd64/idm/Makefile @@ -1,3 +1,4 @@ + # # CDDL HEADER START # @@ -39,3 +40,5 @@ include ../../../Makefile.module CPPFLAGS += -I$(ISCSITBASE) CPPFLAGS += -I$(ISCSIBASE) CPPFLAGS += -I$(ISERBASE) + +CERRWARN += -_gcc=-Wno-uninitialized diff --git a/usr/src/cmd/mdb/intel/amd64/ipc/Makefile b/usr/src/cmd/mdb/intel/amd64/ipc/Makefile index a0cab76c18..4c77f4bec7 100644 --- a/usr/src/cmd/mdb/intel/amd64/ipc/Makefile +++ b/usr/src/cmd/mdb/intel/amd64/ipc/Makefile @@ -23,7 +23,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = ipc.so MDBTGT = kvm @@ -34,3 +33,5 @@ include ../../../../Makefile.cmd include ../../../../Makefile.cmd.64 include ../../Makefile.amd64 include ../../../Makefile.module + +CERRWARN += -_gcc=-Wno-parentheses diff --git a/usr/src/cmd/mdb/intel/amd64/ipp/Makefile b/usr/src/cmd/mdb/intel/amd64/ipp/Makefile index 6ed321bf73..da6e6cfea0 100644 --- a/usr/src/cmd/mdb/intel/amd64/ipp/Makefile +++ b/usr/src/cmd/mdb/intel/amd64/ipp/Makefile @@ -23,7 +23,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = ipp.so MDBTGT = kvm @@ -34,3 +33,5 @@ include ../../../../Makefile.cmd include ../../../../Makefile.cmd.64 include ../../Makefile.amd64 include ../../../Makefile.module + +CERRWARN += -_gcc=-Wno-uninitialized diff --git a/usr/src/cmd/mdb/intel/amd64/libproc/Makefile b/usr/src/cmd/mdb/intel/amd64/libproc/Makefile index 4e98e2dee4..64e67e2d0d 100644 --- a/usr/src/cmd/mdb/intel/amd64/libproc/Makefile +++ b/usr/src/cmd/mdb/intel/amd64/libproc/Makefile @@ -22,7 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = libproc.so MDBTGT = proc @@ -39,6 +38,8 @@ include ../../../Makefile.module CFLAGS64 += -I../../../../../lib/libproc/common LINTFLAGS64 += -I../../../../../lib/libproc/common +CERRWARN += -_gcc=-Wno-uninitialized + %.o: $(MODSRCS_DIR)/%.c $(COMPILE.c) $< $(CTFCONVERT_O) diff --git a/usr/src/cmd/mdb/intel/amd64/libtopo/Makefile b/usr/src/cmd/mdb/intel/amd64/libtopo/Makefile index f669c27ae7..1f33d61aa3 100644 --- a/usr/src/cmd/mdb/intel/amd64/libtopo/Makefile +++ b/usr/src/cmd/mdb/intel/amd64/libtopo/Makefile @@ -23,7 +23,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = libtopo.so MDBTGT = proc @@ -36,3 +35,4 @@ include ../../Makefile.amd64 include ../../../Makefile.module CPPFLAGS += -I$(SRC)/lib/fm/topo/libtopo/common +CERRWARN += -_gcc=-Wno-parentheses diff --git a/usr/src/cmd/mdb/intel/amd64/libumem/Makefile b/usr/src/cmd/mdb/intel/amd64/libumem/Makefile index b1b38c5a2a..ae22217a1b 100644 --- a/usr/src/cmd/mdb/intel/amd64/libumem/Makefile +++ b/usr/src/cmd/mdb/intel/amd64/libumem/Makefile @@ -51,6 +51,10 @@ include ../../../Makefile.module dmod/$(MODULE) := LDLIBS += -lproc -lm +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + %.o: $(MODSRCS_DIR)/%.c $(COMPILE.c) $< $(CTFCONVERT_O) diff --git a/usr/src/cmd/mdb/intel/amd64/libzpool/Makefile b/usr/src/cmd/mdb/intel/amd64/libzpool/Makefile index d2a5a8c2a6..fa059da58b 100644 --- a/usr/src/cmd/mdb/intel/amd64/libzpool/Makefile +++ b/usr/src/cmd/mdb/intel/amd64/libzpool/Makefile @@ -23,7 +23,6 @@ # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = libzpool.so MDBTGT = proc @@ -44,6 +43,8 @@ CPPFLAGS += -I../../../../../lib/libzpool/common \ C99MODE= -xc99=%all C99LMODE= -Xc99=%all +CERRWARN += -_gcc=-Wno-type-limits + dmod/%.o: $(GENUNIX_DIR)/%.c $(COMPILE.c) -o $@ $< $(CTFCONVERT_O) diff --git a/usr/src/cmd/mdb/intel/amd64/mdb/Makefile b/usr/src/cmd/mdb/intel/amd64/mdb/Makefile index 2115a928e7..6542718c6b 100644 --- a/usr/src/cmd/mdb/intel/amd64/mdb/Makefile +++ b/usr/src/cmd/mdb/intel/amd64/mdb/Makefile @@ -22,12 +22,12 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" SRCS = kvm_amd64dep.c \ kvm_isadep.c \ mdb_amd64util.c \ - proc_amd64dep.c + proc_amd64dep.c \ + saveargs.c %.o: %.c $(COMPILE.c) $< @@ -37,17 +37,25 @@ SRCS = kvm_amd64dep.c \ $(COMPILE.c) $< $(CTFCONVERT_O) +%.o: $(SRC)/common/saveargs/%.c + $(COMPILE.c) $< + $(CTFCONVERT_O) + %.ln: %.c $(LINT.c) -c $< %.ln: ../../mdb/%.c $(LINT.c) -c $< +%.ln: $(SRC)/common/saveargs/%.c + $(LINT.c) -c $< + include ../../../../Makefile.cmd include ../../../../Makefile.cmd.64 include ../../Makefile.amd64 include ../../../Makefile.mdb CPPFLAGS += -I../../mdb +CPPFLAGS += -I$(SRC)/common/saveargs install: all $(ISAEXEC) $(ROOTPROG64) $(ROOTLINK64) diff --git a/usr/src/cmd/mdb/intel/amd64/mpt_sas/Makefile b/usr/src/cmd/mdb/intel/amd64/mpt_sas/Makefile index 2a751d4ebf..3b87bba4f0 100644 --- a/usr/src/cmd/mdb/intel/amd64/mpt_sas/Makefile +++ b/usr/src/cmd/mdb/intel/amd64/mpt_sas/Makefile @@ -33,3 +33,5 @@ include ../../Makefile.amd64 include ../../../Makefile.module CPPFLAGS += -I$(SRC)/uts/common + +CERRWARN += -_gcc=-Wno-trigraphs diff --git a/usr/src/cmd/mdb/intel/amd64/pmcs/Makefile b/usr/src/cmd/mdb/intel/amd64/pmcs/Makefile index e016f01a1d..a8e6e2cfcc 100644 --- a/usr/src/cmd/mdb/intel/amd64/pmcs/Makefile +++ b/usr/src/cmd/mdb/intel/amd64/pmcs/Makefile @@ -36,3 +36,7 @@ include $(SRC)/cmd/mdb/Makefile.module C99MODE = -xc99=%all CPPFLAGS += -I$(SRC)/uts/common + +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-uninitialized diff --git a/usr/src/cmd/mdb/intel/amd64/qlc/Makefile b/usr/src/cmd/mdb/intel/amd64/qlc/Makefile index 7e82d4699b..5c60dfe50b 100644 --- a/usr/src/cmd/mdb/intel/amd64/qlc/Makefile +++ b/usr/src/cmd/mdb/intel/amd64/qlc/Makefile @@ -44,3 +44,4 @@ LINTFLAGS64 += -erroff=E_STATIC_UNUSED -erroff=E_FUNC_ARG_UNUSED C99MODE= -xc99=%all C99LMODE= -Xc99=%all +CERRWARN += -_gcc=-Wno-address diff --git a/usr/src/cmd/mdb/intel/amd64/rdc/Makefile b/usr/src/cmd/mdb/intel/amd64/rdc/Makefile index 7ceb0798e4..e9dd4a514c 100644 --- a/usr/src/cmd/mdb/intel/amd64/rdc/Makefile +++ b/usr/src/cmd/mdb/intel/amd64/rdc/Makefile @@ -34,3 +34,5 @@ include ../../Makefile.amd64 include ../../../Makefile.module include ../../../common/modules/rdc/Makefile.com CPPFLAGS += -erroff=E_STATIC_UNUSED + +CERRWARN += -_gcc=-Wno-unused-function diff --git a/usr/src/cmd/mdb/intel/amd64/ufs/Makefile b/usr/src/cmd/mdb/intel/amd64/ufs/Makefile index ca03049662..376308fcf3 100644 --- a/usr/src/cmd/mdb/intel/amd64/ufs/Makefile +++ b/usr/src/cmd/mdb/intel/amd64/ufs/Makefile @@ -22,7 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = ufs.so MDBTGT = kvm @@ -33,3 +32,5 @@ include ../../../../Makefile.cmd include ../../../../Makefile.cmd.64 include ../../Makefile.amd64 include ../../../Makefile.module + +CERRWARN += -_gcc=-Wno-trigraphs diff --git a/usr/src/cmd/mdb/intel/amd64/zfs/Makefile b/usr/src/cmd/mdb/intel/amd64/zfs/Makefile index 972d59937e..97a4a859c9 100644 --- a/usr/src/cmd/mdb/intel/amd64/zfs/Makefile +++ b/usr/src/cmd/mdb/intel/amd64/zfs/Makefile @@ -23,7 +23,6 @@ # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = zfs.so MDBTGT = kvm @@ -39,3 +38,5 @@ CPPFLAGS += -I../../../../../uts/common/fs/zfs C99MODE= -xc99=%all C99LMODE= -Xc99=%all + +CERRWARN += -_gcc=-Wno-type-limits diff --git a/usr/src/cmd/mdb/intel/ia32/fcip/Makefile b/usr/src/cmd/mdb/intel/ia32/fcip/Makefile index 53f235a417..2fdfd5e872 100644 --- a/usr/src/cmd/mdb/intel/ia32/fcip/Makefile +++ b/usr/src/cmd/mdb/intel/ia32/fcip/Makefile @@ -35,3 +35,5 @@ include ../../../Makefile.module CPPFLAGS += -I$(SRC)/uts/common LINTFLAGS += -erroff=E_STATIC_UNUSED + +CERRWARN += -_gcc=-Wno-unused-function diff --git a/usr/src/cmd/mdb/intel/ia32/fctl/Makefile b/usr/src/cmd/mdb/intel/ia32/fctl/Makefile index 9b15adf814..a784d92918 100644 --- a/usr/src/cmd/mdb/intel/ia32/fctl/Makefile +++ b/usr/src/cmd/mdb/intel/ia32/fctl/Makefile @@ -41,4 +41,8 @@ LINTFLAGS += -erroff=E_FUNC_SET_NOT_USED LINTFLAGS += -erroff=E_FUNC_ARG_UNUSED LINTFLAGS += -erroff=E_SEC_SPRINTF_UNBOUNDED_COPY # if optimization is on, compiler asserts -COPTFLAG = -v +COPTFLAG = $(CCVERBOSE) + +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses diff --git a/usr/src/cmd/mdb/intel/ia32/genunix/Makefile b/usr/src/cmd/mdb/intel/ia32/genunix/Makefile index bb50d0bed8..e5efcd19ac 100644 --- a/usr/src/cmd/mdb/intel/ia32/genunix/Makefile +++ b/usr/src/cmd/mdb/intel/ia32/genunix/Makefile @@ -18,13 +18,10 @@ # # CDDL HEADER END - -# # # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = genunix.so MDBTGT = kvm @@ -66,3 +63,9 @@ CPPFLAGS += -I$(SRC)/uts/common # Needed to find include file mutex_impl.h CPPFLAGS += -I$(SRC)/uts/intel + +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits diff --git a/usr/src/cmd/mdb/intel/ia32/idm/Makefile b/usr/src/cmd/mdb/intel/ia32/idm/Makefile index f6aab4d791..3b43e3170b 100644 --- a/usr/src/cmd/mdb/intel/ia32/idm/Makefile +++ b/usr/src/cmd/mdb/intel/ia32/idm/Makefile @@ -38,3 +38,5 @@ include ../../../Makefile.module CPPFLAGS += -I$(ISCSITBASE) CPPFLAGS += -I$(ISCSIBASE) CPPFLAGS += -I$(ISERBASE) + +CERRWARN += -_gcc=-Wno-uninitialized diff --git a/usr/src/cmd/mdb/intel/ia32/ipc/Makefile b/usr/src/cmd/mdb/intel/ia32/ipc/Makefile index 2dd41475da..b2a5bcedfa 100644 --- a/usr/src/cmd/mdb/intel/ia32/ipc/Makefile +++ b/usr/src/cmd/mdb/intel/ia32/ipc/Makefile @@ -23,7 +23,6 @@ # Copyright (c) 1999 by Sun Microsystems, Inc. # All rights reserved. # -#ident "%Z%%M% %I% %E% SMI" MODULE = ipc.so MDBTGT = kvm @@ -33,3 +32,5 @@ MODSRCS = ipc.c include ../../../../Makefile.cmd include ../../Makefile.ia32 include ../../../Makefile.module + +CERRWARN += -_gcc=-Wno-parentheses diff --git a/usr/src/cmd/mdb/intel/ia32/ipp/Makefile b/usr/src/cmd/mdb/intel/ia32/ipp/Makefile index 3b01f7ce7e..4905c5df0c 100644 --- a/usr/src/cmd/mdb/intel/ia32/ipp/Makefile +++ b/usr/src/cmd/mdb/intel/ia32/ipp/Makefile @@ -23,7 +23,6 @@ # Copyright 2001-2002 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = ipp.so MDBTGT = kvm @@ -33,3 +32,5 @@ MODSRCS = ipp.c include ../../../../Makefile.cmd include ../../Makefile.ia32 include ../../../Makefile.module + +CERRWARN += -_gcc=-Wno-uninitialized diff --git a/usr/src/cmd/mdb/intel/ia32/libproc/Makefile b/usr/src/cmd/mdb/intel/ia32/libproc/Makefile index 938998447c..08d6644a93 100644 --- a/usr/src/cmd/mdb/intel/ia32/libproc/Makefile +++ b/usr/src/cmd/mdb/intel/ia32/libproc/Makefile @@ -22,7 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = libproc.so MDBTGT = proc @@ -38,6 +37,8 @@ include ../../../Makefile.module CFLAGS += -I../../../../../lib/libproc/common LINTFLAGS += -I../../../../../lib/libproc/common +CERRWARN += -_gcc=-Wno-uninitialized + %.o: $(MODSRCS_DIR)/%.c $(COMPILE.c) $< $(CTFCONVERT_O) diff --git a/usr/src/cmd/mdb/intel/ia32/libtopo/Makefile b/usr/src/cmd/mdb/intel/ia32/libtopo/Makefile index f7563492bb..364b30392d 100644 --- a/usr/src/cmd/mdb/intel/ia32/libtopo/Makefile +++ b/usr/src/cmd/mdb/intel/ia32/libtopo/Makefile @@ -23,7 +23,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = libtopo.so MDBTGT = proc @@ -35,3 +34,4 @@ include ../../Makefile.ia32 include ../../../Makefile.module CPPFLAGS += -I$(SRC)/lib/fm/topo/libtopo/common +CERRWARN += -_gcc=-Wno-parentheses diff --git a/usr/src/cmd/mdb/intel/ia32/libumem/Makefile b/usr/src/cmd/mdb/intel/ia32/libumem/Makefile index 1a1f23446c..bde1be90ac 100644 --- a/usr/src/cmd/mdb/intel/ia32/libumem/Makefile +++ b/usr/src/cmd/mdb/intel/ia32/libumem/Makefile @@ -50,6 +50,10 @@ include ../../../Makefile.module dmod/$(MODULE) := LDLIBS += -lproc -lm +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + %.o: $(MODSRCS_DIR)/%.c $(COMPILE.c) $< $(CTFCONVERT_O) diff --git a/usr/src/cmd/mdb/intel/ia32/libzpool/Makefile b/usr/src/cmd/mdb/intel/ia32/libzpool/Makefile index c8e8b4bb34..bb2758e83b 100644 --- a/usr/src/cmd/mdb/intel/ia32/libzpool/Makefile +++ b/usr/src/cmd/mdb/intel/ia32/libzpool/Makefile @@ -23,7 +23,6 @@ # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = libzpool.so MDBTGT = proc @@ -43,6 +42,8 @@ CPPFLAGS += -I../../../../../lib/libzpool/common \ C99MODE= -xc99=%all C99LMODE= -Xc99=%all +CERRWARN += -_gcc=-Wno-type-limits + dmod/%.o: $(GENUNIX_DIR)/%.c $(COMPILE.c) -o $@ $< $(CTFCONVERT_O) diff --git a/usr/src/cmd/mdb/intel/ia32/mpt_sas/Makefile b/usr/src/cmd/mdb/intel/ia32/mpt_sas/Makefile index 0c277eef7a..7a03980d61 100644 --- a/usr/src/cmd/mdb/intel/ia32/mpt_sas/Makefile +++ b/usr/src/cmd/mdb/intel/ia32/mpt_sas/Makefile @@ -33,3 +33,5 @@ include ../../Makefile.ia32 include ../../../Makefile.module CPPFLAGS += -I$(SRC)/uts/common + +CERRWARN += -_gcc=-Wno-trigraphs diff --git a/usr/src/cmd/mdb/intel/ia32/pmcs/Makefile b/usr/src/cmd/mdb/intel/ia32/pmcs/Makefile index f68f0e6f9e..63375fbb5a 100644 --- a/usr/src/cmd/mdb/intel/ia32/pmcs/Makefile +++ b/usr/src/cmd/mdb/intel/ia32/pmcs/Makefile @@ -35,3 +35,7 @@ include $(SRC)/cmd/mdb/Makefile.module C99MODE = -xc99=%all CPPFLAGS += -I$(SRC)/uts/common + +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-uninitialized diff --git a/usr/src/cmd/mdb/intel/ia32/qlc/Makefile b/usr/src/cmd/mdb/intel/ia32/qlc/Makefile index c9ce97dbfe..7c015a5ec3 100644 --- a/usr/src/cmd/mdb/intel/ia32/qlc/Makefile +++ b/usr/src/cmd/mdb/intel/ia32/qlc/Makefile @@ -43,3 +43,4 @@ LINTFLAGS += -erroff=E_STATIC_UNUSED -erroff=E_FUNC_ARG_UNUSED C99MODE= -xc99=%all C99LMODE= -Xc99=%all +CERRWARN += -_gcc=-Wno-address diff --git a/usr/src/cmd/mdb/intel/ia32/rdc/Makefile b/usr/src/cmd/mdb/intel/ia32/rdc/Makefile index 30a242b3e2..63d95aefb3 100644 --- a/usr/src/cmd/mdb/intel/ia32/rdc/Makefile +++ b/usr/src/cmd/mdb/intel/ia32/rdc/Makefile @@ -33,3 +33,5 @@ include ../../Makefile.ia32 include ../../../Makefile.module include ../../../common/modules/rdc/Makefile.com CPPFLAGS += -erroff=E_STATIC_UNUSED + +CERRWARN += -_gcc=-Wno-unused-function diff --git a/usr/src/cmd/mdb/intel/ia32/ufs/Makefile b/usr/src/cmd/mdb/intel/ia32/ufs/Makefile index 212a14d9d4..ebc0c99046 100644 --- a/usr/src/cmd/mdb/intel/ia32/ufs/Makefile +++ b/usr/src/cmd/mdb/intel/ia32/ufs/Makefile @@ -22,7 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = ufs.so MDBTGT = kvm @@ -32,3 +31,5 @@ MODSRCS = ufs.c ufs_log.c include ../../../../Makefile.cmd include ../../Makefile.ia32 include ../../../Makefile.module + +CERRWARN += -_gcc=-Wno-trigraphs diff --git a/usr/src/cmd/mdb/intel/ia32/zfs/Makefile b/usr/src/cmd/mdb/intel/ia32/zfs/Makefile index a569d4fd91..8220aa4947 100644 --- a/usr/src/cmd/mdb/intel/ia32/zfs/Makefile +++ b/usr/src/cmd/mdb/intel/ia32/zfs/Makefile @@ -23,8 +23,6 @@ # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# MODULE = zfs.so MDBTGT = kvm @@ -39,3 +37,5 @@ CPPFLAGS += -I../../../../../uts/common/fs/zfs C99MODE= -xc99=%all C99LMODE= -Xc99=%all + +CERRWARN += -_gcc=-Wno-type-limits diff --git a/usr/src/cmd/mdb/intel/libstand/uname.c b/usr/src/cmd/mdb/intel/libstand/uname.c deleted file mode 100644 index f6647df922..0000000000 --- a/usr/src/cmd/mdb/intel/libstand/uname.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * CDDL HEADER START - * - * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. - * - * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE - * or http://www.opensolaris.org/os/licensing. - * See the License for the specific language governing permissions - * and limitations under the License. - * - * When distributing Covered Code, include this CDDL HEADER in each - * file and include the License file at usr/src/OPENSOLARIS.LICENSE. - * If applicable, add the following below this CDDL HEADER, with the - * fields enclosed by brackets "[]" replaced with your own identifying - * information: Portions Copyright [yyyy] [name of copyright owner] - * - * CDDL HEADER END - */ -/* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#pragma ident "%Z%%M% %I% %E% SMI" - -/* - * The inclusion of <sys/utsname.h> in a source file causes an automatic - * inclusion of a static definition of uname() that calls _nuname(). - */ - -#include <sys/utsname.h> -#include <errno.h> - -/*ARGSUSED*/ -int -_nuname(struct utsname *utsp) -{ - return (EINVAL); -} diff --git a/usr/src/cmd/mdb/intel/mdb/mdb_amd64util.c b/usr/src/cmd/mdb/intel/mdb/mdb_amd64util.c index 868533fe11..65adaf37be 100644 --- a/usr/src/cmd/mdb/intel/mdb/mdb_amd64util.c +++ b/usr/src/cmd/mdb/intel/mdb/mdb_amd64util.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/types.h> #include <sys/reg.h> #include <sys/privregs.h> @@ -41,6 +39,8 @@ #include <mdb/mdb_err.h> #include <mdb/mdb.h> +#include <saveargs.h> + /* * This array is used by the getareg and putareg entry points, and also by our * register variable discipline. @@ -138,170 +138,6 @@ mdb_amd64_printregs(const mdb_tgt_gregset_t *gregs) } /* - * Sun Studio 10 patch compiler and gcc 3.4.3 Sun branch implemented a - * "-save_args" option on amd64. When the option is specified, INTEGER - * type function arguments passed via registers will be saved on the stack - * immediately after %rbp, and will not be modified through out the life - * of the routine. - * - * +--------+ - * %rbp --> | %rbp | - * +--------+ - * -0x8(%rbp) | %rdi | - * +--------+ - * -0x10(%rbp) | %rsi | - * +--------+ - * -0x18(%rbp) | %rdx | - * +--------+ - * -0x20(%rbp) | %rcx | - * +--------+ - * -0x28(%rbp) | %r8 | - * +--------+ - * -0x30(%rbp) | %r9 | - * +--------+ - * - * - * For example, for the following function, - * - * void - * foo(int a1, int a2, int a3, int a4, int a5, int a6, int a7) - * { - * ... - * } - * - * Disassembled code will look something like the following: - * - * pushq %rbp - * movq %rsp, %rbp - * subq $imm8, %rsp ** - * movq %rdi, -0x8(%rbp) - * movq %rsi, -0x10(%rbp) - * movq %rdx, -0x18(%rbp) - * movq %rcx, -0x20(%rbp) - * movq %r8, -0x28(%rbp) - * movq %r9, -0x30(%rbp) - * ... - * or - * pushq %rbp - * movq %rsp, %rbp - * subq $imm8, %rsp ** - * movq %r9, -0x30(%rbp) - * movq %r8, -0x28(%rbp) - * movq %rcx, -0x20(%rbp) - * movq %rdx, -0x18(%rbp) - * movq %rsi, -0x10(%rbp) - * movq %rdi, -0x8(%rbp) - * ... - * - * **: The space being reserved is in addition to what the current - * function prolog already reserves. - * - * If there are odd number of arguments to a function, additional space is - * reserved on the stack to maintain 16-byte alignment. For example, - * - * argc == 0: no argument saving. - * argc == 3: save 3, but space for 4 is reserved - * argc == 7: save 6. - */ - -/* - * The longest instruction sequence in bytes before all 6 arguments are - * saved on the stack. This value depends on compiler implementation, - * therefore it should be examined periodically to guarantee accuracy. - */ -#define SEQ_LEN 80 - -/* - * Size of the instruction sequence arrays. It should correspond to - * the maximum number of arguments passed via registers. - */ -#define INSTR_ARRAY_SIZE 6 - -#define INSTR4(ins, off) \ - (ins[(off)] + (ins[(off) + 1] << 8) + (ins[(off + 2)] << 16) + \ - (ins[(off) + 3] << 24)) - -/* - * Sun Studio 10 patch implementation saves %rdi first; - * GCC 3.4.3 Sun branch implementation saves them in reverse order. - */ -static const uint32_t save_instr[INSTR_ARRAY_SIZE] = { - 0xf87d8948, /* movq %rdi, -0x8(%rbp) */ - 0xf0758948, /* movq %rsi, -0x10(%rbp) */ - 0xe8558948, /* movq %rdx, -0x18(%rbp) */ - 0xe04d8948, /* movq %rcx, -0x20(%rbp) */ - 0xd845894c, /* movq %r8, -0x28(%rbp) */ - 0xd04d894c /* movq %r9, -0x30(%rbp) */ -}; - -static const uint32_t save_fp_instr[] = { - 0xe5894855, /* pushq %rbp; movq %rsp,%rbp, encoding 1 */ - 0xec8b4855, /* pushq %rbp; movq %rsp,%rbp, encoding 2 */ - 0xe58948cc, /* int $0x3; movq %rsp,%rbp, encoding 1 */ - 0xec8b48cc, /* int $0x3; movq %rsp,%rbp, encoding 2 */ - NULL -}; - -/* - * Look for the above instruction sequences as indicators for register - * arguments being available on the stack. - */ -static int -is_argsaved(mdb_tgt_t *t, uintptr_t fstart, uint64_t size, uint_t argc, - int start_index) -{ - uint8_t ins[SEQ_LEN]; - int i, j; - uint32_t n; - - size = MIN(size, SEQ_LEN); - argc = MIN((start_index + argc), INSTR_ARRAY_SIZE); - - if (mdb_tgt_vread(t, ins, size, fstart) != size) - return (0); - - /* - * Make sure framepointer has been saved. - */ - n = INSTR4(ins, 0); - for (i = 0; save_fp_instr[i] != NULL; i++) { - if (n == save_fp_instr[i]) - break; - } - - if (save_fp_instr[i] == NULL) - return (0); - - /* - * Compare against Sun Studio implementation - */ - for (i = 8, j = start_index; i < size - 4; i++) { - n = INSTR4(ins, i); - - if (n == save_instr[j]) { - i += 3; - if (++j >= argc) - return (1); - } - } - - /* - * Compare against GCC implementation - */ - for (i = 8, j = argc - 1; i < size - 4; i++) { - n = INSTR4(ins, i); - - if (n == save_instr[j]) { - i += 3; - if (--j < start_index) - return (1); - } - } - - return (0); -} - -/* * We expect all proper Solaris core files to have STACK_ALIGN-aligned stacks. * Hence the name. However, if the core file resulted from a * hypervisor-initiated panic, the hypervisor's frames may only be 64-bit @@ -339,6 +175,8 @@ mdb_amd64_kvm_stack_iter(mdb_tgt_t *t, const mdb_tgt_gregset_t *gsp, uintptr_t lastfp, curpc; ssize_t size; + ssize_t insnsize; + uint8_t ins[SAVEARGS_INSN_SEQ_LEN]; GElf_Sym s; mdb_syminfo_t sip; @@ -354,6 +192,7 @@ mdb_amd64_kvm_stack_iter(mdb_tgt_t *t, const mdb_tgt_gregset_t *gsp, bcopy(gsp, &gregs, sizeof (gregs)); while (fp != 0) { + int args_style = 0; curpc = pc; @@ -367,28 +206,75 @@ mdb_amd64_kvm_stack_iter(mdb_tgt_t *t, const mdb_tgt_gregset_t *gsp, NULL, 0, &s, &sip) == 0) && (mdb_ctf_func_info(&s, &sip, &mfp) == 0)) { int return_type = mdb_ctf_type_kind(mfp.mtf_return); + mdb_ctf_id_t args_types[5]; + argc = mfp.mtf_argc; + /* - * If the function returns a structure or union, - * %rdi contains the address in which to store the - * return value rather than for an argument. + * If the function returns a structure or union + * greater than 16 bytes in size %rdi contains the + * address in which to store the return value rather + * than for an argument. */ - if (return_type == CTF_K_STRUCT || - return_type == CTF_K_UNION) + if ((return_type == CTF_K_STRUCT || + return_type == CTF_K_UNION) && + mdb_ctf_type_size(mfp.mtf_return) > 16) start_index = 1; else start_index = 0; + + /* + * If any of the first 5 arguments are a structure + * less than 16 bytes in size, it will be passed + * spread across two argument registers, and we will + * not cope. + */ + if (mdb_ctf_func_args(&mfp, 5, args_types) == CTF_ERR) + argc = 0; + + for (i = 0; i < MIN(5, argc); i++) { + int t = mdb_ctf_type_kind(args_types[i]); + + if (((t == CTF_K_STRUCT) || + (t == CTF_K_UNION)) && + mdb_ctf_type_size(args_types[i]) <= 16) { + argc = 0; + break; + } + } } else { argc = 0; } - if (argc != 0 && is_argsaved(t, s.st_value, s.st_size, - argc, start_index)) { + /* + * The number of instructions to search for argument saving is + * limited such that only instructions prior to %pc are + * considered such that we never read arguments from a + * function where the saving code has not in fact yet + * executed. + */ + insnsize = MIN(MIN(s.st_size, SAVEARGS_INSN_SEQ_LEN), + pc - s.st_value); + + if (mdb_tgt_vread(t, ins, insnsize, s.st_value) != insnsize) + argc = 0; - /* Upto to 6 arguments are passed via registers */ - reg_argc = MIN(6, mfp.mtf_argc); + if ((argc != 0) && + ((args_style = saveargs_has_args(ins, insnsize, argc, + start_index)) != SAVEARGS_NO_ARGS)) { + /* Up to 6 arguments are passed via registers */ + reg_argc = MIN((6 - start_index), mfp.mtf_argc); size = reg_argc * sizeof (long); + /* + * If Studio pushed a structure return address as an + * argument, we need to read one more argument than + * actually exists (the addr) to make everything line + * up. + */ + if (args_style == SAVEARGS_STRUCT_ARGS) + size += sizeof (long); + if (mdb_tgt_vread(t, fr_argv, size, (fp - size)) != size) return (-1); /* errno has been set for us */ @@ -397,21 +283,25 @@ mdb_amd64_kvm_stack_iter(mdb_tgt_t *t, const mdb_tgt_gregset_t *gsp, * Arrange the arguments in the right order for * printing. */ - for (i = 0; i < (reg_argc >> 1); i++) { + for (i = 0; i < (reg_argc / 2); i++) { long t = fr_argv[i]; fr_argv[i] = fr_argv[reg_argc - i - 1]; fr_argv[reg_argc - i - 1] = t; } - if (argc > 6) { - size = (argc - 6) * sizeof (long); - if (mdb_tgt_vread(t, &fr_argv[6], size, + if (argc > reg_argc) { + size = MIN((argc - reg_argc) * sizeof (long), + sizeof (fr_argv) - + (reg_argc * sizeof (long))); + + if (mdb_tgt_vread(t, &fr_argv[reg_argc], size, fp + sizeof (fr)) != size) return (-1); /* errno has been set */ } - } else + } else { argc = 0; + } if (got_pc && func(arg, pc, argc, fr_argv, &gregs) != 0) break; diff --git a/usr/src/cmd/mdb/intel/modules/amd_opteron/amd64/Makefile b/usr/src/cmd/mdb/intel/modules/amd_opteron/amd64/Makefile index f33fd3d67a..324ea9da32 100644 --- a/usr/src/cmd/mdb/intel/modules/amd_opteron/amd64/Makefile +++ b/usr/src/cmd/mdb/intel/modules/amd_opteron/amd64/Makefile @@ -36,3 +36,5 @@ CPPFLAGS += -I../../../../common CPPFLAGS += -I$(SRC)/uts/i86pc/cpu CPPFLAGS += -I$(SRC)/uts/intel CPPFLAGS += -I$(SRC)/uts/i86pc + +CERRWARN += -_gcc=-Wno-uninitialized diff --git a/usr/src/cmd/mdb/intel/modules/amd_opteron/ia32/Makefile b/usr/src/cmd/mdb/intel/modules/amd_opteron/ia32/Makefile index adacbdc27e..cd8c42adef 100644 --- a/usr/src/cmd/mdb/intel/modules/amd_opteron/ia32/Makefile +++ b/usr/src/cmd/mdb/intel/modules/amd_opteron/ia32/Makefile @@ -35,3 +35,5 @@ CPPFLAGS += -I../../../../common CPPFLAGS += -I$(SRC)/uts/i86pc/cpu CPPFLAGS += -I$(SRC)/uts/intel CPPFLAGS += -I$(SRC)/uts/i86pc + +CERRWARN += -_gcc=-Wno-uninitialized diff --git a/usr/src/cmd/mdb/intel/modules/generic_cpu/amd64/Makefile b/usr/src/cmd/mdb/intel/modules/generic_cpu/amd64/Makefile index 483ed03218..55b43df8fb 100644 --- a/usr/src/cmd/mdb/intel/modules/generic_cpu/amd64/Makefile +++ b/usr/src/cmd/mdb/intel/modules/generic_cpu/amd64/Makefile @@ -35,3 +35,5 @@ CPPFLAGS += -I../../../../common CPPFLAGS += -I$(SRC)/uts/i86pc/cpu CPPFLAGS += -I$(SRC)/uts/intel CPPFLAGS += -I$(SRC)/uts/i86pc + +CERRWARN += -_gcc=-Wno-uninitialized diff --git a/usr/src/cmd/mdb/intel/modules/generic_cpu/ia32/Makefile b/usr/src/cmd/mdb/intel/modules/generic_cpu/ia32/Makefile index 84adb38a5c..ab61ac5b5e 100644 --- a/usr/src/cmd/mdb/intel/modules/generic_cpu/ia32/Makefile +++ b/usr/src/cmd/mdb/intel/modules/generic_cpu/ia32/Makefile @@ -35,3 +35,5 @@ CPPFLAGS += -I../../../../common CPPFLAGS += -I$(SRC)/uts/i86pc/cpu CPPFLAGS += -I$(SRC)/uts/intel CPPFLAGS += -I$(SRC)/uts/i86pc + +CERRWARN += -_gcc=-Wno-uninitialized diff --git a/usr/src/cmd/mdb/sparc/v7/libproc/Makefile b/usr/src/cmd/mdb/sparc/v7/libproc/Makefile index 6c0562334d..137a96b715 100644 --- a/usr/src/cmd/mdb/sparc/v7/libproc/Makefile +++ b/usr/src/cmd/mdb/sparc/v7/libproc/Makefile @@ -22,7 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = libproc.so MDBTGT = proc @@ -38,6 +37,8 @@ include ../../../Makefile.module CFLAGS += -I../../../../../lib/libproc/common LINTFLAGS += -I../../../../../lib/libproc/common +CERRWARN += -_gcc=-Wno-uninitialized + %.o: $(MODSRCS_DIR)/%.c $(COMPILE.c) $< $(CTFCONVERT_O) diff --git a/usr/src/cmd/mdb/sparc/v7/libtopo/Makefile b/usr/src/cmd/mdb/sparc/v7/libtopo/Makefile index 2902d3ab2f..988276028d 100644 --- a/usr/src/cmd/mdb/sparc/v7/libtopo/Makefile +++ b/usr/src/cmd/mdb/sparc/v7/libtopo/Makefile @@ -23,7 +23,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = libtopo.so MDBTGT = proc @@ -35,3 +34,4 @@ include ../../Makefile.sparcv7 include ../../../Makefile.module CPPFLAGS += -I$(SRC)/lib/fm/topo/libtopo/common +CERRWARN += -_gcc=-Wno-parentheses diff --git a/usr/src/cmd/mdb/sparc/v7/libumem/Makefile b/usr/src/cmd/mdb/sparc/v7/libumem/Makefile index 47072b4380..0488e6739a 100644 --- a/usr/src/cmd/mdb/sparc/v7/libumem/Makefile +++ b/usr/src/cmd/mdb/sparc/v7/libumem/Makefile @@ -50,6 +50,10 @@ include ../../../Makefile.module dmod/$(MODULE) := LDLIBS += -lproc -lm +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + %.o: $(MODSRCS_DIR)/%.c $(COMPILE.c) $< $(CTFCONVERT_O) diff --git a/usr/src/cmd/mdb/sparc/v7/libzpool/Makefile b/usr/src/cmd/mdb/sparc/v7/libzpool/Makefile index 501b3ef347..54a2d6f42c 100644 --- a/usr/src/cmd/mdb/sparc/v7/libzpool/Makefile +++ b/usr/src/cmd/mdb/sparc/v7/libzpool/Makefile @@ -23,7 +23,6 @@ # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = libzpool.so MDBTGT = proc @@ -43,6 +42,8 @@ CPPFLAGS += -I../../../../../lib/libzpool/common \ C99MODE= -xc99=%all C99LMODE= -Xc99=%all +CERRWARN += -_gcc=-Wno-type-limits + dmod/%.o: $(GENUNIX_DIR)/%.c $(COMPILE.c) -o $@ $< $(CTFCONVERT_O) diff --git a/usr/src/cmd/mdb/sparc/v9/fcip/Makefile b/usr/src/cmd/mdb/sparc/v9/fcip/Makefile index 103ff0b9f4..9d270aa8e6 100644 --- a/usr/src/cmd/mdb/sparc/v9/fcip/Makefile +++ b/usr/src/cmd/mdb/sparc/v9/fcip/Makefile @@ -36,3 +36,5 @@ include ../../../Makefile.module CPPFLAGS += -I$(SRC)/uts/common LINTFLAGS64 += -erroff=E_STATIC_UNUSED + +CERRWARN += -_gcc=-Wno-unused-function diff --git a/usr/src/cmd/mdb/sparc/v9/fctl/Makefile b/usr/src/cmd/mdb/sparc/v9/fctl/Makefile index 4dd5beb32b..28fd247a1c 100644 --- a/usr/src/cmd/mdb/sparc/v9/fctl/Makefile +++ b/usr/src/cmd/mdb/sparc/v9/fctl/Makefile @@ -41,3 +41,7 @@ LINTFLAGS64 += -erroff=E_SEC_FORBIDDEN_WARN_CFTIME LINTFLAGS64 += -erroff=E_FUNC_SET_NOT_USED LINTFLAGS64 += -erroff=E_FUNC_ARG_UNUSED LINTFLAGS64 += -erroff=E_SEC_SPRINTF_UNBOUNDED_COPY + +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses diff --git a/usr/src/cmd/mdb/sparc/v9/genunix/Makefile b/usr/src/cmd/mdb/sparc/v9/genunix/Makefile index e70857198b..bb127fd0e3 100644 --- a/usr/src/cmd/mdb/sparc/v9/genunix/Makefile +++ b/usr/src/cmd/mdb/sparc/v9/genunix/Makefile @@ -24,7 +24,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = genunix.so MDBTGT = kvm @@ -65,3 +64,9 @@ CPPFLAGS += -I$(SRC)/uts/sun4u CPPFLAGS += -I$(SRC)/uts/common # Needed to find include file mutex_impl.h CPPFLAGS += -I$(SRC)/uts/sparc/v9 + +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits diff --git a/usr/src/cmd/mdb/sparc/v9/idm/Makefile b/usr/src/cmd/mdb/sparc/v9/idm/Makefile index 3224132f41..c0d77bb8bb 100644 --- a/usr/src/cmd/mdb/sparc/v9/idm/Makefile +++ b/usr/src/cmd/mdb/sparc/v9/idm/Makefile @@ -39,3 +39,5 @@ include ../../../Makefile.module CPPFLAGS += -I$(ISCSITBASE) CPPFLAGS += -I$(ISCSIBASE) CPPFLAGS += -I$(ISERBASE) + +CERRWARN += -_gcc=-Wno-uninitialized diff --git a/usr/src/cmd/mdb/sparc/v9/ipc/Makefile b/usr/src/cmd/mdb/sparc/v9/ipc/Makefile index 0cbd234a1d..bb5ab76ef0 100644 --- a/usr/src/cmd/mdb/sparc/v9/ipc/Makefile +++ b/usr/src/cmd/mdb/sparc/v9/ipc/Makefile @@ -23,7 +23,6 @@ # Copyright (c) 1999-2000 by Sun Microsystems, Inc. # All rights reserved. # -#ident "%Z%%M% %I% %E% SMI" MODULE = ipc.so MDBTGT = kvm @@ -34,3 +33,5 @@ include ../../../../Makefile.cmd include ../../../../Makefile.cmd.64 include ../../Makefile.sparcv9 include ../../../Makefile.module + +CERRWARN += -_gcc=-Wno-parentheses diff --git a/usr/src/cmd/mdb/sparc/v9/ipp/Makefile b/usr/src/cmd/mdb/sparc/v9/ipp/Makefile index 8cdbb5ff78..d546ca1f4a 100644 --- a/usr/src/cmd/mdb/sparc/v9/ipp/Makefile +++ b/usr/src/cmd/mdb/sparc/v9/ipp/Makefile @@ -23,7 +23,6 @@ # Copyright 2001-2002 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = ipp.so MDBTGT = kvm @@ -34,3 +33,5 @@ include ../../../../Makefile.cmd include ../../../../Makefile.cmd.64 include ../../Makefile.sparcv9 include ../../../Makefile.module + +CERRWARN += -_gcc=-Wno-uninitialized diff --git a/usr/src/cmd/mdb/sparc/v9/libproc/Makefile b/usr/src/cmd/mdb/sparc/v9/libproc/Makefile index 77fd8f45ba..8dbdc151d4 100644 --- a/usr/src/cmd/mdb/sparc/v9/libproc/Makefile +++ b/usr/src/cmd/mdb/sparc/v9/libproc/Makefile @@ -22,7 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = libproc.so MDBTGT = proc @@ -39,6 +38,8 @@ include ../../../Makefile.module CFLAGS64 += -I../../../../../lib/libproc/common LINTFLAGS64 += -I../../../../../lib/libproc/common +CERRWARN += -_gcc=-Wno-uninitialized + %.o: $(MODSRCS_DIR)/%.c $(COMPILE.c) $< $(CTFCONVERT_O) diff --git a/usr/src/cmd/mdb/sparc/v9/libtopo/Makefile b/usr/src/cmd/mdb/sparc/v9/libtopo/Makefile index 19a1294bcd..b0adeeeae2 100644 --- a/usr/src/cmd/mdb/sparc/v9/libtopo/Makefile +++ b/usr/src/cmd/mdb/sparc/v9/libtopo/Makefile @@ -23,7 +23,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = libtopo.so MDBTGT = proc @@ -36,3 +35,4 @@ include ../../Makefile.sparcv9 include ../../../Makefile.module CPPFLAGS += -I$(SRC)/lib/fm/topo/libtopo/common +CERRWARN += -_gcc=-Wno-parentheses diff --git a/usr/src/cmd/mdb/sparc/v9/libumem/Makefile b/usr/src/cmd/mdb/sparc/v9/libumem/Makefile index 16d8d80221..87ce977423 100644 --- a/usr/src/cmd/mdb/sparc/v9/libumem/Makefile +++ b/usr/src/cmd/mdb/sparc/v9/libumem/Makefile @@ -64,6 +64,10 @@ include ../../../Makefile.module dmod/$(MODULE) := LDLIBS += -lproc -lm +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + %.o: $(MODSRCS_DIR)/%.c $(COMPILE.c) $< $(CTFCONVERT_O) diff --git a/usr/src/cmd/mdb/sparc/v9/libzpool/Makefile b/usr/src/cmd/mdb/sparc/v9/libzpool/Makefile index ddcd3d89bc..d7be9ab133 100644 --- a/usr/src/cmd/mdb/sparc/v9/libzpool/Makefile +++ b/usr/src/cmd/mdb/sparc/v9/libzpool/Makefile @@ -23,7 +23,6 @@ # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = libzpool.so MDBTGT = proc @@ -44,6 +43,8 @@ CPPFLAGS += -I../../../../../lib/libzpool/common \ C99MODE= -xc99=%all C99LMODE= -Xc99=%all +CERRWARN += -_gcc=-Wno-type-limits + dmod/%.o: $(GENUNIX_DIR)/%.c $(COMPILE.c) -o $@ $< $(CTFCONVERT_O) diff --git a/usr/src/cmd/mdb/sparc/v9/mpt_sas/Makefile b/usr/src/cmd/mdb/sparc/v9/mpt_sas/Makefile index 2fb251c727..0dfa0293e4 100644 --- a/usr/src/cmd/mdb/sparc/v9/mpt_sas/Makefile +++ b/usr/src/cmd/mdb/sparc/v9/mpt_sas/Makefile @@ -33,3 +33,5 @@ include ../../Makefile.sparcv9 include ../../../Makefile.module CPPFLAGS += -I$(SRC)/uts/common + +CERRWARN += -_gcc=-Wno-trigraphs diff --git a/usr/src/cmd/mdb/sparc/v9/pmcs/Makefile b/usr/src/cmd/mdb/sparc/v9/pmcs/Makefile index 27c8563bb2..d282a060e5 100644 --- a/usr/src/cmd/mdb/sparc/v9/pmcs/Makefile +++ b/usr/src/cmd/mdb/sparc/v9/pmcs/Makefile @@ -36,3 +36,7 @@ include $(SRC)/cmd/mdb/Makefile.module C99MODE = -xc99=%all CPPFLAGS += -I$(SRC)/uts/common + +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-uninitialized diff --git a/usr/src/cmd/mdb/sparc/v9/qlc/Makefile b/usr/src/cmd/mdb/sparc/v9/qlc/Makefile index 35f315fcbc..1b5dff0286 100644 --- a/usr/src/cmd/mdb/sparc/v9/qlc/Makefile +++ b/usr/src/cmd/mdb/sparc/v9/qlc/Makefile @@ -44,3 +44,4 @@ LINTFLAGS64 += -erroff=E_STATIC_UNUSED -erroff=E_FUNC_ARG_UNUSED C99MODE= -xc99=%all C99LMODE= -Xc99=%all +CERRWARN += -_gcc=-Wno-address diff --git a/usr/src/cmd/mdb/sparc/v9/rdc/Makefile b/usr/src/cmd/mdb/sparc/v9/rdc/Makefile index 7c09f45c44..5810ed3fb0 100644 --- a/usr/src/cmd/mdb/sparc/v9/rdc/Makefile +++ b/usr/src/cmd/mdb/sparc/v9/rdc/Makefile @@ -34,3 +34,5 @@ include ../../Makefile.sparcv9 include ../../../Makefile.module include ../../../common/modules/rdc/Makefile.com CPPFLAGS += -erroff=E_STATIC_UNUSED + +CERRWARN += -_gcc=-Wno-unused-function diff --git a/usr/src/cmd/mdb/sparc/v9/ufs/Makefile b/usr/src/cmd/mdb/sparc/v9/ufs/Makefile index c48e4fc262..af42f8c31d 100644 --- a/usr/src/cmd/mdb/sparc/v9/ufs/Makefile +++ b/usr/src/cmd/mdb/sparc/v9/ufs/Makefile @@ -22,7 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = ufs.so MDBTGT = kvm @@ -33,3 +32,5 @@ include ../../../../Makefile.cmd include ../../../../Makefile.cmd.64 include ../../Makefile.sparcv9 include ../../../Makefile.module + +CERRWARN += -_gcc=-Wno-trigraphs diff --git a/usr/src/cmd/mdb/sparc/v9/zfs/Makefile b/usr/src/cmd/mdb/sparc/v9/zfs/Makefile index fd6c408774..aa63a724fb 100644 --- a/usr/src/cmd/mdb/sparc/v9/zfs/Makefile +++ b/usr/src/cmd/mdb/sparc/v9/zfs/Makefile @@ -23,7 +23,6 @@ # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = zfs.so MDBTGT = kvm @@ -39,3 +38,5 @@ CPPFLAGS += -I../../../../../uts/common/fs/zfs C99MODE= -xc99=%all C99LMODE= -Xc99=%all + +CERRWARN += -_gcc=-Wno-type-limits diff --git a/usr/src/cmd/mdb/sun4u/modules/unix/v9/Makefile b/usr/src/cmd/mdb/sun4u/modules/unix/v9/Makefile index 33c885ac46..529847d000 100644 --- a/usr/src/cmd/mdb/sun4u/modules/unix/v9/Makefile +++ b/usr/src/cmd/mdb/sun4u/modules/unix/v9/Makefile @@ -23,7 +23,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = unix.so MDBTGT = kvm @@ -42,3 +41,4 @@ CPPFLAGS += -I$(SRC)/uts/sun4 CPPFLAGS += -I$(SRC)/uts/sun4u CPPFLAGS += -I$(SRC)/uts/sfmmu CPPFLAGS += -I$(SRC)/uts/sparc/v9 +CERRWARN += -_gcc=-Wno-uninitialized diff --git a/usr/src/cmd/mdb/sun4v/modules/unix/v9/Makefile b/usr/src/cmd/mdb/sun4v/modules/unix/v9/Makefile index c160537311..6dda857ccb 100644 --- a/usr/src/cmd/mdb/sun4v/modules/unix/v9/Makefile +++ b/usr/src/cmd/mdb/sun4v/modules/unix/v9/Makefile @@ -23,7 +23,6 @@ # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = unix.so MDBTGT = kvm @@ -46,3 +45,4 @@ CPPFLAGS += -I$(SRC)/uts/sun4v CPPFLAGS += -I$(SRC)/uts/sun4u CPPFLAGS += -I$(SRC)/uts/sfmmu CPPFLAGS += -I$(SRC)/uts/sparc/v9 +CERRWARN += -_gcc=-Wno-uninitialized diff --git a/usr/src/cmd/mdb/sun4v/v9/kmdb/Makefile b/usr/src/cmd/mdb/sun4v/v9/kmdb/Makefile index 4450e96109..d22287ce44 100644 --- a/usr/src/cmd/mdb/sun4v/v9/kmdb/Makefile +++ b/usr/src/cmd/mdb/sun4v/v9/kmdb/Makefile @@ -72,6 +72,7 @@ ASFLAGS += -xarch=v9v -I$(SRC)/uts/sun4 -I$(SRC)/uts/sun4v $(TRAPCOUNT) ASFLAGS += -Dsun4v ASFLAGS += -I$(SRC)/cmd/mdb/sparc ASFLAGS += -I$(SRC)/cmd/mdb/sparc/v9 -I$(SRC)/cmd/mdb/sparc/v9/kmdb +CERRWARN += -_gcc=-Wno-unused-function install: all $(ROOTMISC64) kaif.fth diff --git a/usr/src/cmd/mdb/tools/findfp/Makefile.com b/usr/src/cmd/mdb/tools/findfp/Makefile.com index 67c6f37e32..1da6562ccb 100644 --- a/usr/src/cmd/mdb/tools/findfp/Makefile.com +++ b/usr/src/cmd/mdb/tools/findfp/Makefile.com @@ -23,8 +23,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# .KEEP_STATE: @@ -46,6 +44,7 @@ include ../../common/Makefile.util # CPPFLAGS = -I../../common -I../common CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized LDFLAGS = LDLIBS = -lelf diff --git a/usr/src/cmd/mdb/tools/setdynflag/Makefile.com b/usr/src/cmd/mdb/tools/setdynflag/Makefile.com index 8d2e569c6c..9db6e62e8a 100644 --- a/usr/src/cmd/mdb/tools/setdynflag/Makefile.com +++ b/usr/src/cmd/mdb/tools/setdynflag/Makefile.com @@ -23,8 +23,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# .KEEP_STATE: @@ -45,6 +43,7 @@ include ../../common/Makefile.util # CPPFLAGS = -I../../common CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized LDFLAGS = LDLIBS = -lelf diff --git a/usr/src/cmd/mkdir/Makefile b/usr/src/cmd/mkdir/Makefile index f78554c906..e01d79efc2 100644 --- a/usr/src/cmd/mkdir/Makefile +++ b/usr/src/cmd/mkdir/Makefile @@ -20,13 +20,9 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# cmd/mkdir/Makefile -# PROG= mkdir OBJS= $(PROG).o common.o @@ -35,6 +31,8 @@ SRCS= mkdir.c ../chmod/common.c include ../Makefile.cmd CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses LDLIBS += -lgen %.o: ../chmod/%.c diff --git a/usr/src/cmd/mkfifo/Makefile b/usr/src/cmd/mkfifo/Makefile index 9133e66eae..c7eb356cf3 100644 --- a/usr/src/cmd/mkfifo/Makefile +++ b/usr/src/cmd/mkfifo/Makefile @@ -20,13 +20,9 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# cmd/mkfifo/Makefile -# PROG= mkfifo OBJS= $(PROG).o common.o @@ -35,6 +31,7 @@ SRCS= mkfifo.c ../chmod/common.c include ../Makefile.cmd CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses %.o: ../chmod/%.c $(COMPILE.c) -o $@ $< diff --git a/usr/src/cmd/mkmsgs/Makefile b/usr/src/cmd/mkmsgs/Makefile index e9b08e6c01..d2ebe036bf 100644 --- a/usr/src/cmd/mkmsgs/Makefile +++ b/usr/src/cmd/mkmsgs/Makefile @@ -27,6 +27,8 @@ PROG= mkmsgs include ../Makefile.cmd LDLIBS += -lgen +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/cmd/mknod/Makefile b/usr/src/cmd/mknod/Makefile index 2f7f9116c2..cdffd352bd 100644 --- a/usr/src/cmd/mknod/Makefile +++ b/usr/src/cmd/mknod/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -31,6 +29,7 @@ PROG= mknod include ../Makefile.cmd CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/cmd/mkpwdict/Makefile b/usr/src/cmd/mkpwdict/Makefile index 791fadf4c2..a85eca0423 100644 --- a/usr/src/cmd/mkpwdict/Makefile +++ b/usr/src/cmd/mkpwdict/Makefile @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= mkpwdict @@ -34,6 +32,8 @@ CFLAGS += -I$(SRC)/lib/pam_modules/authtok_check LINTFLAGS += -erroff=E_NAME_DEF_NOT_USED2 -m LINTFLAGS += -I$(SRC)/lib/pam_modules/authtok_check +CERRWARN += -_gcc=-Wno-parentheses + CRACK_SRCDIR= $(SRC)/lib/pam_modules/authtok_check/ CRACK_OBJS= packer.o packlib.o dict.o stringlib.o CRACK_SRCS= $(CRACK_OBJS:%.o=$(CRACK_SRCDIR)/%.c) diff --git a/usr/src/cmd/mktemp/Makefile b/usr/src/cmd/mktemp/Makefile index 4e9ddcd47b..6113762e0f 100644 --- a/usr/src/cmd/mktemp/Makefile +++ b/usr/src/cmd/mktemp/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -# ident "%Z%%M% %I% %E% SMI" -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -30,6 +28,8 @@ PROG= mktemp include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/modload/Makefile.com b/usr/src/cmd/modload/Makefile.com index c2805ae9bc..3fe1c676fd 100644 --- a/usr/src/cmd/modload/Makefile.com +++ b/usr/src/cmd/modload/Makefile.com @@ -59,6 +59,8 @@ CLOBBERFILES = $(PROG) LINT_PROG= $(PROG:%=lint_%.c) LINTFLAGS += -erroff=E_NAME_DEF_NOT_USED2 +CERRWARN += -_gcc=-Wno-parentheses + # install specifics $(ROOTDRVPROG) := FILEMODE = 0555 diff --git a/usr/src/cmd/more/Makefile b/usr/src/cmd/more/Makefile index f8bf6391f1..9ad39bb247 100644 --- a/usr/src/cmd/more/Makefile +++ b/usr/src/cmd/more/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -39,6 +37,9 @@ CPPFLAGS += -D_FILE_OFFSET_BITS=64 $(ROOTLIBDATA) := FILEMODE = 0644 CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-clobbered .KEEP_STATE: diff --git a/usr/src/cmd/msgfmt/Makefile b/usr/src/cmd/msgfmt/Makefile index 0cd1e997b0..63b22a8d50 100644 --- a/usr/src/cmd/msgfmt/Makefile +++ b/usr/src/cmd/msgfmt/Makefile @@ -26,8 +26,6 @@ # All Rights Reserved # -#ident "%Z%%M% %I% %E% SMI" - # cmd/msgfmt/Makefile include ../Makefile.cmd @@ -64,6 +62,11 @@ CLOBBERFILES += gmsgfmt_rev ROOTBINPROG= $(BINPROG:%=$(ROOTBIN)/%) ROOTLIBPROG= $(LIBPROG:%=$(ROOTLIB)/%) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable + .KEEP_STATE: .PARALLEL: $(SOBJS) $(GOBJS) $(YOBJS) $(COBJS) $(BOBJS) $(LOBJS) \ diff --git a/usr/src/cmd/mv/Makefile b/usr/src/cmd/mv/Makefile index 911682845c..2072612ffe 100644 --- a/usr/src/cmd/mv/Makefile +++ b/usr/src/cmd/mv/Makefile @@ -18,8 +18,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -42,6 +40,9 @@ clean $(XPG4) := OBJS += values-xpg4.o CLOBBERFILES += $(CPFILE) $(LNFILE) CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized $(XPG4) := CFLAGS += -DXPG4 LINTFLAGS += -DXPG4 -u XGETFLAGS += -a -x mv.xcl diff --git a/usr/src/cmd/ndmpadm/Makefile b/usr/src/cmd/ndmpadm/Makefile index b19efbd625..94f51fce89 100644 --- a/usr/src/cmd/ndmpadm/Makefile +++ b/usr/src/cmd/ndmpadm/Makefile @@ -46,6 +46,8 @@ POFILE= ndmpadm.po LDLIBS += -lndmp +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/ndmpd/Makefile b/usr/src/cmd/ndmpd/Makefile index 3663a45b08..3cb74257ce 100644 --- a/usr/src/cmd/ndmpd/Makefile +++ b/usr/src/cmd/ndmpd/Makefile @@ -65,6 +65,11 @@ LINTFLAGS += -xerroff=E_INCONS_VAL_TYPE_DECL2 # argument used inconsistently LINTFLAGS += -xerroff=E_INCONS_ARG_USED2 +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-address + LDLIBS += -lsocket -lnsl -lzfs -lsec -lndmp -lmd5 -lnvpair -lumem -lbsm -lgen -lcmdutils -linetutil OBJS= \ diff --git a/usr/src/cmd/newform/Makefile b/usr/src/cmd/newform/Makefile index ea2188a8da..56a6c40af3 100644 --- a/usr/src/cmd/newform/Makefile +++ b/usr/src/cmd/newform/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989 by Sun Microsystems, Inc. # @@ -29,6 +27,8 @@ PROG= newform include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/news/Makefile b/usr/src/cmd/news/Makefile index 9649f6b17c..214ae487bd 100644 --- a/usr/src/cmd/news/Makefile +++ b/usr/src/cmd/news/Makefile @@ -29,6 +29,9 @@ include ../Makefile.cmd VARNEWSD= $(ROOT)/var/news DIRS= $(VARNEWSD) +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/newtask/Makefile.com b/usr/src/cmd/newtask/Makefile.com index a358d0d56e..7f2dbf60ee 100644 --- a/usr/src/cmd/newtask/Makefile.com +++ b/usr/src/cmd/newtask/Makefile.com @@ -34,6 +34,9 @@ LDLIBS += -lproc -lproject -lsecdb CFLAGS += $(CCVERBOSE) CFLAGS64 += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + CPPFLAGS += -I.. .KEEP_STATE: diff --git a/usr/src/cmd/nl/Makefile b/usr/src/cmd/nl/Makefile index 69eb13dd06..1d68f2308f 100644 --- a/usr/src/cmd/nl/Makefile +++ b/usr/src/cmd/nl/Makefile @@ -22,10 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# -# cmd/nl/Makefile -# # Message catalog requires no special processing because messages # only occur in ./nl.c, not in ../expr/compile.c. @@ -42,6 +38,8 @@ include ../Makefile.cmd LDLIBS += -lgen CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable $(XPG4):= CPPFLAGS += -DXPG4 MAPFILE.INT = ../expr/mapfile-intf diff --git a/usr/src/cmd/nlsadmin/Makefile b/usr/src/cmd/nlsadmin/Makefile index c80378fa23..ce2bc57745 100644 --- a/usr/src/cmd/nlsadmin/Makefile +++ b/usr/src/cmd/nlsadmin/Makefile @@ -27,6 +27,9 @@ PROG= nlsadmin include ../Makefile.cmd FILEMODE= 0755 +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/cmd/nscd/Makefile b/usr/src/cmd/nscd/Makefile index 984028cec4..aa478fa3b0 100644 --- a/usr/src/cmd/nscd/Makefile +++ b/usr/src/cmd/nscd/Makefile @@ -58,6 +58,11 @@ LINTFLAGS += -erroff=E_GLOBAL_COULD_BE_STATIC2 LINTFLAGS += -erroff=E_NAME_USED_NOT_DEF2 LINTFLAGS += -erroff=E_NAME_DEF_NOT_USED2 +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits + # nscd interposes on many symbols, and must export others for its own dlsym() # use, and dlsym() calls from libc. Itemizing the interfaces within a mapfile # is error-prone, so establish the whole object as an interposer. diff --git a/usr/src/cmd/oamuser/group/Makefile b/usr/src/cmd/oamuser/group/Makefile index c4c39b56f4..438890f14b 100644 --- a/usr/src/cmd/oamuser/group/Makefile +++ b/usr/src/cmd/oamuser/group/Makefile @@ -50,6 +50,7 @@ LINTFLAGS= -u INSSBINPROG= $(SBINPROG:%=$(ROOTUSRSBIN)/%) CPPFLAGS= -I$(HERE) -I$(LOCAL) $(CPPFLAGS.master) +CERRWARN += -_gcc=-Wno-type-limits FILEMODE= 0555 $(GROUPADD) := OBJS = $(ADD_OBJ) diff --git a/usr/src/cmd/oamuser/lib/Makefile b/usr/src/cmd/oamuser/lib/Makefile index b431c2f5c8..561cf0a3fd 100644 --- a/usr/src/cmd/oamuser/lib/Makefile +++ b/usr/src/cmd/oamuser/lib/Makefile @@ -63,6 +63,9 @@ CLOBBERFILES= $(DATEFILE) GENERAL= ../inc CPPFLAGS= -I. -I$(GENERAL) $(CPPFLAGS.master) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-unused-variable ARFLAGS= cr AROBJS= `$(LORDER) $(OBJS) | $(TSORT)` LINTFLAGS= -u diff --git a/usr/src/cmd/oamuser/user/Makefile b/usr/src/cmd/oamuser/user/Makefile index 64d1a6ed1f..6d3266c508 100644 --- a/usr/src/cmd/oamuser/user/Makefile +++ b/usr/src/cmd/oamuser/user/Makefile @@ -70,6 +70,10 @@ INSSBINPROG= $(SBINPROG:%=$(ROOTUSRSBIN)/%) INSSKELFILE= $(SKELFILE:%=$(ROOTSKEL)/%) CPPFLAGS= -I$(HERE) -I$(LOCAL) $(CPPFLAGS.master) +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses $(INSSBINPROG) := FILEMODE = 0555 $(INSSYSADMPROG):= FILEMODE = 0500 diff --git a/usr/src/cmd/oawk/Makefile b/usr/src/cmd/oawk/Makefile index 4ce7950110..1b148cf0de 100644 --- a/usr/src/cmd/oawk/Makefile +++ b/usr/src/cmd/oawk/Makefile @@ -20,13 +20,9 @@ # CDDL HEADER END # # -# ident "%Z%%M% %I% %E% SMI" -# # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# cmd/oawk/Makefile -# include ../Makefile.cmd @@ -67,6 +63,12 @@ CPPFLAGS += -D_FILE_OFFSET_BITS=64 ROOTLINK = $(LINKPROG:%=$(ROOTBIN)/%) +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-extra +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE : all : $(PROG) $(TXTS) diff --git a/usr/src/cmd/oplhpd/Makefile b/usr/src/cmd/oplhpd/Makefile index b512c9f08c..c4772bf3e4 100644 --- a/usr/src/cmd/oplhpd/Makefile +++ b/usr/src/cmd/oplhpd/Makefile @@ -45,6 +45,8 @@ ROOTMANIFESTDIR = $(ROOTSVCPLATFORMSUN4U) CPPFLAGS += -I$(SRC)/uts/sun4u/opl LDLIBS64 += -lsysevent -lnvpair -lcfgadm -ldevinfo +CERRWARN += -_gcc=-Wno-unused-variable + PSMPROG = $(USR_PSM_LIB64_DIR)/$(PROG) $(PSMPROG) := FILEMODE = 0755 diff --git a/usr/src/cmd/pack/Makefile b/usr/src/cmd/pack/Makefile index 365475cb39..b50710d831 100644 --- a/usr/src/cmd/pack/Makefile +++ b/usr/src/cmd/pack/Makefile @@ -19,8 +19,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -30,6 +28,8 @@ PROG= pack include ../Makefile.cmd CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized XGETFLAGS += -a -x $(PROG).xcl CPPFLAGS += -D_FILE_OFFSET_BITS=64 diff --git a/usr/src/cmd/parted/Makefile b/usr/src/cmd/parted/Makefile index 371df7dd71..d3aff3828f 100644 --- a/usr/src/cmd/parted/Makefile +++ b/usr/src/cmd/parted/Makefile @@ -30,6 +30,7 @@ include ../Makefile.cmd C99MODE= $(C99_ENABLE) CERRWARN += -erroff=E_EXTERN_INLINE_UNDEFINED CERRWARN += -erroff=E_ARG_INCOMPATIBLE_WITH_ARG +CERRWARN += -_gcc=-Wno-unused-function srcdir= . diff --git a/usr/src/cmd/passmgmt/Makefile b/usr/src/cmd/passmgmt/Makefile index 397270a03c..f6d9bf3283 100644 --- a/usr/src/cmd/passmgmt/Makefile +++ b/usr/src/cmd/passmgmt/Makefile @@ -38,6 +38,9 @@ $(ROOTFILE):= FILEMODE= $(LIBFILEMODE) .KEEP_STATE: LDLIBS += -lsecdb -lnsl +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-uninitialized all: $(PROG) $(TXTS) diff --git a/usr/src/cmd/passwd/Makefile b/usr/src/cmd/passwd/Makefile index 561357a16c..d53cad2cd6 100644 --- a/usr/src/cmd/passwd/Makefile +++ b/usr/src/cmd/passwd/Makefile @@ -33,6 +33,10 @@ lint := LDLIBS += -lpasswdutil LDFLAGS += $(ZIGNORE) LDLIBS += -lbsm -lpam -lnsl +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + FILEMODE = 06555 XGETFLAGS += -a -x $(PROG).xcl diff --git a/usr/src/cmd/pbind/Makefile.com b/usr/src/cmd/pbind/Makefile.com index 34d8d9d4ad..13f6fab98a 100644 --- a/usr/src/cmd/pbind/Makefile.com +++ b/usr/src/cmd/pbind/Makefile.com @@ -32,6 +32,8 @@ SRCS= $(OBJS:%.o=../%.c) include ../../Makefile.cmd LDLIBS += -lproc +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/cmd/pcidr/Makefile.com b/usr/src/cmd/pcidr/Makefile.com index ff0bbce8e6..0e9a25dc2c 100755..100644 --- a/usr/src/cmd/pcidr/Makefile.com +++ b/usr/src/cmd/pcidr/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# # # to be included AFTER cmd/Makefile.cmd or lib/Makefile.lib @@ -48,6 +46,8 @@ ROOTCMDDIR = $(ROOTLIBDIR) CPPFLAGS += -D_REENTRANT -I$(HDRDIR) +CERRWARN += -_gcc=-Wno-type-limits + # Note that LDFLAGS is NOT used in the build rules for shared objects! # LDLIBS is limited to -L and -l options; all other options must be added to # DYNFLAGS for shared objects diff --git a/usr/src/cmd/pcitool/Makefile.com b/usr/src/cmd/pcitool/Makefile.com index 6ed6c1fbf8..de7dd7c05b 100644 --- a/usr/src/cmd/pcitool/Makefile.com +++ b/usr/src/cmd/pcitool/Makefile.com @@ -31,6 +31,9 @@ UTSBASE = ../../../../src/uts LDLIBS += -ldevinfo CFLAGS += -D$(MACH) -I$(UTSBASE)/common +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable LINTFLAGS += -I$(UTSBASE)/common diff --git a/usr/src/cmd/pg/Makefile b/usr/src/cmd/pg/Makefile index 12a5835fbb..c5ba757837 100644 --- a/usr/src/cmd/pg/Makefile +++ b/usr/src/cmd/pg/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -35,6 +33,10 @@ LDLIBS += -lgen -lcurses XGETFLAGS += -a -x $(PROG).xcl CPPFLAGS += -D_FILE_OFFSET_BITS=64 +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-clobbered + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/pgrep/Makefile b/usr/src/cmd/pgrep/Makefile index e97990cdbb..67993f0ff2 100644 --- a/usr/src/cmd/pgrep/Makefile +++ b/usr/src/cmd/pgrep/Makefile @@ -37,6 +37,7 @@ include ../Makefile.cmd CLOBBERFILES += $(PKILLFILE) CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses LDLIBS += -luutil -lproject -lcontract POFILE = ppgrep.po diff --git a/usr/src/cmd/picl/plugins/Makefile.com b/usr/src/cmd/picl/plugins/Makefile.com index a44481ed52..d56f0ec184 100644 --- a/usr/src/cmd/picl/plugins/Makefile.com +++ b/usr/src/cmd/picl/plugins/Makefile.com @@ -29,6 +29,12 @@ MAPFILES = CPPFLAGS += -I$(SRC)/lib/libpicl -I$(SRC)/lib/libpicltree CPPFLAGS += -I$(SRC)/cmd/picl/plugins/inc CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable # Some picl plugins have dependencies to which they make no reference. These # dependencies are expected to be loaded so that their .init's fire and thus diff --git a/usr/src/cmd/picl/plugins/lib/picld_pluginutil/Makefile.com b/usr/src/cmd/picl/plugins/lib/picld_pluginutil/Makefile.com index bff1d92236..a797ca6ea4 100644 --- a/usr/src/cmd/picl/plugins/lib/picld_pluginutil/Makefile.com +++ b/usr/src/cmd/picl/plugins/lib/picld_pluginutil/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libpicld_pluginutil.a VERS= .1 @@ -54,6 +52,7 @@ POFILE= picld_pluginutil.po CPPFLAGS += -I.. -I$(SRC)/lib/libpicl -I$(SRC)/lib/libpicltree CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized CPPFLAGS += -D_REENTRANT DYNFLAGS += $(ZNOLAZYLOAD) LDLIBS += -L$(SRC)/lib/libpicltree/$(MACH) diff --git a/usr/src/cmd/plimit/amd64/Makefile b/usr/src/cmd/plimit/amd64/Makefile index 42450afe68..190969b38f 100644 --- a/usr/src/cmd/plimit/amd64/Makefile +++ b/usr/src/cmd/plimit/amd64/Makefile @@ -23,8 +23,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= plimit @@ -36,6 +34,7 @@ include ../../Makefile.cmd include ../../Makefile.cmd.64 CFLAGS64 += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += -lproc diff --git a/usr/src/cmd/plimit/i386/Makefile b/usr/src/cmd/plimit/i386/Makefile index bd858110ea..7bfabc3b75 100644 --- a/usr/src/cmd/plimit/i386/Makefile +++ b/usr/src/cmd/plimit/i386/Makefile @@ -20,13 +20,9 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# cmd/plimit/i386/Makefile -# PROG= plimit @@ -37,6 +33,7 @@ SRCS= $(OBJS:%.o=../%.c) include ../../Makefile.cmd CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += -lproc diff --git a/usr/src/cmd/plimit/sparcv9/Makefile b/usr/src/cmd/plimit/sparcv9/Makefile index 3119a50c4c..e4f39a0931 100644 --- a/usr/src/cmd/plimit/sparcv9/Makefile +++ b/usr/src/cmd/plimit/sparcv9/Makefile @@ -35,6 +35,7 @@ include ../../Makefile.cmd include ../../Makefile.cmd.64 CFLAGS64 += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += -lproc diff --git a/usr/src/cmd/policykit/Makefile b/usr/src/cmd/policykit/Makefile index c7fff81ed4..0c91f51fe8 100644 --- a/usr/src/cmd/policykit/Makefile +++ b/usr/src/cmd/policykit/Makefile @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG = polkit-is-privileged @@ -39,6 +37,8 @@ CPPFLAGS += $(POLICYKIT_DBUS_CPPFLAGS) $(POLICYKIT_GLIB_CPPFLAGS) CPPFLAGS += -DPACKAGE_VERSION=\"$(POLICYKIT_VERSION)\" C99MODE = $(C99_ENABLE) +CERRWARN += -_gcc=-Wno-unused-variable + ROOTUSRSBINPROG = $(PROG:%=$(ROOTUSRSBIN)/%) .KEEP_STATE: diff --git a/usr/src/cmd/pools/Makefile.pools b/usr/src/cmd/pools/Makefile.pools index 9b8f96eb1e..14c23e64a4 100644 --- a/usr/src/cmd/pools/Makefile.pools +++ b/usr/src/cmd/pools/Makefile.pools @@ -23,12 +23,14 @@ # Copyright (c) 2001 by Sun Microsystems, Inc. # All rights reserved. # -#ident "%Z%%M% %I% %E% SMI" -# -# cmd/pools/Makefile.pools POOLSSRC = $(SRC)/cmd/pools POOLSCOMMONDIR = $(POOLSSRC)/common COMMON_OBJS = utils.o COMMON_SRCS = $(COMMON_OBJS:%.o=$(POOLSCOMMONDIR)/%.c) + +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-implicit-function-declaration diff --git a/usr/src/cmd/power/Makefile b/usr/src/cmd/power/Makefile index 3496ab78df..85e903e3ec 100644 --- a/usr/src/cmd/power/Makefile +++ b/usr/src/cmd/power/Makefile @@ -90,6 +90,9 @@ $(ROOTUSRSBINSYSIDPM) := FILEMODE= 755 # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-value .PARALLEL: $(OBJS) diff --git a/usr/src/cmd/power/powerd.c b/usr/src/cmd/power/powerd.c index 227e91ac38..2d4a3ae274 100644 --- a/usr/src/cmd/power/powerd.c +++ b/usr/src/cmd/power/powerd.c @@ -399,7 +399,6 @@ autos3_monitor(void) logerror("Unable to open %s: %s", SRN, strerror(errno)); thr_exit((void *) errno); } - logerror("Able to open %s", SRN); /* * Tell device we want the special sauce diff --git a/usr/src/cmd/powertop/Makefile.com b/usr/src/cmd/powertop/Makefile.com index 6c88a6cd03..441cefcbbc 100644 --- a/usr/src/cmd/powertop/Makefile.com +++ b/usr/src/cmd/powertop/Makefile.com @@ -41,6 +41,8 @@ include ../../Makefile.cmd CFLAGS += $(CCVERBOSE) CFLAGS64 += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += -lcurses -ldtrace -lkstat FILEMODE = 0555 diff --git a/usr/src/cmd/pr/Makefile b/usr/src/cmd/pr/Makefile index 8c6b8c8747..802d3170c6 100644 --- a/usr/src/cmd/pr/Makefile +++ b/usr/src/cmd/pr/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989 by Sun Microsystems, Inc. # @@ -33,6 +31,8 @@ include ../Makefile.cmd SED = sed DCFILE = $(PROG).dc +CERRWARN += -_gcc=-Wno-parentheses + $(XPG4):= CPPFLAGS += -DXPG4 $(POFILE) := XGETFLAGS += -a -x pr.xcl diff --git a/usr/src/cmd/praudit/Makefile b/usr/src/cmd/praudit/Makefile index 8fafd8043f..4a1b957841 100644 --- a/usr/src/cmd/praudit/Makefile +++ b/usr/src/cmd/praudit/Makefile @@ -42,6 +42,9 @@ XGETFLAGS += -a -x praudit.xcl CPPFLAGS += -D_PRAUDIT -I$(XLATEDIR) CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + LDLIBS += -lbsm -lnsl -lpam -ltsol .KEEP_STATE: diff --git a/usr/src/cmd/prctl/Makefile.com b/usr/src/cmd/prctl/Makefile.com index 24df4f70b5..7c57f8f7ac 100644 --- a/usr/src/cmd/prctl/Makefile.com +++ b/usr/src/cmd/prctl/Makefile.com @@ -23,10 +23,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# -# cmd/prctl/Makefile.com -# PROG= prctl @@ -37,6 +33,8 @@ SRCS= ../prctl.c ../utils.c include ../../Makefile.cmd CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += -lproc -lproject diff --git a/usr/src/cmd/priocntl/Makefile b/usr/src/cmd/priocntl/Makefile index f09a10f50f..526d67098e 100644 --- a/usr/src/cmd/priocntl/Makefile +++ b/usr/src/cmd/priocntl/Makefile @@ -35,6 +35,8 @@ SRCS= $(OBJ:%.o=%.c) include ../Makefile.cmd LDLIBS += -lcontract +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized CLASSD = $(ROOTLIB)/class RTD = $(CLASSD)/RT diff --git a/usr/src/cmd/projects/Makefile b/usr/src/cmd/projects/Makefile index 19bedca9bb..f61bc033b6 100644 --- a/usr/src/cmd/projects/Makefile +++ b/usr/src/cmd/projects/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -37,6 +35,7 @@ LDLIBS += -lproject .KEEP_STATE: CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized all: $(PROG) diff --git a/usr/src/cmd/prstat/Makefile.com b/usr/src/cmd/prstat/Makefile.com index 84aac0d24b..e317483142 100644 --- a/usr/src/cmd/prstat/Makefile.com +++ b/usr/src/cmd/prstat/Makefile.com @@ -32,6 +32,7 @@ SRCS = $(OBJS:%.o=../%.c) include ../../Makefile.cmd CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses LDLIBS += -lcurses -lproject LINTFLAGS += -u LINTFLAGS64 += -u diff --git a/usr/src/cmd/prtconf/Makefile.com b/usr/src/cmd/prtconf/Makefile.com index ad0ecde37f..b92d0925aa 100644 --- a/usr/src/cmd/prtconf/Makefile.com +++ b/usr/src/cmd/prtconf/Makefile.com @@ -30,7 +30,10 @@ SRCS= $(OBJS:%.o=../%.c) include ../../Makefile.cmd CFLAGS += $(CCVERBOSE) -LDLIBS += -ldevinfo -lnvpair -lpcidb +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +LDLIBS += -ldevinfo -lnvpair FILEMODE= 02555 diff --git a/usr/src/cmd/prtdiag/Makefile.com b/usr/src/cmd/prtdiag/Makefile.com index 2f5e7b0ac0..ca779165bf 100644 --- a/usr/src/cmd/prtdiag/Makefile.com +++ b/usr/src/cmd/prtdiag/Makefile.com @@ -31,6 +31,8 @@ PROG = prtdiag OBJS = main.o CLASS = 32 +CERRWARN += -_gcc=-Wno-parentheses + FILEMODE = 2755 DIRMODE = 755 diff --git a/usr/src/cmd/prtfru/Makefile b/usr/src/cmd/prtfru/Makefile index 3a90f7882e..a0e7bd359f 100644 --- a/usr/src/cmd/prtfru/Makefile +++ b/usr/src/cmd/prtfru/Makefile @@ -32,6 +32,8 @@ SRCS = $(OBJS:%.o=%.c) include $(SRC)/cmd/Makefile.cmd CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses CPPFLAGS += -I$(SRC)/lib/libfru/include \ -I$(SRC)/lib/libfruutils LINTFLAGS += -u diff --git a/usr/src/cmd/prtvtoc/Makefile b/usr/src/cmd/prtvtoc/Makefile index 164efc05c6..59db9914bd 100644 --- a/usr/src/cmd/prtvtoc/Makefile +++ b/usr/src/cmd/prtvtoc/Makefile @@ -32,6 +32,9 @@ RELUSRSBIN= ../usr/sbin ROOTSYMLINK= $(ROOTETC)/$(PROG) LDLIBS += -ladm -lefi +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/ps/Makefile.com b/usr/src/cmd/ps/Makefile.com index aa7a2bec45..48e187ef48 100644 --- a/usr/src/cmd/ps/Makefile.com +++ b/usr/src/cmd/ps/Makefile.com @@ -34,6 +34,8 @@ SRCS= $(OBJS:%.o=../%.c) include ../../Makefile.cmd CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += -lproject .KEEP_STATE: diff --git a/usr/src/cmd/psrinfo/Makefile b/usr/src/cmd/psrinfo/Makefile index 0c0f980612..7786294a6f 100644 --- a/usr/src/cmd/psrinfo/Makefile +++ b/usr/src/cmd/psrinfo/Makefile @@ -31,6 +31,7 @@ PROG= psrinfo include ../Makefile.cmd LDLIBS += -lkstat +CERRWARN += -_gcc=-Wno-uninitialized XGETFLAGS += $(PROG).po := CPPFLAGS += -DXGETTEXT diff --git a/usr/src/cmd/psrset/Makefile.com b/usr/src/cmd/psrset/Makefile.com index 7420cb5d38..b162a57982 100644 --- a/usr/src/cmd/psrset/Makefile.com +++ b/usr/src/cmd/psrset/Makefile.com @@ -32,6 +32,8 @@ SRCS= $(OBJS:%.o=../%.c) include ../../Makefile.cmd CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += -lproc .KEEP_STATE: diff --git a/usr/src/cmd/ptools/Makefile.bld b/usr/src/cmd/ptools/Makefile.bld index d0ab70bc6d..f5b50f5ea1 100644 --- a/usr/src/cmd/ptools/Makefile.bld +++ b/usr/src/cmd/ptools/Makefile.bld @@ -54,6 +54,21 @@ LDLIBS_pwdx = -lproc LDLIBS += $(LDLIBS_$(PROG)) +CERRWARN_plgrp += -_gcc=-Wno-parentheses + +CERRWARN_ppriv += -_gcc=-Wno-parentheses +CERRWARN_ppriv += -_gcc=-Wno-uninitialized + +CERRWARN_ptree += -_gcc=-Wno-parentheses + +CERRWARN_pstack += -_gcc=-Wno-uninitialized +CERRWARN_pstack += -_gcc=-Wno-clobbered + +CERRWARN_pargs += -_gcc=-Wno-clobbered +CERRWARN_pargs += -_gcc=-Wno-type-limits + +CERRWARN += $(CERRWARN_$(PROG)) + # pargs depends on ../../common/elfcap components # pmadvise depends on pmap components diff --git a/usr/src/cmd/ptools/pfiles/pfiles.c b/usr/src/cmd/ptools/pfiles/pfiles.c index d752d8e95c..a5cefcbdce 100644 --- a/usr/src/cmd/ptools/pfiles/pfiles.c +++ b/usr/src/cmd/ptools/pfiles/pfiles.c @@ -21,6 +21,7 @@ /* * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 DEY Storage Systems, Inc. All rights reserved. */ #include <stdio.h> @@ -61,7 +62,7 @@ static int Fflag; static boolean_t nflag = B_FALSE; static void intr(int); -static void dofcntl(struct ps_prochandle *, int, int, int); +static void dofcntl(struct ps_prochandle *, prfdinfo_t *, int, int); static void dosocket(struct ps_prochandle *, int); static void dofifo(struct ps_prochandle *, int); static void dotli(struct ps_prochandle *, int); @@ -102,7 +103,7 @@ main(int argc, char **argv) argv += optind; if (errflg || argc <= 0) { - (void) fprintf(stderr, "usage:\t%s [-F] pid ...\n", + (void) fprintf(stderr, "usage:\t%s [-F] { pid | core } ...\n", command); (void) fprintf(stderr, " (report open files of each process)\n"); @@ -132,12 +133,35 @@ main(int argc, char **argv) (void) proc_flushstdio(); + arg = *argv++; + /* get the specified pid and the psinfo struct */ - if ((pid = proc_arg_psinfo(arg = *argv++, PR_ARG_PIDS, + if ((pid = proc_arg_psinfo(arg, PR_ARG_PIDS, &psinfo, &gret)) == -1) { - (void) fprintf(stderr, "%s: cannot examine %s: %s\n", - command, arg, Pgrab_error(gret)); - retc++; + + if ((Pr = proc_arg_xgrab(arg, NULL, PR_ARG_CORES, + Fflag, &gret, NULL)) == NULL) { + (void) fprintf(stderr, + "%s: cannot examine %s: %s\n", + command, arg, Pgrab_error(gret)); + retc++; + continue; + } + if (proc_arg_psinfo(arg, PR_ARG_ANY, &psinfo, + &gret) < 0) { + (void) fprintf(stderr, + "%s: cannot examine %s: %s\n", + command, arg, Pgrab_error(gret)); + retc++; + Prelease(Pr, 0); + continue; + } + (void) printf("core '%s' of %d:\t%.70s\n", + arg, (int)psinfo.pr_pid, psinfo.pr_psargs); + + show_files(Pr); + Prelease(Pr, 0); + } else if ((Pr = Pgrab(pid, Fflag, &gret)) != NULL) { if (Pcreate_agent(Pr) == 0) { proc_unctrl_psinfo(&psinfo); @@ -190,160 +214,121 @@ intr(int sig) /* ------ begin specific code ------ */ -static void -show_files(struct ps_prochandle *Pr) +static int +show_file(void *data, prfdinfo_t *info) { - DIR *dirp; - struct dirent *dentp; - const char *dev; - char pname[100]; - char fname[PATH_MAX]; - struct stat64 statb; - struct rlimit rlim; - pid_t pid; - int fd; + struct ps_prochandle *Pr = data; + char unknown[12]; char *s; - int ret; - - if (pr_getrlimit(Pr, RLIMIT_NOFILE, &rlim) == 0) { - ulong_t nfd = rlim.rlim_cur; - if (nfd == RLIM_INFINITY) - (void) printf( - " Current rlimit: unlimited file descriptors\n"); - else - (void) printf( - " Current rlimit: %lu file descriptors\n", nfd); - } - - /* in case we are doing this to ourself */ - pid = (Pr == NULL)? getpid() : Pstatus(Pr)->pr_pid; - - (void) sprintf(pname, "/proc/%d/fd", (int)pid); - if ((dirp = opendir(pname)) == NULL) { - (void) fprintf(stderr, "%s: cannot open directory %s\n", - command, pname); - return; + mode_t mode; + + if (interrupt) + return (1); + + mode = info->pr_mode; + + switch (mode & S_IFMT) { + case S_IFCHR: s = "S_IFCHR"; break; + case S_IFBLK: s = "S_IFBLK"; break; + case S_IFIFO: s = "S_IFIFO"; break; + case S_IFDIR: s = "S_IFDIR"; break; + case S_IFREG: s = "S_IFREG"; break; + case S_IFLNK: s = "S_IFLNK"; break; + case S_IFSOCK: s = "S_IFSOCK"; break; + case S_IFDOOR: s = "S_IFDOOR"; break; + case S_IFPORT: s = "S_IFPORT"; break; + default: + s = unknown; + (void) sprintf(s, "0x%.4x ", (int)mode & S_IFMT); + break; } - /* for each open file --- */ - while ((dentp = readdir(dirp)) != NULL && !interrupt) { - char unknown[12]; - dev_t rdev; + (void) printf("%4d: %s mode:0%.3o", info->pr_fd, s, + (int)mode & ~S_IFMT); - /* skip '.' and '..' */ - if (!isdigit(dentp->d_name[0])) - continue; + (void) printf(" dev:%u,%u", + (unsigned)info->pr_major, (unsigned)info->pr_minor); - fd = atoi(dentp->d_name); - if (pr_fstat64(Pr, fd, &statb) == -1) { - s = unknown; - (void) sprintf(s, "%4d", fd); - perror(s); - continue; - } - - rdev = NODEV; - switch (statb.st_mode & S_IFMT) { - case S_IFCHR: s = "S_IFCHR"; rdev = statb.st_rdev; break; - case S_IFBLK: s = "S_IFBLK"; rdev = statb.st_rdev; break; - case S_IFIFO: s = "S_IFIFO"; break; - case S_IFDIR: s = "S_IFDIR"; break; - case S_IFREG: s = "S_IFREG"; break; - case S_IFLNK: s = "S_IFLNK"; break; - case S_IFSOCK: s = "S_IFSOCK"; break; - case S_IFDOOR: s = "S_IFDOOR"; break; - case S_IFPORT: s = "S_IFPORT"; break; - default: - s = unknown; - (void) sprintf(s, "0x%.4x ", - (int)statb.st_mode & S_IFMT); - break; - } - - (void) printf("%4d: %s mode:0%.3o", fd, s, - (int)statb.st_mode & ~S_IFMT); - - if (major(statb.st_dev) != (major_t)NODEV && - minor(statb.st_dev) != (minor_t)NODEV) - (void) printf(" dev:%lu,%lu", - (ulong_t)major(statb.st_dev), - (ulong_t)minor(statb.st_dev)); - else - (void) printf(" dev:0x%.8lX", (long)statb.st_dev); - - if ((statb.st_mode & S_IFMT) == S_IFPORT) { - (void) printf(" uid:%d gid:%d", - (int)statb.st_uid, - (int)statb.st_gid); - (void) printf(" size:%lld\n", - (longlong_t)statb.st_size); - continue; - } - - (void) printf(" ino:%llu uid:%d gid:%d", - (u_longlong_t)statb.st_ino, - (int)statb.st_uid, (int)statb.st_gid); - - if (rdev == NODEV) - (void) printf(" size:%lld\n", - (longlong_t)statb.st_size); - else if (major(rdev) != (major_t)NODEV && - minor(rdev) != (minor_t)NODEV) - (void) printf(" rdev:%lu,%lu\n", - (ulong_t)major(rdev), (ulong_t)minor(rdev)); - else - (void) printf(" rdev:0x%.8lX\n", (long)rdev); + if ((mode & S_IFMT) == S_IFPORT) { + (void) printf(" uid:%d gid:%d", + (int)info->pr_uid, (int)info->pr_gid); + (void) printf(" size:%lld\n", (longlong_t)info->pr_size); + return (0); + } - if (!nflag) { - off_t offset; + (void) printf(" ino:%llu uid:%d gid:%d", + (u_longlong_t)info->pr_ino, (int)info->pr_uid, (int)info->pr_gid); - dofcntl(Pr, fd, - (statb.st_mode & (S_IFMT|S_ENFMT|S_IXGRP)) - == (S_IFREG|S_ENFMT), - (statb.st_mode & S_IFMT) == S_IFDOOR); + if ((info->pr_rmajor == (major_t)NODEV) && + (info->pr_rminor == (minor_t)NODEV)) + (void) printf(" size:%lld\n", (longlong_t)info->pr_size); + else + (void) printf(" rdev:%u,%u\n", + (unsigned)info->pr_rmajor, (unsigned)info->pr_rminor); - if ((statb.st_mode & S_IFMT) == S_IFSOCK) - dosocket(Pr, fd); - else if ((statb.st_mode & S_IFMT) == S_IFIFO) - dofifo(Pr, fd); + if (!nflag) { + dofcntl(Pr, info, + (mode & (S_IFMT|S_ENFMT|S_IXGRP)) == (S_IFREG|S_ENFMT), + (mode & S_IFMT) == S_IFDOOR); - (void) sprintf(pname, "/proc/%d/path/%d", (int)pid, fd); + if (Pstate(Pr) != PS_DEAD) { + char *dev; - if ((ret = readlink(pname, fname, PATH_MAX - 1)) <= 0) - continue; + if ((mode & S_IFMT) == S_IFSOCK) + dosocket(Pr, info->pr_fd); + else if ((mode & S_IFMT) == S_IFIFO) + dofifo(Pr, info->pr_fd); - fname[ret] = '\0'; - - if ((statb.st_mode & S_IFMT) == S_IFCHR && - (dev = strrchr(fname, ':')) != NULL) { + if ((mode & S_IFMT) == S_IFCHR && + (dev = strrchr(info->pr_path, ':')) != NULL) { /* - * There's no elegant way to determine if a - * character device supports TLI, so we lame - * out and just check a hardcoded list of - * known TLI devices. + * There's no elegant way to determine + * if a character device supports TLI, + * so we lame out and just check a + * hardcoded list of known TLI devices. */ int i; - const char *tlidevs[] = - { "tcp", "tcp6", "udp", "udp6", NULL }; + const char *tlidevs[] = { + "tcp", "tcp6", "udp", "udp6", NULL + }; dev++; /* skip past the `:' */ for (i = 0; tlidevs[i] != NULL; i++) { if (strcmp(dev, tlidevs[i]) == 0) { - dotli(Pr, fd); + dotli(Pr, info->pr_fd); break; } } } - (void) printf(" %s\n", fname); + } - offset = pr_lseek(Pr, fd, 0, SEEK_CUR); - if (offset != -1) { - (void) printf(" offset:%ld\n", offset); - } + if (info->pr_path[0] != '\0') + (void) printf(" %s\n", info->pr_path); + if (info->pr_offset != -1) { + (void) printf(" offset:%lld\n", + (long long)info->pr_offset); } } - (void) closedir(dirp); + return (0); +} + +static void +show_files(struct ps_prochandle *Pr) +{ + struct rlimit rlim; + + if (pr_getrlimit(Pr, RLIMIT_NOFILE, &rlim) == 0) { + ulong_t nfd = rlim.rlim_cur; + if (nfd == RLIM_INFINITY) + (void) printf( + " Current rlimit: unlimited file descriptors\n"); + else + (void) printf( + " Current rlimit: %lu file descriptors\n", nfd); + } + + (void) Pfdinfo_iter(Pr, show_file, Pr); } @@ -371,14 +356,17 @@ getflock(struct ps_prochandle *Pr, int fd, struct flock *flock_native) /* examine open file with fcntl() */ static void -dofcntl(struct ps_prochandle *Pr, int fd, int mandatory, int isdoor) +dofcntl(struct ps_prochandle *Pr, prfdinfo_t *info, int mandatory, int isdoor) { struct flock flock; int fileflags; int fdflags; + int fd; + + fd = info->pr_fd; - fileflags = pr_fcntl(Pr, fd, F_GETXFL, 0); - fdflags = pr_fcntl(Pr, fd, F_GETFD, 0); + fileflags = info->pr_fileflags; + fdflags = info->pr_fdflags; if (fileflags != -1 || fdflags != -1) { (void) printf(" "); @@ -386,10 +374,10 @@ dofcntl(struct ps_prochandle *Pr, int fd, int mandatory, int isdoor) show_fileflags(fileflags); if (fdflags != -1 && (fdflags & FD_CLOEXEC)) (void) printf(" FD_CLOEXEC"); - if (isdoor) + if (isdoor && (Pstate(Pr) != PS_DEAD)) show_door(Pr, fd); (void) fputc('\n', stdout); - } else if (isdoor) { + } else if (isdoor && (Pstate(Pr) != PS_DEAD)) { (void) printf(" "); show_door(Pr, fd); (void) fputc('\n', stdout); @@ -401,7 +389,7 @@ dofcntl(struct ps_prochandle *Pr, int fd, int mandatory, int isdoor) flock.l_len = 0; flock.l_sysid = 0; flock.l_pid = 0; - if (getflock(Pr, fd, &flock) != -1) { + if ((Pstate(Pr) != PS_DEAD) && (getflock(Pr, fd, &flock) != -1)) { if (flock.l_type != F_UNLCK && (flock.l_sysid || flock.l_pid)) { unsigned long sysid = flock.l_sysid; diff --git a/usr/src/cmd/raidctl/Makefile b/usr/src/cmd/raidctl/Makefile index 5096020a81..4f7f648912 100644 --- a/usr/src/cmd/raidctl/Makefile +++ b/usr/src/cmd/raidctl/Makefile @@ -30,6 +30,7 @@ include $(SRC)/cmd/Makefile.cmd LDLIBS += -lraidcfg CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/cmd/ramdiskadm/Makefile b/usr/src/cmd/ramdiskadm/Makefile index 7a9b7c3518..7dae74826e 100644 --- a/usr/src/cmd/ramdiskadm/Makefile +++ b/usr/src/cmd/ramdiskadm/Makefile @@ -23,8 +23,6 @@ # Copyright 2002-2003 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= ramdiskadm OBJS= main.o utils.o @@ -34,6 +32,7 @@ POFILES= $(OBJS:%.o=%.po) include ../Makefile.cmd LDLIBS += -ldevinfo +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/cmd/rcap/Makefile.com b/usr/src/cmd/rcap/Makefile.com index 69f9575d3f..fa5925f732 100644 --- a/usr/src/cmd/rcap/Makefile.com +++ b/usr/src/cmd/rcap/Makefile.com @@ -22,7 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" # # Definitions for targets shared by some subdirs, which have @@ -32,6 +31,10 @@ LDFLAGS += $(MAPFILE.NGB:%=-M%) +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + %.o: $(COMMON_DIR)/%.c $(COMPILE.c) $< %.po: $(COMMON_DIR)/%.c diff --git a/usr/src/cmd/rcm_daemon/Makefile.com b/usr/src/cmd/rcm_daemon/Makefile.com index d64a5cbb0b..570da30bb1 100644 --- a/usr/src/cmd/rcm_daemon/Makefile.com +++ b/usr/src/cmd/rcm_daemon/Makefile.com @@ -117,6 +117,11 @@ CPPFLAGS += -I.. CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT CFLAGS += $(CCVERBOSE) $(C_PICFLAGS) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-function + MAPFILES = ../common/mapfile-intf $(MAPFILE.NGB) rcm_daemon := LDFLAGS += $(MAPFILES:%=-M%) diff --git a/usr/src/cmd/rctladm/Makefile b/usr/src/cmd/rctladm/Makefile index 2592301166..79348db834 100644 --- a/usr/src/cmd/rctladm/Makefile +++ b/usr/src/cmd/rctladm/Makefile @@ -34,6 +34,8 @@ lint := LINTFLAGS = -mx include ../Makefile.cmd CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized POFILE = rctladm_msg.po XGETFLAGS = -a FILEMODE = 0555 diff --git a/usr/src/cmd/refer/Makefile b/usr/src/cmd/refer/Makefile index 0a838b040b..4adb63a15d 100644 --- a/usr/src/cmd/refer/Makefile +++ b/usr/src/cmd/refer/Makefile @@ -23,10 +23,6 @@ # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# -# Makefile for cmd/refer -# include ../Makefile.cmd @@ -49,6 +45,11 @@ OBJS = addbib.o deliv2.o glue1.o glue2.o glue3.o glue4.o \ POFILES= $(OBJS:%.o=%.po) POFILE= refer.po +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized + addbib.po := XGETFLAGS += -a -x addbib.xcl diff --git a/usr/src/cmd/regcmp/Makefile b/usr/src/cmd/regcmp/Makefile index ee7560da69..969a8b6d4b 100644 --- a/usr/src/cmd/regcmp/Makefile +++ b/usr/src/cmd/regcmp/Makefile @@ -22,13 +22,13 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= regcmp include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/rexd/Makefile b/usr/src/cmd/rexd/Makefile index 5817b4add5..986f823620 100644 --- a/usr/src/cmd/rexd/Makefile +++ b/usr/src/cmd/rexd/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" -# PROG= rpc.rexd on # where under @@ -35,6 +33,13 @@ MANIFEST= rex.xml include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-address +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-extra + ROOTMANIFESTDIR= $(ROOTSVCNETWORKRPC) SRCS= $(PROG:%=%.c) diff --git a/usr/src/cmd/rm/Makefile b/usr/src/cmd/rm/Makefile index f4e4e02ce1..02ef64bed8 100644 --- a/usr/src/cmd/rm/Makefile +++ b/usr/src/cmd/rm/Makefile @@ -19,8 +19,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -35,6 +33,7 @@ SRCS= $(RMOBJ1:%.o=%.c) $(SRC)/common/util/getresponse.c include ../Makefile.cmd CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses $(XPG4) := CFLAGS += -DXPG4 CPPFLAGS += -D_FILE_OFFSET_BITS=64 -I $(SRC)/common/util LINTFLAGS += -u diff --git a/usr/src/cmd/rmdir/Makefile b/usr/src/cmd/rmdir/Makefile index 78101eb911..4c935458bd 100644 --- a/usr/src/cmd/rmdir/Makefile +++ b/usr/src/cmd/rmdir/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -32,6 +30,7 @@ include ../Makefile.cmd LDLIBS += -lgen CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized XGETFLAGS += -a -x rmdir.xcl diff --git a/usr/src/cmd/rmformat/Makefile b/usr/src/cmd/rmformat/Makefile index 70739bcf3b..91634d31fa 100644 --- a/usr/src/cmd/rmformat/Makefile +++ b/usr/src/cmd/rmformat/Makefile @@ -23,8 +23,6 @@ # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= rmformat @@ -36,6 +34,8 @@ SRCS= $(OBJS:.o=.c) LDLIBS += -lsmedia -lvolmgt -ladm -lefi +CERRWARN += -_gcc=-Wno-uninitialized + LINTFLAGS += -u CPPFLAGS += -D_FILE_OFFSET_BITS=64 diff --git a/usr/src/cmd/rmmount/Makefile b/usr/src/cmd/rmmount/Makefile index a8affe358c..a859d240e7 100644 --- a/usr/src/cmd/rmmount/Makefile +++ b/usr/src/cmd/rmmount/Makefile @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG = rmmount LOCAL_OBJS = rmmount.o @@ -43,6 +41,12 @@ CPPFLAGS += -I$(ROOT)/usr/include/hal CPPFLAGS += -I$(SRC)/cmd/rmvolmgr C99MODE = $(C99_ENABLE) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/rmvolmgr/Makefile b/usr/src/cmd/rmvolmgr/Makefile index a4ffac4951..32833c1f55 100644 --- a/usr/src/cmd/rmvolmgr/Makefile +++ b/usr/src/cmd/rmvolmgr/Makefile @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG = rmvolmgr OBJS = rmm_common.o rmvolmgr.o vold.o @@ -44,6 +42,12 @@ CPPFLAGS += $(HAL_DBUS_CPPFLAGS) $(HAL_GLIB_CPPFLAGS) CPPFLAGS += -I$(ROOT)/usr/include/hal C99MODE = $(C99_ENABLE) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-function + ROOTCMDDIR = $(ROOTLIB) ROOTMANIFESTDIR = $(ROOTSVCSYSTEMFILESYSTEM) $(ROOTMANIFEST) := FILEMODE = 444 diff --git a/usr/src/cmd/rpcbind/Makefile b/usr/src/cmd/rpcbind/Makefile index 39e98a9435..1e77d8e12c 100644 --- a/usr/src/cmd/rpcbind/Makefile +++ b/usr/src/cmd/rpcbind/Makefile @@ -19,12 +19,9 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# cmd/rpcbind/Makefile PROG= rpcbind MANIFEST= bind.xml @@ -44,6 +41,11 @@ ROOTMANIFESTDIR= $(ROOTSVCNETWORKRPC) CPPFLAGS= -I. -DPORTMAP $(CPPFLAGS.master) CPPFLAGS += -D_REENTRANT +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label LDLIBS += -lsocket -lnsl -lwrap -lscf .KEEP_STATE: diff --git a/usr/src/cmd/rpcgen/Makefile b/usr/src/cmd/rpcgen/Makefile index b6165a59a8..0d0dd2f82c 100644 --- a/usr/src/cmd/rpcgen/Makefile +++ b/usr/src/cmd/rpcgen/Makefile @@ -29,13 +29,16 @@ PROG= rpcgen OBJS= rpc_clntout.o rpc_cout.o rpc_hout.o rpc_main.o rpc_parse.o \ - rpc_scan.o rpc_svcout.o rpc_tblout.o rpc_util.o rpc_sample.o + rpc_scan.o rpc_svcout.o rpc_tblout.o rpc_util.o rpc_sample.o SRCS= $(OBJS:%.o=%.c) include ../Makefile.cmd LDLIBS += -CFLAGS += -v +CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-char-subscripts .KEEP_STATE: diff --git a/usr/src/cmd/rpcinfo/Makefile b/usr/src/cmd/rpcinfo/Makefile index 6cac5b8322..57483c153a 100644 --- a/usr/src/cmd/rpcinfo/Makefile +++ b/usr/src/cmd/rpcinfo/Makefile @@ -20,11 +20,8 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989 by Sun Microsystems, Inc. # -# cmd/rpcinfo/Makefile PROG= rpcinfo @@ -34,6 +31,7 @@ include ../Makefile.cmd CPPFLAGS= -DPORTMAP $(CPPFLAGS.master) LDLIBS += -lnsl +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/cmd/rpcsvc/Makefile b/usr/src/cmd/rpcsvc/Makefile index 3f56f1cb24..fb78120a07 100644 --- a/usr/src/cmd/rpcsvc/Makefile +++ b/usr/src/cmd/rpcsvc/Makefile @@ -59,8 +59,13 @@ include ../Makefile.cmd ROOTMANIFESTDIR= $(ROOTSVCNETWORKRPC) CPPFLAGS= -I. $(CPPFLAGS.master) +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-extra +CERRWARN += -_gcc=-Wno-unused-function LDLIBS += -lnsl -rusers := CFLAGS += -v +rusers := CFLAGS += $(CCVERBOSE) $(BINPROG) := LDLIBS += -lrpcsvc $(RPROG) := LDLIBS += -lrpcsvc $(SPROG) := LDLIBS += -lrpcsvc diff --git a/usr/src/cmd/rpcsvc/rpc.bootparamd/Makefile b/usr/src/cmd/rpcsvc/rpc.bootparamd/Makefile index 28abf8b2ce..b9e0cb036b 100644 --- a/usr/src/cmd/rpcsvc/rpc.bootparamd/Makefile +++ b/usr/src/cmd/rpcsvc/rpc.bootparamd/Makefile @@ -23,9 +23,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# -# cmd/rpcsvc/rpc.bootparamd/Makefile PROG= rpc.bootparamd MANIFEST= bootparams.xml @@ -36,6 +33,7 @@ OBJS= bootparam_ip_route.o bootparam_prot_svc.o \ include ../Makefile.rpc CPPFLAGS= -I. $(CPPFLAGS.master) +CERRWARN += -_gcc=-Wno-parentheses CFLAGS += -DSYSV LDLIBS += -lsocket -lnsl diff --git a/usr/src/cmd/sa/Makefile b/usr/src/cmd/sa/Makefile index 39aea59f50..26434ff36c 100644 --- a/usr/src/cmd/sa/Makefile +++ b/usr/src/cmd/sa/Makefile @@ -32,6 +32,9 @@ include ../Makefile.cmd ROOTMANIFESTDIR = $(ROOTSVCSYSTEM) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + GREP= grep SADC= sadc diff --git a/usr/src/cmd/saf/Makefile b/usr/src/cmd/saf/Makefile index a61b2c8b91..438a9d17b4 100644 --- a/usr/src/cmd/saf/Makefile +++ b/usr/src/cmd/saf/Makefile @@ -56,6 +56,11 @@ LDLIBS += -lnsl LDFLAGS += $(MAPFILE.NGB:%=-M%) LINTFLAGS += -b -x +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-extra + util1.o := CPPFLAGS += -DSAC util2.o := CPPFLAGS += -USAC diff --git a/usr/src/cmd/sasinfo/Makefile b/usr/src/cmd/sasinfo/Makefile index 2f35783729..919b3bcc78 100644 --- a/usr/src/cmd/sasinfo/Makefile +++ b/usr/src/cmd/sasinfo/Makefile @@ -45,6 +45,8 @@ POFILES = $(LOCAL_OBJS:%.o=%.po) LDLIBS += -lSMHBAAPI +CERRWARN += -_gcc=-Wno-unused-value + INCS += -I. INCS += -I$(SRC)/lib/smhba/common INCS += -I$(SRC)/lib/hbaapi/common diff --git a/usr/src/cmd/savecore/Makefile.com b/usr/src/cmd/savecore/Makefile.com index 591f33395b..2a9e06a0d7 100644 --- a/usr/src/cmd/savecore/Makefile.com +++ b/usr/src/cmd/savecore/Makefile.com @@ -32,6 +32,7 @@ C99MODE = $(C99_ENABLE) CFLAGS += $(CCVERBOSE) CFLAGS64 += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized CPPFLAGS += -D_LARGEFILE64_SOURCE=1 -DBZ_NO_STDIO -I$(SRC)/uts/common # diff --git a/usr/src/cmd/scadm/Makefile.com b/usr/src/cmd/scadm/Makefile.com index 16ec946480..f85d0d8363 100644 --- a/usr/src/cmd/scadm/Makefile.com +++ b/usr/src/cmd/scadm/Makefile.com @@ -79,6 +79,9 @@ IFLAGS = -I$(SRCDIR) -I$(USR_PSM_INCL_DIR) \ CPPFLAGS = $(IFLAGS) $(CPPFLAGS.master) -D_SYSCALL32 +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-variable + LINKED_DIRS = $(PLATLINKS:%=$(USR_PLAT_DIR)/%) LINKED_SBIN_DIRS = $(PLATLINKS:%=$(USR_PLAT_DIR)/%/sbin) diff --git a/usr/src/cmd/script/Makefile b/usr/src/cmd/script/Makefile index f35f1f2c65..dc777f0841 100644 --- a/usr/src/cmd/script/Makefile +++ b/usr/src/cmd/script/Makefile @@ -28,6 +28,8 @@ include ../Makefile.cmd FILEMODE= 0555 +CERRWARN += -_gcc=-Wno-unused-variable + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/scsi/sestopo/Makefile.com b/usr/src/cmd/scsi/sestopo/Makefile.com index 8fdbbb6ab5..b3ba07a197 100644 --- a/usr/src/cmd/scsi/sestopo/Makefile.com +++ b/usr/src/cmd/scsi/sestopo/Makefile.com @@ -23,7 +23,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" .KEEP_STATE: .SUFFIXES: @@ -40,6 +39,7 @@ ROOTPROG = $(ROOTLIBSCSI)/$(PROG) $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG CPPFLAGS += -I. -I../common CFLAGS += $(CTF_FLAGS) $(CCVERBOSE) $(XSTRCONST) +CERRWARN += -_gcc=-Wno-unused-variable LDLIBS += -L$(ROOT)/usr/lib/scsi -lses -lnvpair LDFLAGS += -R/usr/lib/scsi diff --git a/usr/src/cmd/scsi/smp/Makefile.com b/usr/src/cmd/scsi/smp/Makefile.com index f22f111c9e..919bf46201 100644 --- a/usr/src/cmd/scsi/smp/Makefile.com +++ b/usr/src/cmd/scsi/smp/Makefile.com @@ -41,6 +41,8 @@ CFLAGS += $(CTF_FLAGS) $(CCVERBOSE) $(XSTRCONST) LDLIBS += -L$(ROOT)/usr/lib/scsi -lsmp LDFLAGS += -R/usr/lib/scsi +CERRWARN += -_gcc=-Wno-unused-variable + all: $(PROG) $(PROG): $(OBJS) diff --git a/usr/src/cmd/sdiff/Makefile b/usr/src/cmd/sdiff/Makefile index 37481aa580..e2a02338db 100644 --- a/usr/src/cmd/sdiff/Makefile +++ b/usr/src/cmd/sdiff/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989 by Sun Microsystems, Inc. # @@ -29,6 +27,8 @@ PROG= sdiff include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/sendmail/Makefile.cmd b/usr/src/cmd/sendmail/Makefile.cmd index d633dca0bb..c06ca1f5c2 100644 --- a/usr/src/cmd/sendmail/Makefile.cmd +++ b/usr/src/cmd/sendmail/Makefile.cmd @@ -26,4 +26,10 @@ CPPFLAGS.sm= $(CPPFLAGS.master) -DSOLARIS=2$(RELEASE_MINOR)00 \ -D_FILE_OFFSET_BITS=64 +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-empty-body +CERRWARN += -_gcc=-Wno-unused-variable DBMDEF= -DNDBM -DNEWDB -DNIS -DUSERDB -DMAP_REGEX -DLDAPMAP diff --git a/usr/src/cmd/sendmail/libmilter/Makefile.com b/usr/src/cmd/sendmail/libmilter/Makefile.com index 88729a2e40..d59a896251 100644 --- a/usr/src/cmd/sendmail/libmilter/Makefile.com +++ b/usr/src/cmd/sendmail/libmilter/Makefile.com @@ -23,8 +23,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libmilter.a VERS= .1 @@ -50,6 +48,8 @@ ENVDEF= -DMILTER -DNETINET6 -DNOT_SENDMAIL -D_REENTRANT \ -Dsm_snprintf=snprintf CPPFLAGS= $(INCPATH) $(ENVDEF) $(CPPFLAGS.sm) +CERRWARN += -_gcc=-Wno-type-limits + LIBS= $(DYNLIB) $(LINTLIB) LDLIBS += -lc -lsocket -lnsl $(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC) diff --git a/usr/src/cmd/setfacl/Makefile b/usr/src/cmd/setfacl/Makefile index 2cf8ec236e..9519ffca23 100644 --- a/usr/src/cmd/setfacl/Makefile +++ b/usr/src/cmd/setfacl/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -# ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1993 by Sun Microsystems, Inc. # @@ -29,6 +27,10 @@ PROG= setfacl include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-uninitialized + LDLIBS += -lsec .KEEP_STATE: diff --git a/usr/src/cmd/setuname/Makefile.com b/usr/src/cmd/setuname/Makefile.com index 463fb49651..f5252a3fb7 100644 --- a/usr/src/cmd/setuname/Makefile.com +++ b/usr/src/cmd/setuname/Makefile.com @@ -23,8 +23,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= setuname OBJS= $(PROG).o @@ -34,6 +32,8 @@ include ../../Makefile.cmd CFLAGS += $(CCVERBOSE) CFLAGS64 += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses LDLIBS += -lkvm CLEANFILES += $(OBJS) diff --git a/usr/src/cmd/sf880drd/Makefile b/usr/src/cmd/sf880drd/Makefile index d3604de8b1..a37fdd6da5 100644 --- a/usr/src/cmd/sf880drd/Makefile +++ b/usr/src/cmd/sf880drd/Makefile @@ -39,6 +39,11 @@ ROOTMANIFESTDIR = $(ROOTSVCPLATFORMSUN4U) CPPFLAGS += -I$(ROOT)/usr/platform/sun4u/include LDLIBS += -lcfgadm +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized + PSMPROG = $(USR_PSM_LIB_DIR)/$(PROG) $(PSMPROG) := FILEMODE = 0755 diff --git a/usr/src/cmd/sgs/Makefile.com b/usr/src/cmd/sgs/Makefile.com index 11f2bde809..38f138d24b 100644 --- a/usr/src/cmd/sgs/Makefile.com +++ b/usr/src/cmd/sgs/Makefile.com @@ -50,6 +50,10 @@ C99_DISABLE = $(C99_ENABLE) CFLAGS += $(CCVERBOSE) $(DEBUG) $(XFFLAG) CFLAGS64 += $(CCVERBOSE) $(DEBUG) $(XFFLAG) +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-value + # # Location of the shared elfcap code # diff --git a/usr/src/cmd/sgs/ar/Makefile.com b/usr/src/cmd/sgs/ar/Makefile.com index 2670d05404..4d00f744a4 100644 --- a/usr/src/cmd/sgs/ar/Makefile.com +++ b/usr/src/cmd/sgs/ar/Makefile.com @@ -41,6 +41,7 @@ CPPFLAGS= -I. -I../../include $(CPPFLAGS.master) -I$(ELFCAP) CFLAGS += $(CCVERBOSE) C99MODE= $(C99_ENABLE) +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += -lelf $(CONVLIBDIR) $(CONV_LIB) -lsendfile LINTFLAGS= -x LINTFLAGS64= -x diff --git a/usr/src/cmd/sgs/dump/Makefile.com b/usr/src/cmd/sgs/dump/Makefile.com index 39891ab6e4..1d90361f73 100644 --- a/usr/src/cmd/sgs/dump/Makefile.com +++ b/usr/src/cmd/sgs/dump/Makefile.com @@ -23,8 +23,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= dump @@ -43,6 +41,8 @@ LLDFLAGS = '$(LDPASS)-R$$ORIGIN/../../lib' LLDFLAGS64 = '$(LDPASS)-R$$ORIGIN/../../../lib/$(MACH64)' LDFLAGS += $(LLDFLAGS) +CERRWARN += -_gcc=-Wno-uninitialized + LDLIBS += $(CONVLIBDIR) $(CONV_LIB) $(ELFLIBDIR) -lelf LINTFLAGS += -x LINTSRCS = $(SRCS) diff --git a/usr/src/cmd/sgs/elfdump/Makefile.com b/usr/src/cmd/sgs/elfdump/Makefile.com index 3f43a0c776..6f3fdeedac 100644 --- a/usr/src/cmd/sgs/elfdump/Makefile.com +++ b/usr/src/cmd/sgs/elfdump/Makefile.com @@ -58,6 +58,9 @@ LDLIBS += $(ELFLIBDIR) -lelf $(LDDBGLIBDIR) $(LDDBG_LIB) \ LINTFLAGS += -x LINTFLAGS64 += -x +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch + BLTDEFS = msg.h BLTDATA = msg.c BLTMESG = $(SGSMSGDIR)/elfdump diff --git a/usr/src/cmd/sgs/elfdump/common/_elfdump.h b/usr/src/cmd/sgs/elfdump/common/_elfdump.h index b2ce8c8e3e..401b29c2d3 100644 --- a/usr/src/cmd/sgs/elfdump/common/_elfdump.h +++ b/usr/src/cmd/sgs/elfdump/common/_elfdump.h @@ -224,7 +224,7 @@ typedef enum { extern corenote_ret_t corenote(Half, int, Word, const char *, Word); extern void dump_eh_frame(uchar_t *, size_t, uint64_t, Half e_machine, - uchar_t *e_ident); + uchar_t *e_ident, uint64_t gotaddr); extern void dump_hex_bytes(const void *, size_t, int, int, int); extern int fake_shdr_cache32(const char *, int, Elf *, Elf32_Ehdr *, diff --git a/usr/src/cmd/sgs/elfdump/common/corenote.c b/usr/src/cmd/sgs/elfdump/common/corenote.c index deeaedb85f..81c293572b 100644 --- a/usr/src/cmd/sgs/elfdump/common/corenote.c +++ b/usr/src/cmd/sgs/elfdump/common/corenote.c @@ -23,7 +23,9 @@ * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright 2012 DEY Storage Systems, Inc. All rights reserved. + */ #include <stdlib.h> #include <stdio.h> @@ -1545,6 +1547,45 @@ dump_prpriv(note_state_t *state, const char *title) indent_exit(state); } +static void +dump_prfdinfo(note_state_t *state, const char *title) +{ + const sl_prfdinfo_layout_t *layout = state->ns_arch->prfdinfo; + char buf[1024]; + uint32_t fileflags, mode; + + indent_enter(state, title, &layout->pr_fd); + + PRINT_DEC(MSG_ORIG(MSG_CNOTE_T_PR_FD), pr_fd); + mode = extract_as_word(state, &layout->pr_mode); + + print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_MODE), + conv_cnote_filemode(mode, 0, buf, sizeof (buf))); + + PRINT_DEC_2UP(MSG_ORIG(MSG_CNOTE_T_PR_UID), pr_uid, + MSG_ORIG(MSG_CNOTE_T_PR_GID), pr_gid); + + PRINT_DEC_2UP(MSG_ORIG(MSG_CNOTE_T_PR_MAJOR), pr_major, + MSG_ORIG(MSG_CNOTE_T_PR_MINOR), pr_minor); + PRINT_DEC_2UP(MSG_ORIG(MSG_CNOTE_T_PR_RMAJOR), pr_rmajor, + MSG_ORIG(MSG_CNOTE_T_PR_RMINOR), pr_rminor); + + PRINT_DEC(MSG_ORIG(MSG_CNOTE_T_PR_INO), pr_ino); + + PRINT_DEC_2UP(MSG_ORIG(MSG_CNOTE_T_PR_SIZE), pr_size, + MSG_ORIG(MSG_CNOTE_T_PR_OFFSET), pr_offset); + + fileflags = extract_as_word(state, &layout->pr_fileflags); + + print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_FILEFLAGS), + conv_cnote_fileflags(fileflags, 0, buf, sizeof (buf))); + + PRINT_DEC(MSG_ORIG(MSG_CNOTE_T_PR_FDFLAGS), pr_fdflags); + + PRINT_STRBUF(MSG_ORIG(MSG_CNOTE_T_PR_PATH), pr_path); + + indent_exit(state); +} /* * Output information from priv_impl_info_t structure. @@ -1777,6 +1818,14 @@ corenote(Half mach, int do_swap, Word type, dbg_print(0, MSG_ORIG(MSG_NOTE_DESC)); dbg_print(0, MSG_ORIG(MSG_FMT_INDENT), safe_str(desc, descsz)); return (CORENOTE_R_OK); + + + case NT_FDINFO: + state.ns_vcol = 22; + state.ns_t2col = 41; + state.ns_v2col = 54; + dump_prfdinfo(&state, MSG_ORIG(MSG_CNOTE_DESC_PRFDINFO_T)); + return (CORENOTE_R_OK); } return (CORENOTE_R_BADTYPE); diff --git a/usr/src/cmd/sgs/elfdump/common/dwarf.c b/usr/src/cmd/sgs/elfdump/common/dwarf.c index ae95e09630..d6072f51f5 100644 --- a/usr/src/cmd/sgs/elfdump/common/dwarf.c +++ b/usr/src/cmd/sgs/elfdump/common/dwarf.c @@ -49,6 +49,7 @@ typedef struct { uint64_t ciecalign; /* CIE code align factor */ int64_t ciedalign; /* CIE data align factor */ uint64_t fdeinitloc; /* FDE initial location */ + uint64_t gotaddr; /* Address of the GOT */ } dump_cfi_state_t; @@ -301,8 +302,8 @@ dump_cfi(uchar_t *data, uint64_t off, uint64_t *ndx, uint_t len, case 0x01: /* v2: DW_CFA_set_loc, address */ cur_pc = dwarf_ehe_extract(&data[off], ndx, - state->cieRflag, state->e_ident, - state->sh_addr, off + *ndx); + state->cieRflag, state->e_ident, B_FALSE, + state->sh_addr, off + *ndx, state->gotaddr); dbg_print(0, MSG_ORIG(MSG_CFA_CFASET), PREFIX, EC_XWORD(cur_pc)); break; @@ -465,7 +466,7 @@ dump_cfi(uchar_t *data, uint64_t off, uint64_t *ndx, uint_t len, void dump_eh_frame(uchar_t *data, size_t datasize, uint64_t sh_addr, - Half e_machine, uchar_t *e_ident) + Half e_machine, uchar_t *e_ident, uint64_t gotaddr) { Conv_dwarf_ehe_buf_t dwarf_ehe_buf; dump_cfi_state_t cfi_state; @@ -479,6 +480,7 @@ dump_eh_frame(uchar_t *data, size_t datasize, uint64_t sh_addr, cfi_state.e_ident = e_ident; cfi_state.sh_addr = sh_addr; cfi_state.do_swap = _elf_sys_encoding() != e_ident[EI_DATA]; + cfi_state.gotaddr = gotaddr; off = 0; while (off < datasize) { @@ -568,8 +570,8 @@ dump_eh_frame(uchar_t *data, size_t datasize, uint64_t sh_addr, ndx += 1; persVal = dwarf_ehe_extract(&data[off], - &ndx, ciePflag, e_ident, - sh_addr, off + ndx); + &ndx, ciePflag, e_ident, B_FALSE, + sh_addr, off + ndx, gotaddr); dbg_print(0, MSG_ORIG(MSG_UNW_CIEAXPERS)); dbg_print(0, @@ -633,11 +635,11 @@ dump_eh_frame(uchar_t *data, size_t datasize, uint64_t sh_addr, fdelength, fdecieptr); cfi_state.fdeinitloc = dwarf_ehe_extract(&data[off], - &ndx, cfi_state.cieRflag, e_ident, - sh_addr, off + ndx); + &ndx, cfi_state.cieRflag, e_ident, B_FALSE, + sh_addr, off + ndx, gotaddr); fdeaddrrange = dwarf_ehe_extract(&data[off], &ndx, (cfi_state.cieRflag & ~DW_EH_PE_pcrel), - e_ident, sh_addr, off + ndx); + e_ident, B_FALSE, sh_addr, off + ndx, gotaddr); dbg_print(0, MSG_ORIG(MSG_UNW_FDEINITLOC), EC_XWORD(cfi_state.fdeinitloc), @@ -660,7 +662,8 @@ dump_eh_frame(uchar_t *data, size_t datasize, uint64_t sh_addr, lsda = dwarf_ehe_extract(&data[off], &lndx, cieLflag, e_ident, - sh_addr, off + lndx); + B_FALSE, sh_addr, off + lndx, + gotaddr); dbg_print(0, MSG_ORIG(MSG_UNW_FDEAXLSDA), EC_XWORD(lsda)); diff --git a/usr/src/cmd/sgs/elfdump/common/elfdump.c b/usr/src/cmd/sgs/elfdump/common/elfdump.c index 3eb27cf804..cfd19abc76 100644 --- a/usr/src/cmd/sgs/elfdump/common/elfdump.c +++ b/usr/src/cmd/sgs/elfdump/common/elfdump.c @@ -521,6 +521,7 @@ getphdr(Word phnum, Word *type_arr, Word type_cnt, const char *file, Elf *elf) * entry: * cache - Cache of all section headers * shndx - Index of .eh_frame or .eh_frame_hdr section to be displayed + * shnum - Total number of sections which exist * uphdr - NULL, or unwind program header associated with * the .eh_frame_hdr section. * ehdr - ELF header for file @@ -532,7 +533,7 @@ getphdr(Word phnum, Word *type_arr, Word type_cnt, const char *file, Elf *elf) * flags - Command line option flags */ static void -unwind_eh_frame(Cache *cache, Word shndx, Phdr *uphdr, Ehdr *ehdr, +unwind_eh_frame(Cache *cache, Word shndx, Word shnum, Phdr *uphdr, Ehdr *ehdr, gnu_eh_state_t *eh_state, uchar_t osabi, const char *file, uint_t flags) { #if defined(_ELF64) @@ -551,7 +552,16 @@ unwind_eh_frame(Cache *cache, Word shndx, Phdr *uphdr, Ehdr *ehdr, uint64_t ndx, frame_ptr, fde_cnt, tabndx; uint_t vers, frame_ptr_enc, fde_cnt_enc, table_enc; uint64_t initloc, initloc0; + uint64_t gotaddr = 0; + int cnt; + for (cnt = 1; cnt < shnum; cnt++) { + if (strncmp(cache[cnt].c_name, MSG_ORIG(MSG_ELF_GOT), + MSG_ELF_GOT_SIZE) == 0) { + gotaddr = cache[cnt].c_shdr->sh_addr; + break; + } + } /* * Is this a .eh_frame_hdr? @@ -578,7 +588,7 @@ unwind_eh_frame(Cache *cache, Word shndx, Phdr *uphdr, Ehdr *ehdr, dbg_print(0, MSG_ORIG(MSG_UNW_FRMVERS), vers); frame_ptr = dwarf_ehe_extract(data, &ndx, frame_ptr_enc, - ehdr->e_ident, shdr->sh_addr, ndx); + ehdr->e_ident, B_TRUE, shdr->sh_addr, ndx, gotaddr); if (eh_state->hdr_cnt == 1) { eh_state->hdr_ndx = shndx; eh_state->frame_ptr = frame_ptr; @@ -589,7 +599,7 @@ unwind_eh_frame(Cache *cache, Word shndx, Phdr *uphdr, Ehdr *ehdr, EC_XWORD(frame_ptr)); fde_cnt = dwarf_ehe_extract(data, &ndx, fde_cnt_enc, - ehdr->e_ident, shdr->sh_addr, ndx); + ehdr->e_ident, B_TRUE, shdr->sh_addr, ndx, gotaddr); dbg_print(0, MSG_ORIG(MSG_UNW_FDCNENC), conv_dwarf_ehe(fde_cnt_enc, &dwarf_ehe_buf), @@ -601,7 +611,7 @@ unwind_eh_frame(Cache *cache, Word shndx, Phdr *uphdr, Ehdr *ehdr, for (tabndx = 0; tabndx < fde_cnt; tabndx++) { initloc = dwarf_ehe_extract(data, &ndx, table_enc, - ehdr->e_ident, shdr->sh_addr, ndx); + ehdr->e_ident, B_TRUE, shdr->sh_addr, ndx, gotaddr); /*LINTED:E_VAR_USED_BEFORE_SET*/ if ((tabndx != 0) && (initloc0 > initloc)) (void) fprintf(stderr, @@ -610,8 +620,8 @@ unwind_eh_frame(Cache *cache, Word shndx, Phdr *uphdr, Ehdr *ehdr, dbg_print(0, MSG_ORIG(MSG_UNW_BINSRTABENT), EC_XWORD(initloc), EC_XWORD(dwarf_ehe_extract(data, &ndx, - table_enc, ehdr->e_ident, shdr->sh_addr, - ndx))); + table_enc, ehdr->e_ident, B_TRUE, shdr->sh_addr, + ndx, gotaddr))); initloc0 = initloc; } } else { /* Display the .eh_frame section */ @@ -628,7 +638,7 @@ unwind_eh_frame(Cache *cache, Word shndx, Phdr *uphdr, Ehdr *ehdr, conv_ehdr_type(osabi, ehdr->e_type, 0, &inv_buf)); } dump_eh_frame(data, datasize, shdr->sh_addr, - ehdr->e_machine, ehdr->e_ident); + ehdr->e_machine, ehdr->e_ident, gotaddr); } /* @@ -875,8 +885,8 @@ unwind(Cache *cache, Word shnum, Word phnum, Ehdr *ehdr, uchar_t osabi, unwind_exception_ranges(_cache, file, _elf_sys_encoding() != ehdr->e_ident[EI_DATA]); else - unwind_eh_frame(cache, cnt, uphdr, ehdr, &eh_state, - osabi, file, flags); + unwind_eh_frame(cache, cnt, shnum, uphdr, ehdr, + &eh_state, osabi, file, flags); } } diff --git a/usr/src/cmd/sgs/elfdump/common/elfdump.msg b/usr/src/cmd/sgs/elfdump/common/elfdump.msg index aada7e8e9f..62aeab5d73 100644 --- a/usr/src/cmd/sgs/elfdump/common/elfdump.msg +++ b/usr/src/cmd/sgs/elfdump/common/elfdump.msg @@ -21,6 +21,7 @@ # # Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright 2012 DEY Storage Systems, Inc. All rights reserved. # @ _START_ @@ -457,6 +458,7 @@ @ MSG_CNOTE_DESC_PSINFO_T "desc: (psinfo_t)" @ MSG_CNOTE_DESC_PSTATUS_T "desc: (pstatus_t)" @ MSG_CNOTE_DESC_STRUCT_UTSNAME "desc: (struct utsname)" +@ MSG_CNOTE_DESC_PRFDINFO_T "desc: (prfdinfo_t)" @ MSG_CNOTE_FMT_LINE "%*s%-*s%s" @@ -615,6 +617,17 @@ @ MSG_CNOTE_T_UTS_RELEASE "release:" @ MSG_CNOTE_T_UTS_SYSNAME "sysname:" @ MSG_CNOTE_T_UTS_VERSION "version:" +@ MSG_CNOTE_T_PR_FD "pr_fd:" +@ MSG_CNOTE_T_PR_MODE "pr_mode:" +@ MSG_CNOTE_T_PR_PATH "pr_path:" +@ MSG_CNOTE_T_PR_MAJOR "pr_major:" +@ MSG_CNOTE_T_PR_MINOR "pr_minor:" +@ MSG_CNOTE_T_PR_RMAJOR "pr_rmajor:" +@ MSG_CNOTE_T_PR_RMINOR "pr_rminor:" +@ MSG_CNOTE_T_PR_OFFSET "pr_offset:" +@ MSG_CNOTE_T_PR_INO "pr_ino:" +@ MSG_CNOTE_T_PR_FILEFLAGS "pr_fileflags:" +@ MSG_CNOTE_T_PR_FDFLAGS "pr_fdflags:" # Names of fake sections generated from program header data diff --git a/usr/src/cmd/sgs/elfdump/common/struct_layout.h b/usr/src/cmd/sgs/elfdump/common/struct_layout.h index 69934f9336..11dbcc4b83 100644 --- a/usr/src/cmd/sgs/elfdump/common/struct_layout.h +++ b/usr/src/cmd/sgs/elfdump/common/struct_layout.h @@ -24,6 +24,10 @@ * Use is subject to license terms. */ +/* + * Copyright 2012 DEY Storage Systems, Inc. All rights reserved. + */ + #ifndef _STRUCT_LAYOUT_H #define _STRUCT_LAYOUT_H @@ -88,7 +92,7 @@ typedef struct { } sl_field_t; /* - * This type is used to extract and manipuate data described by + * This type is used to extract and manipulate data described by * sl_field_t. We rely on the C guarantee that all the fields in * a union have offset 0. */ @@ -502,6 +506,27 @@ typedef struct { } sl_utsname_layout_t; /* + * Layout description of prdinfo_t, from <sys/procfs.h>. + */ +typedef struct { + sl_field_t sizeof_struct; + sl_field_t pr_fd; + sl_field_t pr_mode; + sl_field_t pr_uid; + sl_field_t pr_gid; + sl_field_t pr_major; + sl_field_t pr_minor; + sl_field_t pr_rmajor; + sl_field_t pr_rminor; + sl_field_t pr_ino; + sl_field_t pr_offset; + sl_field_t pr_size; + sl_field_t pr_fileflags; + sl_field_t pr_fdflags; + sl_field_t pr_path; +} sl_prfdinfo_layout_t; + +/* * This type collects all of the layout definitions for * a given architecture. */ @@ -525,6 +550,7 @@ typedef struct { const sl_sysset_layout_t *sysset; /* sysset_t */ const sl_timestruc_layout_t *timestruc; /* timestruc_t */ const sl_utsname_layout_t *utsname; /* struct utsname */ + const sl_prfdinfo_layout_t *prfdinfo; /* prdinfo_t */ } sl_arch_layout_t; diff --git a/usr/src/cmd/sgs/elfdump/common/struct_layout_amd64.c b/usr/src/cmd/sgs/elfdump/common/struct_layout_amd64.c index 9d945be569..e23de0589b 100644 --- a/usr/src/cmd/sgs/elfdump/common/struct_layout_amd64.c +++ b/usr/src/cmd/sgs/elfdump/common/struct_layout_amd64.c @@ -23,7 +23,9 @@ * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright 2012 DEY Storage Systems, Inc. All rights reserved. + */ #include <struct_layout.h> @@ -356,6 +358,23 @@ static const sl_utsname_layout_t utsname_layout = { }; +static const sl_prfdinfo_layout_t prfdinfo_layout = { + { 0, 1088, 0, 0 }, /* sizeof (prfdinfo_t) */ + { 0, 4, 0, 0 }, /* pr_fd */ + { 4, 4, 0, 0 }, /* pr_mode */ + { 8, 4, 0, 0 }, /* pr_uid */ + { 12, 4, 0, 0 }, /* pr_gid */ + { 16, 4, 0, 0 }, /* pr_major */ + { 20, 4, 0, 0 }, /* pr_minor */ + { 24, 4, 0, 0 }, /* pr_rmajor */ + { 28, 4, 0, 0 }, /* pr_rminor */ + { 32, 8, 0, 0 }, /* pr_ino */ + { 40, 8, 0, 0 }, /* pr_offset */ + { 48, 8, 0, 0 }, /* pr_size */ + { 56, 4, 0, 0 }, /* pr_filefags */ + { 60, 4, 0, 0 }, /* pr_fdflags */ + { 64, 1, 1024, 0 }, /* pr_path */ +}; static const sl_arch_layout_t layout_amd64 = { @@ -378,6 +397,7 @@ static const sl_arch_layout_t layout_amd64 = { &sysset_layout, ×truc_layout, &utsname_layout, + &prfdinfo_layout, }; diff --git a/usr/src/cmd/sgs/elfdump/common/struct_layout_i386.c b/usr/src/cmd/sgs/elfdump/common/struct_layout_i386.c index 0f38abd92b..1273eec8db 100644 --- a/usr/src/cmd/sgs/elfdump/common/struct_layout_i386.c +++ b/usr/src/cmd/sgs/elfdump/common/struct_layout_i386.c @@ -23,7 +23,9 @@ * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright 2012 DEY Storage Systems, Inc. All rights reserved. + */ #include <struct_layout.h> @@ -356,6 +358,23 @@ static const sl_utsname_layout_t utsname_layout = { }; +static const sl_prfdinfo_layout_t prfdinfo_layout = { + { 0, 1088, 0, 0 }, /* sizeof (prfdinfo_t) */ + { 0, 4, 0, 0 }, /* pr_fd */ + { 4, 4, 0, 0 }, /* pr_mode */ + { 8, 4, 0, 0 }, /* pr_uid */ + { 12, 4, 0, 0 }, /* pr_gid */ + { 16, 4, 0, 0 }, /* pr_major */ + { 20, 4, 0, 0 }, /* pr_minor */ + { 24, 4, 0, 0 }, /* pr_rmajor */ + { 28, 4, 0, 0 }, /* pr_rminor */ + { 32, 8, 0, 0 }, /* pr_ino */ + { 40, 8, 0, 0 }, /* pr_offset */ + { 48, 8, 0, 0 }, /* pr_size */ + { 56, 4, 0, 0 }, /* pr_filefags */ + { 60, 4, 0, 0 }, /* pr_fdflags */ + { 64, 1, 1024, 0 }, /* pr_path */ +}; static const sl_arch_layout_t layout_i386 = { @@ -378,6 +397,7 @@ static const sl_arch_layout_t layout_i386 = { &sysset_layout, ×truc_layout, &utsname_layout, + &prfdinfo_layout, }; diff --git a/usr/src/cmd/sgs/elfdump/common/struct_layout_sparc.c b/usr/src/cmd/sgs/elfdump/common/struct_layout_sparc.c index 5cdf63dae4..c1a05a3a63 100644 --- a/usr/src/cmd/sgs/elfdump/common/struct_layout_sparc.c +++ b/usr/src/cmd/sgs/elfdump/common/struct_layout_sparc.c @@ -23,8 +23,9 @@ * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - +/* + * Copyright 2012 DEY Storage Systems, Inc. All rights reserved. + */ #include <struct_layout.h> @@ -356,6 +357,23 @@ static const sl_utsname_layout_t utsname_layout = { }; +static const sl_prfdinfo_layout_t prfdinfo_layout = { + { 0, 1088, 0, 0 }, /* sizeof (prfdinfo_t) */ + { 0, 4, 0, 0 }, /* pr_fd */ + { 4, 4, 0, 0 }, /* pr_mode */ + { 8, 4, 0, 0 }, /* pr_uid */ + { 12, 4, 0, 0 }, /* pr_gid */ + { 16, 4, 0, 0 }, /* pr_major */ + { 20, 4, 0, 0 }, /* pr_minor */ + { 24, 4, 0, 0 }, /* pr_rmajor */ + { 28, 4, 0, 0 }, /* pr_rminor */ + { 32, 8, 0, 0 }, /* pr_ino */ + { 40, 8, 0, 0 }, /* pr_offset */ + { 48, 8, 0, 0 }, /* pr_size */ + { 56, 4, 0, 0 }, /* pr_filefags */ + { 60, 4, 0, 0 }, /* pr_fdflags */ + { 64, 1, 1024, 0 }, /* pr_path */ +}; static const sl_arch_layout_t layout_sparc = { @@ -378,6 +396,7 @@ static const sl_arch_layout_t layout_sparc = { &sysset_layout, ×truc_layout, &utsname_layout, + &prfdinfo_layout, }; diff --git a/usr/src/cmd/sgs/elfdump/common/struct_layout_sparcv9.c b/usr/src/cmd/sgs/elfdump/common/struct_layout_sparcv9.c index c74b45f62a..cf61ab9f81 100644 --- a/usr/src/cmd/sgs/elfdump/common/struct_layout_sparcv9.c +++ b/usr/src/cmd/sgs/elfdump/common/struct_layout_sparcv9.c @@ -23,7 +23,9 @@ * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright 2012 DEY Storage Systems, Inc. All rights reserved. + */ #include <struct_layout.h> @@ -356,6 +358,23 @@ static const sl_utsname_layout_t utsname_layout = { }; +static const sl_prfdinfo_layout_t prfdinfo_layout = { + { 0, 1088, 0, 0 }, /* sizeof (prfdinfo_t) */ + { 0, 4, 0, 0 }, /* pr_fd */ + { 4, 4, 0, 0 }, /* pr_mode */ + { 8, 4, 0, 0 }, /* pr_uid */ + { 12, 4, 0, 0 }, /* pr_gid */ + { 16, 4, 0, 0 }, /* pr_major */ + { 20, 4, 0, 0 }, /* pr_minor */ + { 24, 4, 0, 0 }, /* pr_rmajor */ + { 28, 4, 0, 0 }, /* pr_rminor */ + { 32, 8, 0, 0 }, /* pr_ino */ + { 40, 8, 0, 0 }, /* pr_offset */ + { 48, 8, 0, 0 }, /* pr_size */ + { 56, 4, 0, 0 }, /* pr_filefags */ + { 60, 4, 0, 0 }, /* pr_fdflags */ + { 64, 1, 1024, 0 }, /* pr_path */ +}; static const sl_arch_layout_t layout_sparcv9 = { @@ -378,6 +397,7 @@ static const sl_arch_layout_t layout_sparcv9 = { &sysset_layout, ×truc_layout, &utsname_layout, + &prfdinfo_layout, }; diff --git a/usr/src/cmd/sgs/elfedit/Makefile.com b/usr/src/cmd/sgs/elfedit/Makefile.com index 9e86980583..67059f62b0 100644 --- a/usr/src/cmd/sgs/elfedit/Makefile.com +++ b/usr/src/cmd/sgs/elfedit/Makefile.com @@ -53,6 +53,9 @@ LDLIBS += $(ELFLIBDIR) -lelf $(LDDBGLIBDIR) $(LDDBG_LIB) \ LINTFLAGS += -x LINTFLAGS64 += -x +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + BLTDEFS = msg.h BLTDATA = msg.c BLTMESG = $(SGSMSGDIR)/elfedit diff --git a/usr/src/cmd/sgs/elfedit/modules/Makefile.com b/usr/src/cmd/sgs/elfedit/modules/Makefile.com index 294016f554..226b8a4f13 100644 --- a/usr/src/cmd/sgs/elfedit/modules/Makefile.com +++ b/usr/src/cmd/sgs/elfedit/modules/Makefile.com @@ -96,6 +96,9 @@ LLDFLAGS64 = '-R$$ORIGIN/../../../../lib/$(MACH64)' LDFLAGS += $(CC_USE_PROTO) $(LLDFLAGS) DYNFLAGS += $(VERSREF) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + LINTFLAGS += -uaxs $(LDLIBS) LINTFLAGS64 += -uaxs $(LDLIBS64) diff --git a/usr/src/cmd/sgs/elfwrap/Makefile.com b/usr/src/cmd/sgs/elfwrap/Makefile.com index 3d0162766e..0236d7a437 100644 --- a/usr/src/cmd/sgs/elfwrap/Makefile.com +++ b/usr/src/cmd/sgs/elfwrap/Makefile.com @@ -57,6 +57,8 @@ LDLIBS += $(ELFLIBDIR) -lelf $(CONVLIBDIR) $(CONV_LIB) LINTFLAGS += -x LINTFLAGS64 += -x +CERRWARN += -_gcc=-Wno-uninitialized + BLTDEFS = msg.h BLTDATA = msg.c BLTMESG = $(SGSMSGDIR)/elfwrap diff --git a/usr/src/cmd/sgs/error/i386/Makefile b/usr/src/cmd/sgs/error/i386/Makefile index a76c0ceb52..c08963db2a 100644 --- a/usr/src/cmd/sgs/error/i386/Makefile +++ b/usr/src/cmd/sgs/error/i386/Makefile @@ -19,12 +19,9 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# cmd/sgs/error/i386/Makefile PROG= error @@ -41,6 +38,9 @@ CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master) CFLAGS += $(CCVERBOSE) C99MODE= $(C99_ENABLE) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + CLEANFILES += $(LINTOUT) %.o: ../common/%.c diff --git a/usr/src/cmd/sgs/error/sparc/Makefile b/usr/src/cmd/sgs/error/sparc/Makefile index daa0de73e0..5415983e4c 100644 --- a/usr/src/cmd/sgs/error/sparc/Makefile +++ b/usr/src/cmd/sgs/error/sparc/Makefile @@ -19,8 +19,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -39,6 +37,8 @@ INCLIST= -I../common DEFLIST= -DELF CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master) CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses C99MODE= $(C99_ENABLE) CLEANFILES += $(LINTOUT) diff --git a/usr/src/cmd/sgs/gprof/Makefile.com b/usr/src/cmd/sgs/gprof/Makefile.com index bb7f707877..71f1ac66c4 100644 --- a/usr/src/cmd/sgs/gprof/Makefile.com +++ b/usr/src/cmd/sgs/gprof/Makefile.com @@ -45,6 +45,7 @@ C99MODE= $(C99_ENABLE) LDLIBS += $(CONVLIBDIR) $(CONV_LIB) $(ELFLIBDIR) -lelf LINTSRCS = $(SRCS) LINTFLAGS += -x +CERRWARN += -_gcc=-Wno-uninitialized CLEANFILES += $(LINTOUTS) ROOTLIBBLURB= $(BLURBS:%=$(ROOTSHLIBCCS)/%) diff --git a/usr/src/cmd/sgs/include/conv.h b/usr/src/cmd/sgs/include/conv.h index 020cad4f53..611feb403e 100644 --- a/usr/src/cmd/sgs/include/conv.h +++ b/usr/src/cmd/sgs/include/conv.h @@ -24,6 +24,7 @@ * All Rights Reserved * * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 DEY Storage Systems, Inc. All rights reserved. */ #ifndef _CONV_H @@ -837,6 +838,10 @@ extern const char *conv_cnote_syscall(Word, Conv_fmt_flags_t, Conv_inv_buf_t *); extern const char *conv_cnote_sysset(uint32_t *, int, Conv_fmt_flags_t, Conv_cnote_sysset_buf_t *); +extern const char *conv_cnote_fileflags(uint32_t, Conv_fmt_flags_t, + char *, size_t); +extern const char *conv_cnote_filemode(uint32_t, Conv_fmt_flags_t, + char *, size_t); extern const char *conv_cnote_type(Word, Conv_fmt_flags_t, Conv_inv_buf_t *); extern const char *conv_def_tag(Symref, Conv_inv_buf_t *); diff --git a/usr/src/cmd/sgs/include/dwarf.h b/usr/src/cmd/sgs/include/dwarf.h index 31c295d17c..8bb8b75eec 100644 --- a/usr/src/cmd/sgs/include/dwarf.h +++ b/usr/src/cmd/sgs/include/dwarf.h @@ -232,6 +232,8 @@ extern "C" { #define DW_EH_PE_datarel 0x30 /* Value is reletive to the beginning */ /* of the eh_frame_hdr segment */ /* ( segment type PT_AMD64_UNWIND ) */ + /* when within that segment, or to */ + /* the GOT when without. */ #define DW_EH_PE_funcrel 0x40 #define DW_EH_PE_aligned 0x50 /* value is an aligned void* */ #define DW_EH_PE_indirect 0x80 /* bit to signal indirection after */ @@ -251,7 +253,8 @@ typedef enum _LANG { extern uint64_t uleb_extract(unsigned char *, uint64_t *); extern int64_t sleb_extract(unsigned char *, uint64_t *); extern uint64_t dwarf_ehe_extract(unsigned char *, uint64_t *, - uint_t, unsigned char *, uint64_t, uint64_t); + uint_t, unsigned char *, boolean_t, uint64_t, + uint64_t, uint64_t); #ifdef __cplusplus } diff --git a/usr/src/cmd/sgs/ld/Makefile.com b/usr/src/cmd/sgs/ld/Makefile.com index 74c0c16c72..1462a7af29 100644 --- a/usr/src/cmd/sgs/ld/Makefile.com +++ b/usr/src/cmd/sgs/ld/Makefile.com @@ -41,6 +41,9 @@ LDFLAGS += $(VERSREF) $(CC_USE_PROTO) $(MAPOPTS) $(VAR_LD_LLDFLAGS) LDLIBS += $(LDLIBDIR) $(LD_LIB) $(ELFLIBDIR) -lelf \ $(LDDBGLIBDIR) $(LDDBG_LIB) $(CONVLIBDIR) $(CONV_LIB) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses + LINTFLAGS += -x LINTFLAGS64 += -x $(VAR_LINTFLAGS64) diff --git a/usr/src/cmd/sgs/lex/Makefile.com b/usr/src/cmd/sgs/lex/Makefile.com index d39bdbd037..d33a882296 100644 --- a/usr/src/cmd/sgs/lex/Makefile.com +++ b/usr/src/cmd/sgs/lex/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= lex @@ -47,13 +45,16 @@ SRCDIR = ../common C99MODE= $(C99_ENABLE) +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # Override default source file derivation rule (in Makefile.lib) # from objects # MACHSRCS= $(MACHOBJS:%.o=../common/%.c) LIBSRCS = $(LIBOBJS:%.o=../common/%.c) SRCS= $(MACHSRCS) $(LIBSRCS) - LIBS = $(DYNLIB) $(LINTLIB) diff --git a/usr/src/cmd/sgs/libconv/Makefile.com b/usr/src/cmd/sgs/libconv/Makefile.com index 7c890ad68a..933176f928 100644 --- a/usr/src/cmd/sgs/libconv/Makefile.com +++ b/usr/src/cmd/sgs/libconv/Makefile.com @@ -87,6 +87,9 @@ CTFMERGE_LIB = : include $(SRC)/lib/Makefile.lib include $(SRC)/cmd/sgs/Makefile.com +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-switch + CTFCONVERT_O= README_REVISION=../../packages/common/readme_revision diff --git a/usr/src/cmd/sgs/libconv/common/bld_vernote.ksh b/usr/src/cmd/sgs/libconv/common/bld_vernote.ksh index d8f29a05d6..1ca0564379 100644 --- a/usr/src/cmd/sgs/libconv/common/bld_vernote.ksh +++ b/usr/src/cmd/sgs/libconv/common/bld_vernote.ksh @@ -19,8 +19,7 @@ # # CDDL HEADER END # -# -# ident "%Z%%M% %I% %E% SMI" + # # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. @@ -46,7 +45,7 @@ pad_notestring() build_sparcnote() { - notestring="Solaris Link Editors: $release-$revision\0" + notestring="Solaris Link Editors: $release-$revision (illumos)\0" # # The 'adjustment' is for the '\0' # @@ -69,14 +68,14 @@ cat > $notefile <<EOF .global link_ver_string link_ver_string: .type link_ver_string, #object - .ascii "${release}-${revision}\0" + .ascii "${release}-${revision} (illumos)\0" .size link_ver_string, .-link_ver_string EOF } build_i386note() { - notestring="Solaris Link Editors: $release-$revision" + notestring="Solaris Link Editors: $release-$revision (illumos)" # # The 'adjustment' is for the the fact that the x86/amd64 # assembler automatically append a '\0' at the end of a string. @@ -99,7 +98,7 @@ cat > $notefile <<EOF .globl link_ver_string link_ver_string: .type link_ver_string,@object - .string "${release}-${revision}\0" + .string "${release}-${revision} (illumos)\0" .size link_ver_string, .-link_ver_string EOF } diff --git a/usr/src/cmd/sgs/libconv/common/corenote.c b/usr/src/cmd/sgs/libconv/common/corenote.c index f30809c9cc..2fd96b3931 100644 --- a/usr/src/cmd/sgs/libconv/common/corenote.c +++ b/usr/src/cmd/sgs/libconv/common/corenote.c @@ -23,6 +23,9 @@ * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2012 DEY Storage Systems, Inc. All rights reserved. + */ /* * String conversion routines the system structs found in @@ -52,9 +55,9 @@ conv_cnote_type(Word type, Conv_fmt_flags_t fmt_flags, MSG_NT_UTSNAME, MSG_NT_LWPSTATUS, MSG_NT_LWPSINFO, MSG_NT_PRPRIV, MSG_NT_PRPRIVINFO, MSG_NT_CONTENT, - MSG_NT_ZONENAME + MSG_NT_ZONENAME, MSG_NT_FDINFO }; -#if NT_NUM != NT_ZONENAME +#if NT_NUM != NT_FDINFO #error "NT_NUM has grown. Update core note types[]" #endif static const conv_ds_msg_t ds_types = { @@ -2442,3 +2445,138 @@ conv_cnote_sysset(uint32_t *maskarr, int n_mask, #undef N_MASK } + +const char * +conv_cnote_fileflags(uint32_t fileflags, Conv_fmt_flags_t fmt_flags, + char *buf, size_t bufsize) +{ + CONV_EXPN_FIELD_ARG arg = { 0 }; + + Val_desc vda[] = { + { 0x0001, MSG_PR_O_WRONLY }, + { 0x0002, MSG_PR_O_RDONLY }, + { 0x200000, MSG_PR_O_SEARCH }, + { 0x400000, MSG_PR_O_EXEC }, + { 0x0004, MSG_PR_O_NDELAY }, + { 0x0008, MSG_PR_O_APPEND }, + { 0x0010, MSG_PR_O_SYNC }, + { 0x0040, MSG_PR_O_DSYNC }, + { 0x0080, MSG_PR_O_NONBLOCK }, + { 0x0100, MSG_PR_O_CREAT }, + { 0x0200, MSG_PR_O_TRUNC }, + { 0x0400, MSG_PR_O_EXCL }, + { 0x0800, MSG_PR_O_NOCTTY }, + { 0x4000, MSG_PR_O_XATTR }, + { 0x8000, MSG_PR_O_RSYNC }, + { 0x2000, MSG_PR_O_LARGEFILE }, + { 0x20000, MSG_PR_O_NOFOLLOW }, + { 0x40000, MSG_PR_O_NOLINKS }, + { 0, NULL }, + }; + + arg.oflags = arg.rflags = fileflags; + arg.buf = buf; + arg.bufsize = bufsize; + + switch (fileflags & (0x600003)) { + case 0: /* RDONLY */ + vda[0].v_msg = MSG_PR_O_RDONLY; + arg.oflags |= 1; + arg.rflags |= 1; + break; + case 1: /* WRONLY */ + case 2: /* RDWR */ + case 0x200000: /* SEARCH */ + case 0x400000: + /* In isolate, treat these as normal bits */ + break; + default: + /* More than one bit set in this group, emit numerically */ + arg.oflags &= ~(fileflags & 0x600003); + } + + if (fileflags == 0) + return (MSG_ORIG(MSG_GBL_ZERO)); + + (void) conv_expn_field(&arg, vda, fmt_flags); + return (buf); +} + +const char * +conv_cnote_filemode(uint32_t mode, Conv_fmt_flags_t fmt_flags, + char *buf, size_t bufsize) +{ + CONV_EXPN_FIELD_ARG arg = { 0 }; + Msg s; + + Val_desc vda[] = { + { 0x1000, MSG_S_IFIFO }, + { 0x800, MSG_S_ISUID }, + { 0x400, MSG_S_ISGID }, + { 0x200, MSG_S_ISVTX }, + { 0400, MSG_S_IRUSR }, + { 0200, MSG_S_IWUSR }, + { 0100, MSG_S_IXUSR }, + { 0040, MSG_S_IRGRP }, + { 0020, MSG_S_IWGRP }, + { 0010, MSG_S_IXGRP }, + { 0004, MSG_S_IROTH }, + { 0002, MSG_S_IWOTH }, + { 0001, MSG_S_IXOTH }, + { 0, NULL }, + }; + + arg.oflags = arg.rflags = mode & ~(0xf000); + arg.buf = buf; + arg.bufsize = bufsize; + + switch (mode & (0xf000)) { + case 0x1000: + s = MSG_S_IFIFO; + break; + case 0x2000: + s = MSG_S_IFCHR; + break; + case 0x4000: + s = MSG_S_IFDIR; + break; + case 0x5000: + s = MSG_S_IFNAM; + break; + case 0x6000: + s = MSG_S_IFBLK; + break; + case 0x8000: + s = MSG_S_IFREG; + break; + case 0xA000: + s = MSG_S_IFLNK; + break; + case 0xc000: + s = MSG_S_IFSOCK; + break; + case 0xd000: + s = MSG_S_IFDOOR; + break; + case 0xe000: + s = MSG_S_IFPORT; + break; + default: + s = NULL; + break; + } + + if (s) { + arg.oflags |= 0x1000; + arg.rflags |= 0x1000; + vda[0].v_msg = s; + } else { + arg.rflags = mode; + } + + if (mode == 0) + return (MSG_ORIG(MSG_GBL_ZERO)); + + (void) conv_expn_field(&arg, vda, fmt_flags); + return (buf); +} diff --git a/usr/src/cmd/sgs/libconv/common/corenote.msg b/usr/src/cmd/sgs/libconv/common/corenote.msg index 3774d5119a..e074c19301 100644 --- a/usr/src/cmd/sgs/libconv/common/corenote.msg +++ b/usr/src/cmd/sgs/libconv/common/corenote.msg @@ -23,6 +23,8 @@ # Copyright 2010 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # +# Copyright 2012 DEY Storage Systems, Inc. All rights reserved. +# @ MSG_NT_PRSTATUS "[ NT_PRSTATUS ]" @ MSG_NT_PRFPREG "[ NT_PRFPREG ]" @@ -43,6 +45,7 @@ @ MSG_NT_PRPRIVINFO "[ NT_PRPRIVINFO ]" @ MSG_NT_CONTENT "[ NT_CONTENT ]" @ MSG_NT_ZONENAME "[ NT_ZONENAME ]" +@ MSG_NT_FDINFO "[ NT_FDINFO ]" @ MSG_AUXV_AF_SUN_SETUGID "AF_SUN_SETUGID" @@ -1067,6 +1070,48 @@ @ MSG_SYS_UMOUNT2 "[ umount2 ]" # 255 @ MSG_SYS_UMOUNT2_ALT "umount2" +@ MSG_PR_O_RDONLY "O_RDONLY" +@ MSG_PR_O_WRONLY "O_WRONLY" +@ MSG_PR_O_RDWR "O_RDWR" +@ MSG_PR_O_SEARCH "O_SEARCH" +@ MSG_PR_O_EXEC "O_EXEC" +@ MSG_PR_O_NDELAY "O_NDELAY" +@ MSG_PR_O_NONBLOCK "O_NONBLOCK" +@ MSG_PR_O_APPEND "O_APPEND" +@ MSG_PR_O_SYNC "O_SYNC" +@ MSG_PR_O_DSYNC "O_DSYNC" +@ MSG_PR_O_RSYNC "O_RSYNC" +@ MSG_PR_O_CREAT "O_CREAT" +@ MSG_PR_O_TRUNC "O_TRUNC" +@ MSG_PR_O_EXCL "O_EXCL" +@ MSG_PR_O_NOCTTY "O_NOCTTY" +@ MSG_PR_O_LARGEFILE "O_LARGEFILE" +@ MSG_PR_O_XATTR "O_XATTR" +@ MSG_PR_O_NOFOLLOW "O_NOFOLLOW" +@ MSG_PR_O_NOLINKS "O_NOLINKS" + +@ MSG_S_IFIFO "S_IFIFO" +@ MSG_S_IFCHR "S_IFCHR" +@ MSG_S_IFDIR "S_IFDIR" +@ MSG_S_IFNAM "S_IFNAM" +@ MSG_S_IFBLK "S_IFBLK" +@ MSG_S_IFREG "S_IFREG" +@ MSG_S_IFLNK "S_IFLNK" +@ MSG_S_IFSOCK "S_IFSOCK" +@ MSG_S_IFDOOR "S_IFDOOR" +@ MSG_S_IFPORT "S_IFPORT" +@ MSG_S_ISUID "S_ISUID" +@ MSG_S_ISGID "S_ISGID" +@ MSG_S_ISVTX "S_ISVTX" +@ MSG_S_IRUSR "S_IRUSR" +@ MSG_S_IWUSR "S_IWUSR" +@ MSG_S_IXUSR "S_IXUSR" +@ MSG_S_IRGRP "S_IRGRP" +@ MSG_S_IWGRP "S_IWGRP" +@ MSG_S_IXGRP "S_IXGRP" +@ MSG_S_IROTH "S_IROTH" +@ MSG_S_IWOTH "S_IWOTH" +@ MSG_S_IXOTH "S_IXOTH" @ MSG_GBL_ZERO "0" diff --git a/usr/src/cmd/sgs/libelf/Makefile.com b/usr/src/cmd/sgs/libelf/Makefile.com index 8a2f67e945..28d4e5fff8 100644 --- a/usr/src/cmd/sgs/libelf/Makefile.com +++ b/usr/src/cmd/sgs/libelf/Makefile.com @@ -70,6 +70,9 @@ LDLIBS += $(CONVLIBDIR) $(CONV_LIB) -lc LINTFLAGS += -u -erroff=E_BAD_PTR_CAST_ALIGN LINTFLAGS64 += -u -erroff=E_CAST_INT_TO_SMALL_INT +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + BUILD.AR= $(RM) $@ ; \ $(AR) q $@ `$(LORDER) $(OBJECTS:%=$(DIR)/%)| $(TSORT)` $(POST_PROCESS_A) diff --git a/usr/src/cmd/sgs/libld/Makefile.com b/usr/src/cmd/sgs/libld/Makefile.com index 664a9a890e..0141955f16 100644 --- a/usr/src/cmd/sgs/libld/Makefile.com +++ b/usr/src/cmd/sgs/libld/Makefile.com @@ -41,7 +41,7 @@ COMOBJS64 = args64.o entry64.o exit64.o groups64.o \ ldentry64.o ldlibs64.o ldmachdep64.o ldmain64.o \ libs64.o files64.o map64.o map_core64.o \ map_support64.o map_v264.o order64.o outfile64.o \ - place64.o relocate64.o resolve64.o sections64.o \ + place64.o relocate64.o resolve64.o sections64.o \ sunwmove64.o support64.o syms64.o update64.o \ unwind64.o version64.o wrap64.o @@ -87,6 +87,12 @@ include $(SRC)/cmd/sgs/Makefile.com SRCDIR = ../common +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-type-limits # Location of the shared relocation engines maintained under usr/src/uts. # diff --git a/usr/src/cmd/sgs/libld/common/files.c b/usr/src/cmd/sgs/libld/common/files.c index 7f85d3abad..c1e66ecfea 100644 --- a/usr/src/cmd/sgs/libld/common/files.c +++ b/usr/src/cmd/sgs/libld/common/files.c @@ -1429,6 +1429,7 @@ is_name_cmp(const char *is_name, const char *match_name, size_t match_len) * are updated as necessary to reflect the changes. Returns TRUE * for success, FALSE for failure. */ +/*ARGSUSED*/ inline static Boolean process_progbits_alloc(const char *name, Ifl_desc *ifl, Shdr *shdr, Word ndx, int *ident, Ofl_desc *ofl, Boolean is_stab_index, @@ -1437,8 +1438,6 @@ process_progbits_alloc(const char *name, Ifl_desc *ifl, Shdr *shdr, Boolean done = FALSE; if (name[0] == '.') { - Conv_inv_buf_t inv_buf1, inv_buf2; - switch (name[1]) { case 'e': if (!is_name_cmp(name, MSG_ORIG(MSG_SCN_EHFRAME), diff --git a/usr/src/cmd/sgs/libld/common/unwind.c b/usr/src/cmd/sgs/libld/common/unwind.c index 20d7051a4f..1e10b4664d 100644 --- a/usr/src/cmd/sgs/libld/common/unwind.c +++ b/usr/src/cmd/sgs/libld/common/unwind.c @@ -639,8 +639,8 @@ ld_unwind_populate_hdr(Ofl_desc *ofl) (void) dwarf_ehe_extract( &data[off + ndx], &ndx, ciePflag, - ofl->ofl_dehdr->e_ident, - shdr->sh_addr, off + ndx); + ofl->ofl_dehdr->e_ident, B_FALSE, + shdr->sh_addr, off + ndx, 0); break; case 'R': /* code encoding */ @@ -658,10 +658,17 @@ ld_unwind_populate_hdr(Ofl_desc *ofl) uint_t bintabndx; uint64_t initloc; uint64_t fdeaddr; + uint64_t gotaddr = 0; + + if (ofl->ofl_osgot != NULL) + gotaddr = + ofl->ofl_osgot->os_shdr->sh_addr; initloc = dwarf_ehe_extract(&data[off], &ndx, cieRflag, ofl->ofl_dehdr->e_ident, - shdr->sh_addr, off + ndx); + B_FALSE, + shdr->sh_addr, off + ndx, + gotaddr); /* * Ignore FDEs with initloc set to 0. diff --git a/usr/src/cmd/sgs/liblddbg/Makefile.com b/usr/src/cmd/sgs/liblddbg/Makefile.com index c6a00e5710..d1dc9dd27c 100644 --- a/usr/src/cmd/sgs/liblddbg/Makefile.com +++ b/usr/src/cmd/sgs/liblddbg/Makefile.com @@ -31,7 +31,7 @@ COMOBJS = args.o audit.o basic.o debug.o \ COMOBJS32 = bindings32.o cap32.o dlfcns32.o dynamic32.o \ elf32.o entry32.o files32.o got32.o \ - libs32.o map32.o move32.o phdr32.o \ + libs32.o map32.o move32.o phdr32.o \ relocate32.o sections32.o segments32.o shdr32.o \ statistics32.o support32.o syms32.o unused32.o \ util32.o version32.o @@ -58,6 +58,10 @@ SRCDIR = ../common LINTFLAGS += -u -D_REENTRANT LINTFLAGS64 += -u -D_REENTRANT +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + CPPFLAGS += -I$(SRCBASE)/lib/libc/inc DYNFLAGS += $(VERSREF) $(CC_USE_PROTO) '-R$$ORIGIN' LDLIBS += $(CONVLIBDIR) $(CONV_LIB) -lc diff --git a/usr/src/cmd/sgs/librtld/Makefile.com b/usr/src/cmd/sgs/librtld/Makefile.com index 59610b7263..f196ac328a 100644 --- a/usr/src/cmd/sgs/librtld/Makefile.com +++ b/usr/src/cmd/sgs/librtld/Makefile.com @@ -45,6 +45,11 @@ CPPFLAGS += -I../../rtld/common -I$(SRCBASE)/lib/libc/inc \ DYNFLAGS += $(VERSREF) $(CC_USE_PROTO) '-R$$ORIGIN' LDLIBS += $(CONVLIBDIR) $(CONV_LIB) $(ELFLIBDIR) -lelf -lc +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized + LINTFLAGS += -u -erroff=E_NAME_DECL_NOT_USED_DEF2 LINTFLAGS64 += -u -erroff=E_NAME_DECL_NOT_USED_DEF2 diff --git a/usr/src/cmd/sgs/librtld_db/Makefile.com b/usr/src/cmd/sgs/librtld_db/Makefile.com index ddddc5d73e..955f3e21d8 100644 --- a/usr/src/cmd/sgs/librtld_db/Makefile.com +++ b/usr/src/cmd/sgs/librtld_db/Makefile.com @@ -42,6 +42,8 @@ LDLIBS += $(CONVLIBDIR) $(CONV_LIB) -lc LINTFLAGS += -u -erroff=E_NAME_DECL_NOT_USED_DEF2 LINTFLAGS64 += -u -erroff=E_NAME_DECL_NOT_USED_DEF2 +CERRWARN += -_gcc=-Wno-uninitialized + BLTDEFS= msg.h BLTDATA= msg.c diff --git a/usr/src/cmd/sgs/m4/i386/Makefile b/usr/src/cmd/sgs/m4/i386/Makefile index eb9d756285..0a13a85c48 100644 --- a/usr/src/cmd/sgs/m4/i386/Makefile +++ b/usr/src/cmd/sgs/m4/i386/Makefile @@ -22,10 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# -# cmd/sgs/m4/i386/Makefile -# PROG= m4 XPG4PROG= m4 @@ -56,6 +52,10 @@ CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master) CFLAGS += $(CCVERBOSE) C99MODE= $(C99_ENABLE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + LINTFLAGS += $(LDLIBS) CLEANFILES += $(LINTOUT) $(BLTSRCS) diff --git a/usr/src/cmd/sgs/m4/sparc/Makefile b/usr/src/cmd/sgs/m4/sparc/Makefile index 99a71f05ca..ecda17a550 100644 --- a/usr/src/cmd/sgs/m4/sparc/Makefile +++ b/usr/src/cmd/sgs/m4/sparc/Makefile @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# # cmd/sgs/m4/sparc/Makefile # @@ -54,6 +52,9 @@ INCLIST= -I../common DEFLIST= -DELF CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master) CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized C99MODE= $(C99_ENABLE) LINTFLAGS += $(LDLIBS) diff --git a/usr/src/cmd/sgs/mcs/Makefile.com b/usr/src/cmd/sgs/mcs/Makefile.com index 322a9feb37..137286fc6c 100644 --- a/usr/src/cmd/sgs/mcs/Makefile.com +++ b/usr/src/cmd/sgs/mcs/Makefile.com @@ -49,6 +49,8 @@ LDLIBS += $(CONVLIBDIR) $(CONV_LIB) $(ELFLIBDIR) -lelf LINTFLAGS += -x LINTFLAGS64 += -x +CERRWARN += -_gcc=-Wno-uninitialized + SRCS = $(COMOBJS:%.o=../common/%.c) \ $(TOOLSOBJS:%.o=$(SGSTOOLS)/common/%.c) LINTSRCS = $(SRCS) ../common/lintsup.c diff --git a/usr/src/cmd/sgs/nm/amd64/Makefile b/usr/src/cmd/sgs/nm/amd64/Makefile index f2a8c30347..72bbbbb1d4 100644 --- a/usr/src/cmd/sgs/nm/amd64/Makefile +++ b/usr/src/cmd/sgs/nm/amd64/Makefile @@ -40,6 +40,9 @@ LDFLAGS += '-R$$ORIGIN/../../../lib/$(MACH64)' INCLIST= -I../../include -I../../include/i386 \ -I$(SRCBASE)/uts/$(ARCH)/sys CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master) -I$(ELFCAP) + +CERRWARN += -_gcc=-Wno-uninitialized + LDLIBS += $(CONVLIBDIR64) $(CONV_LIB) $(ELFLIBDIR) -lelf LINTFLAGS64 += -x $(LDLIBS) -m64 LINTSRCS= $(SRCS) diff --git a/usr/src/cmd/sgs/nm/i386/Makefile b/usr/src/cmd/sgs/nm/i386/Makefile index 6653481253..f351d68aca 100644 --- a/usr/src/cmd/sgs/nm/i386/Makefile +++ b/usr/src/cmd/sgs/nm/i386/Makefile @@ -44,6 +44,9 @@ INCLIST= -I../../include -I../../include/i386 \ -I$(SRCBASE)/uts/$(ARCH)/sys DEFLIST= -DTARGET=I386 -DI386=1 -D$(ARFORMAT) -DELF CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master) -I$(ELFCAP) + +CERRWARN += -_gcc=-Wno-uninitialized + LDLIBS += $(CONVLIBDIR) $(CONV_LIB) $(ELFLIBDIR) -lelf LINTFLAGS += -x $(LDLIBS) LINTSRCS= $(SRCS) diff --git a/usr/src/cmd/sgs/nm/sparc/Makefile b/usr/src/cmd/sgs/nm/sparc/Makefile index cd94ccfa0d..056fa29160 100644 --- a/usr/src/cmd/sgs/nm/sparc/Makefile +++ b/usr/src/cmd/sgs/nm/sparc/Makefile @@ -45,6 +45,7 @@ INCLIST= -I../../include -I../../include/sparc \ -I$(SRCBASE)/uts/$(ARCH)/sys DEFLIST= -DTARGET=SPARC -DSPARC=1 -D$(ARFORMAT) -DELF CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master) -I$(ELFCAP) +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += $(CONVLIBDIR) $(CONV_LIB) $(ELFLIBDIR) -lelf LINTFLAGS= -x $(LDLIBS) LINTSRCS= $(SRCS) diff --git a/usr/src/cmd/sgs/nm/sparcv9/Makefile b/usr/src/cmd/sgs/nm/sparcv9/Makefile index 51fbab7770..55fb1cd328 100644 --- a/usr/src/cmd/sgs/nm/sparcv9/Makefile +++ b/usr/src/cmd/sgs/nm/sparcv9/Makefile @@ -43,6 +43,7 @@ INCLIST= -I../../include -I../../include/sparc \ -I$(SRCBASE)/uts/$(ARCH)/sys DEFLIST= -DTARGET=SPARC -DSPARC=1 -D$(ARFORMAT) -DELF CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master) -I$(ELFCAP) +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += $(CONVLIBDIR64) $(CONV_LIB) $(ELFLIBDIR) -lelf LINTFLAGS64= -x $(LDLIBS) -m64 LINTSRCS= $(SRCS) diff --git a/usr/src/cmd/sgs/packages/common/SUNWonld-README b/usr/src/cmd/sgs/packages/common/SUNWonld-README index 67c224ca95..184212bfb8 100644 --- a/usr/src/cmd/sgs/packages/common/SUNWonld-README +++ b/usr/src/cmd/sgs/packages/common/SUNWonld-README @@ -1631,3 +1631,12 @@ Bugid Risk Synopsis ================================================================================ 308 ld may misalign sections only preceded by empty sections +1301 ld crashes with '-z ignore' due to a null data descriptor +1626 libld may accidentally return success while failing +2413 %ymm* need to be preserved on way through PLT +3210 ld should tolerate SHT_PROGBITS for .eh_frame sections on amd64 +3228 Want -zassert-deflib for ld +3230 ld.so.1 should check default paths for DT_DEPAUDIT +3260 linker is insufficiently careful with strtok +3261 linker should ignore unknown hardware capabilities +3265 link-editor builds bogus .eh_frame_hdr on ia32 diff --git a/usr/src/cmd/sgs/prof/Makefile.com b/usr/src/cmd/sgs/prof/Makefile.com index 32ed03f0c5..edaaa695f8 100644 --- a/usr/src/cmd/sgs/prof/Makefile.com +++ b/usr/src/cmd/sgs/prof/Makefile.com @@ -42,6 +42,7 @@ INCLIST= -I../common -I../../include -I../../include/$(MACH) CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master) -I$(ELFCAP) CFLAGS += $(CCVERBOSE) C99MODE= $(C99_ENABLE) +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += $(CONVLIBDIR) $(CONV_LIB) $(ELFLIBDIR) -lelf LINTSRCS = $(SRCS) LINTFLAGS += -x diff --git a/usr/src/cmd/sgs/rtld/Makefile.com b/usr/src/cmd/sgs/rtld/Makefile.com index f2c06076ae..037141b7a4 100644 --- a/usr/src/cmd/sgs/rtld/Makefile.com +++ b/usr/src/cmd/sgs/rtld/Makefile.com @@ -85,6 +85,10 @@ ASFLAGS= -P -D_ASM $(CPPFLAGS) LDLIB = -L ../../libld/$(MACH) RTLDLIB = -L ../../librtld/$(MACH) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-switch + # These definitions require that libc be built in the same workspace # as the run-time linker and before the run-time linker is built. # This is required for the system's self-consistency in any case. diff --git a/usr/src/cmd/sgs/rtld/common/cap.c b/usr/src/cmd/sgs/rtld/common/cap.c index 93302468c9..9aa82022be 100644 --- a/usr/src/cmd/sgs/rtld/common/cap.c +++ b/usr/src/cmd/sgs/rtld/common/cap.c @@ -858,8 +858,9 @@ cap_modify(Xword tag, const char *str) if ((caps = strdup(str)) == NULL) return (0); - ptr = strtok_r(caps, MSG_ORIG(MSG_CAP_DELIMIT), &next); - do { + for (ptr = strtok_r(caps, MSG_ORIG(MSG_CAP_DELIMIT), &next); + ptr != NULL; + ptr = strtok_r(NULL, MSG_ORIG(MSG_CAP_DELIMIT), &next)) { Xword val = 0; /* @@ -921,6 +922,8 @@ cap_modify(Xword tag, const char *str) * Invalid indexes are ignored. */ if (val == 0) { + char *end; + if ((*ptr == '[') && (*(ptr + 2) == ']')) { if (*(ptr + 1) == '1') { ndx = tag; @@ -941,14 +944,25 @@ cap_modify(Xword tag, const char *str) ndx = tag; errno = 0; - if (((val = strtol(ptr, NULL, 16)) == 0) && errno) + if (((val = strtol(ptr, &end, 16)) == 0) && errno) + continue; + + /* + * If the value wasn't an entirely valid hexadecimal + * integer, assume it was intended as a capability + * name and skip it. + */ + if (*end != '\0') { + eprintf(NULL, ERR_WARNING, + MSG_INTL(MSG_CAP_IGN_UNKCAP), ptr); continue; + } } + cap_settings[ndx - 1].cs_val[mode] |= val; cap_settings[ndx - 1].cs_set[mode]++; - } while ((ptr = strtok_r(NULL, - MSG_ORIG(MSG_CAP_DELIMIT), &next)) != NULL); + } /* * If the "override" token was supplied, set the alternative @@ -982,8 +996,9 @@ cap_files(const char *str) if ((caps = strdup(str)) == NULL) return (0); - name = strtok_r(caps, MSG_ORIG(MSG_CAP_DELIMIT), &next); - do { + for (name = strtok_r(caps, MSG_ORIG(MSG_CAP_DELIMIT), &next); + name != NULL; + name = strtok_r(NULL, MSG_ORIG(MSG_CAP_DELIMIT), &next)) { avl_index_t where; PathNode *pnp; uint_t hash = sgs_str_hash(name); @@ -999,8 +1014,7 @@ cap_files(const char *str) pnp->pn_hash = hash; avl_insert(capavl, pnp, where); } - } while ((name = strtok_r(NULL, - MSG_ORIG(MSG_CAP_DELIMIT), &next)) != NULL); + } return (1); } diff --git a/usr/src/cmd/sgs/rtld/common/rtld.msg b/usr/src/cmd/sgs/rtld/common/rtld.msg index 0d3811b003..0a3cb5d74a 100644 --- a/usr/src/cmd/sgs/rtld/common/rtld.msg +++ b/usr/src/cmd/sgs/rtld/common/rtld.msg @@ -300,6 +300,7 @@ @ MSG_STR_ONE "1" @ MSG_CAP_DELIMIT "," +@ MSG_CAP_IGN_UNKCAP "ignoring unknown capability: %s" @ MSG_SUNW_OST_SGS "SUNW_OST_SGS" @ MSG_SUNW_OST_OSLIB "SUNW_OST_OSLIB" diff --git a/usr/src/cmd/sgs/rtld/common/setup.c b/usr/src/cmd/sgs/rtld/common/setup.c index f1092a674f..c5d2a2671e 100644 --- a/usr/src/cmd/sgs/rtld/common/setup.c +++ b/usr/src/cmd/sgs/rtld/common/setup.c @@ -104,8 +104,10 @@ preload(const char *str, Rt_map *mlmp, Rt_map **clmp) lddstub = (lmflags & LML_FLG_TRC_ENABLE) && (FLAGS1(*clmp) & FL1_RT_LDDSTUB); - ptr = strtok_r(objs, MSG_ORIG(MSG_STR_DELIMIT), &next); - do { + + for (ptr = strtok_r(objs, MSG_ORIG(MSG_STR_DELIMIT), &next); + ptr != NULL; + ptr = strtok_r(NULL, MSG_ORIG(MSG_STR_DELIMIT), &next)) { Rt_map *nlmp = NULL; uint_t flags; @@ -179,8 +181,7 @@ preload(const char *str, Rt_map *mlmp, Rt_map **clmp) if (flags & FLG_RT_OBJINTPO) lml_main.lm_flags |= LML_FLG_INTRPOSE; - } while ((ptr = strtok_r(NULL, - MSG_ORIG(MSG_STR_DELIMIT), &next)) != NULL); + } free(palp); free(objs); diff --git a/usr/src/cmd/sgs/rtld/mdbmod/Makefile.com b/usr/src/cmd/sgs/rtld/mdbmod/Makefile.com index b2ab5da932..740a33d3d0 100644 --- a/usr/src/cmd/sgs/rtld/mdbmod/Makefile.com +++ b/usr/src/cmd/sgs/rtld/mdbmod/Makefile.com @@ -50,6 +50,8 @@ SGSMSGFLAGS += -h $(BLTDEFS) -d $(BLTDATA) LINTFLAGS += -u -erroff=E_NAME_DECL_NOT_USED_DEF2 LINTFLAGS64 += -u -erroff=E_NAME_DECL_NOT_USED_DEF2 +CERRWARN += -_gcc=-Wno-uninitialized + LINTSRCS= $(COMOBJS:%.o=../common/%.c) $(BLTDATA) FILEMODE= 555 diff --git a/usr/src/cmd/sgs/size/Makefile.com b/usr/src/cmd/sgs/size/Makefile.com index e28c593b0a..c84525db97 100644 --- a/usr/src/cmd/sgs/size/Makefile.com +++ b/usr/src/cmd/sgs/size/Makefile.com @@ -23,8 +23,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= size @@ -35,6 +33,8 @@ COMOBJS= main.o process.o fcns.o SRCS= $(COMOBJS:%.o=../common/%.c) +CERRWARN += -_gcc=-Wno-unused-variable + OBJS = $(COMOBJS) .PARALLEL: $(OBJS) diff --git a/usr/src/cmd/sgs/test/README b/usr/src/cmd/sgs/test/README new file mode 100644 index 0000000000..d63f91a0ce --- /dev/null +++ b/usr/src/cmd/sgs/test/README @@ -0,0 +1,19 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2012, Joyent, Inc. +# + +This directory contains various unit tests for parts of the sgs source tree. +There currently is no master runner for these tests, you should run them +individually. You will need to manually make test executable. Currently tests +expect to be given a path to the proto area. diff --git a/usr/src/cmd/sgs/test/ld/assert-deflib/link.c b/usr/src/cmd/sgs/test/ld/assert-deflib/link.c new file mode 100644 index 0000000000..823c7a3785 --- /dev/null +++ b/usr/src/cmd/sgs/test/ld/assert-deflib/link.c @@ -0,0 +1,23 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright (c) 2012, Joyent, Inc. + */ + +#include <stdio.h> + +int +main(void) +{ + (void) printf("Hello, world!\n"); + return (0); +} diff --git a/usr/src/cmd/sgs/test/ld/assert-deflib/test-deflib.sh b/usr/src/cmd/sgs/test/ld/assert-deflib/test-deflib.sh new file mode 100644 index 0000000000..cf07c35788 --- /dev/null +++ b/usr/src/cmd/sgs/test/ld/assert-deflib/test-deflib.sh @@ -0,0 +1,135 @@ +#!/bin/bash +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright (c) 2012, Joyent, Inc. +# + +# +# This test validates that the -zassert-deflib option of ld(1) works correctly. +# It requires that some cc is in your path and that you have passed in the path +# to the proto area with the new version of libld.so.4. One thing that we have +# to do is be careful with using LD_LIBRARY_PATH. Setting LD_LIBRARY_PATH does +# not change the default search path so we want to make sure that we use a +# different ISA (e.g. 32-bit vs 64-bit) from the binary we're generating. +# +unalias -a + +sh_path= +sh_lib="lib" +sh_lib64="$sh_lib/64" +sh_soname="libld.so.4" +sh_cc="cc" +sh_cflags="-m32" +sh_file="link.c" +sh_arg0=$(basename $0) + +function fatal +{ + local msg="$*" + [[ -z "$msg" ]] && msg="failed" + echo "$sh_arg0: $msg" >&2 + exit 1 +} + + +# +# Validate that everything we need is in our path. That includes having cc +# and the proto area libld. +# +function validate +{ + [[ -f $sh_path/$sh_lib/$sh_soname ]] || fatal "missing 32-bit $sh_soname" + [[ -f $sh_path/$sh_lib64/$sh_soname ]] || + fatal "missing 64-bit $sh_soname" + which $sh_cc >/dev/null || fatal "cc not in path" +} + +# +# $1 is a series of flags to append +# $2 is expected exit status +# $3 is pre-test message +# $4 is the failure message +# +function run +{ + local ret + + echo $3 + LD_LIBRARY_PATH_64="$sh_path/$sh_lib64" $sh_cc $sh_cflags $sh_file $1 + if [[ $? -eq $2 ]]; then + printf "success\n\n" + else + fatal $4 + fi +} + +sh_path=$1 +[[ -z "$1" ]] && fatal "<proto root>" +validate + +run "-Wl,-zassert-deflib" 0 \ + "Testing basic compilation succeeds with warnings..." \ + "failed to compile with warnings" + +run "-Wl,-zassert-deflib -Wl,-zfatal-warnings" 1 \ + "Testing basic compilation fails if warning are fatal..." \ + "linking succeeeded, expected failure" + +run "-Wl,-zassert-deflib=libc.so -Wl,-zfatal-warnings" 0 \ + "Testing basic exception with fatal warnings..." \ + "linking failed despite exception" + +run "-Wl,-zassert-deflib=libc.so -Wl,-zfatal-warnings" 0 \ + "Testing basic exception with fatal warnings..." \ + "linking failed despite exception" + + +run "-Wl,-zassert-deflib=lib.so -Wl,-zfatal-warnings" 1 \ + "Testing invalid library name..." \ + "ld should not allow invalid library name" + +run "-Wl,-zassert-deflib=libf -Wl,-zfatal-warnings" 1 \ + "Testing invalid library name..." \ + "ld should not allow invalid library name" + +run "-Wl,-zassert-deflib=libf.s -Wl,-zfatal-warnings" 1 \ + "Testing invalid library name..." \ + "ld should not allow invalid library name" + +run "-Wl,-zassert-deflib=libc.so -Wl,-zfatal-warnings -lelf" 1 \ + "Errors even if one library is under exception path..." \ + "one exception shouldn't stop another" + +args="-Wl,-zassert-deflib=libc.so -Wl,-zassert-deflib=libelf.so" +args="$args -Wl,-zfatal-warnings -lelf" + +run "$args" 0 \ + "Multiple exceptions work..." \ + "multiple exceptions don't work" + +args="-Wl,-zassert-deflib=libc.so -Wl,-zassert-deflib=libelfe.so" +args="$args -Wl,-zfatal-warnings -lelf" + +run "$args" 1 \ + "Exceptions only catch the specific library" \ + "exceptions caught the wrong library" + +args="-Wl,-zassert-deflib=libc.so -Wl,-zassert-deflib=libel.so" +args="$args -Wl,-zfatal-warnings -lelf" + +run "$args" 1 \ + "Exceptions only catch the specific library" \ + "exceptions caught the wrong library" + +echo "Tests passed." +exit 0 diff --git a/usr/src/cmd/sgs/tools/common/leb128.c b/usr/src/cmd/sgs/tools/common/leb128.c index 1183e6f854..42ed001e15 100644 --- a/usr/src/cmd/sgs/tools/common/leb128.c +++ b/usr/src/cmd/sgs/tools/common/leb128.c @@ -190,12 +190,16 @@ sleb_extract(unsigned char *data, uint64_t *dotp) * at which the desired datum starts. * ehe_flags - DWARF encoding * eident - ELF header e_ident[] array for object being processed + * frame_hdr - Boolean, true if we're extracting from .eh_frame_hdr * sh_base - Base address of ELF section containing desired datum * sh_offset - Offset relative to sh_base of desired datum. + * dbase - The base address to which DW_EH_PE_datarel is relative + * (if frame_hdr is false) */ uint64_t dwarf_ehe_extract(unsigned char *data, uint64_t *dotp, uint_t ehe_flags, - unsigned char *eident, uint64_t sh_base, uint64_t sh_offset) + unsigned char *eident, boolean_t frame_hdr, uint64_t sh_base, + uint64_t sh_offset, uint64_t dbase) { uint64_t dot = *dotp; uint_t lsb; @@ -281,17 +285,27 @@ dwarf_ehe_extract(unsigned char *data, uint64_t *dotp, uint_t ehe_flags, /* * If value is relative to a base address, adjust it */ - if (result) { - switch (ehe_flags & 0xf0) { - case DW_EH_PE_pcrel: - result += sh_base + sh_offset; - break; + switch (ehe_flags & 0xf0) { + case DW_EH_PE_pcrel: + result += sh_base + sh_offset; + break; - case DW_EH_PE_datarel: + /* + * datarel is relative to .eh_frame_hdr if within .eh_frame, + * but GOT if not. + */ + case DW_EH_PE_datarel: + if (frame_hdr) result += sh_base; - break; - } + else + result += dbase; + break; } + + /* Truncate the result to its specified size */ + result = (result << ((sizeof (uint64_t) - fsize) * 8)) >> + ((sizeof (uint64_t) - fsize) * 8); + *dotp = dot; return (result); } diff --git a/usr/src/cmd/sgs/tsort/i386/Makefile b/usr/src/cmd/sgs/tsort/i386/Makefile index a01e70f078..c565d58a91 100644 --- a/usr/src/cmd/sgs/tsort/i386/Makefile +++ b/usr/src/cmd/sgs/tsort/i386/Makefile @@ -19,14 +19,9 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# -# # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# cmd/sgs/tsort/i386/Makefile -# PROG= tsort @@ -43,6 +38,8 @@ CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master) CFLAGS += $(CCVERBOSE) C99MODE= $(C99_ENABLE) +CERRWARN += -_gcc=-Wno-parentheses + CLEANFILES += $(LINTOUT) %.o: ../common/%.c diff --git a/usr/src/cmd/sgs/tsort/sparc/Makefile b/usr/src/cmd/sgs/tsort/sparc/Makefile index 289a26aa1d..508983d078 100644 --- a/usr/src/cmd/sgs/tsort/sparc/Makefile +++ b/usr/src/cmd/sgs/tsort/sparc/Makefile @@ -19,9 +19,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# -# # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -41,6 +38,7 @@ SRCS= $(OBJS:%.o=../common/%.c) DEFLIST= -DELF CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master) CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses C99MODE= $(C99_ENABLE) CLEANFILES += $(LINTOUT) diff --git a/usr/src/cmd/sgs/unifdef/i386/Makefile b/usr/src/cmd/sgs/unifdef/i386/Makefile index 8c61cd7c65..33f7b96b30 100644 --- a/usr/src/cmd/sgs/unifdef/i386/Makefile +++ b/usr/src/cmd/sgs/unifdef/i386/Makefile @@ -19,13 +19,9 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# cmd/sgs/unifdef/i386/Makefile -# PROG= unifdef @@ -43,6 +39,9 @@ LINTFLAGS += $(LDLIBS) CLEANFILES += $(LINTOUT) +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-parentheses + %.o: ../common/%.c $(COMPILE.c) $< diff --git a/usr/src/cmd/sgs/unifdef/sparc/Makefile b/usr/src/cmd/sgs/unifdef/sparc/Makefile index 55b099b227..0a16f4c5f0 100644 --- a/usr/src/cmd/sgs/unifdef/sparc/Makefile +++ b/usr/src/cmd/sgs/unifdef/sparc/Makefile @@ -19,13 +19,9 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# cmd/sgs/unifdef/sparc/Makefile -# PROG= unifdef @@ -38,6 +34,8 @@ SRCS= $(OBJS:%.o=../common/%.c) DEFLIST= -DELF_OBJ -DELF CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master) CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-parentheses C99MODE= $(C99_ENABLE) LINTFLAGS += $(LDLIBS) diff --git a/usr/src/cmd/sgs/yacc/Makefile.com b/usr/src/cmd/sgs/yacc/Makefile.com index 009a2d41fa..4b9a945978 100644 --- a/usr/src/cmd/sgs/yacc/Makefile.com +++ b/usr/src/cmd/sgs/yacc/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= yacc @@ -67,6 +65,8 @@ LINTPOUT= lint.out C99MODE= $(C99_ENABLE) CFLAGS += $(CCVERBOSE) CFLAGS64 += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized $(LINTLIB):= LINTFLAGS = -nvx $(ROOTPROG):= FILEMODE = 0555 diff --git a/usr/src/cmd/sh/Makefile b/usr/src/cmd/sh/Makefile index b0741b195b..f1b67294ce 100644 --- a/usr/src/cmd/sh/Makefile +++ b/usr/src/cmd/sh/Makefile @@ -41,6 +41,10 @@ POFILES= $(SRCS:%.c=%.po) XGETFLAGS += -a -x sh.xcl CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DACCT +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-extra +CERRWARN += -_gcc=-Wno-unused-variable MAPFILES = $(MAPFILE.INT) $(MAPFILE.NGB) LDFLAGS += $(MAPFILES:%=-M%) LDLIBS += -lgen diff --git a/usr/src/cmd/shcomp/Makefile b/usr/src/cmd/shcomp/Makefile index 63ee23fa07..d09f5945c1 100644 --- a/usr/src/cmd/shcomp/Makefile +++ b/usr/src/cmd/shcomp/Makefile @@ -61,6 +61,8 @@ CFLAGS += \ CFLAGS64 += \ $(ASTCFLAGS64) +CERRWARN += -_gcc=-Wno-parentheses + ROOTCMDDIR=$(ROOT)/usr/bin PROG= shcomp diff --git a/usr/src/cmd/smbsrv/smbadm/Makefile b/usr/src/cmd/smbsrv/smbadm/Makefile index ccf2a8436c..3cdc52d13f 100644 --- a/usr/src/cmd/smbsrv/smbadm/Makefile +++ b/usr/src/cmd/smbsrv/smbadm/Makefile @@ -32,6 +32,10 @@ include ../Makefile.smbsrv.defs LDLIBS += -L$(ROOT)/usr/lib/smbsrv -lsmb -lsecdb -lumem LDFLAGS += -R/usr/lib/smbsrv +.KEEP_STATE: + +CERRWARN += -_gcc=-Wno-uninitialized + all: $(PROG) clean: diff --git a/usr/src/cmd/smserverd/Makefile b/usr/src/cmd/smserverd/Makefile index 34597f4d15..f138639025 100644 --- a/usr/src/cmd/smserverd/Makefile +++ b/usr/src/cmd/smserverd/Makefile @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG = rpc.smserverd OBJS = smediad.o smediad_err.o myaudit.o smed_svc.o smed_xdr.o @@ -47,6 +45,8 @@ LDLIBS += -lnsl -lbsm CPPFLAGS += -D_REENTRANT CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable LINTFLAGS += -u .KEEP_STATE: diff --git a/usr/src/cmd/soelim/Makefile b/usr/src/cmd/soelim/Makefile index bddde2ea1a..1dc7c5890b 100644 --- a/usr/src/cmd/soelim/Makefile +++ b/usr/src/cmd/soelim/Makefile @@ -20,12 +20,8 @@ # CDDL HEADER END # # -# ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989 by Sun Microsystems, Inc. # -# cmd/soelim/Makefile -# include ../Makefile.cmd @@ -35,13 +31,14 @@ OBJS = soelim.o SRCS = $(OBJS:%.o=%.c) +CERRWARN += -_gcc=-Wno-implicit-function-declaration all : $(PROG) $(PROG) : soelim.o $(LINK.c) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS) $(POST_PROCESS) - + install : all $(ROOTPROG) clean: diff --git a/usr/src/cmd/sort/Makefile.com b/usr/src/cmd/sort/Makefile.com index 922cab1f38..a65ab5327a 100644 --- a/usr/src/cmd/sort/Makefile.com +++ b/usr/src/cmd/sort/Makefile.com @@ -23,9 +23,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# -# sort(1) Makefile.com + # # Debugging targets # sort provides a number of debugging options to simplify failure analysis. @@ -86,6 +84,10 @@ CFLAGS64 += $(CCVERBOSE) $(SORT_DEBUG) CPPFLAGS += -D_FILE_OFFSET_BITS=64 LINTFLAGS += -U_FILE_OFFSET_BITS +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-function + $(XPG4) := CFLAGS += -DXPG4 debug := SORT_DEBUG = -g -DDEBUG $(ILDOFF) diff --git a/usr/src/cmd/spell/Makefile b/usr/src/cmd/spell/Makefile index 9fdcb2ebc9..659481df0a 100644 --- a/usr/src/cmd/spell/Makefile +++ b/usr/src/cmd/spell/Makefile @@ -20,13 +20,9 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# cmd/spell/Makefile -# HASHPROG= hashmk1 spellin1 SHPROG= spell compress @@ -55,6 +51,7 @@ TXTS= compress.sh spell.sh include ../Makefile.cmd CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses XGETFLAGS += -a -x spell.xcl diff --git a/usr/src/cmd/sqlite/Makefile b/usr/src/cmd/sqlite/Makefile index 5cc113b608..86a329605b 100644 --- a/usr/src/cmd/sqlite/Makefile +++ b/usr/src/cmd/sqlite/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" -# PROG= sqlite @@ -41,6 +39,8 @@ OBJS= shell.o $(OBJS) := CFLAGS += $(CTF_FLAGS) $(OBJS) := CTFCONVERT_POST = $(CTFCONVERT_O) +CERRWARN += -_gcc=-Wno-empty-body + .KEEP_STATE: $(ROOTSQLITE) := FILEMODE= 555 diff --git a/usr/src/cmd/srchtxt/Makefile b/usr/src/cmd/srchtxt/Makefile index 609a29dc9b..8adc2f68c5 100644 --- a/usr/src/cmd/srchtxt/Makefile +++ b/usr/src/cmd/srchtxt/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989 by Sun Microsystems, Inc. # @@ -29,6 +27,7 @@ PROG= srchtxt include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-parentheses LDLIBS += -lgen .KEEP_STATE: diff --git a/usr/src/cmd/ssh/Makefile.ssh-common b/usr/src/cmd/ssh/Makefile.ssh-common index f931266862..25a9c2560f 100644 --- a/usr/src/cmd/ssh/Makefile.ssh-common +++ b/usr/src/cmd/ssh/Makefile.ssh-common @@ -79,6 +79,11 @@ LINTFLAGS += \ -erroff=E_STMT_NOT_REACHED \ -errtags=yes +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable + ROOTLIBSSH= $(ROOTLIB)/ssh ROOTLIBSSHPROG= $(PROG:%=$(ROOTLIBSSH)/%) diff --git a/usr/src/cmd/stat/fsstat/Makefile b/usr/src/cmd/stat/fsstat/Makefile index 17a0e34f1b..26bfdb023b 100644 --- a/usr/src/cmd/stat/fsstat/Makefile +++ b/usr/src/cmd/stat/fsstat/Makefile @@ -35,6 +35,7 @@ COMMON_SRCS = $(COMMON_OBJS:%.o=$(STATCOMMONDIR)/%.c) LDLIBS += -lkstat CFLAGS += $(CCVERBOSE) -I${STATCOMMONDIR} +CERRWARN += -_gcc=-Wno-parentheses FILEMODE= 0555 lint := LINTFLAGS = -muxs -I$(STATCOMMONDIR) diff --git a/usr/src/cmd/stat/iostat/Makefile b/usr/src/cmd/stat/iostat/Makefile index bbc3b4c8c1..36142d5a8a 100644 --- a/usr/src/cmd/stat/iostat/Makefile +++ b/usr/src/cmd/stat/iostat/Makefile @@ -32,6 +32,9 @@ include $(SRC)/cmd/stat/Makefile.stat LDLIBS += -lkstat -ldevinfo -lavl CFLAGS += $(CCVERBOSE) -I${STATCOMMONDIR} +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses FILEMODE= 0555 lint := LINTFLAGS = -muxs -I$(STATCOMMONDIR) diff --git a/usr/src/cmd/stat/mpstat/Makefile b/usr/src/cmd/stat/mpstat/Makefile index c8638ebb49..fd3d57dafb 100644 --- a/usr/src/cmd/stat/mpstat/Makefile +++ b/usr/src/cmd/stat/mpstat/Makefile @@ -32,6 +32,9 @@ include $(SRC)/cmd/stat/Makefile.stat LDLIBS += -ldevinfo -lkstat -lavl CFLAGS += $(CCVERBOSE) -I${STATCOMMONDIR} +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses FILEMODE= 0555 lint := LINTFLAGS = -muxs -I$(STATCOMMONDIR) diff --git a/usr/src/cmd/stat/vmstat/Makefile b/usr/src/cmd/stat/vmstat/Makefile index 3257070752..d6f65b98d0 100644 --- a/usr/src/cmd/stat/vmstat/Makefile +++ b/usr/src/cmd/stat/vmstat/Makefile @@ -32,6 +32,9 @@ include $(SRC)/cmd/stat/Makefile.stat LDLIBS += -ldevinfo -lkstat -lavl CFLAGS += $(CCVERBOSE) -I${STATCOMMONDIR} +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses FILEMODE= 0555 lint := LINTFLAGS = -muxs -I$(STATCOMMONDIR) diff --git a/usr/src/cmd/stmfadm/Makefile b/usr/src/cmd/stmfadm/Makefile index ff2f191566..548ab3bf0c 100644 --- a/usr/src/cmd/stmfadm/Makefile +++ b/usr/src/cmd/stmfadm/Makefile @@ -38,8 +38,9 @@ OBJS = $(LOCAL_OBJS) $(COMMON_OBJS) SRCS = $(LOCAL_SRCS) $(COMMON_SRCS) POFILE = stmfadm_all.po POFILES = $(LOCAL_OBJS:%.o=%.po) $(COMMON_OBJS:%.o=$(COMMONBASE)/cmdparse/%.po) - + CPPFLAGS += -I. -I$(COMMONBASE)/cmdparse +CERRWARN += -_gcc=-Wno-unused-label LDLIBS += -lstmf LINTFLAGS += -xerroff=E_BAD_FORMAT_STR2 diff --git a/usr/src/cmd/stmsboot/Makefile b/usr/src/cmd/stmsboot/Makefile index ab97b566c2..8e97f0f467 100644 --- a/usr/src/cmd/stmsboot/Makefile +++ b/usr/src/cmd/stmsboot/Makefile @@ -40,6 +40,7 @@ ROOTFSLIB_MPXIO = $(ROOT)/lib/mpxio ROOTMANIFESTDIR = $(ROOTSVCSYSTEMDEVICE) LDLIBS += -ldevinfo -ldevid -lnvpair -lumem +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/cmd/streams/log/Makefile b/usr/src/cmd/streams/log/Makefile index c3f397ed68..67909774a1 100644 --- a/usr/src/cmd/streams/log/Makefile +++ b/usr/src/cmd/streams/log/Makefile @@ -27,6 +27,7 @@ PROG= strace strerr strclean include ../../Makefile.cmd CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-variable FILEMODE= 0555 diff --git a/usr/src/cmd/streams/strcmd/Makefile b/usr/src/cmd/streams/strcmd/Makefile index 4196ca1b45..ce0aa9f71e 100644 --- a/usr/src/cmd/streams/strcmd/Makefile +++ b/usr/src/cmd/streams/strcmd/Makefile @@ -26,6 +26,8 @@ PROG= strchg strconf include ../../Makefile.cmd +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/strings/Makefile.com b/usr/src/cmd/strings/Makefile.com index 5aee1b058d..36fc42dd15 100644 --- a/usr/src/cmd/strings/Makefile.com +++ b/usr/src/cmd/strings/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# PROG= strings SRCS= ../$(PROG).c @@ -34,6 +32,8 @@ LDLIBS += -lelf CFLAGS += $(CCVERBOSE) CFLAGS64 += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/cmd/su/Makefile b/usr/src/cmd/su/Makefile index 6eb13dd6df..031ebc0740 100644 --- a/usr/src/cmd/su/Makefile +++ b/usr/src/cmd/su/Makefile @@ -54,6 +54,8 @@ LINTFLAGS += -DDYNAMIC_SU CLOBBERFILES += $(ROOTFS_PROG) $(EMB_PROG) +CERRWARN += -_gcc=-Wno-parentheses + lint := LDLIBS += -lbsm -lpam -lsecdb .KEEP_STATE: diff --git a/usr/src/cmd/sunpc/other/Makefile b/usr/src/cmd/sunpc/other/Makefile index 8e8e9956cf..b5434c8597 100644 --- a/usr/src/cmd/sunpc/other/Makefile +++ b/usr/src/cmd/sunpc/other/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989 by Sun Microsystems, Inc. # # cmd/sunpc/other/Makefile @@ -31,6 +29,10 @@ SRCS= ${PROG:%=%.c} include ../../Makefile.cmd +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/svc/configd/Makefile b/usr/src/cmd/svc/configd/Makefile index 6f4da5b248..c6f2000e8c 100644 --- a/usr/src/cmd/svc/configd/Makefile +++ b/usr/src/cmd/svc/configd/Makefile @@ -50,7 +50,13 @@ ROOTCMDDIR= $(ROOT)/lib/svc/bin MYCPPFLAGS = -I. -I../common -I../../../common/svc -I$(ROOT)/usr/include/sqlite -D_REENTRANT CPPFLAGS += $(MYCPPFLAGS) -CFLAGS += -v +CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized MYLDLIBS = -lumem -luutil -lbsm LDLIBS += -lsecdb $(MYLDLIBS) LINTFLAGS += -errtags -erroff=E_BAD_FORMAT_ARG_TYPE2 -erroff=E_NAME_DEF_NOT_USED2 diff --git a/usr/src/cmd/svc/lsvcrun/Makefile b/usr/src/cmd/svc/lsvcrun/Makefile index 545d70149f..4eda2674db 100644 --- a/usr/src/cmd/svc/lsvcrun/Makefile +++ b/usr/src/cmd/svc/lsvcrun/Makefile @@ -23,7 +23,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" PROG = lsvcrun OBJS = lsvcrun.o @@ -35,6 +34,8 @@ ROOTLIBSVCBINPROG = $(ROOT)/lib/svc/bin/$(PROG) include ../../Makefile.cmd LDLIBS += -lcontract -lscf -luutil +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized lint := LINTFLAGS = -ux diff --git a/usr/src/cmd/svc/mfstscan/Makefile b/usr/src/cmd/svc/mfstscan/Makefile index a0783bf3d3..5a24abb0ca 100644 --- a/usr/src/cmd/svc/mfstscan/Makefile +++ b/usr/src/cmd/svc/mfstscan/Makefile @@ -44,6 +44,9 @@ CPPFLAGS += -I../common LDLIBS += -lscf -luutil -lmd5 CLOBBERFILES += $(POFILES) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label + lint := LINTFLAGS = -ux -erroff=E_GLOBAL_COULD_BE_STATIC2 .KEEP_STATE: diff --git a/usr/src/cmd/svc/startd/Makefile b/usr/src/cmd/svc/startd/Makefile index 1df70d64dd..1a29300a68 100644 --- a/usr/src/cmd/svc/startd/Makefile +++ b/usr/src/cmd/svc/startd/Makefile @@ -63,9 +63,14 @@ include ../../Makefile.ctf ROOTCMDDIR= $(ROOT)/lib/svc/bin $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG -CFLAGS += -v +CFLAGS += $(CCVERBOSE) CPPFLAGS += -I. -I../common +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + $(OBJS) := CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_REENTRANT proc.o := CPPFLAGS += -D_REENTRANT diff --git a/usr/src/cmd/svc/svcadm/Makefile b/usr/src/cmd/svc/svcadm/Makefile index 8b024e20da..1a6a0dd35c 100644 --- a/usr/src/cmd/svc/svcadm/Makefile +++ b/usr/src/cmd/svc/svcadm/Makefile @@ -34,6 +34,9 @@ include ../../Makefile.cmd POFILE = $(PROG)_all.po LDLIBS += -lscf -luutil -lcontract +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + lint := LINTFLAGS = -ux .KEEP_STATE: diff --git a/usr/src/cmd/svc/svccfg/Makefile b/usr/src/cmd/svc/svccfg/Makefile index 6d613ffa7a..d5a6e434d6 100644 --- a/usr/src/cmd/svc/svccfg/Makefile +++ b/usr/src/cmd/svc/svccfg/Makefile @@ -73,6 +73,13 @@ MYCPPFLAGS = -I ../common -I$(ADJUNCT_PROTO)/usr/include/libxml2 CPPFLAGS += $(MYCPPFLAGS) LDFLAGS += $(MAPOPTS) +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses + LFLAGS = -t YFLAGS = -d diff --git a/usr/src/cmd/svc/svcprop/Makefile b/usr/src/cmd/svc/svcprop/Makefile index af09f6555d..4e1f4d4981 100644 --- a/usr/src/cmd/svc/svcprop/Makefile +++ b/usr/src/cmd/svc/svcprop/Makefile @@ -35,6 +35,8 @@ LDLIBS += -lscf -luutil lint := LINTFLAGS = -ux +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/svc/svcs/Makefile b/usr/src/cmd/svc/svcs/Makefile index 7d0085b64e..0e9fc52652 100644 --- a/usr/src/cmd/svc/svcs/Makefile +++ b/usr/src/cmd/svc/svcs/Makefile @@ -38,6 +38,9 @@ LDLIBS += -lcontract -lscf -luutil -lumem -lnvpair -lzonecfg CPPFLAGS += -I ../common lint := LINTFLAGS = -mux +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses .KEEP_STATE: diff --git a/usr/src/cmd/svr4pkg/Makefile.svr4pkg b/usr/src/cmd/svr4pkg/Makefile.svr4pkg index f7d3462665..89c4854e39 100644 --- a/usr/src/cmd/svr4pkg/Makefile.svr4pkg +++ b/usr/src/cmd/svr4pkg/Makefile.svr4pkg @@ -33,6 +33,14 @@ CPPFLAGS += -I$(SRC)/cmd/svr4pkg/hdrs \ -D_FILE_OFFSET_BITS=64 +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-extra +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-address + LIBINST = $(SRC)/cmd/svr4pkg/libinst/libinst.a SRCS= $(OBJS:.o=.c) diff --git a/usr/src/cmd/svr4pkg/libinst/Makefile b/usr/src/cmd/svr4pkg/libinst/Makefile index ea6117dc58..89823b854d 100644 --- a/usr/src/cmd/svr4pkg/libinst/Makefile +++ b/usr/src/cmd/svr4pkg/libinst/Makefile @@ -61,6 +61,12 @@ CPPFLAGS += -I$(SRC)/cmd/svr4pkg/hdrs \ # LINTFLAGS += -un +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-unused-variable + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/swap/Makefile.com b/usr/src/cmd/swap/Makefile.com index 451fb51b65..3734d8ac58 100644 --- a/usr/src/cmd/swap/Makefile.com +++ b/usr/src/cmd/swap/Makefile.com @@ -33,6 +33,7 @@ include ../../Makefile.cmd CFLAGS += $(CCVERBOSE) CPPFLAGS += -D_LARGEFILE64_SOURCE CFLAGS64 += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized FILEMODE=02555 diff --git a/usr/src/cmd/sysdef/Makefile.com b/usr/src/cmd/sysdef/Makefile.com index df73086429..05ded4a1c8 100644 --- a/usr/src/cmd/sysdef/Makefile.com +++ b/usr/src/cmd/sysdef/Makefile.com @@ -30,6 +30,7 @@ SRCS= $(OBJS:%.o=../%.c) include ../../Makefile.cmd LDLIBS += -ldevinfo -lelf +CERRWARN += -_gcc=-Wno-parentheses FILEMODE= 02555 diff --git a/usr/src/cmd/syseventadm/Makefile b/usr/src/cmd/syseventadm/Makefile index 95a3a0fdc3..91c515b00f 100644 --- a/usr/src/cmd/syseventadm/Makefile +++ b/usr/src/cmd/syseventadm/Makefile @@ -32,6 +32,7 @@ OBJS = $(PROG).o include ../Makefile.cmd FILEMODE= 0555 +CERRWARN += -_gcc=-Wno-uninitialized POFILES = $(SRCS:.c=.po) diff --git a/usr/src/cmd/syseventd/daemons/syseventd/Makefile b/usr/src/cmd/syseventd/daemons/syseventd/Makefile index 310736ba03..b599ae9560 100644 --- a/usr/src/cmd/syseventd/daemons/syseventd/Makefile +++ b/usr/src/cmd/syseventd/daemons/syseventd/Makefile @@ -23,14 +23,14 @@ # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG = syseventd SRCS = syseventd.c sysevent_signal.c sysevent_client.c include ../Makefile.com +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/syseventd/modules/devfsadmd_mod/Makefile b/usr/src/cmd/syseventd/modules/devfsadmd_mod/Makefile index 0385e82cc5..164b6c1acf 100644 --- a/usr/src/cmd/syseventd/modules/devfsadmd_mod/Makefile +++ b/usr/src/cmd/syseventd/modules/devfsadmd_mod/Makefile @@ -20,19 +20,16 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 2001 by Sun Microsystems, Inc. # All rights reserved. # -# cmd/syseventd/modules/devfsadmd_mod/Makefile -# LIBRARY = devfsadmd_mod include ../Makefile.com CPPFLAGS += -I $(SRC)/cmd/devfsadm +CERRWARN += -_gcc=-Wno-parentheses .KEEP_STATE: diff --git a/usr/src/cmd/syseventd/modules/sysevent_conf_mod/Makefile b/usr/src/cmd/syseventd/modules/sysevent_conf_mod/Makefile index d778082424..377c91df68 100644 --- a/usr/src/cmd/syseventd/modules/sysevent_conf_mod/Makefile +++ b/usr/src/cmd/syseventd/modules/sysevent_conf_mod/Makefile @@ -19,13 +19,9 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# cmd/syseventd/modules/sysevent_conf_mod/Makefile -# LIBRARY = sysevent_conf_mod @@ -34,6 +30,8 @@ include ../Makefile.com LDLIBS += -lnvpair CPPFLAGS += -I ../../daemons/syseventconfd +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(DYNLIB) diff --git a/usr/src/cmd/syseventd/modules/zfs_mod/Makefile b/usr/src/cmd/syseventd/modules/zfs_mod/Makefile index ad550e28dc..13dcc10c90 100644 --- a/usr/src/cmd/syseventd/modules/zfs_mod/Makefile +++ b/usr/src/cmd/syseventd/modules/zfs_mod/Makefile @@ -29,6 +29,8 @@ include ../Makefile.com CPPFLAGS += -I../../../../lib/libc/inc LDLIBS += -lzfs -ldevid -lcmdutils -lnvpair +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(DYNLIB) diff --git a/usr/src/cmd/syslogd/Makefile.com b/usr/src/cmd/syslogd/Makefile.com index 0005ab31ba..93b2a94dd4 100644 --- a/usr/src/cmd/syslogd/Makefile.com +++ b/usr/src/cmd/syslogd/Makefile.com @@ -34,7 +34,7 @@ LLOBJS= $(OBJS:%.o=%.ll) include ../../Makefile.cmd $(PROG) lint := LDLIBS += -lscf -lnsl -CCVERBOSE = +CERRWARN += -_gcc=-Wno-uninitialized CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT CFLAGS += -DNDEBUG diff --git a/usr/src/cmd/tabs/Makefile b/usr/src/cmd/tabs/Makefile index c59a187d44..9a5e534cc4 100644 --- a/usr/src/cmd/tabs/Makefile +++ b/usr/src/cmd/tabs/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -32,6 +30,8 @@ include ../Makefile.cmd LDLIBS += -lcurses CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-address .KEEP_STATE: diff --git a/usr/src/cmd/tar/Makefile b/usr/src/cmd/tar/Makefile index 5af64596d0..5da69ec0f9 100644 --- a/usr/src/cmd/tar/Makefile +++ b/usr/src/cmd/tar/Makefile @@ -37,6 +37,9 @@ LINTFLAGS += -u LDLIBS += -lsec -lcmdutils -lnvpair -ltsol CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized CPPFLAGS += -DEUC diff --git a/usr/src/cmd/tbl/Makefile b/usr/src/cmd/tbl/Makefile index 309ccfdc92..8213f9bf01 100644 --- a/usr/src/cmd/tbl/Makefile +++ b/usr/src/cmd/tbl/Makefile @@ -20,12 +20,8 @@ # CDDL HEADER END # # -# ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989 by Sun Microsystems, Inc. # -# cmd/tbl/Makefile -# include ../Makefile.cmd @@ -40,6 +36,11 @@ OBJS = $(SRCS:%.c=%.o) POFILES= $(OBJS:%.o=%.po) POFILE= tbl.po +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-char-subscripts + .KEEP_STATE : all : $(PROG) diff --git a/usr/src/cmd/tcopy/Makefile b/usr/src/cmd/tcopy/Makefile index a29584eb18..d5813abe94 100644 --- a/usr/src/cmd/tcopy/Makefile +++ b/usr/src/cmd/tcopy/Makefile @@ -20,17 +20,17 @@ # CDDL HEADER END # # -# ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1990 by Sun Microsystems, Inc. # -# Makefile for cmd/tcopy -# PROG = tcopy include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-extra .KEEP_STATE : diff --git a/usr/src/cmd/tcpd/Makefile b/usr/src/cmd/tcpd/Makefile index ab1318c55e..ec4d3c4876 100644 --- a/usr/src/cmd/tcpd/Makefile +++ b/usr/src/cmd/tcpd/Makefile @@ -9,10 +9,7 @@ PROG= safe_finger tcpd tcpdchk tcpdmatch try-from include ../Makefile.cmd -ERROFF= -erroff=E_FUNC_HAS_NO_RETURN_STMT \ - -erroff=E_IMPLICIT_DECL_FUNC_RETURN_INT \ - -_gcc=-Wno-return-type -_gcc=-Wno-implicit -CFLAGS += $(CCVERBOSE) $(ERROFF) +CFLAGS += $(CCVERBOSE) CPPFLAGS += $(ACCESS) $(PARANOID) $(NETGROUP) $(TLI) \ $(UMASK) $(STYLE) $(TABLES) $(KILL_OPT) $(BUGS) \ -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \ @@ -23,6 +20,15 @@ tcpd tcpdmatch try-from := \ LDLIBS += -lwrap tcpdchk := LDLIBS += -lwrap -lnsl +CERRWARN += -erroff=E_FUNC_HAS_NO_RETURN_STMT +CERRWARN += -erroff=E_IMPLICIT_DECL_FUNC_RETURN_INT +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-return-type +CERRWARN += -_gcc=-Wno-clobbered + # Various components must export interfaces, but also contain name-space # clashes with system libraries. MAPFILE.INT.D= $(MAPFILE.NGB) mapfile-intf-tcpdchk diff --git a/usr/src/cmd/th_tools/Makefile b/usr/src/cmd/th_tools/Makefile index b2eb73cfe5..c57e71e622 100644 --- a/usr/src/cmd/th_tools/Makefile +++ b/usr/src/cmd/th_tools/Makefile @@ -32,6 +32,8 @@ CFLAGS += -I$(SRC)/uts/common LINTFLAGS += -I$(SRC)/uts/common C99MODE= $(C99_ENABLE) CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized SRCS = $(PROG:%=%.c) OBJECTS = $(SRCS:%.c=%.o) diff --git a/usr/src/cmd/tic/Makefile b/usr/src/cmd/tic/Makefile index a27787d06a..e4d3c127b1 100644 --- a/usr/src/cmd/tic/Makefile +++ b/usr/src/cmd/tic/Makefile @@ -19,8 +19,6 @@ # CDDL HEADER END # # -# ident "%Z%%M% %I% %E% SMI" -# # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -45,6 +43,11 @@ CPPFLAGS += -I../../lib/libcurses/screen MAPFILES = $(MAPFILE.INT) $(MAPFILE.NGB) LDFLAGS += $(MAPFILES:%=-M%) +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/tip/Makefile b/usr/src/cmd/tip/Makefile index 0c04dc41fd..0aaeb39d1e 100644 --- a/usr/src/cmd/tip/Makefile +++ b/usr/src/cmd/tip/Makefile @@ -60,6 +60,9 @@ $(ROOTACULOG) := FILEMODE = 600 LINTFLAGS += -u CPPFLAGS += -DDEFBR=300 -DDEFFS=BUFSIZ -DACULOG -DUSG +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-uninitialized CONFIG= -DV831 -DVENTEL -DV3451 -DDF02 -DDF03 -DBIZ1031 -DBIZ1022 -DHAYES ACULIB= aculib/aculib.a LDLIBS= $(ACULIB) $(LDLIBS.cmd) diff --git a/usr/src/cmd/tip/aculib/Makefile b/usr/src/cmd/tip/aculib/Makefile index 4b35f0edca..c31175daff 100644 --- a/usr/src/cmd/tip/aculib/Makefile +++ b/usr/src/cmd/tip/aculib/Makefile @@ -6,8 +6,7 @@ # All rights reserved. The Berkeley software License Agreement # specifies the terms and conditions for redistribution. # -# ident "%Z%%M% %I% %E% SMI" -# + # make file for tip device drivers # # Current drivers: @@ -28,6 +27,8 @@ include ../../Makefile.cmd LINTFLAGS += -u CPPFLAGS= -I../ -DUSG $(CPPFLAGS.master) +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-parentheses .KEEP_STATE: diff --git a/usr/src/cmd/tnf/prex/Makefile.com b/usr/src/cmd/tnf/prex/Makefile.com index b6ea70d2dc..6a25466978 100644 --- a/usr/src/cmd/tnf/prex/Makefile.com +++ b/usr/src/cmd/tnf/prex/Makefile.com @@ -19,8 +19,7 @@ # # CDDL HEADER END # -# -#ident "%Z%%M% %I% %E% SMI" + # # Copyright 1989,2003 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. @@ -65,7 +64,13 @@ 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 -v +# COPTFLAG = -g -DDEBUG + +CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/cmd/tnf/tnfxtract/Makefile.com b/usr/src/cmd/tnf/tnfxtract/Makefile.com index 747f5030f1..3916b9ca6f 100644 --- a/usr/src/cmd/tnf/tnfxtract/Makefile.com +++ b/usr/src/cmd/tnf/tnfxtract/Makefile.com @@ -23,8 +23,6 @@ # Copyright 1994, 2002 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= tnfxtract @@ -38,6 +36,7 @@ include ../../../Makefile.cmd LFLAGS= -v LDLIBS += -lkvm +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/cmd/tput/Makefile b/usr/src/cmd/tput/Makefile index ac90caaecd..80cd77e8f1 100644 --- a/usr/src/cmd/tput/Makefile +++ b/usr/src/cmd/tput/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -33,6 +31,7 @@ include ../Makefile.cmd .KEEP_STATE: CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses XGETFLAGS += -a -x tput.xcl LDLIBS += -lcurses diff --git a/usr/src/cmd/tput/tput.c b/usr/src/cmd/tput/tput.c index 18dce8d6cb..c8a61cc2ee 100644 --- a/usr/src/cmd/tput/tput.c +++ b/usr/src/cmd/tput/tput.c @@ -22,6 +22,7 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright (c) 2012 Gary Mills */ /* Copyright (c) 1988 AT&T */ @@ -174,10 +175,12 @@ main(int argc, char **argv) for (i = 0; i < 10; i++) v[i] = (char *)malloc(32 * sizeof (char)); - while (gets(buff) != NULL) { + while (fgets(buff, sizeof (buff), stdin) != NULL) { /* read standard input line; skip over empty lines */ if ((std_argc = - sscanf(buff, "%s %s %s %s %s %s %s %s %s %s", + sscanf(buff, + "%31s %31s %31s %31s %31s %31s %31s %31s " + "%31s %31s", v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7], v[8], v[9])) < 1) { continue; diff --git a/usr/src/cmd/trapstat/sun4/Makefile b/usr/src/cmd/trapstat/sun4/Makefile index a69c5e6af3..8c48d97ad2 100644 --- a/usr/src/cmd/trapstat/sun4/Makefile +++ b/usr/src/cmd/trapstat/sun4/Makefile @@ -34,6 +34,7 @@ EXTOBJS = ../capabilities/sun4u/symcap.o \ CPPFLAGS += -I$(SRC)/uts/sun4 -I. LINTFLAGS += -erroff=E_SEC_PRINTF_VAR_FMT +CERRWARN += -_gcc=-Wno-clobbered .KEEP_STATE: @@ -47,7 +48,7 @@ $(PROG): $(OBJS) $(EXTOBJS) clean: $(RM) $(OBJS) $(EXTOBJS) - + lint: lint_PROG include $(SRC)/cmd/Makefile.targ diff --git a/usr/src/cmd/troff/nroff.d/Makefile b/usr/src/cmd/troff/nroff.d/Makefile index 6d991447f2..295dcfb704 100644 --- a/usr/src/cmd/troff/nroff.d/Makefile +++ b/usr/src/cmd/troff/nroff.d/Makefile @@ -20,12 +20,8 @@ # CDDL HEADER END # # -# ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989 by Sun Microsystems, Inc. # -# cmd/troff/nroff.d/Makefile -# include ../../Makefile.cmd @@ -43,6 +39,12 @@ SRCS = $(OBJS:%.o=%.c) $(COMMONOBJS:%.o=../%.c) CPPFLAGS = -DNROFF -DUSG -DINCORE -DEUC -I. -I.. $(CPPFLAGS.master) +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-extra +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable + LDLIBS += -lmapmalloc # # message catalog diff --git a/usr/src/cmd/troff/troff.d/Makefile b/usr/src/cmd/troff/troff.d/Makefile index 475a1718c0..e94bea647d 100644 --- a/usr/src/cmd/troff/troff.d/Makefile +++ b/usr/src/cmd/troff/troff.d/Makefile @@ -43,6 +43,13 @@ SRCS = $(TAOBJS:%.o=%.c) $(MAKEDEVOBJS:%.o=%.c) \ TXTS = README maketables troff.sh CPPFLAGS = -DUSG -DINCORE -I. -I.. $(CPPFLAGS.master) + +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-extra + # # For message catalog # @@ -93,7 +100,7 @@ $(POFILE): $(POFILES) strip : $(STRIP $(PROG) - + lint : lint_SRCS include ../../Makefile.targ diff --git a/usr/src/cmd/truss/Makefile.com b/usr/src/cmd/truss/Makefile.com index 0590cce251..b500283399 100644 --- a/usr/src/cmd/truss/Makefile.com +++ b/usr/src/cmd/truss/Makefile.com @@ -38,6 +38,9 @@ include ../../Makefile.cmd CFLAGS += $(CCVERBOSE) CFLAGS64 += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch + C99MODE= $(C99_ENABLE) LDLIBS += -lproc -lrtld_db -lc_db -lnsl -lsocket -ltsol -lnvpair diff --git a/usr/src/cmd/tsol/tnctl/Makefile b/usr/src/cmd/tsol/tnctl/Makefile index cbb8cf16a0..71cb5f5a95 100644 --- a/usr/src/cmd/tsol/tnctl/Makefile +++ b/usr/src/cmd/tsol/tnctl/Makefile @@ -37,6 +37,9 @@ $(ROOTMANIFEST) := FILEMODE= 444 LDLIBS += -lnsl -ltsnet +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/tsol/tnd/Makefile b/usr/src/cmd/tsol/tnd/Makefile index 3d7d9d7794..247a680358 100644 --- a/usr/src/cmd/tsol/tnd/Makefile +++ b/usr/src/cmd/tsol/tnd/Makefile @@ -44,6 +44,9 @@ LDLIBS += -lnsl -ltsnet CPPFLAGS += $(IFLAGS) CPPFLAGS += -DDEBUG +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/tsol/updatehome/Makefile b/usr/src/cmd/tsol/updatehome/Makefile index ed3ca8c04b..5651d36d99 100644 --- a/usr/src/cmd/tsol/updatehome/Makefile +++ b/usr/src/cmd/tsol/updatehome/Makefile @@ -24,10 +24,6 @@ # # -# ident "%Z%%M% %I% %E% SMI" -# - -# # cmd/tsol/updatehome # PROG= updatehome @@ -38,6 +34,7 @@ OBJS= setupfiles.o updatehome.o SRCS= $(OBJS:%.o=%.c) LDLIBS += -ltsol -lsecdb +CERRWARN += -_gcc=-Wno-parentheses .KEEP_STATE: diff --git a/usr/src/cmd/ttymon/Makefile b/usr/src/cmd/ttymon/Makefile index abe863d46f..854e5e8d95 100644 --- a/usr/src/cmd/ttymon/Makefile +++ b/usr/src/cmd/ttymon/Makefile @@ -73,6 +73,11 @@ LINTFLAGS = -b -x CFLAGS += $(CCVERBOSE) LDFLAGS += $(MAPFILE.NGB:%=-M%) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-extra + # # Message catalog # diff --git a/usr/src/cmd/ucodeadm/Makefile b/usr/src/cmd/ucodeadm/Makefile index 1155f50081..1fb1938265 100644 --- a/usr/src/cmd/ucodeadm/Makefile +++ b/usr/src/cmd/ucodeadm/Makefile @@ -45,7 +45,9 @@ ROOTINTELUCODE = $(INTEL_UCODE_FILE:%=$(ROOTUCODEPATH)/%) ROOTAMDUCODE = $(AMD_UCODE_FILE:%=$(ROOTUCODEPATH)/%) CPPFLAGS = -I../../common -I../../uts/common -CFLAGS += -v +CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits LINTFLAGS += -errtags -erroff=E_NAME_DEF_NOT_USED2 LINTFLAGS += -erroff=E_INCONS_ARG_DECL2,E_INCONS_VAL_TYPE_DECL2 LDLIBS = -lgen diff --git a/usr/src/cmd/uname/Makefile b/usr/src/cmd/uname/Makefile index 723e597cc0..daa11b4aa8 100644 --- a/usr/src/cmd/uname/Makefile +++ b/usr/src/cmd/uname/Makefile @@ -28,6 +28,7 @@ ROOTFS_PROG= $(PROG) include ../Makefile.cmd CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/cmd/units/Makefile b/usr/src/cmd/units/Makefile index 8071ad08a1..b6455296de 100644 --- a/usr/src/cmd/units/Makefile +++ b/usr/src/cmd/units/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989 by Sun Microsystems, Inc. # @@ -30,6 +28,9 @@ UNITTAB=unittab include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-implicit-function-declaration + LIBUNITTAB= $(UNITTAB:%=$(ROOTSHLIB)/%) $(LIBUNITTAB) := FILEMODE = $(LIBFILEMODE) diff --git a/usr/src/cmd/unlink/Makefile b/usr/src/cmd/unlink/Makefile index 1a2c6d59bc..78cb745acd 100644 --- a/usr/src/cmd/unlink/Makefile +++ b/usr/src/cmd/unlink/Makefile @@ -27,6 +27,8 @@ PROG= unlink include ../Makefile.cmd FILEMODE = 0555 +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses .KEEP_STATE: diff --git a/usr/src/cmd/unpack/Makefile b/usr/src/cmd/unpack/Makefile index 31e0e24556..bb3fc4e9e8 100644 --- a/usr/src/cmd/unpack/Makefile +++ b/usr/src/cmd/unpack/Makefile @@ -19,8 +19,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -29,6 +27,8 @@ PROG= unpack include ../Makefile.cmd CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized CPPFLAGS += -D_FILE_OFFSET_BITS=64 LDLIBS += -lcmdutils -lsec diff --git a/usr/src/cmd/users/Makefile b/usr/src/cmd/users/Makefile index 78887bc15e..253af50ff5 100644 --- a/usr/src/cmd/users/Makefile +++ b/usr/src/cmd/users/Makefile @@ -19,9 +19,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# -# # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -32,6 +29,9 @@ SRCS= $(OBJS:%.o=%.c) include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/utmpd/Makefile b/usr/src/cmd/utmpd/Makefile index ecb124120c..f1b2a4222e 100644 --- a/usr/src/cmd/utmpd/Makefile +++ b/usr/src/cmd/utmpd/Makefile @@ -34,6 +34,8 @@ ROOTMANIFESTDIR = $(ROOTSVCSYSTEM) FILEMODE = 555 +CERRWARN += -_gcc=-Wno-extra + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/vgrind/Makefile b/usr/src/cmd/vgrind/Makefile index 2d58bb0c16..0bb0619aa2 100644 --- a/usr/src/cmd/vgrind/Makefile +++ b/usr/src/cmd/vgrind/Makefile @@ -61,6 +61,11 @@ CLOBBERFILES= $(LIBPROG) $(RETEST) include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function + # # Message catalog # diff --git a/usr/src/cmd/vi/misc/Makefile b/usr/src/cmd/vi/misc/Makefile index 5d88cceb8b..d124adae63 100644 --- a/usr/src/cmd/vi/misc/Makefile +++ b/usr/src/cmd/vi/misc/Makefile @@ -20,11 +20,8 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989 by Sun Microsystems, Inc. # -# cmd/vi/misc/Makefile CFLAGS += v @@ -41,6 +38,12 @@ POFILES= $(SRCS:%.c=%.po) include ../../Makefile.cmd $(XPG4) := CFLAGS += -DXPG4 +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-variable + POFILE= misc.po CLOBBERFILES += $(OTHERPROGS) diff --git a/usr/src/cmd/vi/port/Makefile b/usr/src/cmd/vi/port/Makefile index 8bb0e5f1b5..8e223d98e8 100644 --- a/usr/src/cmd/vi/port/Makefile +++ b/usr/src/cmd/vi/port/Makefile @@ -51,6 +51,16 @@ TXTS = READ_ME makeoptions asfix.c70 ex.news port.mk.370 port.mk.70 \ port.mk.c70 port.mk.usg ovdoprnt.s ovprintf.c rofix include ../../Makefile.cmd + +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-address + # # For message catalogue files # diff --git a/usr/src/cmd/volcheck/Makefile b/usr/src/cmd/volcheck/Makefile index fb82067395..762dd50c9b 100644 --- a/usr/src/cmd/volcheck/Makefile +++ b/usr/src/cmd/volcheck/Makefile @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG = volcheck LOCAL_OBJS = volcheck.o @@ -43,6 +41,12 @@ CPPFLAGS += -I$(ROOT)/usr/include/hal CPPFLAGS += -I$(SRC)/cmd/rmvolmgr C99MODE = $(C99_ENABLE) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-function + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/volrmmount/Makefile b/usr/src/cmd/volrmmount/Makefile index 0c0b6c7fdb..5166036a04 100644 --- a/usr/src/cmd/volrmmount/Makefile +++ b/usr/src/cmd/volrmmount/Makefile @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG = volrmmount LOCAL_OBJS = volrmmount.o @@ -43,6 +41,12 @@ CPPFLAGS += -I$(ROOT)/usr/include/hal CPPFLAGS += -I$(SRC)/cmd/rmvolmgr C99MODE = $(C99_ENABLE) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-function + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/vrrpadm/Makefile b/usr/src/cmd/vrrpadm/Makefile index a7631e7d09..c63a09589d 100644 --- a/usr/src/cmd/vrrpadm/Makefile +++ b/usr/src/cmd/vrrpadm/Makefile @@ -30,6 +30,8 @@ include ../Makefile.cmd XGETFLAGS += -a -x $(PROG).xcl LDLIBS += -lvrrpadm -lnsl -linetutil +CERRWARN += -_gcc=-Wno-unused-label + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/vscan/vscand/Makefile b/usr/src/cmd/vscan/vscand/Makefile index 32c1a73da7..15ff0086c2 100755..100644 --- a/usr/src/cmd/vscan/vscand/Makefile +++ b/usr/src/cmd/vscan/vscand/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" PROG = vscand SRCS = vs_main.c \ @@ -46,6 +44,8 @@ CFLAGS += $(CCVERBOSE) CFLAGS += -D_FILE_OFFSET_BITS=64 $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG +CERRWARN += -_gcc=-Wno-switch + LINTFLAGS += -mu C99MODE = -xc99=%all C99LMODE = -Xc99=%all diff --git a/usr/src/cmd/vt/Makefile b/usr/src/cmd/vt/Makefile index b7a1c63cdd..48fa393153 100644 --- a/usr/src/cmd/vt/Makefile +++ b/usr/src/cmd/vt/Makefile @@ -31,6 +31,7 @@ VTINFO_SRC= vtinfo.c include ../Makefile.cmd CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += -lpam -lbsm diff --git a/usr/src/cmd/w/amd64/Makefile b/usr/src/cmd/w/amd64/Makefile index 8e80f8c4b1..539860f566 100644 --- a/usr/src/cmd/w/amd64/Makefile +++ b/usr/src/cmd/w/amd64/Makefile @@ -33,6 +33,7 @@ include ../../Makefile.cmd include ../../Makefile.cmd.64 CFLAGS64 += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses ROOTLINK= $(ROOTBIN64)/uptime diff --git a/usr/src/cmd/w/i386/Makefile b/usr/src/cmd/w/i386/Makefile index 7e806136fc..55a9b448c2 100644 --- a/usr/src/cmd/w/i386/Makefile +++ b/usr/src/cmd/w/i386/Makefile @@ -33,6 +33,7 @@ SRCS= $(OBJS:%.o=../%.c) include ../../Makefile.cmd CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses lint := LINTFLAGS = -x diff --git a/usr/src/cmd/w/sparcv9/Makefile b/usr/src/cmd/w/sparcv9/Makefile index a83b770b3c..0a72a73af1 100644 --- a/usr/src/cmd/w/sparcv9/Makefile +++ b/usr/src/cmd/w/sparcv9/Makefile @@ -34,6 +34,7 @@ include ../../Makefile.cmd include ../../Makefile.cmd.64 CFLAGS64 += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses lint := LINTFLAGS64 = -x -m64 diff --git a/usr/src/cmd/wall/Makefile b/usr/src/cmd/wall/Makefile index e338057768..344209d5a7 100644 --- a/usr/src/cmd/wall/Makefile +++ b/usr/src/cmd/wall/Makefile @@ -31,6 +31,8 @@ include ../Makefile.cmd FILEMODE = 02555 LDLIBS += -lzonecfg -lcontract +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/cmd/whodo/amd64/Makefile b/usr/src/cmd/whodo/amd64/Makefile index 59abff4e6d..ca074ce6de 100644 --- a/usr/src/cmd/whodo/amd64/Makefile +++ b/usr/src/cmd/whodo/amd64/Makefile @@ -33,6 +33,7 @@ include ../../Makefile.cmd include ../../Makefile.cmd.64 CFLAGS64 += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses FILEMODE= 04555 diff --git a/usr/src/cmd/whodo/i386/Makefile b/usr/src/cmd/whodo/i386/Makefile index 71fa35a66d..e40790412d 100644 --- a/usr/src/cmd/whodo/i386/Makefile +++ b/usr/src/cmd/whodo/i386/Makefile @@ -33,6 +33,7 @@ SRCS= $(OBJS:%.o=../%.c) include ../../Makefile.cmd CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses lint := LINTFLAGS = -x diff --git a/usr/src/cmd/whodo/sparcv9/Makefile b/usr/src/cmd/whodo/sparcv9/Makefile index bc1ac015a6..a0d41d0f83 100644 --- a/usr/src/cmd/whodo/sparcv9/Makefile +++ b/usr/src/cmd/whodo/sparcv9/Makefile @@ -35,6 +35,7 @@ include ../../Makefile.cmd include ../../Makefile.cmd.64 CFLAGS64 += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses lint := LINTFLAGS64 = -x -m64 diff --git a/usr/src/cmd/write/Makefile b/usr/src/cmd/write/Makefile index 7cd6e710a8..74ffb5e953 100644 --- a/usr/src/cmd/write/Makefile +++ b/usr/src/cmd/write/Makefile @@ -36,6 +36,7 @@ XGETFLAGS += -a -x write.xcl .KEEP_STATE: CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-variable all: $(PROG) diff --git a/usr/src/cmd/xargs/Makefile b/usr/src/cmd/xargs/Makefile index e6d32e7452..b4e136d8a6 100644 --- a/usr/src/cmd/xargs/Makefile +++ b/usr/src/cmd/xargs/Makefile @@ -19,8 +19,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -38,6 +36,8 @@ include ../Makefile.cmd CPPFLAGS += -I $(SRC)/common/util LINTFLAGS += -u +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/xstr/Makefile b/usr/src/cmd/xstr/Makefile index ac50ba07da..c188866ad4 100644 --- a/usr/src/cmd/xstr/Makefile +++ b/usr/src/cmd/xstr/Makefile @@ -20,17 +20,14 @@ # CDDL HEADER END # # -# ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1989 by Sun Microsystems, Inc. # -# Makefile for cmd/xstr -# PROG = xstr include ../Makefile.cmd +CERRWARN += -_gcc=-Wno-parentheses .KEEP_STATE : diff --git a/usr/src/cmd/ypcmd/Makefile b/usr/src/cmd/ypcmd/Makefile index 55cf13f972..ed16123edc 100644 --- a/usr/src/cmd/ypcmd/Makefile +++ b/usr/src/cmd/ypcmd/Makefile @@ -141,6 +141,16 @@ INIS2LDAPPROG = $(NIS2LDAPPROG:%=$(NETYP)/%) NIS2LDAPINC = -I$(SRC)/lib/libnisdb/yptol +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-extra +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-address +CERRWARN += -_gcc=-Wno-unused-function + #conditional assignments ypalias.o := CPPFLAGS= -DMAIN $(CPPFLAGS.master) makedbm.o := CPPFLAGS= $(CPPFLAGS.master) diff --git a/usr/src/cmd/ypcmd/mknetid/Makefile b/usr/src/cmd/ypcmd/mknetid/Makefile index 97453b068e..e336bef421 100644 --- a/usr/src/cmd/ypcmd/mknetid/Makefile +++ b/usr/src/cmd/ypcmd/mknetid/Makefile @@ -23,8 +23,6 @@ # Copyright 1994, 2002 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG = mknetid @@ -35,6 +33,9 @@ LDLIBS += -lnsl OBJS = mknetid.o getname.o SRCS = $(OBJS:.o=.c) +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-function .KEEP_STATE: diff --git a/usr/src/cmd/ypcmd/revnetgroup/Makefile b/usr/src/cmd/ypcmd/revnetgroup/Makefile index 174fd0bee0..82a979b837 100644 --- a/usr/src/cmd/ypcmd/revnetgroup/Makefile +++ b/usr/src/cmd/ypcmd/revnetgroup/Makefile @@ -23,8 +23,6 @@ # Copyright 1996, 2002 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG = revnetgroup @@ -34,6 +32,10 @@ OBJS = revnetgroup.o getgroup.o table.o util.o SRCS = $(OBJS:.o=.c) HDRS = getgroup.h table.h util.h +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/ypcmd/yppasswd/Makefile b/usr/src/cmd/ypcmd/yppasswd/Makefile index 82fc4293dd..1906d7bcf7 100644 --- a/usr/src/cmd/ypcmd/yppasswd/Makefile +++ b/usr/src/cmd/ypcmd/yppasswd/Makefile @@ -56,6 +56,10 @@ INETYPPROG= $(NETYPPROG:%=$(NETYP)/%) COMMONOBJ = yppasswdxdr.o yplckpwdf.o RPCYPPASSWDDOBJ = yppasswdd.o changepasswd.o +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Objects shared between all the major components # diff --git a/usr/src/cmd/ypcmd/ypupdated/Makefile b/usr/src/cmd/ypcmd/ypupdated/Makefile index 7f7592c7f0..0fd7bf0e4c 100644 --- a/usr/src/cmd/ypcmd/ypupdated/Makefile +++ b/usr/src/cmd/ypcmd/ypupdated/Makefile @@ -52,6 +52,9 @@ OBJS = $(RPCYPUPDATEOBJ) SRCS = $(OBJS:%.o=%.c) +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-variable + #conditional assignments $(INETSVC) := FILEMODE=555 diff --git a/usr/src/cmd/zdb/Makefile.com b/usr/src/cmd/zdb/Makefile.com index 0f018b6d6a..353eb61018 100644 --- a/usr/src/cmd/zdb/Makefile.com +++ b/usr/src/cmd/zdb/Makefile.com @@ -45,6 +45,8 @@ CFLAGS += $(CCVERBOSE) CFLAGS64 += $(CCVERBOSE) CPPFLAGS += -D_LARGEFILE64_SOURCE=1 -D_REENTRANT $(INCS) -DDEBUG +CERRWARN += -_gcc=-Wno-uninitialized + # lint complains about unused _umem_* functions LINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2 LINTFLAGS64 += -xerroff=E_NAME_DEF_NOT_USED2 diff --git a/usr/src/cmd/zdb/zdb.c b/usr/src/cmd/zdb/zdb.c index d462d3f18e..28c7565c19 100644 --- a/usr/src/cmd/zdb/zdb.c +++ b/usr/src/cmd/zdb/zdb.c @@ -86,6 +86,7 @@ extern void dump_intent_log(zilog_t *); uint64_t *zopt_object = NULL; int zopt_objects = 0; libzfs_handle_t *g_zfs; +uint64_t max_inflight = 200; /* * These libumem hooks provide a reasonable set of defaults for the allocator's @@ -108,13 +109,14 @@ usage(void) { (void) fprintf(stderr, "Usage: %s [-CumdibcsDvhLXFPA] [-t txg] [-e [-p path...]] " - "poolname [object...]\n" - " %s [-divPA] [-e -p path...] dataset [object...]\n" - " %s -m [-LXFPA] [-t txg] [-e [-p path...]] " + "[-U config] [-M inflight I/Os] poolname [object...]\n" + " %s [-divPA] [-e -p path...] [-U config] dataset " + "[object...]\n" + " %s -m [-LXFPA] [-t txg] [-e [-p path...]] [-U config] " "poolname [vdev [metaslab...]]\n" " %s -R [-A] [-e [-p path...]] poolname " "vdev:offset:size[:flags]\n" - " %s -S [-PA] [-e [-p path...]] poolname\n" + " %s -S [-PA] [-e [-p path...]] [-U config] poolname\n" " %s -l [-uA] device\n" " %s -C [-A] [-U config]\n\n", cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, cmdname); @@ -161,6 +163,8 @@ usage(void) (void) fprintf(stderr, " -P print numbers in parseable form\n"); (void) fprintf(stderr, " -t <txg> -- highest txg to use when " "searching for uberblocks\n"); + (void) fprintf(stderr, " -M <number of inflight I/Os> -- " + "specify the maximum number of checksumming I/Os [default is 200]"); (void) fprintf(stderr, "Specify an option more than once (e.g. -bb) " "to make only that option verbose\n"); (void) fprintf(stderr, "Default is to dump everything non-verbosely\n"); @@ -2028,6 +2032,45 @@ zdb_count_block(zdb_cb_t *zcb, zilog_t *zilog, const blkptr_t *bp, bp, NULL, NULL, ZIO_FLAG_CANFAIL)), ==, 0); } +static void +zdb_blkptr_done(zio_t *zio) +{ + spa_t *spa = zio->io_spa; + blkptr_t *bp = zio->io_bp; + int ioerr = zio->io_error; + zdb_cb_t *zcb = zio->io_private; + zbookmark_t *zb = &zio->io_bookmark; + + zio_data_buf_free(zio->io_data, zio->io_size); + + mutex_enter(&spa->spa_scrub_lock); + spa->spa_scrub_inflight--; + cv_broadcast(&spa->spa_scrub_io_cv); + + if (ioerr && !(zio->io_flags & ZIO_FLAG_SPECULATIVE)) { + char blkbuf[BP_SPRINTF_LEN]; + + zcb->zcb_haderrors = 1; + zcb->zcb_errors[ioerr]++; + + if (dump_opt['b'] >= 2) + sprintf_blkptr(blkbuf, bp); + else + blkbuf[0] = '\0'; + + (void) printf("zdb_blkptr_cb: " + "Got error %d reading " + "<%llu, %llu, %lld, %llx> %s -- skipping\n", + ioerr, + (u_longlong_t)zb->zb_objset, + (u_longlong_t)zb->zb_object, + (u_longlong_t)zb->zb_level, + (u_longlong_t)zb->zb_blkid, + blkbuf); + } + mutex_exit(&spa->spa_scrub_lock); +} + /* ARGSUSED */ static int zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf, @@ -2049,39 +2092,23 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf, is_metadata = (BP_GET_LEVEL(bp) != 0 || DMU_OT_IS_METADATA(type)); if (dump_opt['c'] > 1 || (dump_opt['c'] && is_metadata)) { - int ioerr; size_t size = BP_GET_PSIZE(bp); - void *data = malloc(size); + void *data = zio_data_buf_alloc(size); int flags = ZIO_FLAG_CANFAIL | ZIO_FLAG_SCRUB | ZIO_FLAG_RAW; /* If it's an intent log block, failure is expected. */ if (zb->zb_level == ZB_ZIL_LEVEL) flags |= ZIO_FLAG_SPECULATIVE; - ioerr = zio_wait(zio_read(NULL, spa, bp, data, size, - NULL, NULL, ZIO_PRIORITY_ASYNC_READ, flags, zb)); - - free(data); + mutex_enter(&spa->spa_scrub_lock); + while (spa->spa_scrub_inflight > max_inflight) + cv_wait(&spa->spa_scrub_io_cv, &spa->spa_scrub_lock); + spa->spa_scrub_inflight++; + mutex_exit(&spa->spa_scrub_lock); - if (ioerr && !(flags & ZIO_FLAG_SPECULATIVE)) { - zcb->zcb_haderrors = 1; - zcb->zcb_errors[ioerr]++; + zio_nowait(zio_read(NULL, spa, bp, data, size, + zdb_blkptr_done, zcb, ZIO_PRIORITY_ASYNC_READ, flags, zb)); - if (dump_opt['b'] >= 2) - sprintf_blkptr(blkbuf, bp); - else - blkbuf[0] = '\0'; - - (void) printf("zdb_blkptr_cb: " - "Got error %d reading " - "<%llu, %llu, %lld, %llx> %s -- skipping\n", - ioerr, - (u_longlong_t)zb->zb_objset, - (u_longlong_t)zb->zb_object, - (u_longlong_t)zb->zb_level, - (u_longlong_t)zb->zb_blkid, - blkbuf); - } } zcb->zcb_readfails = 0; @@ -2283,6 +2310,18 @@ dump_block_stats(spa_t *spa) zcb.zcb_haderrors |= traverse_pool(spa, 0, flags, zdb_blkptr_cb, &zcb); + /* + * If we've traversed the data blocks then we need to wait for those + * I/Os to complete. We leverage "The Godfather" zio to wait on + * all async I/Os to complete. + */ + if (dump_opt['c']) { + (void) zio_wait(spa->spa_async_zio_root); + spa->spa_async_zio_root = zio_root(spa, NULL, NULL, + ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE | + ZIO_FLAG_GODFATHER); + } + if (zcb.zcb_haderrors) { (void) printf("\nError counts:\n\n"); (void) printf("\t%5s %s\n", "errno", "count"); @@ -3040,7 +3079,7 @@ main(int argc, char **argv) dprintf_setup(&argc, argv); - while ((c = getopt(argc, argv, "bcdhilmsuCDRSAFLXevp:t:U:P")) != -1) { + while ((c = getopt(argc, argv, "bcdhilmM:suCDRSAFLXevp:t:U:P")) != -1) { switch (c) { case 'b': case 'c': @@ -3069,6 +3108,15 @@ main(int argc, char **argv) case 'v': verbose++; break; + case 'M': + max_inflight = strtoull(optarg, NULL, 0); + if (max_inflight == 0) { + (void) fprintf(stderr, "maximum number " + "of inflight I/Os must be greater " + "than 0\n"); + usage(); + } + break; case 'p': if (searchdirs == NULL) { searchdirs = umem_alloc(sizeof (char *), diff --git a/usr/src/cmd/zfs/Makefile b/usr/src/cmd/zfs/Makefile index b117b1206e..3007b82213 100644 --- a/usr/src/cmd/zfs/Makefile +++ b/usr/src/cmd/zfs/Makefile @@ -53,6 +53,12 @@ $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG LINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2 LINTFLAGS64 += -xerroff=E_NAME_DEF_NOT_USED2 +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-old-style-declaration + ROOTUSRSBINLINKS = $(PROG:%=$(ROOTUSRSBIN)/%) USRLIBFSTYPELINKS = $(LINKPROGS:%=$(USRLIBFSTYPE)/%) ROOTETCFSTYPELINKS = $(LINKPROGS:%=$(ROOTETCFSTYPE)/%) diff --git a/usr/src/cmd/zfs/zfs_main.c b/usr/src/cmd/zfs/zfs_main.c index e34116d7ec..b32b5ab865 100644 --- a/usr/src/cmd/zfs/zfs_main.c +++ b/usr/src/cmd/zfs/zfs_main.c @@ -253,7 +253,7 @@ get_usage(zfs_help_t idx) case HELP_ROLLBACK: return (gettext("\trollback [-rRf] <snapshot>\n")); case HELP_SEND: - return (gettext("\tsend [-DnPpRrv] [-[iI] snapshot] " + return (gettext("\tsend [-DnPpRv] [-[iI] snapshot] " "<snapshot>\n")); case HELP_SET: return (gettext("\tset <property=value> " diff --git a/usr/src/cmd/zic/Makefile b/usr/src/cmd/zic/Makefile index 06cf5ba052..a2ffc86536 100644 --- a/usr/src/cmd/zic/Makefile +++ b/usr/src/cmd/zic/Makefile @@ -31,6 +31,9 @@ ROOTTZSRCD= $(ROOTSHLIB)/zoneinfo/src ROOTTZTABD= $(ROOTSHLIB)/zoneinfo/tab DIRS= $(ROOTTZSRCD) $(ROOTTZTABD) +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized + ROOTLIBTZSRCFILES= $(SRCFILES:%=$(ROOTTZSRCD)/%) ROOTLIBTZTABFILES= $(TABFILES:%=$(ROOTTZTABD)/%) ROOTKSHPROG= $(ROOTBIN)/$(KSHPROG) diff --git a/usr/src/cmd/zinject/Makefile.com b/usr/src/cmd/zinject/Makefile.com index c1ac4ac922..3a094ba196 100644 --- a/usr/src/cmd/zinject/Makefile.com +++ b/usr/src/cmd/zinject/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG:sh= cd ..; basename `pwd` OBJS= $(PROG).o translate.o @@ -41,6 +39,9 @@ C99LMODE= -Xc99=%all CPPFLAGS += -D_LARGEFILE64_SOURCE=1 -D_REENTRANT $(INCS) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/zinject/translate.c b/usr/src/cmd/zinject/translate.c index 87751e315e..53a38e1ea8 100644 --- a/usr/src/cmd/zinject/translate.c +++ b/usr/src/cmd/zinject/translate.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include <libzfs.h> @@ -472,6 +473,20 @@ translate_device(const char *pool, const char *device, err_type_t label_type, &record->zi_guid) == 0); } + /* + * Device faults can take on three different forms: + * 1). delayed or hanging I/O + * 2). zfs label faults + * 3). generic disk faults + */ + if (record->zi_timer != 0) { + record->zi_cmd = ZINJECT_DELAY_IO; + } else if (label_type != TYPE_INVAL) { + record->zi_cmd = ZINJECT_LABEL_FAULT; + } else { + record->zi_cmd = ZINJECT_DEVICE_FAULT; + } + switch (label_type) { case TYPE_LABEL_UBERBLOCK: record->zi_start = offsetof(vdev_label_t, vl_uberblock[0]); diff --git a/usr/src/cmd/zinject/zinject.c b/usr/src/cmd/zinject/zinject.c index aff2539a1b..b5c85b459f 100644 --- a/usr/src/cmd/zinject/zinject.c +++ b/usr/src/cmd/zinject/zinject.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ /* @@ -600,7 +601,7 @@ main(int argc, char **argv) } while ((c = getopt(argc, argv, - ":aA:b:d:f:Fg:qhIc:t:T:l:mr:s:e:uL:p:")) != -1) { + ":aA:b:d:D:f:Fg:qhIc:t:T:l:mr:s:e:uL:p:")) != -1) { switch (c) { case 'a': flags |= ZINJECT_FLUSH_ARC; @@ -626,6 +627,15 @@ main(int argc, char **argv) case 'd': device = optarg; break; + case 'D': + record.zi_timer = strtoull(optarg, &end, 10); + if (errno != 0 || *end != '\0') { + (void) fprintf(stderr, "invalid i/o delay " + "value: '%s'\n", optarg); + usage(); + return (1); + } + break; case 'e': if (strcasecmp(optarg, "io") == 0) { error = EIO; @@ -690,6 +700,7 @@ main(int argc, char **argv) case 'p': (void) strlcpy(record.zi_func, optarg, sizeof (record.zi_func)); + record.zi_cmd = ZINJECT_PANIC; break; case 'q': quiet = 1; @@ -763,13 +774,15 @@ main(int argc, char **argv) argc -= optind; argv += optind; + if (record.zi_duration != 0) + record.zi_cmd = ZINJECT_IGNORED_WRITES; + if (cancel != NULL) { /* * '-c' is invalid with any other options. */ if (raw != NULL || range != NULL || type != TYPE_INVAL || - level != 0 || record.zi_func[0] != '\0' || - record.zi_duration != 0) { + level != 0 || record.zi_cmd != ZINJECT_UNINITIALIZED) { (void) fprintf(stderr, "cancel (-c) incompatible with " "any other options\n"); usage(); @@ -801,8 +814,7 @@ main(int argc, char **argv) * for doing injection, so handle it separately here. */ if (raw != NULL || range != NULL || type != TYPE_INVAL || - level != 0 || record.zi_func[0] != '\0' || - record.zi_duration != 0) { + level != 0 || record.zi_cmd != ZINJECT_UNINITIALIZED) { (void) fprintf(stderr, "device (-d) incompatible with " "data error injection\n"); usage(); @@ -836,7 +848,7 @@ main(int argc, char **argv) } else if (raw != NULL) { if (range != NULL || type != TYPE_INVAL || level != 0 || - record.zi_func[0] != '\0' || record.zi_duration != 0) { + record.zi_cmd != ZINJECT_UNINITIALIZED) { (void) fprintf(stderr, "raw (-b) format with " "any other options\n"); usage(); @@ -859,13 +871,14 @@ main(int argc, char **argv) return (1); } + record.zi_cmd = ZINJECT_DATA_FAULT; if (translate_raw(raw, &record) != 0) return (1); if (!error) error = EIO; - } else if (record.zi_func[0] != '\0') { + } else if (record.zi_cmd == ZINJECT_PANIC) { if (raw != NULL || range != NULL || type != TYPE_INVAL || - level != 0 || device != NULL || record.zi_duration != 0) { + level != 0 || device != NULL) { (void) fprintf(stderr, "panic (-p) incompatible with " "other options\n"); usage(); @@ -883,7 +896,7 @@ main(int argc, char **argv) if (argv[1] != NULL) record.zi_type = atoi(argv[1]); dataset[0] = '\0'; - } else if (record.zi_duration != 0) { + } else if (record.zi_cmd == ZINJECT_IGNORED_WRITES) { if (nowrites == 0) { (void) fprintf(stderr, "-s or -g meaningless " "without -I (ignore writes)\n"); @@ -937,6 +950,7 @@ main(int argc, char **argv) return (1); } + record.zi_cmd = ZINJECT_DATA_FAULT; if (translate_record(type, argv[0], range, level, &record, pool, dataset) != 0) return (1); diff --git a/usr/src/cmd/zlogin/Makefile b/usr/src/cmd/zlogin/Makefile index e5c0c7db75..b498823b07 100644 --- a/usr/src/cmd/zlogin/Makefile +++ b/usr/src/cmd/zlogin/Makefile @@ -31,6 +31,8 @@ LDLIBS += -lsocket -lzonecfg -lcontract -lbrand -lsecdb CFLAGS += $(CCVERBOSE) FILEMODE = 0555 +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/zlook/Makefile.com b/usr/src/cmd/zlook/Makefile.com index 9afe89f00f..937842724d 100644 --- a/usr/src/cmd/zlook/Makefile.com +++ b/usr/src/cmd/zlook/Makefile.com @@ -34,6 +34,8 @@ CFLAGS += -g $(CCVERBOSE) CFLAGS64 += -g $(CCVERBOSE) CPPFLAGS += -D_LARGEFILE64_SOURCE=1 -D_REENTRANT $(INCS) +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/zoneadm/Makefile b/usr/src/cmd/zoneadm/Makefile index 30e91714d8..15cbf5c68e 100644 --- a/usr/src/cmd/zoneadm/Makefile +++ b/usr/src/cmd/zoneadm/Makefile @@ -41,6 +41,8 @@ POFILES= $(OBJS:%.o=%.po) LDLIBS += -lzonecfg -lsocket -lgen -lpool -lzfs -luuid -lnvpair -lbrand -ldladm -lsecdb +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(PROG) $(SCRIPTS) diff --git a/usr/src/cmd/zoneadmd/Makefile b/usr/src/cmd/zoneadmd/Makefile index 4c3c697a9d..fd2460664b 100644 --- a/usr/src/cmd/zoneadmd/Makefile +++ b/usr/src/cmd/zoneadmd/Makefile @@ -36,6 +36,14 @@ clean := TARGET = clean clobber := TARGET = clobber lint := TARGET = lint +CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + +LDLIBS += -lsocket -lzonecfg -lnsl -ldevinfo -ldevice -lnvpair \ + -lgen -lbsm -lcontract -lzfs -luuid -lbrand -ldladm -ltsnet -ltsol \ + -linetutil XGETFLAGS += -a -x zoneadmd.xcl ROOTUSRLIBZONES = $(ROOT)/usr/lib/zones diff --git a/usr/src/cmd/zonecfg/Makefile b/usr/src/cmd/zonecfg/Makefile index 5c824ce759..3efc6bb40b 100644 --- a/usr/src/cmd/zonecfg/Makefile +++ b/usr/src/cmd/zonecfg/Makefile @@ -41,6 +41,11 @@ CPPFLAGS += -I. LDFLAGS += $(MAPOPTS) CLEANFILES += zonecfg_lex.c zonecfg_grammar.tab.c zonecfg_grammar.tab.h +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-implicit-function-declaration + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/zonestat/zonestat/Makefile b/usr/src/cmd/zonestat/zonestat/Makefile index 2f4681b1ed..1caf1a8218 100644 --- a/usr/src/cmd/zonestat/zonestat/Makefile +++ b/usr/src/cmd/zonestat/zonestat/Makefile @@ -28,8 +28,10 @@ OBJS = $(SRCS:%.c=%.o) include ../../Makefile.cmd -LDLIBS += -lscf -lzonestat -lumem -LINTFLAGS += -u +LDLIBS += -lscf -lzonestat -lumem +LINTFLAGS += -u + +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/cmd/zonestat/zonestatd/Makefile b/usr/src/cmd/zonestat/zonestatd/Makefile index d8a13af002..833103e197 100644 --- a/usr/src/cmd/zonestat/zonestatd/Makefile +++ b/usr/src/cmd/zonestat/zonestatd/Makefile @@ -36,10 +36,14 @@ SRCS = zonestatd.c CPPFLAGS += -I$(ADJUNCT_PROTO)/usr/include/libxml2 LDLIBS += -lkstat -lpool -lexacct -lscf \ -lcontract -lcmdutils -lumem +CPPFLAGS += -I/usr/include/libxml2 -LINTFLAGS += -u +LINTFLAGS += -u +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized -OBJS = $(SRCS:%.c=%.o) +OBJS = $(SRCS:%.c=%.o) .KEEP_STATE: diff --git a/usr/src/cmd/zpool/Makefile b/usr/src/cmd/zpool/Makefile index 0bf7b02767..0c0132d075 100644 --- a/usr/src/cmd/zpool/Makefile +++ b/usr/src/cmd/zpool/Makefile @@ -48,6 +48,10 @@ $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG LINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2 LINTFLAGS64 += -xerroff=E_NAME_DEF_NOT_USED2 +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + ROOTUSRSBINLINKS = $(PROG:%=$(ROOTUSRSBIN)/%) .KEEP_STATE: diff --git a/usr/src/cmd/zpool/zpool_main.c b/usr/src/cmd/zpool/zpool_main.c index 8e6d6b337e..b2e3acdc3c 100644 --- a/usr/src/cmd/zpool/zpool_main.c +++ b/usr/src/cmd/zpool/zpool_main.c @@ -239,7 +239,7 @@ get_usage(zpool_help_t idx) { case HELP_REMOVE: return (gettext("\tremove <pool> <device> ...\n")); case HELP_REOPEN: - return (""); /* Undocumented command */ + return (gettext("\treopen <pool>\n")); case HELP_SCRUB: return (gettext("\tscrub [-s] <pool> ...\n")); case HELP_STATUS: @@ -3277,7 +3277,7 @@ zpool_do_split(int argc, char **argv) if (zpool_get_state(zhp) != POOL_STATE_UNAVAIL && zpool_enable_datasets(zhp, mntopts, 0) != 0) { ret = 1; - (void) fprintf(stderr, gettext("Split was succssful, but " + (void) fprintf(stderr, gettext("Split was successful, but " "the datasets could not all be mounted\n")); (void) fprintf(stderr, gettext("Try doing '%s' with a " "different altroot\n"), "zpool import"); @@ -3556,22 +3556,37 @@ zpool_do_reguid(int argc, char **argv) * zpool reopen <pool> * * Reopen the pool so that the kernel can update the sizes of all vdevs. - * - * NOTE: This command is currently undocumented. If the command is ever - * exposed then the appropriate usage() messages will need to be made. */ int zpool_do_reopen(int argc, char **argv) { + int c; int ret = 0; zpool_handle_t *zhp; char *pool; + /* check options */ + while ((c = getopt(argc, argv, "")) != -1) { + switch (c) { + case '?': + (void) fprintf(stderr, gettext("invalid option '%c'\n"), + optopt); + usage(B_FALSE); + } + } + argc--; argv++; - if (argc != 1) - return (2); + if (argc < 1) { + (void) fprintf(stderr, gettext("missing pool name\n")); + usage(B_FALSE); + } + + if (argc > 1) { + (void) fprintf(stderr, gettext("too many arguments\n")); + usage(B_FALSE); + } pool = argv[0]; if ((zhp = zpool_open_canfail(g_zfs, pool)) == NULL) diff --git a/usr/src/cmd/zstreamdump/Makefile b/usr/src/cmd/zstreamdump/Makefile index 26944be2fb..5b7e6b79c1 100644 --- a/usr/src/cmd/zstreamdump/Makefile +++ b/usr/src/cmd/zstreamdump/Makefile @@ -45,6 +45,8 @@ $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG LINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2 LINTFLAGS64 += -xerroff=E_NAME_DEF_NOT_USED2 +CERRWARN += -_gcc=-Wno-switch + .KEEP_STATE: .PARALLEL: diff --git a/usr/src/cmd/ztest/Makefile.com b/usr/src/cmd/ztest/Makefile.com index 0f308ab2e3..6126853ba0 100644 --- a/usr/src/cmd/ztest/Makefile.com +++ b/usr/src/cmd/ztest/Makefile.com @@ -46,6 +46,8 @@ CPPFLAGS += -D_LARGEFILE64_SOURCE=1 -D_REENTRANT $(INCS) -DDEBUG LINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2 LINTFLAGS64 += -xerroff=E_NAME_DEF_NOT_USED2 +CERRWARN += -_gcc=-Wno-switch + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/ztest/ztest.c b/usr/src/cmd/ztest/ztest.c index 95b8e2ed79..3da6723459 100644 --- a/usr/src/cmd/ztest/ztest.c +++ b/usr/src/cmd/ztest/ztest.c @@ -119,8 +119,8 @@ #include <sys/fs/zfs.h> #include <libnvpair.h> -#define ZTEST_FD_DATA 3 -#define ZTEST_FD_RAND 4 +static int ztest_fd_data = -1; +static int ztest_fd_rand = -1; typedef struct ztest_shared_hdr { uint64_t zh_hdr_size; @@ -708,14 +708,17 @@ process_options(int argc, char **argv) UINT64_MAX >> 2); if (strlen(altdir) > 0) { - char cmd[MAXNAMELEN]; - char realaltdir[MAXNAMELEN]; + char *cmd; + char *realaltdir; char *bin; char *ztest; char *isa; int isalen; - (void) realpath(getexecname(), cmd); + cmd = umem_alloc(MAXPATHLEN, UMEM_NOFAIL); + realaltdir = umem_alloc(MAXPATHLEN, UMEM_NOFAIL); + + VERIFY(NULL != realpath(getexecname(), cmd)); if (0 != access(altdir, F_OK)) { ztest_dump_core = B_FALSE; fatal(B_TRUE, "invalid alternate ztest path: %s", @@ -746,6 +749,9 @@ process_options(int argc, char **argv) fatal(B_TRUE, "invalid alternate lib directory %s", zo->zo_alt_libpath); } + + umem_free(cmd, MAXPATHLEN); + umem_free(realaltdir, MAXPATHLEN); } } @@ -762,10 +768,12 @@ ztest_random(uint64_t range) { uint64_t r; + ASSERT3S(ztest_fd_rand, >=, 0); + if (range == 0) return (0); - if (read(ZTEST_FD_RAND, &r, sizeof (r)) != sizeof (r)) + if (read(ztest_fd_rand, &r, sizeof (r)) != sizeof (r)) fatal(1, "short read from /dev/urandom"); return (r % range); @@ -4695,7 +4703,18 @@ ztest_fault_inject(ztest_ds_t *zd, uint64_t id) if (islog) (void) rw_unlock(&ztest_name_lock); } else { + /* + * Ideally we would like to be able to randomly + * call vdev_[on|off]line without holding locks + * to force unpredictable failures but the side + * effects of vdev_[on|off]line prevent us from + * doing so. We grab the ztest_vdev_lock here to + * prevent a race between injection testing and + * aux_vdev removal. + */ + VERIFY(mutex_lock(&ztest_vdev_lock) == 0); (void) vdev_online(spa, guid0, 0, NULL); + VERIFY(mutex_unlock(&ztest_vdev_lock) == 0); } } @@ -5650,20 +5669,16 @@ ztest_init(ztest_shared_t *zs) } static void -setup_fds(void) +setup_data_fd(void) { - int fd; - - char *tmp = tempnam(NULL, NULL); - fd = open(tmp, O_RDWR | O_CREAT, 0700); - ASSERT3U(fd, ==, ZTEST_FD_DATA); - (void) unlink(tmp); - free(tmp); + static char ztest_name_data[] = "/tmp/ztest.data.XXXXXX"; - fd = open("/dev/urandom", O_RDONLY); - ASSERT3U(fd, ==, ZTEST_FD_RAND); + ztest_fd_data = mkstemp(ztest_name_data); + ASSERT3S(ztest_fd_data, >=, 0); + (void) unlink(ztest_name_data); } + static int shared_data_size(ztest_shared_hdr_t *hdr) { @@ -5685,10 +5700,10 @@ setup_hdr(void) ztest_shared_hdr_t *hdr; hdr = (void *)mmap(0, P2ROUNDUP(sizeof (*hdr), getpagesize()), - PROT_READ | PROT_WRITE, MAP_SHARED, ZTEST_FD_DATA, 0); + PROT_READ | PROT_WRITE, MAP_SHARED, ztest_fd_data, 0); ASSERT(hdr != MAP_FAILED); - VERIFY3U(0, ==, ftruncate(ZTEST_FD_DATA, sizeof (ztest_shared_hdr_t))); + VERIFY3U(0, ==, ftruncate(ztest_fd_data, sizeof (ztest_shared_hdr_t))); hdr->zh_hdr_size = sizeof (ztest_shared_hdr_t); hdr->zh_opts_size = sizeof (ztest_shared_opts_t); @@ -5699,7 +5714,7 @@ setup_hdr(void) hdr->zh_ds_count = ztest_opts.zo_datasets; size = shared_data_size(hdr); - VERIFY3U(0, ==, ftruncate(ZTEST_FD_DATA, size)); + VERIFY3U(0, ==, ftruncate(ztest_fd_data, size)); (void) munmap((caddr_t)hdr, P2ROUNDUP(sizeof (*hdr), getpagesize())); } @@ -5712,14 +5727,14 @@ setup_data(void) uint8_t *buf; hdr = (void *)mmap(0, P2ROUNDUP(sizeof (*hdr), getpagesize()), - PROT_READ, MAP_SHARED, ZTEST_FD_DATA, 0); + PROT_READ, MAP_SHARED, ztest_fd_data, 0); ASSERT(hdr != MAP_FAILED); size = shared_data_size(hdr); (void) munmap((caddr_t)hdr, P2ROUNDUP(sizeof (*hdr), getpagesize())); hdr = ztest_shared_hdr = (void *)mmap(0, P2ROUNDUP(size, getpagesize()), - PROT_READ | PROT_WRITE, MAP_SHARED, ZTEST_FD_DATA, 0); + PROT_READ | PROT_WRITE, MAP_SHARED, ztest_fd_data, 0); ASSERT(hdr != MAP_FAILED); buf = (uint8_t *)hdr; @@ -5738,12 +5753,13 @@ exec_child(char *cmd, char *libpath, boolean_t ignorekill, int *statusp) { pid_t pid; int status; - char cmdbuf[MAXPATHLEN]; + char *cmdbuf = NULL; pid = fork(); if (cmd == NULL) { - (void) strlcpy(cmdbuf, getexecname(), sizeof (cmdbuf)); + cmdbuf = umem_alloc(MAXPATHLEN, UMEM_NOFAIL); + (void) strlcpy(cmdbuf, getexecname(), MAXPATHLEN); cmd = cmdbuf; } @@ -5752,9 +5768,16 @@ exec_child(char *cmd, char *libpath, boolean_t ignorekill, int *statusp) if (pid == 0) { /* child */ char *emptyargv[2] = { cmd, NULL }; + char fd_data_str[12]; struct rlimit rl = { 1024, 1024 }; (void) setrlimit(RLIMIT_NOFILE, &rl); + + (void) close(ztest_fd_rand); + VERIFY3U(11, >=, + snprintf(fd_data_str, 12, "%d", ztest_fd_data)); + VERIFY0(setenv("ZTEST_FD_DATA", fd_data_str, 1)); + (void) enable_extended_FILE_stdio(-1, -1); if (libpath != NULL) VERIFY(0 == setenv("LD_LIBRARY_PATH", libpath, 1)); @@ -5763,6 +5786,11 @@ exec_child(char *cmd, char *libpath, boolean_t ignorekill, int *statusp) fatal(B_TRUE, "exec failed: %s", cmd); } + if (cmdbuf != NULL) { + umem_free(cmdbuf, MAXPATHLEN); + cmd = NULL; + } + while (waitpid(pid, &status, 0) != pid) continue; if (statusp != NULL) @@ -5827,39 +5855,41 @@ main(int argc, char **argv) char timebuf[100]; char numbuf[6]; spa_t *spa; - char cmd[MAXNAMELEN]; + char *cmd; boolean_t hasalt; - - boolean_t ischild = (0 == lseek(ZTEST_FD_DATA, 0, SEEK_CUR)); - ASSERT(ischild || errno == EBADF); + char *fd_data_str = getenv("ZTEST_FD_DATA"); (void) setvbuf(stdout, NULL, _IOLBF, 0); dprintf_setup(&argc, argv); - if (!ischild) { + ztest_fd_rand = open("/dev/urandom", O_RDONLY); + ASSERT3S(ztest_fd_rand, >=, 0); + + if (!fd_data_str) { process_options(argc, argv); - setup_fds(); + setup_data_fd(); setup_hdr(); setup_data(); bcopy(&ztest_opts, ztest_shared_opts, sizeof (*ztest_shared_opts)); } else { + ztest_fd_data = atoi(fd_data_str); setup_data(); bcopy(ztest_shared_opts, &ztest_opts, sizeof (ztest_opts)); } ASSERT3U(ztest_opts.zo_datasets, ==, ztest_shared_hdr->zh_ds_count); /* Override location of zpool.cache */ - (void) asprintf((char **)&spa_config_path, "%s/zpool.cache", - ztest_opts.zo_dir); + VERIFY3U(asprintf((char **)&spa_config_path, "%s/zpool.cache", + ztest_opts.zo_dir), !=, -1); ztest_ds = umem_alloc(ztest_opts.zo_datasets * sizeof (ztest_ds_t), UMEM_NOFAIL); zs = ztest_shared; - if (ischild) { + if (fd_data_str) { metaslab_gang_bang = ztest_opts.zo_metaslab_gang_bang; metaslab_df_alloc_threshold = zs->zs_metaslab_df_alloc_threshold; @@ -5882,7 +5912,8 @@ main(int argc, char **argv) (u_longlong_t)ztest_opts.zo_time); } - (void) strlcpy(cmd, getexecname(), sizeof (cmd)); + cmd = umem_alloc(MAXNAMELEN, UMEM_NOFAIL); + (void) strlcpy(cmd, getexecname(), MAXNAMELEN); zs->zs_do_init = B_TRUE; if (strlen(ztest_opts.zo_alt_ztest) != 0) { @@ -6023,5 +6054,7 @@ main(int argc, char **argv) kills, iters - kills, (100.0 * kills) / MAX(1, iters)); } + umem_free(cmd, MAXNAMELEN); + return (0); } diff --git a/usr/src/common/saveargs/saveargs.c b/usr/src/common/saveargs/saveargs.c new file mode 100644 index 0000000000..c75d07e5b9 --- /dev/null +++ b/usr/src/common/saveargs/saveargs.c @@ -0,0 +1,268 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + + +/* + * The Sun Studio and GCC (patched for opensolaris/illumos) compilers + * implement a argument saving scheme on amd64 via the -Wu,save-args or + * options. When the option is specified, INTEGER type function arguments + * passed via registers will be saved on the stack immediately after %rbp, and + * will not be modified through out the life of the routine. + * + * +--------+ + * %rbp --> | %rbp | + * +--------+ + * -0x8(%rbp) | %rdi | + * +--------+ + * -0x10(%rbp) | %rsi | + * +--------+ + * -0x18(%rbp) | %rdx | + * +--------+ + * -0x20(%rbp) | %rcx | + * +--------+ + * -0x28(%rbp) | %r8 | + * +--------+ + * -0x30(%rbp) | %r9 | + * +--------+ + * + * + * For example, for the following function, + * + * void + * foo(int a1, int a2, int a3, int a4, int a5, int a6, int a7) + * { + * ... + * } + * + * Disassembled code will look something like the following: + * + * pushq %rbp + * movq %rsp, %rbp + * subq $imm8, %rsp ** + * movq %rdi, -0x8(%rbp) + * movq %rsi, -0x10(%rbp) + * movq %rdx, -0x18(%rbp) + * movq %rcx, -0x20(%rbp) + * movq %r8, -0x28(%rbp) + * movq %r9, -0x30(%rbp) + * ... + * or + * pushq %rbp + * movq %rsp, %rbp + * subq $imm8, %rsp ** + * movq %r9, -0x30(%rbp) + * movq %r8, -0x28(%rbp) + * movq %rcx, -0x20(%rbp) + * movq %rdx, -0x18(%rbp) + * movq %rsi, -0x10(%rbp) + * movq %rdi, -0x8(%rbp) + * ... + * or + * pushq %rbp + * movq %rsp, %rbp + * pushq %rdi + * pushq %rsi + * pushq %rdx + * pushq %rcx + * pushq %r8 + * pushq %r9 + * + * **: The space being reserved is in addition to what the current + * function prolog already reserves. + * + * We loop through the first SAVEARGS_INSN_SEQ_LEN bytes of the function + * looking for each argument saving instruction we would expect to see. We + * loop byte-by-byte, rather than doing anything smart about insn lengths, + * only deviating from this when we know we have our insn, and can skip the + * rest of it. + * + * If there are odd number of arguments to a function, additional space is + * reserved on the stack to maintain 16-byte alignment. For example, + * + * argc == 0: no argument saving. + * argc == 3: save 3, but space for 4 is reserved + * argc == 7: save 6. + */ + +#include <sys/sysmacros.h> +#include <sys/types.h> +#include <saveargs.h> + +/* + * Size of the instruction sequence arrays. It should correspond to + * the maximum number of arguments passed via registers. + */ +#define INSTR_ARRAY_SIZE 6 + +#define INSTR1(ins, off) (ins[(off)]) +#define INSTR2(ins, off) (ins[(off)] + (ins[(off) + 1] << 8)) +#define INSTR3(ins, off) \ + (ins[(off)] + (ins[(off) + 1] << 8) + (ins[(off + 2)] << 16)) +#define INSTR4(ins, off) \ + (ins[(off)] + (ins[(off) + 1] << 8) + (ins[(off + 2)] << 16) + \ + (ins[(off) + 3] << 24)) + +/* + * Sun Studio 10 patch implementation saves %rdi first; + * GCC 3.4.3 Sun branch implementation saves them in reverse order. + */ +static const uint32_t save_instr[INSTR_ARRAY_SIZE] = { + 0xf87d8948, /* movq %rdi, -0x8(%rbp) */ + 0xf0758948, /* movq %rsi, -0x10(%rbp) */ + 0xe8558948, /* movq %rdx, -0x18(%rbp) */ + 0xe04d8948, /* movq %rcx, -0x20(%rbp) */ + 0xd845894c, /* movq %r8, -0x28(%rbp) */ + 0xd04d894c /* movq %r9, -0x30(%rbp) */ +}; + +static const uint16_t save_instr_push[] = { + 0x57, /* pushq %rdi */ + 0x56, /* pushq %rsi */ + 0x52, /* pushq %rdx */ + 0x51, /* pushq %rcx */ + 0x5041, /* pushq %r8 */ + 0x5141 /* pushq %r9 */ +}; + +/* + * If the return type of a function is a structure greater than 16 bytes in + * size, %rdi will contain the address to which it should be stored, and + * arguments will begin at %rsi. Studio will push all of the normal argument + * registers anyway, GCC will start pushing at %rsi, so we need a separate + * pattern. + */ +static const uint32_t save_instr_sr[INSTR_ARRAY_SIZE-1] = { + 0xf8758948, /* movq %rsi,-0x8(%rbp) */ + 0xf0558948, /* movq %rdx,-0x10(%rbp) */ + 0xe84d8948, /* movq %rcx,-0x18(%rbp) */ + 0xe045894c, /* movq %r8,-0x20(%rbp) */ + 0xd84d894c /* movq %r9,-0x28(%rbp) */ +}; + +static const uint8_t save_fp_pushes[] = { + 0x55, /* pushq %rbp */ + 0xcc /* int $0x3 */ +}; +#define NUM_FP_PUSHES (sizeof (save_fp_pushes) / sizeof (save_fp_pushes[0])) + +static const uint32_t save_fp_movs[] = { + 0x00e58948, /* movq %rsp,%rbp, encoding 1 */ + 0x00ec8b48, /* movq %rsp,%rbp, encoding 2 */ +}; +#define NUM_FP_MOVS (sizeof (save_fp_movs) / sizeof (save_fp_movs[0])) + +static int +has_saved_fp(uint8_t *ins, int size) +{ + int i, j; + uint32_t n; + int found_push = 0; + + for (i = 0; i < size; i++) { + if (found_push == 0) { + n = INSTR1(ins, i); + for (j = 0; j <= NUM_FP_PUSHES; j++) + if (save_fp_pushes[j] == n) { + found_push = 1; + break; + } + } else { + n = INSTR3(ins, i); + for (j = 0; j <= NUM_FP_MOVS; j++) + if (save_fp_movs[j] == n) + return (1); + } + } + + return (0); +} + +int +saveargs_has_args(uint8_t *ins, size_t size, uint_t argc, int start_index) +{ + int i, j; + uint32_t n; + + argc = MIN((start_index + argc), INSTR_ARRAY_SIZE); + + if (!has_saved_fp(ins, size)) + return (SAVEARGS_NO_ARGS); + + /* + * Compare against Sun Studio implementation + */ + for (i = 4, j = 0; i <= size - 4; i++) { + n = INSTR4(ins, i); + + if (n == save_instr[j]) { + i += 3; + if (++j >= argc) + return (start_index ? SAVEARGS_STRUCT_ARGS : + SAVEARGS_TRAD_ARGS); + } + } + + /* + * Compare against GCC implementation + */ + for (i = 4, j = argc - 1; i <= size - 4; i++) { + n = INSTR4(ins, i); + + if (n == save_instr[j]) { + i += 3; + if (--j < start_index) + return (SAVEARGS_TRAD_ARGS); + } + } + + /* + * Compare against GCC push-based implementation + */ + for (i = 4, j = start_index; i <= size - 2; i += 1) { + n = (i >= (8 - start_index)) ? INSTR2(ins, i) : INSTR1(ins, i); + + if (n == save_instr_push[j]) { + if (i >= (8 - start_index)) + i += 1; + if (++j >= argc) + return (SAVEARGS_TRAD_ARGS); + } + } + + /* Look for a GCC-style returned structure */ + if (start_index != 0) { + for (i = 4, j = argc - 2; i <= size - 4; i++) { + n = INSTR4(ins, i); + + if (n == save_instr_sr[j]) { + i += 3; + if (--j >= (argc - 1)) + return (SAVEARGS_TRAD_ARGS); + } + } + } + + return (SAVEARGS_NO_ARGS); +} diff --git a/usr/src/common/saveargs/saveargs.h b/usr/src/common/saveargs/saveargs.h new file mode 100644 index 0000000000..c20707d615 --- /dev/null +++ b/usr/src/common/saveargs/saveargs.h @@ -0,0 +1,52 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _SAVEARGS_H +#define _SAVEARGS_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include <sys/types.h> + +/* + * The longest instruction sequence in bytes before all 6 arguments are + * saved on the stack. This value depends on compiler implementation, + * therefore it should be examined periodically to guarantee accuracy. + */ +#define SAVEARGS_INSN_SEQ_LEN 256 + +#define SAVEARGS_NO_ARGS 0 /* no saved arguments */ +#define SAVEARGS_TRAD_ARGS 1 /* traditionally located arguments */ +#define SAVEARGS_STRUCT_ARGS 2 /* struct return addr pushed as arg0 */ + +int saveargs_has_args(uint8_t *, size_t, uint_t, int); + +#ifdef __cplusplus +} +#endif + +#endif /* _SAVEARGS_H */ diff --git a/usr/src/common/saveargs/tests/README b/usr/src/common/saveargs/tests/README new file mode 100644 index 0000000000..d97be601f6 --- /dev/null +++ b/usr/src/common/saveargs/tests/README @@ -0,0 +1,9 @@ +testmatch: + + A stub program that tests the saveargs matcher against a variety of + function prologues (assembled from data.s) + +functional: + + Actually test the full chunk of the (libproc) side of the code, running + pstack on the range of test apps. diff --git a/usr/src/common/saveargs/tests/functional/Makefile b/usr/src/common/saveargs/tests/functional/Makefile new file mode 100644 index 0000000000..d8810eb49a --- /dev/null +++ b/usr/src/common/saveargs/tests/functional/Makefile @@ -0,0 +1,45 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright 2012, Richard Lowe. +# + +include $(SRC)/Makefile.master +include $(SRC)/Makefile.master.64 + +.KEEP_STATE: + +PROGS = align \ + basic \ + big-struct-ret \ + big-struct-ret-and-spill \ + small-struct-ret \ + small-struct-ret-and-spill \ + stack-spill + +CFLAGS += $(CTF_FLAGS) +CFLAGS64 += $(CTF_FLAGS) + +%: %.c + $(LINK.c) -o $@ $< -lc + $(CTFCONVERT) -L VERSION $@ + +all: $(PROGS) + +install: all + +clean: + $(RM) $(PROGS) + +clobber: clean + +FRC: diff --git a/usr/src/common/saveargs/tests/functional/align.c b/usr/src/common/saveargs/tests/functional/align.c new file mode 100644 index 0000000000..731ca5eccb --- /dev/null +++ b/usr/src/common/saveargs/tests/functional/align.c @@ -0,0 +1,32 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2012, Richard Lowe. + */ + +#include <stdio.h> +#include <unistd.h> + +int +test(long a, long b, long c, long d, long e) +{ + printf("%ld %ld %ld %ld %ld\n", a, b, c, d, e); + for (;;) + sleep(60); +} + +int +main(int argc, char **argv) +{ + test(1, 2, 3, 4, 5); + return (0); +} diff --git a/usr/src/common/saveargs/tests/functional/basic.c b/usr/src/common/saveargs/tests/functional/basic.c new file mode 100644 index 0000000000..4a6a3819a6 --- /dev/null +++ b/usr/src/common/saveargs/tests/functional/basic.c @@ -0,0 +1,32 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2012, Richard Lowe. + */ + +#include <stdio.h> +#include <unistd.h> + +int +test(long a, long b, long c, long d) +{ + printf("%ld %ld %ld %ld\n", a, b, c, d); + for (;;) + sleep(60); +} + +int +main(int argc, char **argv) +{ + test(1, 2, 3, 4); + return (0); +} diff --git a/usr/src/common/saveargs/tests/functional/big-struct-ret-and-spill.c b/usr/src/common/saveargs/tests/functional/big-struct-ret-and-spill.c new file mode 100644 index 0000000000..4823346299 --- /dev/null +++ b/usr/src/common/saveargs/tests/functional/big-struct-ret-and-spill.c @@ -0,0 +1,38 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2012, Richard Lowe. + */ + +#include <stdio.h> +#include <unistd.h> + +struct foo { + long a; + long b; + long c; +}; + +struct foo +test(long a, long b, long c, long d, long e, long f, long g, long h) +{ + printf("%ld %ld %ld %ld %ld %ld %ld %ld\n", a, b, c, d, e, f, g, h); + for (;;) + sleep(60); +} + +int +main(int argc, char **argv) +{ + test(1, 2, 3, 4, 5, 6, 7, 8); + return (0); +} diff --git a/usr/src/common/saveargs/tests/functional/big-struct-ret.c b/usr/src/common/saveargs/tests/functional/big-struct-ret.c new file mode 100644 index 0000000000..0953622f0d --- /dev/null +++ b/usr/src/common/saveargs/tests/functional/big-struct-ret.c @@ -0,0 +1,38 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2012, Richard Lowe. + */ + +#include <stdio.h> +#include <unistd.h> + +struct foo { + long a; + long b; + long c; +}; + +struct foo +test(long a, long b, long c, long d) +{ + printf("%ld %ld %ld %ld\n", a, b, c, d); + for (;;) + sleep(60); +} + +int +main(int argc, char **argv) +{ + test(1, 2, 3, 4); + return (0); +} diff --git a/usr/src/common/saveargs/tests/functional/small-struct-ret-and-spill.c b/usr/src/common/saveargs/tests/functional/small-struct-ret-and-spill.c new file mode 100644 index 0000000000..6cbc0cde47 --- /dev/null +++ b/usr/src/common/saveargs/tests/functional/small-struct-ret-and-spill.c @@ -0,0 +1,37 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2012, Richard Lowe. + */ + +#include <stdio.h> +#include <unistd.h> + +struct foo { + long a; + long b; +}; + +struct foo +test(long a, long b, long c, long d, long e, long f, long g, long h) +{ + printf("%ld %ld %ld %ld %ld %ld %ld %ld\n", a, b, c, d, e, f, g, h); + for (;;) + sleep(60); +} + +int +main(int argc, char **argv) +{ + test(1, 2, 3, 4, 5, 6, 7, 8); + return (0); +} diff --git a/usr/src/common/saveargs/tests/functional/small-struct-ret.c b/usr/src/common/saveargs/tests/functional/small-struct-ret.c new file mode 100644 index 0000000000..3731365f11 --- /dev/null +++ b/usr/src/common/saveargs/tests/functional/small-struct-ret.c @@ -0,0 +1,37 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2012, Richard Lowe. + */ + +#include <stdio.h> +#include <unistd.h> + +struct foo { + long a; + long b; +}; + +struct foo +test(long a, long b, long c, long d) +{ + printf("%ld %ld %ld %ld\n", a, b, c, d); + for (;;) + sleep(60); +} + +int +main(int argc, char **argv) +{ + test(1, 2, 3, 4); + return (0); +} diff --git a/usr/src/common/saveargs/tests/functional/stack-spill.c b/usr/src/common/saveargs/tests/functional/stack-spill.c new file mode 100644 index 0000000000..4324d60c27 --- /dev/null +++ b/usr/src/common/saveargs/tests/functional/stack-spill.c @@ -0,0 +1,32 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2012, Richard Lowe. + */ + +#include <stdio.h> +#include <unistd.h> + +int +test(long a, long b, long c, long d, long e, long f, long g, long h) +{ + printf("%ld %ld %ld %ld %ld %ld %ld %ld\n", a, b, c, d, e, f, g, h); + for (;;) + sleep(60); +} + +int +main(int argc, char **argv) +{ + test(1, 2, 3, 4, 5, 6, 7, 8); + return (0); +} diff --git a/usr/src/common/saveargs/tests/functional/test.sh b/usr/src/common/saveargs/tests/functional/test.sh new file mode 100644 index 0000000000..dea1059b2c --- /dev/null +++ b/usr/src/common/saveargs/tests/functional/test.sh @@ -0,0 +1,37 @@ +#! /usr/bin/ksh +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright 2012, Richard Lowe. +# + +function tester { + prog=${1} + pattern=${2} + + ./$prog >/dev/null & + pid=$! + if (/usr/bin/amd64/pstack $pid | /usr/xpg4/bin/grep -q "${pattern}"); then + echo "pass: ${prog}" + else + echo "FAIL: ${prog}" + fi + kill $pid +} + +tester align "test (1, 2, 3, 4, 5)" +tester basic "test (1, 2, 3, 4)" +tester big-struct-ret "test (1, 2, 3, 4)" +tester big-struct-ret-and-spill "test (1, 2, 3, 4, 5, 6, 7, 8)" +tester small-struct-ret "test (1, 2, 3, 4)" +tester small-struct-ret-and-spill "test (1, 2, 3, 4, 5, 6, 7, 8)" +tester stack-spill "test (1, 2, 3, 4, 5, 6, 7, 8)" diff --git a/usr/src/common/saveargs/tests/testmatch/Makefile b/usr/src/common/saveargs/tests/testmatch/Makefile new file mode 100644 index 0000000000..2277b64c60 --- /dev/null +++ b/usr/src/common/saveargs/tests/testmatch/Makefile @@ -0,0 +1,41 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright 2012, Richard Lowe. +# + +include $(SRC)/Makefile.master +include $(SRC)/Makefile.master.64 + +.KEEP_STATE: + +OBJECTS = testmatch.o saveargs.o data.o +PROG = testmatch + +CPPFLAGS += -I$(SRC)/common/saveargs +ASFLAGS += -P +AS_CPPFLAGS += -D_ASM + +%.o: $(SRC)/common/saveargs/%.c + $(COMPILE.c) -o $@ $< + +$(PROG): $(OBJECTS) + $(LINK.c) -o $@ $(OBJECTS) -lc + +clean: + $(RM) $(OBJECTS) $(PROG) + +clobber: clean + +all: $(PROG) + +install: all diff --git a/usr/src/common/saveargs/tests/testmatch/data.s b/usr/src/common/saveargs/tests/testmatch/data.s new file mode 100644 index 0000000000..4d2660b24a --- /dev/null +++ b/usr/src/common/saveargs/tests/testmatch/data.s @@ -0,0 +1,396 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2012, Richard Lowe. + */ + +#define FUNC(x) \ + .text; \ + .align 16; \ + .globl x; \ + .type x, @function; \ +x: + +#define SET_SIZE(x, x_size) \ + .size x, [.-x]; \ + .globl x_size; \ + .type x_size, @object; \ +x_size: + +/* + * Extracted versions of the functional tests + * + * Named of the form <compiler>-<prologue style>-<nature of test> + * basic -- A regular function + * align -- odd number of arguments needing save-area + * alignment + * big-struct-ret -- returns a > 16byte structure by value + * big-struct-ret-and-spill -- returns a > 16byte structure by value and + * spills args to the stack + * small-struct-ret -- returns a < 16byte structure by value + * small-struct-ret-and-spill -- returns a < 16byte structure by value and + * spills args to the stack + * stack-spill -- spills arguments to the stack + */ +FUNC(gcc_mov_align) +pushq %rbp +movq %rsp, %rbp +movq %rbx, -0x38(%rbp) +movq %r8, -0x28(%rbp) +movq %rcx, -0x20(%rbp) +movq %rdx, -0x18(%rbp) +movq %rsi, -0x10(%rbp) +movq %rdi, -0x8(%rbp) +subq $0x70, %rsp +SET_SIZE(gcc_mov_align, gcc_mov_align_end) + +FUNC(gcc_mov_basic) +pushq %rbp +movq %rsp, %rbp +movq %rbx,-0x28(%rbp) +movq %rcx,-0x20(%rbp) +movq %rdx,-0x18(%rbp) +movq %rsi,-0x10(%rbp) +movq %rdi,-0x8(%rbp) +subq $0x50,%rsp +SET_SIZE(gcc_mov_basic, gcc_mov_basic_end) + +FUNC(gcc_mov_big_struct_ret) +pushq %rbp +movq %rsp,%rbp +movq %rbx,-0x28(%rbp) +movq %r8,-0x20(%rbp) +movq %rcx,-0x18(%rbp) +movq %rdx,-0x10(%rbp) +movq %rsi,-0x8(%rbp) +subq $0x50,%rsp +SET_SIZE(gcc_mov_big_struct_ret, gcc_mov_big_struct_ret_end) + +FUNC(gcc_mov_big_struct_ret_and_spill) +pushq %rbp +movq %rsp,%rbp +movq %rbx,-0x38(%rbp) +movq %r9,-0x28(%rbp) +movq %r8,-0x20(%rbp) +movq %rcx,-0x18(%rbp) +movq %rdx,-0x10(%rbp) +movq %rsi,-0x8(%rbp) +subq $0x90,%rsp +SET_SIZE(gcc_mov_big_struct_ret_and_spill, gcc_mov_big_struct_ret_and_spill_end) + +FUNC(gcc_mov_small_struct_ret) +pushq %rbp +movq %rsp,%rbp +movq %rbx,-0x28(%rbp) +movq %rcx,-0x20(%rbp) +movq %rdx,-0x18(%rbp) +movq %rsi,-0x10(%rbp) +movq %rdi,-0x8(%rbp) +subq $0x50,%rsp +SET_SIZE(gcc_mov_small_struct_ret, gcc_mov_small_struct_ret_end) + +FUNC(gcc_mov_small_struct_ret_and_spill) +pushq %rbp +movq %rsp,%rbp +movq %rbx,-0x38(%rbp) +movq %r9,-0x30(%rbp) +movq %r8,-0x28(%rbp) +movq %rcx,-0x20(%rbp) +movq %rdx,-0x18(%rbp) +movq %rsi,-0x10(%rbp) +movq %rdi,-0x8(%rbp) +subq $0x90,%rsp +SET_SIZE(gcc_mov_small_struct_ret_and_spill, gcc_mov_small_struct_ret_and_spill_end) + +FUNC(gcc_mov_stack_spill) +pushq %rbp +movq %rsp,%rbp +movq %rbx,-0x38(%rbp) +movq %r9,-0x30(%rbp) +movq %r8,-0x28(%rbp) +movq %rcx,-0x20(%rbp) +movq %rdx,-0x18(%rbp) +movq %rsi,-0x10(%rbp) +movq %rdi,-0x8(%rbp) +subq $0x90,%rsp +SET_SIZE(gcc_mov_stack_spill, gcc_mov_stack_spill_end) + +FUNC(gcc_push_align) +pushq %rbp +movq %rsp,%rbp +pushq %rdi +pushq %rsi +pushq %rdx +pushq %rcx +pushq %r8 +subq $0x8,%rsp +subq $0x30,%rsp +SET_SIZE(gcc_push_align, gcc_push_align_end) + +FUNC(gcc_push_basic) +pushq %rbp +movq %rsp,%rbp +pushq %rdi +pushq %rsi +pushq %rdx +pushq %rcx +subq $0x20,%rsp +SET_SIZE(gcc_push_basic, gcc_push_basic_end) + +FUNC(gcc_push_big_struct_ret) +pushq %rbp +movq %rsp,%rbp +pushq %rsi +pushq %rdx +pushq %rcx +pushq %r8 +subq $0x30,%rsp +SET_SIZE(gcc_push_big_struct_ret, gcc_push_big_struct_ret_end) + +FUNC(gcc_push_big_struct_ret_and_spill) +pushq %rbp +movq %rsp,%rbp +pushq %rsi +pushq %rdx +pushq %rcx +pushq %r8 +pushq %r9 +subq $0x8,%rsp +subq $0x50,%rsp +SET_SIZE(gcc_push_big_struct_ret_and_spill, gcc_push_big_struct_ret_and_spill_end) + +FUNC(gcc_push_small_struct_ret) +pushq %rbp +movq %rsp,%rbp +pushq %rdi +pushq %rsi +pushq %rdx +pushq %rcx +subq $0x20,%rsp +SET_SIZE(gcc_push_small_struct_ret, gcc_push_small_struct_ret_end) + +FUNC(gcc_push_small_struct_ret_and_spill) +pushq %rbp +movq %rsp,%rbp +pushq %rdi +pushq %rsi +pushq %rdx +pushq %rcx +pushq %r8 +pushq %r9 +subq $0x50,%rsp +SET_SIZE(gcc_push_small_struct_ret_and_spill, gcc_push_small_struct_ret_and_spill_end) + +FUNC(gcc_push_stack_spill) +pushq %rbp +movq %rsp,%rbp +pushq %rdi +pushq %rsi +pushq %rdx +pushq %rcx +pushq %r8 +pushq %r9 +subq $0x50,%rsp +SET_SIZE(gcc_push_stack_spill, gcc_push_stack_spill_end) + +FUNC(ss_mov_align) +pushq %rbp +movq %rsp,%rbp +subq $0x30,%rsp +movq %rdi,-0x8(%rbp) +movq %rsi,-0x10(%rbp) +movq %rdx,-0x18(%rbp) +movq %rcx,-0x20(%rbp) +movq %r8,-0x28(%rbp) +SET_SIZE(ss_mov_align, ss_mov_align_end) + +FUNC(ss_mov_basic) +pushq %rbp +movq %rsp,%rbp +subq $0x20,%rsp +movq %rdi,-0x8(%rbp) +movq %rsi,-0x10(%rbp) +movq %rdx,-0x18(%rbp) +movq %rcx,-0x20(%rbp) +SET_SIZE(ss_mov_basic, ss_mov_basic_end) + +FUNC(ss_mov_big_struct_ret) +pushq %rbp +movq %rsp,%rbp +subq $0x30,%rsp +movq %rdi,-0x8(%rbp) +movq %rsi,-0x10(%rbp) +movq %rdx,-0x18(%rbp) +movq %rcx,-0x20(%rbp) +movq %r8,-0x28(%rbp) +SET_SIZE(ss_mov_big_struct_ret, ss_mov_big_struct_ret_end) + +FUNC(ss_mov_big_struct_ret_and_spill) +pushq %rbp +movq %rsp,%rbp +subq $0x50,%rsp +movq %rdi,-0x8(%rbp) +movq %rsi,-0x10(%rbp) +movq %rdx,-0x18(%rbp) +movq %rcx,-0x20(%rbp) +movq %r8,-0x28(%rbp) +movq %r9,-0x30(%rbp) +SET_SIZE(ss_mov_big_struct_ret_and_spill, ss_mov_big_struct_ret_and_spill_end) + +FUNC(ss_mov_small_struct_ret) +pushq %rbp +movq %rsp,%rbp +subq $0x20,%rsp +movq %rdi,-0x8(%rbp) +movq %rsi,-0x10(%rbp) +movq %rdx,-0x18(%rbp) +movq %rcx,-0x20(%rbp) +SET_SIZE(ss_mov_small_struct_ret, ss_mov_small_struct_ret_end) + +FUNC(ss_mov_small_struct_ret_and_spill) +pushq %rbp +movq %rsp,%rbp +subq $0x50,%rsp +movq %rdi,-0x8(%rbp) +movq %rsi,-0x10(%rbp) +movq %rdx,-0x18(%rbp) +movq %rcx,-0x20(%rbp) +movq %r8,-0x28(%rbp) +movq %r9,-0x30(%rbp) +SET_SIZE(ss_mov_small_struct_ret_and_spill, ss_mov_small_struct_ret_and_spill_end) + +FUNC(ss_mov_stack_spill) +pushq %rbp +movq %rsp,%rbp +subq $0x50,%rsp +movq %rdi,-0x8(%rbp) +movq %rsi,-0x10(%rbp) +movq %rdx,-0x18(%rbp) +movq %rcx,-0x20(%rbp) +movq %r8,-0x28(%rbp) +movq %r9,-0x30(%rbp) +SET_SIZE(ss_mov_stack_spill, ss_mov_stack_spill_end) + +/* DTrace instrumentation */ +FUNC(dtrace_instrumented) +int $0x3 +movq %rsp, %rbp +movq %rbx,-0x28(%rbp) +movq %rcx,-0x20(%rbp) +movq %rdx,-0x18(%rbp) +movq %rsi,-0x10(%rbp) +movq %rdi,-0x8(%rbp) +subq $0x50,%rsp +SET_SIZE(dtrace_instrumented, dtrace_instrumented_end) + +/* + * System functions with special characteristics, be they non-initial FP save, + * gaps between FP save and argument saving, or gaps between saved arguments. + */ +FUNC(kmem_alloc) +leaq -0x1(%rdi),%rax +pushq %rbp +movq %rax,%rdx +movq %rsp,%rbp +subq $0x30,%rsp +shrq $0x3,%rdx +movq %r12,-0x28(%rbp) +movq %rbx,-0x30(%rbp) +cmpq $0x1ff,%rdx +movq %r13,-0x20(%rbp) +movq %r14,-0x18(%rbp) +movq %rsi,-0x10(%rbp) +movq %rdi,-0x8(%rbp) +movq %rdi,%r12 +SET_SIZE(kmem_alloc, kmem_alloc_end) + +FUNC(uts_kill) +pushq %rbp +movq %rsp,%rbp +subq $0x50,%rsp +movq %rbx,-0x28(%rbp) +leaq -0x50(%rbp),%rbx +movq %r12,-0x20(%rbp) +movq %r13,-0x18(%rbp) +movq %rsi,-0x10(%rbp) +movl %edi,%r12d +movq %rdi,-0x8(%rbp) +SET_SIZE(uts_kill, uts_kill_end) + +FUNC(av1394_ic_bitreverse) +movq %rdi,%rdx +movq $0x5555555555555555,%rax +movq $0x3333333333333333,%rcx +shrq $0x1,%rdx +pushq %rbp +andq %rax,%rdx +andq %rdi,%rax +addq %rax,%rax +movq %rsp,%rbp +subq $0x10,%rsp +orq %rdx,%rax +movq %rdi,-0x8(%rbp) +SET_SIZE(av1394_ic_bitreverse, av1394_ic_bitreverse_end) + +/* Problematic functions which should not match */ + +FUNC(no_fp) /* No frame pointer */ +movq %rdi, %rsi +movq %rsi, %rdi +movq %rbx,-0x28(%rbp) +movq %rcx,-0x20(%rbp) +movq %rdx,-0x18(%rbp) +movq %rsi,-0x10(%rbp) +movq %rdi,-0x8(%rbp) +subq $0x50,%rsp +SET_SIZE(no_fp, no_fp_end) + +/* Small structure return, but with an SSE type (thus forcing it to the stack) */ +FUNC(small_struct_ret_w_float) +pushq %rbp +movq %rsp,%rbp +movq %rdi,-0x8(%rbp) +subq $0x30,%rsp +SET_SIZE(small_struct_ret_w_float, small_struct_ret_w_float_end) + +/* Big structure return, but with an SSE type */ +FUNC(big_struct_ret_w_float) +pushq %rbp +movq %rsp,%rbp +movq %rsi,-0x8(%rbp) +subq $0x50,%rsp +movq %rsi,-0x48(%rbp) +movq -0x48(%rbp),%rax +movq %rax,%rsi +movl $0x400f60,%edi +movl $0x0,%eax +movl $0x1770,%edi +movl $0x0,%eax +leave +ret +SET_SIZE(big_struct_ret_w_float, big_struct_ret_w_float_end) + +FUNC(big_struct_arg_by_value) +pushq %rbp +movq %rsp,%rbp +movq %rdi,-0x8(%rbp) +subq $0x40,%rsp +SET_SIZE(big_struct_arg_by_value, big_struct_arg_by_value_end) + +FUNC(small_struct_arg_by_value) +pushq %rbp +movq %rsp,%rbp +movq %rdx,-0x18(%rbp) +movq %rsi,-0x10(%rbp) +movq %rdi,-0x8(%rbp) +subq $0x50,%rsp +SET_SIZE(small_struct_arg_by_value, small_struct_arg_by_value_end) diff --git a/usr/src/common/saveargs/tests/testmatch/testmatch.c b/usr/src/common/saveargs/tests/testmatch/testmatch.c new file mode 100644 index 0000000000..b670a67bbd --- /dev/null +++ b/usr/src/common/saveargs/tests/testmatch/testmatch.c @@ -0,0 +1,137 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2012, Richard Lowe. + */ + +#include <stdio.h> +#include <sys/types.h> +#include <saveargs.h> + +#define DEF_TEST(name) \ + extern uint8_t name[]; \ + extern int name##_end + +#define SIZE_OF(name) ((caddr_t)&name##_end - (caddr_t)&name) + +#define TEST_GOOD(name, argc) \ + if (saveargs_has_args(name, SIZE_OF(name), argc, 0) != 0) \ + printf("Pass: %s\n", #name); \ + else \ + printf("FAIL: %s\n", #name); + +#define TEST_GOOD_STRUCT(name, argc) \ + if (saveargs_has_args(name, SIZE_OF(name), argc, 1) != 0) \ + printf("Pass: %s\n", #name); \ + else \ + printf("FAIL: %s\n", #name); + +#define TEST_BAD(name, argc) \ + if (saveargs_has_args(name, SIZE_OF(name), argc, 0) == 0) \ + printf("Pass: %s\n", #name); \ + else \ + printf("FAIL: %s\n", #name); + +#define TEST_BAD_STRUCT(name, argc) \ + if (saveargs_has_args(name, SIZE_OF(name), argc, 1) == 0) \ + printf("Pass: %s\n", #name); \ + else \ + printf("FAIL: %s\n", #name); + +DEF_TEST(gcc_mov_align); +DEF_TEST(gcc_mov_basic); +DEF_TEST(gcc_mov_big_struct_ret); +DEF_TEST(gcc_mov_big_struct_ret_and_spill); +DEF_TEST(gcc_mov_small_struct_ret); +DEF_TEST(gcc_mov_small_struct_ret_and_spill); +DEF_TEST(gcc_mov_stack_spill); + +DEF_TEST(gcc_push_align); +DEF_TEST(gcc_push_basic); +DEF_TEST(gcc_push_big_struct_ret); +DEF_TEST(gcc_push_big_struct_ret_and_spill); +DEF_TEST(gcc_push_small_struct_ret); +DEF_TEST(gcc_push_small_struct_ret_and_spill); +DEF_TEST(gcc_push_stack_spill); + +DEF_TEST(ss_mov_align); +DEF_TEST(ss_mov_basic); +DEF_TEST(ss_mov_big_struct_ret); +DEF_TEST(ss_mov_big_struct_ret_and_spill); +DEF_TEST(ss_mov_small_struct_ret); +DEF_TEST(ss_mov_small_struct_ret_and_spill); +DEF_TEST(ss_mov_stack_spill); + +DEF_TEST(dtrace_instrumented); +DEF_TEST(kmem_alloc); +DEF_TEST(uts_kill); +DEF_TEST(av1394_ic_bitreverse); + +DEF_TEST(small_struct_ret_w_float); +DEF_TEST(big_struct_ret_w_float); + +/* + * Functions which should not match + * + * no_fp -- valid save-args sequence with no saved FP + * big_struct_arg_by_value -- function with big struct passed by value + * small_struct_arg_by_value -- function with small struct passed by value + */ +DEF_TEST(no_fp); +DEF_TEST(big_struct_arg_by_value); +DEF_TEST(small_struct_arg_by_value); + +int +main(int argc, char **argv) +{ + TEST_GOOD(kmem_alloc, 2); + TEST_GOOD(uts_kill, 2); + TEST_GOOD(av1394_ic_bitreverse, 1); + TEST_GOOD(dtrace_instrumented, 4); + TEST_GOOD_STRUCT(big_struct_ret_w_float, 1); + TEST_BAD(no_fp, 5); + + TEST_GOOD(gcc_mov_align, 5); + TEST_GOOD(gcc_push_align, 5); + TEST_GOOD(ss_mov_align, 5); + + TEST_GOOD(gcc_mov_basic, 4); + TEST_GOOD(gcc_push_basic, 4); + TEST_GOOD(ss_mov_basic, 4); + + TEST_GOOD_STRUCT(gcc_mov_big_struct_ret, 4); + TEST_GOOD_STRUCT(gcc_push_big_struct_ret, 4); + TEST_GOOD_STRUCT(ss_mov_big_struct_ret, 4); + + TEST_GOOD_STRUCT(gcc_mov_big_struct_ret_and_spill, 8); + TEST_GOOD_STRUCT(gcc_push_big_struct_ret_and_spill, 8); + TEST_GOOD_STRUCT(ss_mov_big_struct_ret_and_spill, 8); + + TEST_GOOD(gcc_mov_small_struct_ret, 4); + TEST_GOOD(gcc_push_small_struct_ret, 4); + TEST_GOOD(ss_mov_small_struct_ret, 4); + + TEST_GOOD(gcc_mov_small_struct_ret_and_spill, 8); + TEST_GOOD(gcc_push_small_struct_ret_and_spill, 8); + TEST_GOOD(ss_mov_small_struct_ret_and_spill, 8); + + TEST_GOOD(gcc_mov_stack_spill, 8); + TEST_GOOD(gcc_push_stack_spill, 8); + TEST_GOOD(ss_mov_stack_spill, 8); + + TEST_BAD(big_struct_arg_by_value, 2); + TEST_BAD(small_struct_arg_by_value, 2); + + TEST_BAD(small_struct_ret_w_float, 1); + + return (0); +} diff --git a/usr/src/common/smbsrv/smb_match.c b/usr/src/common/smbsrv/smb_match.c index 4e1f174fcf..1a81af96b3 100644 --- a/usr/src/common/smbsrv/smb_match.c +++ b/usr/src/common/smbsrv/smb_match.c @@ -18,8 +18,10 @@ * * CDDL HEADER END */ + /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. */ #ifndef _KERNEL @@ -38,193 +40,225 @@ */ #define SMB_MATCH_DEPTH_MAX 32 -#define SMB_CRC_POLYNOMIAL 0xD8B5D8B5 +struct match_priv { + int depth; + boolean_t ci; +}; + +static int smb_match_private(const char *, const char *, struct match_priv *); -static int smb_match_private(const char *, const char *, int *); -static int smb_match_ci_private(const char *, const char *, int *); +static const char smb_wildcards[] = "*?<>\""; /* - * smb_match + * Return B_TRUE if pattern contains wildcards */ boolean_t -smb_match(char *patn, char *str) +smb_contains_wildcards(const char *pattern) { - int depth = 0; - return (smb_match_private(patn, str, &depth) == 1); + return (strpbrk(pattern, smb_wildcards) != NULL); } /* - * The '*' character matches multiple characters. - * The '?' character matches a single character. - * - * If the pattern has trailing '?'s then it matches the specified number - * of characters or less. For example, "x??" matches "xab", "xa" and "x", - * but not "xabc". - * - * Returns: - * 1 match - * 0 no-match - * -1 no-match, too many wildcards in pattern + * NT-compatible file name match function. [MS-FSA 3.1.4.4] + * Returns TRUE if there is a match. */ -static int -smb_match_private(const char *patn, const char *str, int *depth) +boolean_t +smb_match(const char *p, const char *s, boolean_t ci) { + struct match_priv priv; int rc; - for (;;) { - switch (*patn) { - case '\0': - return (*str == '\0'); - - case '?': - if (*str != 0) { - str++; - patn++; - continue; - } else { - return (0); - } - /*NOTREACHED*/ - - case '*': - patn += strspn(patn, "*"); - if (*patn == '\0') - return (1); - - if ((*depth)++ >= SMB_MATCH_DEPTH_MAX) - return (-1); + /* + * Optimize common patterns that match everything: + * ("*", "<\"*") That second one is the converted + * form of "*.*" after smb_convert_wildcards() does + * its work on it for an old LM client. Note that a + * plain "*.*" never gets this far. + */ + if (p[0] == '*' && p[1] == '\0') + return (B_TRUE); + if (p[0] == '<' && p[1] == '\"' && p[2] == '*' && p[3] == '\0') + return (B_TRUE); - while (*str) { - rc = smb_match_private(patn, str, depth); - if (rc != 0) - return (rc); - str++; - } - return (0); + /* + * Match string ".." as if "." This is Windows behavior + * (not mentioned in MS-FSA) that was determined using + * the Samba masktest program. + */ + if (s[0] == '.' && s[1] == '.' && s[2] == '\0') + s++; - default: - if (*str != *patn) - return (0); - str++; - patn++; - continue; - } + /* + * Optimize simple patterns (no wildcards) + */ + if (NULL == strpbrk(p, smb_wildcards)) { + if (ci) + rc = smb_strcasecmp(p, s, 0); + else + rc = strcmp(p, s); + return (rc == 0); } - /*NOTREACHED*/ -} -/* - * smb_match_ci - */ -boolean_t -smb_match_ci(char *patn, char *str) -{ - int depth = 0; - - return (smb_match_ci_private(patn, str, &depth) == 1); + /* + * Do real wildcard match. + */ + priv.depth = 0; + priv.ci = ci; + rc = smb_match_private(p, s, &priv); + return (rc == 1); } /* - * The '*' character matches multiple characters. - * The '?' character matches a single character. + * Internal file name match function. [MS-FSA 3.1.4.4] + * This does the full expression evaluation. * - * If the pattern has trailing '?'s then it matches the specified number - * of characters or less. For example, "x??" matches "xab", "xa" and "x", - * but not "xabc". + * '*' matches zero of more of any characters. + * '?' matches exactly one of any character. + * '<' matches any string up through the last dot or EOS. + * '>' matches any one char not a dot, dot at EOS, or EOS. + * '"' matches a dot, or EOS. * * Returns: - * 1 match - * 0 no-match - * -1 no-match, too many wildcards in pattern + * 1 match + * 0 no-match + * -1 no-match, error (illseq, too many wildcards in pattern, ...) + * + * Note that both the pattern and the string are in multi-byte form. + * + * The implementation of this is quite tricky. First note that it + * can call itself recursively, though it limits the recursion depth. + * Each switch case in the while loop can basically do one of three + * things: (a) return "Yes, match", (b) return "not a match", or + * continue processing the match pattern. The cases for wildcards + * that may match a variable number of characters ('*' and '<') do + * recursive calls, looking for a match of the remaining pattern, + * starting at the current and later positions in the string. */ static int -smb_match_ci_private(const char *patn, const char *str, int *depth) +smb_match_private(const char *pat, const char *str, struct match_priv *priv) { - const char *p; - smb_wchar_t wc1, wc2; - int nbytes1, nbytes2; + const char *limit; + char pc; /* current pattern char */ int rc; + smb_wchar_t wcpat, wcstr; /* current wchar in pat, str */ + int nbpat, nbstr; /* multi-byte length of it */ + + if (priv->depth >= SMB_MATCH_DEPTH_MAX) + return (-1); /* - * "<" is a special pattern that matches only those names that do - * NOT have an extension. "." and ".." are ok. + * Advance over one multi-byte char, used in cases like + * '?' or '>' where "match one character" needs to be + * interpreted as "match one multi-byte sequence". + * + * This macro needs to consume the semicolon following + * each place it appears, so this is carefully written + * as an if/else with a missing semicolon at the end. */ - if (strcmp(patn, "<") == 0) { - if ((strcmp(str, ".") == 0) || (strcmp(str, "..") == 0)) - return (1); - if (strchr(str, '.') == 0) - return (1); - return (0); - } +#define ADVANCE(str) \ + if ((nbstr = smb_mbtowc(NULL, str, MTS_MB_CHAR_MAX)) < 1) \ + return (-1); \ + else \ + str += nbstr /* no ; */ - for (;;) { - switch (*patn) { - case '\0': - return (*str == '\0'); + /* + * We move pat forward in each switch case so that the + * default case can move it by a whole multi-byte seq. + */ + while ((pc = *pat) != '\0') { + switch (pc) { - case '?': - if (*str != 0) { - str++; - patn++; + case '?': /* exactly one of any character */ + pat++; + if (*str != '\0') { + ADVANCE(str); continue; - } else { - p = patn; - p += strspn(p, "?"); - return ((*p == '\0') ? 1 : 0); } - /*NOTREACHED*/ - - case '*': - patn += strspn(patn, "*"); - if (*patn == '\0') - return (1); - - if ((*depth)++ >= SMB_MATCH_DEPTH_MAX) - return (-1); + /* EOS: no-match */ + return (0); - while (*str) { - rc = smb_match_ci_private(patn, str, depth); + case '*': /* zero or more of any characters */ + pat++; + /* Optimize '*' at end of pattern. */ + if (*pat == '\0') + return (1); /* match */ + while (*str != '\0') { + priv->depth++; + rc = smb_match_private(pat, str, priv); + priv->depth--; if (rc != 0) - return (rc); - str++; + return (rc); /* match */ + ADVANCE(str); } - return (0); - - default: - nbytes1 = smb_mbtowc(&wc1, patn, MTS_MB_CHAR_MAX); - nbytes2 = smb_mbtowc(&wc2, str, MTS_MB_CHAR_MAX); - if ((nbytes1 == -1) || (nbytes2 == -1)) - return (-1); + continue; - if (wc1 != wc2) { - wc1 = smb_tolower(wc1); - wc2 = smb_tolower(wc2); - if (wc1 != wc2) - return (0); + case '<': /* any string up through the last dot or EOS */ + pat++; + if ((limit = strrchr(str, '.')) != NULL) + limit++; + while (*str != '\0' && str != limit) { + priv->depth++; + rc = smb_match_private(pat, str, priv); + priv->depth--; + if (rc != 0) + return (rc); /* match */ + ADVANCE(str); } - - patn += nbytes1; - str += nbytes2; continue; - } - } - /*NOTREACHED*/ -} -uint32_t -smb_crc_gen(uint8_t *buf, size_t len) -{ - uint32_t crc = SMB_CRC_POLYNOMIAL; - uint8_t *p; - int i; + case '>': /* anything not a dot, dot at EOS, or EOS */ + pat++; + if (*str == '.') { + if (str[1] == '\0') { + /* dot at EOS */ + str++; /* ADVANCE over '.' */ + continue; + } + /* dot NOT at EOS: no-match */ + return (0); + } + if (*str != '\0') { + /* something not a dot */ + ADVANCE(str); + continue; + } + continue; - for (p = buf, i = 0; i < len; ++i, ++p) { - crc = (crc ^ (uint32_t)*p) + (crc << 12); + case '\"': /* dot, or EOS */ + pat++; + if (*str == '.') { + str++; /* ADVANCE over '.' */ + continue; + } + if (*str == '\0') { + continue; + } + /* something else: no-match */ + return (0); - if (crc == 0 || crc == 0xFFFFFFFF) - crc = SMB_CRC_POLYNOMIAL; + default: /* not a wildcard */ + nbpat = smb_mbtowc(&wcpat, pat, MTS_MB_CHAR_MAX); + nbstr = smb_mbtowc(&wcstr, str, MTS_MB_CHAR_MAX); + /* make sure we advance */ + if (nbpat < 1 || nbstr < 1) + return (-1); + if (wcpat == wcstr) { + pat += nbpat; + str += nbstr; + continue; + } + if (priv->ci) { + wcpat = smb_tolower(wcpat); + wcstr = smb_tolower(wcstr); + if (wcpat == wcstr) { + pat += nbpat; + str += nbstr; + continue; + } + } + return (0); /* no-match */ + } } - - return (crc); + return (*str == '\0'); } diff --git a/usr/src/common/smbsrv/smb_xdr.c b/usr/src/common/smbsrv/smb_xdr.c index 33013b20b9..fc9153394d 100644 --- a/usr/src/common/smbsrv/smb_xdr.c +++ b/usr/src/common/smbsrv/smb_xdr.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. */ #include <sys/sunddi.h> @@ -734,3 +735,26 @@ smb_shr_execinfo_xdr(XDR *xdrs, smb_shr_execinfo_t *objp) return (TRUE); } + +/* + * The smbsrv ioctl callers include a CRC of the XDR encoded data, + * and kmod ioctl handler checks it. Both use this function. This + * is not really XDR related, but this is as good a place as any. + */ +#define SMB_CRC_POLYNOMIAL 0xD8B5D8B5 +uint32_t +smb_crc_gen(uint8_t *buf, size_t len) +{ + uint32_t crc = SMB_CRC_POLYNOMIAL; + uint8_t *p; + int i; + + for (p = buf, i = 0; i < len; ++i, ++p) { + crc = (crc ^ (uint32_t)*p) + (crc << 12); + + if (crc == 0 || crc == 0xFFFFFFFF) + crc = SMB_CRC_POLYNOMIAL; + } + + return (crc); +} diff --git a/usr/src/head/link.h b/usr/src/head/link.h index e92bb9e459..b47273d265 100644 --- a/usr/src/head/link.h +++ b/usr/src/head/link.h @@ -28,7 +28,7 @@ #include <sys/link.h> #ifndef _ASM -#include <libelf.h> +#include <elf.h> #include <sys/types.h> #include <dlfcn.h> #endif @@ -39,9 +39,15 @@ extern "C" { #ifndef _ASM /* - * ld support library calls + * ld support library calls. + * + * These cannot be used in a 32bit large file capable environment because + * libelf is not large-file safe. Only define these interfaces if we are not + * 32bit, or not in the large file environment. */ +#if !defined(_ILP32) || _FILE_OFFSET_BITS != 64 #ifdef __STDC__ +#include <libelf.h> extern uint_t ld_version(uint_t); extern void ld_input_done(uint_t *); @@ -88,6 +94,7 @@ extern void ld_section64(); #endif /* (defined(_LP64) || defined(_LONGLONG_TYPE) */ #endif /* __STDC__ */ +#endif /* !defined(_ILP32) || _FILE_OFFSET_BITS != 64 */ /* * ld_version() version values. diff --git a/usr/src/lib/README.mapfiles b/usr/src/lib/README.mapfiles index c94ffe8b91..560226938e 100644 --- a/usr/src/lib/README.mapfiles +++ b/usr/src/lib/README.mapfiles @@ -22,8 +22,8 @@ # Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. # -Mapfiles and versioning in ON -============================= +Mapfiles and versioning in illumos +================================== 1.0 Objective of this README @@ -57,12 +57,11 @@ you must do as a shared library developer if you: Mapfiles are used to tell the link-editor ("ld") all sorts of things about how to generate an executable file or a shared object from a collection of relocatable objects, such as generated by a compiler. For all the gory -details, see the Solaris Linker and Libraries Guide, which can be found -under http://docs.sun.com. +details, see the Solaris Linker and Libraries Guide. There are two versions of the mapfile language accepted by the link-editor. Version 1 derives from AT&T System V Release 4 Unix. Version 2 is a newer -syntax specific to Solaris. All mapfiles in the OSnet (ON consolidation) are +syntax specific to Solaris and derivatives. All mapfiles in illumos are required to use version 2 syntax. Note that every mapfile using version 2 syntax must start with the line: @@ -100,6 +99,16 @@ for brevity): $mapfile_version 2 +SYMBOL_VERSION ILLUMOS_0.2 { # Second interface change in illumos + global: + wb_notify; +} ILLUMOS_0.1; + +SYMBOL_VERSION ILLUMOS_0.1 { # First interface change in illumos + global: + wb_poll; +} SUNW_1.2; + SYMBOL_VERSION SUNW_1.2 { # update to libwombat, Solaris 10 global: wb_readv; @@ -122,34 +131,58 @@ SYMBOL_VERSION SUNWprivate { # private libwombat symbols *; }; -The SUNW_1.* names are the Public version names for the library. -There should be at most one version name for each release of Solaris, -with the minor number incremented by one over the previous version. - -If no update to the Public-visible names in the library is made -in a given Solaris release, no new version name should be generated -for that release. If multiple updates are made to the library at -different points in the development of a given release of Solaris, -only one version should be used for the entire release. - -So, for example, if an update to libwombat is made in Solaris 11, -you would add "SUNW_1.3" at the start of the mapfile: - -SYMBOL_VERSION SUNW_1.3 { # update to libwombat, Solaris 11 +Each of these sections is a version declaration describing an ABI version of +the library containing the set of symbols exposed by the library to +external callers. + +ABI versions must be constant, that is version ILLUMOS_0.2 in a given +library must always describe the same interface such that applications may +safely state their dependencies in terms of these versions and have a +constant and predictable ABI be exposed. This in effect means that once a +version is publicly visible, it may never be removed or have symbols added +to or removed from it. + +ABI versions with the same major number should be upward compatible, that is +ILLUMOS_0.3 of a given library must contain all the interfaces in +ILLUMOS_0.2, and they must be compatible. + +The private version, however, is special, and describes any private yet +exposed symbols within a library, and may change at any time (and without +notice). It exists purely to allow certain symbols to be of global scope +but not Public. Similarly, any symbols scoped local are private and may +change safely, even if the local statement happens to be within a public +version. + +Interface changes made in illumos should be done with ILLUMOS_0.* versions, +introducing one version per interface change. In illumos, unlike Solaris, +symbol versions are not release-specific because of the requirement that +each be constant. No change should be made to add or remove symbols from +any pre-existing Public version. + +The SUNW_*.* names were the Public version names of the library in Solaris. +There should be at most one version name for each release of Solaris, with +the minor number incremented by one over the previous version. No changes +should ever be made to SUNW_1.* versions. + +So, for example, to add a new interface to libwombat in illumos one would add: + +SYMBOL_VERSION ILLUMOS_0.3 { # Third update to libwombat in illumos global: wb_lseek; -} SUNW_1.2; +} ILLUMOS_0.2; -Each version must inherit all symbols from its preceding version, -specified at the ending "}" for each version. SUNW_1.1 does not -inherit any symbols. SUNWprivate, if present, stands alone. +Each version must inherit all symbols from its preceding version, specified at +the ending "}" for each version. The initial public version does not inherit +any symbols. The private version named either "SUNWprivate" for libraries +with private symbols pre-existing illumos, or "ILLUMOSprivate" otherwise +stands alone, inheriting nothing and being inherited by nothing. The two lines in SUNWprivate: local: *; -ensure that no symbols other than those listed in the mapfile are -visible to clients of the library. If there is no SUNWprivate, -these two lines should appear in SUNW_1.1. +ensure that no symbols other than those listed in the mapfile are visible to +clients of the library. If there is no private version, these two lines should +appear in the first public version. For maintainability, the list of names in each version block should be sorted in dictionary order (sort -d). Please comply. @@ -173,7 +206,8 @@ Conditional input can be used if there are ISA-specific library interfaces not common to all instances of the library. It is the preferred method for expressing platform specific items, as long as the differences are simple (which is almost always the case). For example, see libproc, or, if you -are masochistic, libc or libnsl. +are masochistic, libc or libnsl. In general, use of this feature should be +minimal. In addition to conditional input, there is a second heavier weight mechanism for expressing ISA-specific differences. In addition to the common mapfile: @@ -202,68 +236,74 @@ carefully, or the resulting mapfile can be extremly difficult to read. 4.1 Adding a Public interface -The first engineer to update the existing mapfile-vers file in a release needs -to identify the current highest version name and properly increment the minor -version number by 1 to be the new version name. If this is the first Public -interface in the shared object, a new SUNW_1.1 version name must be introduced. +Public interfaces should be added to a new ILLUMOS_ symbol version, with the +minor number incremented by one from the current highest version name. If +this is the first Public interface in the shared object, a new ILLUMOS_0.1 +version name must be introduced. The major revision number is incremented whenever an incompatible change is -made to an interface. This could be the case if an API changes so dramatically -as to invalidate dependencies. This rarely occurs in practice. It also -requires changing the suffix of the shared object from, say, .so.1 to .so.2 -and introducing code to continue to ship the .so.1 version of the library. +made to an interface. This could be the case if an API changes so +dramatically as to invalidate dependencies. This should almost never occur +in practice. It also requires changing the suffix of the shared object +from, say, .so.1 to .so.2 and introducing code to continue to ship the .so.1 +version of the library. The minor revision number is incremented whenever one or more new interfaces -is added to a library. Note that the minor number is not incremented on every -putback that makes an interface addition to the library. Rather, it is -incremented at most once per (external to Sun) release of the library. +is added to a library. Once a version comes to exist in illumos, it is from +that point onward considered to be immutable. 4.2 Adding a Private interface Private interfaces are the non-ABI interfaces of the library. Unlike introducing a Public interface, a new entry is simply added to the -SUNWprivate version. No minor number increment is necessary. - -If this interface happens to be the first Private interface introduced -into the library, the SUNWprivate version must be created (no major.minor -version numbers). It inherits nothing and nothing inherits from it. - -If the library already has Private interfaces, they may have numbered version -names like SUNWprivate_m.n (due to errors of the past). If so, just use the -highest numbered private version name to version the new interface. There -is no need to introduce a new private version name. Be careful not to use -a lower numbered private version name; doing so can cause runtime errors -(as opposed to load time errors) when running an application with older -versions of the library. - -There are libraries in the OSnet consolidation that contain only private -interfaces. In such libraries, the SUNWprivate_m.n may be incremented -to ensure that the programs that depend on them are built and delivered as a -integrated unit. A notable example of this is libld.so (usr/src/cmd/sgs/libld), -which contains the implementation of the link-editor, the public interface to -which is provided by the ld command. When making a modification to the interface -of such a library, you should follow the convention already in place. - -4.3 Adding new public interfaces in an update release - -Adding new public interfaces in an update release requires careful -coordination with the next marketing release currently under development. -Multiple updates ship during the period before the next marketing release -ships, and since it is generally impossible to know the full set of new -interfaces in the next marketing release until late in its development -(after multiple updates have shipped) it must be assumed that not all -interfaces added to the next marketing release will be added to an update. +private version. No minor number increment is necessary. + +If this interface happens to be the first Private interface introduced into +the library, the private version must be created (with no major.minor +version numbers). It inherits nothing, nothing inherits from it and it +should be named ILLUMOSprivate. + +If the library already has Private interfaces in a SUNWprivate version, you +should use that. They may have numbered version names like SUNWprivate_m.n +(due to errors of the past). If so, just use the highest numbered private +version name to version the new interface. There is no need to introduce a +new private version name. Be careful not to use a lower numbered private +version name; doing so can cause runtime errors (as opposed to load time +errors) when running an application with older versions of the library. + +There are also libraries in illumos that contain only private interfaces. In +such libraries, the private versions maybe legitimately be versioned and +they may be incremented to ensure that the programs that depend on them are +built and delivered as a integrated unit. A notable example of this is +libld.so (usr/src/cmd/sgs/libld), which contains the implementation of the +link-editor, the public interface to which is provided by the ld +command. When making a modification to the interface of such a library, you +should follow the convention already in place. + +4.3 Historical handling of Solaris update releases. + +To aid the understanding of our existing mapfiles, it is useful to note how +interface versions were handled as they interacted with update releases of +Solaris. Solaris update releases required careful coordination with the full +release currently under development to keep symbol versions constant between +releases. + +Multiple update releases were generally shipped during the development of the +next full release of Solaris. It was impossible to know in advance the full +set of new interfaces in the next full release until it was complete. Some, +though not all, new interfaces were included in the intervening update +releases between full releases. Consequently, the new version number for an update cannot be a minor -increment, but must be a micro increment. For example, if Release N -has version number SUNW_1.3 and Release N+1 will have SUNW_1.4, then -interfaces added to an update of Release N must have micro numbers such -as SUNW_1.3.1, SUNW_1.3.2, etc. (note that the micro number is not -directly tied to the update number: SUNW_1.3.1 may appear in Update 2). -The micro versions form an inheritance chain that is inserted between -two successive minor versions. For example, the mapfile-vers file for -minor release "N+1" to reflect its inclusion of micro releases will -look like the following: +increment, but must be a micro increment to ensure that was a distinct +version between the two releases. For example, if Release N had version +number SUNW_1.3 and Release N+1 had SUNW_1.4, then interfaces added to +an update of Release N must have micro numbers such as SUNW_1.3.1, +SUNW_1.3.2, etc. (note that the micro number is not directly tied to the +update number: SUNW_1.3.1 may have appeared in Update 2). The micro versions form +an inheritance chain that is inserted between two successive minor versions. +For example, the mapfile-vers file for minor release "N+1" to reflect its +inclusion of micro releases will look like the following: $mapfile_version 2 @@ -310,12 +350,12 @@ except for the exclusion of SUNW_1.4. Those interfaces which are only present in Release N+1 are always put into the next minor version set, SUNW_1.4. -Thus when adding a new public interface to an update, both the mapfiles -of the update release and next marketing release must be modified to be -consistent. The update versions should not be added to the marketing -release until the putback to the update release has occurred, to avoid -timing problems with the update releases (it's all too easy for projects -to slip out of updates, or to change ordering). +Thus when adding a new Public interface to an update release, both the mapfiles +of the update release and next full release should have been modified to be +consistent. + +There have been several cases of accidental deviation from this scheme, and +existing mapfiles sometimes reflect this unfortunate state of affairs. ------------------------------------------------------------------------------- @@ -325,7 +365,8 @@ to slip out of updates, or to change ordering). 5.1.1 Moving a Public interface -No Public interfaces should ever be removed from any mapfile. +No Public interfaces should ever be removed from any mapfile, as this will +break all existing consumers of that interface. To move an interface from one library to (say) libc, the code has to be deleted from the library and added to libc, then the mapfile for the @@ -333,21 +374,29 @@ library has to have the interface's entry changed from: getfoobar; to: getfoobar { TYPE = FUNCTION; FILTER = libc.so.1 }; -See, for example, libnsl's common/mapfile-vers file. +This is an exception to the immutability of public symbol versions. See, +for example, libnsl's common/mapfile-vers file. Follow the rules for adding a new interface for the necessary changes -to libc's mapfile to accommodate the moved interface. In particular, -the new interface must be added to the current highest libc version. +to libc's mapfile to accommodate the moved interface, including creating a +new version in libc for the symbol. -To move an entire library into libc, look at what has already been done -for libthread, libaio, and librt. +When merging an entire library into libc, the mapfile is changed to specify +the type of each public symbol similarly to the above: + getfoobar; +to: + getfoobar { TYPE = FUNCTION }; + +But rather than specifying the library on which we filter for each symbol, +the link-editor is invoked with '-F libc.so.1' to specify that our entire +symbol table is a filter on libc. For examples, see libaio and librt. 5.1.2 Removing a Private interface Deletion of Private interfaces is allowed, but caution should be taken; it should first be established that the interface is not being used. To remove a Private interface, simply delete the corresponding entry -for that symbol from the mapfile's SUNWprivate section. +for that symbol from the mapfile's private version section. Do not forget to delete these Public or Private interfaces from the library's header files as well as from the code that implements the interfaces. @@ -356,17 +405,18 @@ header files as well as from the code that implements the interfaces. This is similar to what's done when adding a Public interface. Promoting an existing Private interface to a Public one only requires a change to the -existing interface definition. Private interfaces have the symbol version name -"SUNWprivate" associated with them. To make the interface a Public one, the -interface must be put into a set associated with the current Public release -level of the library. - -As an example, if we were modifying libwombat.so.1 and its version in the -last release of Solaris was SUNW_1.23, any new ABI introduced in the next -release would be put into a version called SUNW_1.24. Therefore, whether -you wish to promote an existing Private interface to Public, or to introduce -a new Public interface, this (next successive minor numbered version level) -would be the version that it would be associated with. +existing interface definition. Private interfaces have the symbol version +name "ILLUMOSprivate" or "SUNWprivate" associated with them. To make the +interface a Public one, the interface must be added as if it were a new +public symbol, following those same rules and removed from the private +version. + +As an example, if we were modifying libwombat.so.1 and its existing latest +version were ILLUMOS_0.3, any new ABI would be put into a version called +ILLUMOS_0.4. Therefore, whether you wish to promote an existing Private +interface to Public, or to introduce a new Public interface, this (next +successive minor numbered version level) would be the version that it would +be associated with. 5.3 Scoping a Private interface local @@ -379,7 +429,7 @@ outside the library. To move an interface from Private to local scope, simply remove the Private interface from the mapfile-vers file and the header file to prevent it from being exported. This may require moving the Private interface into a library-private header file. Scope reduction of Public -interfaces is not allowed without specific ARC review and approval. +interfaces is forbidden. For the interface to be used in more than one file within the library, it should be in a header file that can be included by each file in the library @@ -393,10 +443,10 @@ that uses the interface. For example: SYSVABI and SISCD are reserved version names for interfaces listed in the System V Interface Definition and the Sparc Compliance Definition. Avoid using these version names when copying the implementation of standard interfaces to -another library. Instead, use SUNW_1.1 for a new library, and SUNW_m.n for -an existing library (where m.n is the next release version; i.e., if the -last version was SUNW_1.18, then you should version the interfaces with -SUNW_1.19). +another library. Instead, use ILLUMOS_0.1 for a new library, and ILLUMOS_m.n for +an existing library (where m.n is the next version; i.e., if the +last version was ILLUMOS_0.8, then you should version the interfaces with +ILLUMOS_0.9). ------------------------------------------------------------------------------- @@ -404,10 +454,10 @@ SUNW_1.19). 6.1 Directories -The normal discipline for introducing a new library in OS/Net is to create a -new subdirectory of /usr/src/lib. The interface definition discipline is to +The normal discipline for introducing a new library in illumos is to create a +new subdirectory of usr/src/lib. The interface definition discipline is to create a common/mapfile-vers file for the new library. If we were introducing -a new foo library, libfoo, we'd create /usr/src/lib/libfoo containing: +a new foo library, libfoo, we'd create usr/src/lib/libfoo containing: Makefile amd64/ i386/ sparcv9/ Makefile.com common/ sparc/ The common subdirectory would contain the normal source files plus the @@ -420,31 +470,29 @@ The new common/mapfile-vers file would contain: $mapfile_version 2 -SYMBOL_VERSION SUNW_1.1 { # first release of libfoo +SYMBOL_VERSION ILLUMOS_0.1 { # first release of libfoo global: ... }; -SYMBOL_VERSION SUNWprivate { +SYMBOL_VERSION ILLUMOSprivate { global: ... local: *; }; -If there are no Public interfaces, the SUNW_1.1 section would be omitted. -If there are no Private interfaces, the SUNWprivate section would be +If there are no Public interfaces, the ILLUMOS_0.1 section would be omitted. +If there are no Private interfaces, the ILLUMOSprivate section would be omitted and the two lines: local: *; would be moved into SUNW_1.1 -To decide which interfaces are Public (part of the ABI) and which are Private -(unstable interfaces not intended to be used by third party applications or -unbundled products), the heuristic which works to a first approximation is -that if it has a man page then it's Public. Also, it is really the ARC case -for the new interfaces that prescribes which interfaces are Public and -which are not (hence, which interfaces have man pages and which do not). +To decide which interfaces are Public (part of the ABI) and which are +Private (unstable interfaces not intended to be used by third parties), the +heuristic which works to a first approximation is that if it has a man page +then it's Public. For maintainability, the list of names in each version block should be sorted in dictionary order (sort -d). Please comply. @@ -468,20 +516,15 @@ SYMBOL_VERSION SUNWobsolete { SUNWobsolete; # This is the only way to do it. } SUNW_1.2; -SYMBOL_VERSION SUNW_1.2 { +SYMBOL_VERSION ILLUMOS_0.2 { ... +You should continue to use the name SUNWobsolete even in illumos. + ------------------------------------------------------------------------------- 8.0 Documentation For further information, please refer to the following documents: - "Solaris Linker and Libraries Guide", http://docs.sun.com - /shared/ON/general_docs/scoping-rules.fm.ps - -For information on the now-obsolete spec files, used in Solaris releases -7 through 10, see: - /shared/ON/general_docs/README.spec - /shared/ON/general_docs/libspec-rules.ps - /shared/ON/general_docs/spectrans/* + "Solaris Linker and Libraries Guide" diff --git a/usr/src/lib/abi/apptrace/Makefile.com b/usr/src/lib/abi/apptrace/Makefile.com index 578ccf83eb..224209a71d 100644 --- a/usr/src/lib/abi/apptrace/Makefile.com +++ b/usr/src/lib/abi/apptrace/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY = apptrace.a VERS = .1 @@ -34,6 +32,8 @@ include ../../Makefile.abi LIBS = $(DYNLIB) CPPFLAGS = -I. $(CPPFLAGS.master) +CERRWARN += -_gcc=-Wno-uninitialized + # No mapfile here MAPFILES = diff --git a/usr/src/lib/auditd_plugins/binfile/Makefile.com b/usr/src/lib/auditd_plugins/binfile/Makefile.com index 96185b4af1..f3f74d02b1 100644 --- a/usr/src/lib/auditd_plugins/binfile/Makefile.com +++ b/usr/src/lib/auditd_plugins/binfile/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= audit_binfile.a VERS= .1 @@ -40,6 +38,8 @@ CFLAGS += $(CCVERBOSE) CPPFLAGS += -D_REENTRANT -I$(LIBBSM) CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +CERRWARN += -_gcc=-Wno-parentheses + ROOTLIBDIR= $(ROOT)/usr/lib/security .KEEP_STATE: diff --git a/usr/src/lib/auditd_plugins/syslog/Makefile.com b/usr/src/lib/auditd_plugins/syslog/Makefile.com index 40ecbc25bd..0e1c95eed9 100644 --- a/usr/src/lib/auditd_plugins/syslog/Makefile.com +++ b/usr/src/lib/auditd_plugins/syslog/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= audit_syslog.a VERS= .1 @@ -49,6 +47,9 @@ CPPFLAGS += -D_REENTRANT CPPFLAGS += -I$(PRAUDIT) CPPFLAGS += -I$(LIBBSM) +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-uninitialized + ROOTLIBDIR= $(ROOT)/usr/lib/security .KEEP_STATE: diff --git a/usr/src/lib/brand/solaris10/s10_brand/Makefile.com b/usr/src/lib/brand/solaris10/s10_brand/Makefile.com index f031d769f0..022b31b4e7 100644 --- a/usr/src/lib/brand/solaris10/s10_brand/Makefile.com +++ b/usr/src/lib/brand/solaris10/s10_brand/Makefile.com @@ -83,6 +83,8 @@ DYNFLAGS += $(DYNFLAGS_$(CLASS)) DYNFLAGS += $(BLOCAL) $(ZNOVERSION) -Wl,-e_start LDLIBS += -lc -lmapmalloc +CERRWARN += -_gcc=-Wno-uninitialized + $(LIBS):= PICS += $(SHAREDOBJS) .KEEP_STATE: diff --git a/usr/src/lib/cfgadm_plugins/fp/Makefile.com b/usr/src/lib/cfgadm_plugins/fp/Makefile.com index b9786290f9..c18d3323d3 100644 --- a/usr/src/lib/cfgadm_plugins/fp/Makefile.com +++ b/usr/src/lib/cfgadm_plugins/fp/Makefile.com @@ -45,6 +45,12 @@ LINTFLAGS64 += -DDEBUG CFLAGS += $(CCVERBOSE) CFLAGS64 += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-address + CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS LINTFLAGS += -erroff=E_SEC_SPRINTF_UNBOUNDED_COPY diff --git a/usr/src/lib/cfgadm_plugins/fp/common/cfga_utils.c b/usr/src/lib/cfgadm_plugins/fp/common/cfga_utils.c index 0ab98b77f5..9f1cee82b8 100644 --- a/usr/src/lib/cfgadm_plugins/fp/common/cfga_utils.c +++ b/usr/src/lib/cfgadm_plugins/fp/common/cfga_utils.c @@ -137,7 +137,7 @@ msgcvt_t str_tbl[] = { {ERR_MATCHING_HBA_PORT, 0, 1, "No match HBA port found"}, {ERR_NO_ADAPTER_FOUND, 0, 1, - "No Fibre Channel adpaters found"}, + "No Fibre Channel adapters found"}, /* Errors with arguments */ {ERRARG_OPT_INVAL, 1, 1, "invalid option: "}, @@ -442,7 +442,7 @@ apidt_create(const char *ap_id, apid_t *apidp, char **errstring) /* Get the path of dynamic attachment point if already configured. */ if (dyncomp != NULL) { ret = dyn_apid_to_path(xport_phys, dyncomp, - &lunlistp, &l_errno); + &lunlistp, &l_errno); if ((ret != FPCFGA_OK) && (ret != FPCFGA_APID_NOCONFIGURE)) { cfga_err(errstring, l_errno, ERR_OP_FAILED, 0); goto err; @@ -564,7 +564,7 @@ walk_tree( while (fpnode) { devfs_fp_path = di_devfs_path(fpnode); if ((devfs_fp_path) && !(strncmp(devfs_fp_path, - root_path, strlen(root_path)))) { + root_path, strlen(root_path)))) { found = 1; di_devfs_path_free(devfs_fp_path); break; @@ -587,7 +587,7 @@ walk_tree( } else { assert(cmd == FPCFGA_WALK_MINOR); rv = di_walk_minor(root, up->walkmode.minor_args.nodetype, 0, - arg, up->walkmode.minor_args.fcn); + arg, up->walkmode.minor_args.fcn); } if (rv != 0) { @@ -671,7 +671,7 @@ cfga_err(char **errstring, int l_errno, ...) * So, concatenate the old and new strings */ if ((tmp_str = calloc(1, - strlen(*errstring) + strlen(tmp_err_str) + 2)) == NULL) { + strlen(*errstring) + strlen(tmp_err_str) + 2)) == NULL) { /* In case of error, retain only the earlier message */ free(tmp_err_str); return; @@ -928,7 +928,7 @@ known_state(di_node_t node) * offline. */ if ((state & DI_DEVICE_OFFLINE) == DI_DEVICE_OFFLINE || - (state & DI_DRIVER_DETACHED) != DI_DRIVER_DETACHED) { + (state & DI_DRIVER_DETACHED) != DI_DRIVER_DETACHED) { return (1); } @@ -1118,8 +1118,8 @@ getAdapterAttrs(HBA_HANDLE handle, HBA_ADAPTERATTRIBUTES *attrs) /* Loop as long as we have a retryable error */ while ((status == HBA_STATUS_ERROR_TRY_AGAIN || - status == HBA_STATUS_ERROR_BUSY) && - count++ < HBA_MAX_RETRIES) { + status == HBA_STATUS_ERROR_BUSY) && + count++ < HBA_MAX_RETRIES) { status = HBA_GetAdapterAttributes(handle, attrs); if (status == HBA_STATUS_OK) { break; @@ -1141,11 +1141,11 @@ getPortAttrsByWWN(HBA_HANDLE handle, HBA_WWN wwn, HBA_PORTATTRIBUTES *attrs) /* Loop as long as we have a retryable error */ while ((status == HBA_STATUS_ERROR_TRY_AGAIN || - status == HBA_STATUS_ERROR_BUSY) && - count++ < HBA_MAX_RETRIES) { + status == HBA_STATUS_ERROR_BUSY) && + count++ < HBA_MAX_RETRIES) { status = HBA_GetPortAttributesByWWN(handle, wwn, attrs); if (status == HBA_STATUS_OK) { - break; + break; } /* The odds of this occuring are very slim, but possible. */ @@ -1175,8 +1175,8 @@ getAdapterPortAttrs(HBA_HANDLE handle, int portIndex, /* Loop as long as we have a retryable error */ while ((status == HBA_STATUS_ERROR_TRY_AGAIN || - status == HBA_STATUS_ERROR_BUSY) && - count++ < HBA_MAX_RETRIES) { + status == HBA_STATUS_ERROR_BUSY) && + count++ < HBA_MAX_RETRIES) { status = HBA_GetAdapterPortAttributes(handle, portIndex, attrs); if (status == HBA_STATUS_OK) { break; @@ -1209,10 +1209,10 @@ getDiscPortAttrs(HBA_HANDLE handle, int portIndex, int discIndex, /* Loop as long as we have a retryable error */ while ((status == HBA_STATUS_ERROR_TRY_AGAIN || - status == HBA_STATUS_ERROR_BUSY) && - count++ < HBA_MAX_RETRIES) { + status == HBA_STATUS_ERROR_BUSY) && + count++ < HBA_MAX_RETRIES) { status = HBA_GetDiscoveredPortAttributes(handle, portIndex, - discIndex, attrs); + discIndex, attrs); if (status == HBA_STATUS_OK) { break; } @@ -1253,119 +1253,135 @@ findMatchingAdapterPort(char *portPath, HBA_HANDLE *matchingHandle, status = HBA_LoadLibrary(); if (status != HBA_STATUS_OK) { - cfga_err(errstring, 0, ERR_HBA_LOAD_LIBRARY, 0); - return (FPCFGA_LIB_ERR); + cfga_err(errstring, 0, ERR_HBA_LOAD_LIBRARY, 0); + return (FPCFGA_LIB_ERR); } count = HBA_GetNumberOfAdapters(); if (count == 0) { - cfga_err(errstring, 0, ERR_NO_ADAPTER_FOUND, 0); - HBA_FreeLibrary(); - return (FPCFGA_LIB_ERR); + cfga_err(errstring, 0, ERR_NO_ADAPTER_FOUND, 0); + HBA_FreeLibrary(); + return (FPCFGA_LIB_ERR); } /* Loop over all HBAs */ for (adapterIndex = 0; adapterIndex < count; adapterIndex ++) { - status = HBA_GetAdapterName(adapterIndex, (char *)&adapterName); - if (status != HBA_STATUS_OK) { - /* May have been DR'd */ - continue; - } - handle = HBA_OpenAdapter(adapterName); - if (handle == 0) { - /* May have been DR'd */ - continue; - } - - do { - if (getAdapterAttrs(handle, &hbaAttrs)) { - /* Should never happen */ - HBA_CloseAdapter(handle); - continue; + status = HBA_GetAdapterName(adapterIndex, (char *)&adapterName); + if (status != HBA_STATUS_OK) { + /* May have been DR'd */ + continue; + } + handle = HBA_OpenAdapter(adapterName); + if (handle == 0) { + /* May have been DR'd */ + continue; } - /* Loop over all HBA Ports */ - for (portIndex = 0; - portIndex < hbaAttrs.NumberOfPorts; portIndex++) { - if ((status = getAdapterPortAttrs(handle, portIndex, - &portAttrs)) != HBA_STATUS_OK) { - /* Need to refresh adapter */ - if (status == HBA_STATUS_ERROR_STALE_DATA) { - HBA_RefreshInformation(handle); - break; - } else { - continue; + do { + if (getAdapterAttrs(handle, &hbaAttrs)) { + /* Should never happen */ + HBA_CloseAdapter(handle); + continue; } - } - /* - * check to see if OSDeviceName is a /dev/cfg link - * or the physical path - */ - if (strncmp(portAttrs.OSDeviceName, CFGA_DEV_DIR, - strlen(CFGA_DEV_DIR)) != 0) { - tmpPtr = strstr(portAttrs.OSDeviceName, MINOR_SEP); - if (tmpPtr != NULL) { - if (strncmp(portPath, + /* Loop over all HBA Ports */ + for (portIndex = 0; + portIndex < hbaAttrs.NumberOfPorts; portIndex++) { + if ((status = getAdapterPortAttrs(handle, + portIndex, + &portAttrs)) != HBA_STATUS_OK) { + /* Need to refresh adapter */ + if (status == + HBA_STATUS_ERROR_STALE_DATA) { + HBA_RefreshInformation(handle); + break; + } else { + continue; + } + } + + /* + * check to see if OSDeviceName is a /dev/cfg + * link or the physical path + */ + if (strncmp(portAttrs.OSDeviceName, + CFGA_DEV_DIR, + strlen(CFGA_DEV_DIR)) != 0) { + tmpPtr = strstr(portAttrs.OSDeviceName, + MINOR_SEP); + if ((tmpPtr != NULL) && + strncmp(portPath, portAttrs.OSDeviceName, strlen(portAttrs.OSDeviceName) - strlen(tmpPtr)) == 0) { - if (matchingHandle) - *matchingHandle = handle; - if (matchingPortIndex) - *matchingPortIndex = portIndex; - if (matchingPortAttrs) - *matchingPortAttrs = portAttrs; - return (FPCFGA_OK); - } - } - } else { - /* - * strip off the /dev/cfg/ portion of the - * OSDeviceName - * make sure that the OSDeviceName is at least - * strlen("/dev/cfg") + 1 + 1 long. - * first 1 is for the / after /dev/cfg - * second 1 is to make sure there is somthing - * after - */ - if (strlen(portAttrs.OSDeviceName) < - (strlen(CFGA_DEV_DIR) + 1 + 1)) - continue; - cfg_ptr = portAttrs.OSDeviceName + - strlen(CFGA_DEV_DIR) + 1; - if (logical_apid == NULL) { - /* get the /dev/cfg link from the portPath */ - if (make_xport_logid(portPath, &logical_apid, - &l_errno) != FPCFGA_OK) { - cfga_err(errstring, l_errno, - ERR_LIST, 0); - HBA_FreeLibrary(); - return (FPCFGA_LIB_ERR); + if (matchingHandle) + *matchingHandle = + handle; + if (matchingPortIndex) + *matchingPortIndex = + portIndex; + if (matchingPortAttrs) + *matchingPortAttrs = + portAttrs; + return (FPCFGA_OK); + } + } else { + /* + * strip off the /dev/cfg/ portion of + * the OSDeviceName make sure that the + * OSDeviceName is at least + * strlen("/dev/cfg") + 1 + 1 long. + * first 1 is for the / after /dev/cfg + * second 1 is to make sure there is + * somthing after + */ + if (strlen(portAttrs.OSDeviceName) < + (strlen(CFGA_DEV_DIR) + 1 + 1)) + continue; + cfg_ptr = portAttrs.OSDeviceName + + strlen(CFGA_DEV_DIR) + 1; + if (logical_apid == NULL) { + /* + * get the /dev/cfg link from + * the portPath + */ + if (make_xport_logid(portPath, + &logical_apid, + &l_errno) != FPCFGA_OK) { + cfga_err(errstring, + l_errno, + ERR_LIST, 0); + HBA_FreeLibrary(); + return + (FPCFGA_LIB_ERR); + } + } + /* compare logical ap_id */ + if (strcmp(logical_apid, + cfg_ptr) == 0) { + if (matchingHandle) + *matchingHandle = + handle; + if (matchingPortIndex) + *matchingPortIndex = + portIndex; + if (matchingPortAttrs) + *matchingPortAttrs = + portAttrs; + S_FREE(logical_apid); + return (FPCFGA_OK); + } } } - /* compare logical ap_id */ - if (strcmp(logical_apid, cfg_ptr) == 0) { - if (matchingHandle) - *matchingHandle = handle; - if (matchingPortIndex) - *matchingPortIndex = portIndex; - if (matchingPortAttrs) - *matchingPortAttrs = portAttrs; + if (logical_apid != NULL) S_FREE(logical_apid); - return (FPCFGA_OK); - } - } - } - if (logical_apid != NULL) - S_FREE(logical_apid); - } while ((status == HBA_STATUS_ERROR_STALE_DATA) && - (retry++ < HBA_MAX_RETRIES)); + } while ((status == HBA_STATUS_ERROR_STALE_DATA) && + (retry++ < HBA_MAX_RETRIES)); - HBA_CloseAdapter(handle); + HBA_CloseAdapter(handle); } free(logical_apid); - /* Got here. No mathcing adatper port found. */ + /* Got here. No matching adapter port found. */ cfga_err(errstring, 0, ERR_MATCHING_HBA_PORT, 0); HBA_FreeLibrary(); return (FPCFGA_LIB_ERR); diff --git a/usr/src/lib/cfgadm_plugins/ib/Makefile.com b/usr/src/lib/cfgadm_plugins/ib/Makefile.com index 659d07eaa7..185009afea 100644 --- a/usr/src/lib/cfgadm_plugins/ib/Makefile.com +++ b/usr/src/lib/cfgadm_plugins/ib/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= ib.a VERS= .1 @@ -45,6 +43,11 @@ LINTFLAGS64 += -DDEBUG CFLAGS += $(CCVERBOSE) CFLAGS64 += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-value + LDLIBS += -lc -ldevice -ldevinfo -lrcm -lnvpair .KEEP_STATE: diff --git a/usr/src/lib/cfgadm_plugins/pci/Makefile.com b/usr/src/lib/cfgadm_plugins/pci/Makefile.com index 58aad22226..b53cad13f7 100644 --- a/usr/src/lib/cfgadm_plugins/pci/Makefile.com +++ b/usr/src/lib/cfgadm_plugins/pci/Makefile.com @@ -47,6 +47,10 @@ CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS CFLAGS += $(CCVERBOSE) LDLIBS += -lc -ldevice -ldevinfo -lrcm +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/cfgadm_plugins/sata/Makefile.com b/usr/src/lib/cfgadm_plugins/sata/Makefile.com index 6b10ca7b3f..1526413a4e 100644 --- a/usr/src/lib/cfgadm_plugins/sata/Makefile.com +++ b/usr/src/lib/cfgadm_plugins/sata/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= sata.a VERS= .1 @@ -45,6 +43,10 @@ LINTFLAGS64 += -DDEBUG CFLAGS += $(CCVERBOSE) CFLAGS64 += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-uninitialized + LDLIBS += -lc -ldevice -ldevinfo -lrcm -lnvpair .KEEP_STATE: diff --git a/usr/src/lib/cfgadm_plugins/sbd/Makefile.com b/usr/src/lib/cfgadm_plugins/sbd/Makefile.com index e28db75c53..b3d7040f9c 100644 --- a/usr/src/lib/cfgadm_plugins/sbd/Makefile.com +++ b/usr/src/lib/cfgadm_plugins/sbd/Makefile.com @@ -47,6 +47,10 @@ LIBS = $(DYNLIB) CFLAGS += $(CCVERBOSE) LDLIBS += -lc -lkstat -lnvpair +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-uninitialized + CPPFLAGS += -I$(ROOT)/usr/platform/$(PLATFORM)/include -DSBD_DEBUG # # Generate the error messages form sbd_ioctl.h diff --git a/usr/src/lib/cfgadm_plugins/scsi/Makefile.com b/usr/src/lib/cfgadm_plugins/scsi/Makefile.com index c29b5bc91d..effff0131e 100644 --- a/usr/src/lib/cfgadm_plugins/scsi/Makefile.com +++ b/usr/src/lib/cfgadm_plugins/scsi/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= scsi.a VERS= .1 @@ -40,6 +38,10 @@ ROOTLIBDIR64= $(ROOTLIBDIR)/$(MACH64) LIBS= $(DYNLIB) CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-address LDLIBS += -lc -ldevice -ldevinfo -lrcm diff --git a/usr/src/lib/cfgadm_plugins/scsi/SUNW,SPARC-Enterprise/Makefile.com b/usr/src/lib/cfgadm_plugins/scsi/SUNW,SPARC-Enterprise/Makefile.com index e675ae9d87..e099697a93 100644 --- a/usr/src/lib/cfgadm_plugins/scsi/SUNW,SPARC-Enterprise/Makefile.com +++ b/usr/src/lib/cfgadm_plugins/scsi/SUNW,SPARC-Enterprise/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= scsi.a VERS= .1 @@ -51,6 +49,10 @@ SRCS= $(GEN_OBJECTS:%.o=../../common/%.c) $(OPL_OBJECTS:%.o=../common/%.c) LIBS= $(DYNLIB) CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-address +CERRWARN += -_gcc=-Wno-char-subscripts LDLIBS += -lc -ldevice -ldevinfo -lrcm diff --git a/usr/src/lib/cfgadm_plugins/shp/Makefile.com b/usr/src/lib/cfgadm_plugins/shp/Makefile.com index 2d86582b4e..3ba1ae337c 100644 --- a/usr/src/lib/cfgadm_plugins/shp/Makefile.com +++ b/usr/src/lib/cfgadm_plugins/shp/Makefile.com @@ -47,6 +47,11 @@ CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS CFLAGS += $(CCVERBOSE) LDLIBS += -lc -ldevinfo -lhotplug +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/cfgadm_plugins/sysctrl/Makefile.com b/usr/src/lib/cfgadm_plugins/sysctrl/Makefile.com index 97074136e6..786b37df3f 100644 --- a/usr/src/lib/cfgadm_plugins/sysctrl/Makefile.com +++ b/usr/src/lib/cfgadm_plugins/sysctrl/Makefile.com @@ -52,6 +52,10 @@ LDLIBS += -lc CPPFLAGS += -I$(ROOT)/usr/platform/$(PLATFORM)/include +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/cfgadm_plugins/usb/Makefile.com b/usr/src/lib/cfgadm_plugins/usb/Makefile.com index bd2941c04c..9588313161 100644 --- a/usr/src/lib/cfgadm_plugins/usb/Makefile.com +++ b/usr/src/lib/cfgadm_plugins/usb/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= usb.a VERS= .1 @@ -45,6 +43,11 @@ LINTFLAGS64 += -DDEBUG CFLAGS += $(CCVERBOSE) CFLAGS64 += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-value + LDLIBS += -lc -ldevice -ldevinfo -lrcm -lnvpair .KEEP_STATE: diff --git a/usr/src/lib/efcode/Makefile.efcode b/usr/src/lib/efcode/Makefile.efcode index b8c1e73b3d..b88f04d40a 100644 --- a/usr/src/lib/efcode/Makefile.efcode +++ b/usr/src/lib/efcode/Makefile.efcode @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# # # Common build rules for efcode shared objects. @@ -48,6 +46,13 @@ CPPFLAGS += -DDEBUG -DFCODE_INTERNAL CPPFLAGS += -I $(SRC)/lib/efcode/include -I $(ROOT)/usr/platform/sun4u/include DYNFLAGS += -R\$$ORIGIN +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits + EFCODE64DIR = /usr/lib/efcode/$(MACH64) ROOTLIBDIR = $(ROOT)/usr/lib/efcode ROOTLIBDIR64 = $(ROOT)/usr/lib/efcode/$(MACH64) diff --git a/usr/src/lib/efcode/efdaemon/Makefile b/usr/src/lib/efcode/efdaemon/Makefile index e4e90c5633..c6343f8413 100644 --- a/usr/src/lib/efcode/efdaemon/Makefile +++ b/usr/src/lib/efcode/efdaemon/Makefile @@ -33,6 +33,8 @@ EFCODEDIR64 = $(EFCODEDIR)/$(MACH64) CPPFLAGS += -DDEBUG -DFCODE_INTERNAL CPPFLAGS += -I ../include -I $(ROOT)/usr/platform/sun4u/include +CERRWARN += -_gcc=-Wno-unused-variable + PROG = efdaemon EFTARGETS += $(EFCODEDIR64)/$(PROG) EFTARGETS += $(EFCODEDIR)/efcode.sh diff --git a/usr/src/lib/efcode/interpreter/Makefile b/usr/src/lib/efcode/interpreter/Makefile index 020ab170bb..d7475b45bb 100644 --- a/usr/src/lib/efcode/interpreter/Makefile +++ b/usr/src/lib/efcode/interpreter/Makefile @@ -23,8 +23,6 @@ # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# include $(SRC)/cmd/Makefile.cmd include $(SRC)/cmd/Makefile.cmd.64 @@ -36,6 +34,8 @@ ROOTCMDDIR = $(EFCODEDIR64) CPPFLAGS += -DDEBUG -DFCODE_INTERNAL CPPFLAGS += -I ../include -I $(ROOT)/usr/platform/sun4u/include +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized LDFLAGS += -R/usr/lib/efcode/$(MACH64) -M mapfile64 LIBS = fcode.so fcdriver.so diff --git a/usr/src/lib/fm/libfmd_adm/Makefile.com b/usr/src/lib/fm/libfmd_adm/Makefile.com index 51a480a2bd..8e58527bef 100644 --- a/usr/src/lib/fm/libfmd_adm/Makefile.com +++ b/usr/src/lib/fm/libfmd_adm/Makefile.com @@ -41,6 +41,7 @@ SRCDIR = ../common CPPFLAGS += -I../common -I. CFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS) CFLAGS64 += $(CCVERBOSE) $(C_BIGPICFLAGS) +CERRWARN += -_gcc=-Wno-unused-variable LDLIBS += -lnvpair -lnsl -lc LINTFLAGS = -msux diff --git a/usr/src/lib/fm/libfmd_log/Makefile.com b/usr/src/lib/fm/libfmd_log/Makefile.com index 730ac39336..6a93e83f61 100644 --- a/usr/src/lib/fm/libfmd_log/Makefile.com +++ b/usr/src/lib/fm/libfmd_log/Makefile.com @@ -40,6 +40,7 @@ SRCDIR = ../common CPPFLAGS += -I../common -I. CFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS) CFLAGS64 += $(CCVERBOSE) $(C_BIGPICFLAGS) +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += -lexacct -lnvpair -lgen -lc LINTFLAGS = -msux diff --git a/usr/src/lib/fm/libfmd_msg/Makefile.com b/usr/src/lib/fm/libfmd_msg/Makefile.com index b704cf62d8..a2a731da0e 100644 --- a/usr/src/lib/fm/libfmd_msg/Makefile.com +++ b/usr/src/lib/fm/libfmd_msg/Makefile.com @@ -40,6 +40,8 @@ SRCDIR = ../common CPPFLAGS += -I../common -I. CFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS) CFLAGS64 += $(CCVERBOSE) $(C_BIGPICFLAGS) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += -lnvpair -lc LINTFLAGS = -msux diff --git a/usr/src/lib/fm/libfmevent/Makefile.com b/usr/src/lib/fm/libfmevent/Makefile.com index 5a3510b49e..ce3f9b4dae 100644 --- a/usr/src/lib/fm/libfmevent/Makefile.com +++ b/usr/src/lib/fm/libfmevent/Makefile.com @@ -59,6 +59,10 @@ $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG CFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS) CFLAGS64 += $(CCVERBOSE) $(C_BIGPICFLAGS) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized + FMLIBDIR=usr/lib/fm $(BUILD64)FMLIBDIR64=usr/lib/fm/$(MACH64) diff --git a/usr/src/lib/fm/libldom/Makefile.com b/usr/src/lib/fm/libldom/Makefile.com index e01f062c10..859a177363 100644 --- a/usr/src/lib/fm/libldom/Makefile.com +++ b/usr/src/lib/fm/libldom/Makefile.com @@ -42,6 +42,8 @@ CPPFLAGS += -I. -I$(SRC)/uts/sun4v -I$(ROOT)/usr/platform/sun4v/include \ CFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS) CFLAGS64 += $(CCVERBOSE) $(C_BIGPICFLAGS) +CERRWARN += -_gcc=-Wno-parentheses + $(DYNLIB) := LDLIBS += $(MACH_LDLIBS) $(DYNLIB) := LDLIBS += -lfmd_agent -lnvpair -lscf -lmdesc -lc -lxml2 -lsocket \ -lumem diff --git a/usr/src/lib/fm/topo/libtopo/Makefile.com b/usr/src/lib/fm/topo/libtopo/Makefile.com index 180aa2a49b..56871dd6d4 100644 --- a/usr/src/lib/fm/topo/libtopo/Makefile.com +++ b/usr/src/lib/fm/topo/libtopo/Makefile.com @@ -78,6 +78,9 @@ CPPFLAGS += -I../common -I$(ADJUNCT_PROTO)/usr/include/libxml2 -I. CFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS) CFLAGS += -D_POSIX_PTHREAD_SEMANTICS CFLAGS64 += $(CCVERBOSE) $(C_BIGPICFLAGS) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses LINTFLAGS = -msux LINTFLAGS64 = -msux -m64 diff --git a/usr/src/lib/fm/topo/modules/Makefile.plugin b/usr/src/lib/fm/topo/modules/Makefile.plugin index 246ce77a5c..d67acbfe7d 100644 --- a/usr/src/lib/fm/topo/modules/Makefile.plugin +++ b/usr/src/lib/fm/topo/modules/Makefile.plugin @@ -58,6 +58,9 @@ ROOTCONF = $($(CLASS)_ROOTCONF) LINTFLAGS = -msux LINTFILES = $(SRCS:%.c=%.ln) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + APIMAP = ../../../libtopo/common/topo_mod.map MAPFILES = # use APIMAP instead diff --git a/usr/src/lib/fm/topo/modules/common/fac_prov_ipmi/fac_prov_ipmi.c b/usr/src/lib/fm/topo/modules/common/fac_prov_ipmi/fac_prov_ipmi.c index 6e3ad18b93..559020efe5 100644 --- a/usr/src/lib/fm/topo/modules/common/fac_prov_ipmi/fac_prov_ipmi.c +++ b/usr/src/lib/fm/topo/modules/common/fac_prov_ipmi/fac_prov_ipmi.c @@ -271,7 +271,7 @@ ipmi_platform_message(topo_mod_t *mod, tnode_t *node, topo_version_t vers, /* * The spec states that any values between 0x20 and 0x29 are * legitimate for "system software". However, some versions of - * Sun's ILOM rejects messages over /dev/ipmi with a generator + * Sun's ILOM rejects messages over /dev/ipmi0 with a generator * of 0x20, so we use 0x21 instead. */ pem.ipem_generator = 0x21; diff --git a/usr/src/lib/gss_mechs/mech_dh/backend/Makefile.com b/usr/src/lib/gss_mechs/mech_dh/backend/Makefile.com index 53625989fd..7379a16129 100644 --- a/usr/src/lib/gss_mechs/mech_dh/backend/Makefile.com +++ b/usr/src/lib/gss_mechs/mech_dh/backend/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# # # This make file will build mech_dh.so.1. This shared object @@ -52,6 +50,10 @@ $(EXPORT_RELEASE_BUILD)include $(MAKEFILE_EXPORT) CPPFLAGS += -I../mech -I../crypto -I$(SRC)/uts/common/gssapi/include +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized + $(PICS) := CFLAGS += $(XFFLAG) $(PICS) := CCFLAGS += $(XFFLAG) $(PICS) := CFLAGS64 += $(XFFLAG) diff --git a/usr/src/lib/gss_mechs/mech_dummy/Makefile.com b/usr/src/lib/gss_mechs/mech_dummy/Makefile.com index 4335c5acf5..9118d6f4ca 100644 --- a/usr/src/lib/gss_mechs/mech_dummy/Makefile.com +++ b/usr/src/lib/gss_mechs/mech_dummy/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# # # The mech_dummy shared object contains all the functionality needed to @@ -42,6 +40,9 @@ MAPFILES = CPPFLAGS += -I../../libgss -I$(SRC)/uts/common/gssapi/include \ -I$(ROOT)/usr/include/gssapi +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + MAKEFILE_EXPORT = $(CLOSED)/lib/gss_mechs/mech_dummy/Makefile.export $(EXPORT_RELEASE_BUILD)include $(MAKEFILE_EXPORT) diff --git a/usr/src/lib/gss_mechs/mech_krb5/Makefile.com b/usr/src/lib/gss_mechs/mech_krb5/Makefile.com index 38c43bc573..d1c68cea64 100644 --- a/usr/src/lib/gss_mechs/mech_krb5/Makefile.com +++ b/usr/src/lib/gss_mechs/mech_krb5/Makefile.com @@ -251,6 +251,16 @@ CPPFLAGS += -I$(REL_PATH)/libgss -I../include \ CPPFLAGS += $(KRB5_DEFS) +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-empty-body +CERRWARN += -_gcc=-Wno-address + MAPFILE_EXPORT = ../mapfile-vers-clean $(EXPORT_RELEASE_BUILD)MAPFILE_EXPORT = \ $(CLOSED)/lib/gss_mechs/mech_krb5/mapfile-vers-export diff --git a/usr/src/lib/gss_mechs/mech_spnego/Makefile.com b/usr/src/lib/gss_mechs/mech_spnego/Makefile.com index ee9a87e049..a8adb3afde 100644 --- a/usr/src/lib/gss_mechs/mech_spnego/Makefile.com +++ b/usr/src/lib/gss_mechs/mech_spnego/Makefile.com @@ -48,6 +48,9 @@ MAPFILES = ../mapfile-vers $(MAPFILE_EXPORT) CPPFLAGS += -I$(SRC)/uts/common/gssapi/include $(DEBUG) -I$(SRC)/lib/gss_mechs/mech_krb5/include -I$(SRC)/uts/common/gssapi/mechs/krb5/include -I$(SRC)/lib/gss_mechs/mech_krb5/mech +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-type-limits + MAKEFILE_EXPORT = $(CLOSED)/lib/gss_mechs/mech_spnego/Makefile.export $(EXPORT_RELEASE_BUILD)include $(MAKEFILE_EXPORT) diff --git a/usr/src/lib/hbaapi/Makefile.com b/usr/src/lib/hbaapi/Makefile.com index 54dd62919f..9dc4272593 100644 --- a/usr/src/lib/hbaapi/Makefile.com +++ b/usr/src/lib/hbaapi/Makefile.com @@ -40,6 +40,11 @@ SRCDIR= ../common INCS += -I$(SRCDIR) CPPFLAGS += $(INCS) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function + LDLIBS += -lc $(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC) diff --git a/usr/src/lib/krb5/dyn/Makefile.com b/usr/src/lib/krb5/dyn/Makefile.com index c772a4897f..501893d8c6 100644 --- a/usr/src/lib/krb5/dyn/Makefile.com +++ b/usr/src/lib/krb5/dyn/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libdyn.a VERS= .1 @@ -63,6 +61,8 @@ CPPFLAGS += -D_REENTRANT -DHAVE_LIBSOCKET=1 -DHAVE_LIBNSL=1 \ CFLAGS += $(CCVERBOSE) -I.. LDLIBS += -lc +CERRWARN += -_gcc=-Wno-unused-variable + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/krb5/kadm5/clnt/Makefile.com b/usr/src/lib/krb5/kadm5/clnt/Makefile.com index 5be5ff8a2f..44d13ddcc5 100644 --- a/usr/src/lib/krb5/kadm5/clnt/Makefile.com +++ b/usr/src/lib/krb5/kadm5/clnt/Makefile.com @@ -80,6 +80,12 @@ CPPFLAGS += -I.. -I../.. -I../../.. -I$(SRC)/lib/gss_mechs/mech_krb5/include \ -DHAVE_STRFTIME=1 -DHAVE_VSPRINTF=1 -DUSE_KADM5_API_VERSION=2 CFLAGS += $(CCVERBOSE) -I.. + +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + LDLIBS += -lc .KEEP_STATE: diff --git a/usr/src/lib/krb5/kadm5/srv/Makefile.com b/usr/src/lib/krb5/kadm5/srv/Makefile.com index 81d762b27c..96d3aba6e6 100644 --- a/usr/src/lib/krb5/kadm5/srv/Makefile.com +++ b/usr/src/lib/krb5/kadm5/srv/Makefile.com @@ -87,6 +87,12 @@ CPPFLAGS += -I.. -I../.. -I../../.. \ CFLAGS += $(CCVERBOSE) -I.. +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/krb5/kdb/Makefile.com b/usr/src/lib/krb5/kdb/Makefile.com index ca7dde1daf..b75f6e5e3e 100644 --- a/usr/src/lib/krb5/kdb/Makefile.com +++ b/usr/src/lib/krb5/kdb/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libkdb.a VERS= .1 @@ -83,6 +81,12 @@ CPPFLAGS += -DHAVE_CONFIG_H -DHAVE_BT_RSEQ \ CFLAGS += $(CCVERBOSE) -I.. +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + DYNFLAGS += $(KRUNPATH) $(KMECHLIB) LDLIBS += -lc -lnsl diff --git a/usr/src/lib/krb5/plugins/kdb/db2/Makefile.com b/usr/src/lib/krb5/plugins/kdb/db2/Makefile.com index 19ae7f9e4f..064c9d7e4b 100644 --- a/usr/src/lib/krb5/plugins/kdb/db2/Makefile.com +++ b/usr/src/lib/krb5/plugins/kdb/db2/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= db2.a VERS= .1 @@ -66,6 +64,10 @@ CPPFLAGS += -DHAVE_CONFIG_H -DHAVE_BT_RSEQ \ -I$(SRC)/uts/common/gssapi/mechs/krb5/include CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized DYNFLAGS += $(KRUNPATH) $(KERBRUNPATH) $(KMECHLIB) LDLIBS += -L $(ROOTLIBDIR) -ldb2 -lkdb -lkadm5srv -lc -lnsl diff --git a/usr/src/lib/krb5/plugins/kdb/db2/libdb2/Makefile.com b/usr/src/lib/krb5/plugins/kdb/db2/libdb2/Makefile.com index a7ff254dac..aec2ac074b 100644 --- a/usr/src/lib/krb5/plugins/kdb/db2/libdb2/Makefile.com +++ b/usr/src/lib/krb5/plugins/kdb/db2/libdb2/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libdb2.a VERS= .1 @@ -103,6 +101,7 @@ CPPFLAGS += -DHAVE_CONFIG_H \ -I$(SRC)/lib/gss_mechs/mech_krb5/include #for db-ndbm.h CFLAGS += $(CCVERBOSE) -I.. +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += -lc # Identify that this library is an interposer (on dbm_ routines from libc.so.1). diff --git a/usr/src/lib/krb5/plugins/kdb/ldap/Makefile.com b/usr/src/lib/krb5/plugins/kdb/ldap/Makefile.com index b92f19520a..72a6b80cab 100644 --- a/usr/src/lib/krb5/plugins/kdb/ldap/Makefile.com +++ b/usr/src/lib/krb5/plugins/kdb/ldap/Makefile.com @@ -60,6 +60,8 @@ CPPFLAGS += -DHAVE_CONFIG_H \ -DUSE_KADM5_API_VERSION=2 CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-function DYNFLAGS += $(KERBRUNPATH) # setting -L $(ROOT)/usr/lib/gss because libkdb_ldap needs mech_krb5 diff --git a/usr/src/lib/krb5/plugins/kdb/ldap/libkdb_ldap/Makefile.com b/usr/src/lib/krb5/plugins/kdb/ldap/libkdb_ldap/Makefile.com index aa7e830953..0f094f2b4d 100644 --- a/usr/src/lib/krb5/plugins/kdb/ldap/libkdb_ldap/Makefile.com +++ b/usr/src/lib/krb5/plugins/kdb/ldap/libkdb_ldap/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libkdb_ldap.a VERS= .1 @@ -76,6 +74,8 @@ CPPFLAGS += -DHAVE_CONFIG_H \ -DUSE_KADM5_API_VERSION=2 CFLAGS += $(CCVERBOSE) -I.. +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-function DYNFLAGS += $(KRUNPATH) $(KERBRUNPATH) $(KMECHLIB) LDLIBS += -L $(ROOTLIBDIR) -lkadm5srv -lc -lnsl -lldap diff --git a/usr/src/lib/krb5/plugins/preauth/pkinit/Makefile.com b/usr/src/lib/krb5/plugins/preauth/pkinit/Makefile.com index 58c7935dde..8449d22e24 100644 --- a/usr/src/lib/krb5/plugins/preauth/pkinit/Makefile.com +++ b/usr/src/lib/krb5/plugins/preauth/pkinit/Makefile.com @@ -65,6 +65,9 @@ CPPFLAGS += -I$(SRC)/lib/krb5 \ -I$(SRC)/uts/common/gssapi/mechs/krb5/include \ -I$(SRC) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-function + CFLAGS += $(CCVERBOSE) -I.. DYNFLAGS += $(KRUNPATH) $(KMECHLIB) -znodelete LDLIBS += -L $(ROOTLIBDIR) -lcrypto -lc diff --git a/usr/src/lib/krb5/ss/Makefile.com b/usr/src/lib/krb5/ss/Makefile.com index c87da9f2c8..424c5293d4 100644 --- a/usr/src/lib/krb5/ss/Makefile.com +++ b/usr/src/lib/krb5/ss/Makefile.com @@ -66,6 +66,8 @@ CPPFLAGS += -DHAVE_LIBSOCKET=1 -DHAVE_LIBNSL=1 -DHAS_STRDUP=1 \ -I$(SRC)/lib/krb5 CFLAGS += $(CCVERBOSE) -I.. +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-variable DYNFLAGS += $(KRUNPATH) $(KMECHLIB) $(ZIGNORE) diff --git a/usr/src/lib/libadm/Makefile.com b/usr/src/lib/libadm/Makefile.com index 58420e2cfc..4631c50bf4 100644 --- a/usr/src/lib/libadm/Makefile.com +++ b/usr/src/lib/libadm/Makefile.com @@ -43,6 +43,10 @@ SRCDIR= ../common CPPFLAGS += -I ../inc +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-char-subscripts + $(LINTLIB) := SRCS=$(SRCDIR)/$(LINTSRC) LDLIBS += -lc diff --git a/usr/src/lib/libadutils/Makefile.com b/usr/src/lib/libadutils/Makefile.com index 7d474526dc..8776b44c86 100644 --- a/usr/src/lib/libadutils/Makefile.com +++ b/usr/src/lib/libadutils/Makefile.com @@ -41,6 +41,9 @@ $(LINTLIB):= SRCS = $(SRCDIR)/$(LINTSRC) CFLAGS += $(CCVERBOSE) CPPFLAGS += -D_REENTRANT -I$(SRCDIR) -I$(SRC)/lib/libldap5/include/ldap +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized + lint := OBJECTS = $(LINT_OBJECTS) .KEEP_STATE: diff --git a/usr/src/lib/libast/Makefile.com b/usr/src/lib/libast/Makefile.com index a4e30d6989..91c6388ed8 100644 --- a/usr/src/lib/libast/Makefile.com +++ b/usr/src/lib/libast/Makefile.com @@ -723,6 +723,19 @@ CFLAGS += \ CFLAGS64 += \ $(ASTCFLAGS64) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-empty-body +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-address + pics/$(MACH)/src/lib/libast/conftab.o \ pics/$(MACH64)/src/lib/libast/conftab.o := CERRWARN += -erroff=E_INIT_DOES_NOT_FIT pics/common/comp/setlocale.o := CERRWARN += -erroff=E_INTEGER_OVERFLOW_DETECTED diff --git a/usr/src/lib/libbc/sparc/Makefile b/usr/src/lib/libbc/sparc/Makefile index b1b66bfa43..7503bae833 100644 --- a/usr/src/lib/libbc/sparc/Makefile +++ b/usr/src/lib/libbc/sparc/Makefile @@ -327,6 +327,15 @@ ASFLAGS= -P -D__STDC__ -DLOCORE -D_SYS_SYS_S -D_ASM $(CPPFLAGS) LDLIBS= -t -R/usr/ucblib -L$(ROOT)/usr/ucblib $(LDLIBS.lib) \ -lucb -lc -lnsl -lsocket +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-extra +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-address + # SONAME is used by DYNFLAGS $(DYNLIB4X) := SONAME = $(DYNLIB4X) $(DYNLIBS5) := SONAME = $(DYNLIBS5) diff --git a/usr/src/lib/libbe/Makefile.com b/usr/src/lib/libbe/Makefile.com index 3e283deb4e..b8349c1d1a 100644 --- a/usr/src/lib/libbe/Makefile.com +++ b/usr/src/lib/libbe/Makefile.com @@ -24,7 +24,7 @@ # # Copyright 2011 Nexenta Systems, Inc. All rights reserved. # - + LIBRARY= libbe.a VERS= .1 @@ -51,6 +51,9 @@ C99MODE= $(C99_ENABLE) LDLIBS += -lzfs -linstzones -luuid -lnvpair -lc -lgen -ldevinfo CPPFLAGS += $(INCS) +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-address $(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC) diff --git a/usr/src/lib/libbsm/Makefile.com b/usr/src/lib/libbsm/Makefile.com index 5d1e207ff5..0d5bc4976d 100644 --- a/usr/src/lib/libbsm/Makefile.com +++ b/usr/src/lib/libbsm/Makefile.com @@ -85,6 +85,9 @@ CLEANFILES += $(LINTOUT) $(LINTLIB) CFLAGS += $(CCVERBOSE) LDLIBS += -lsocket -lnsl -lmd -lc -lsecdb -ltsol -linetutil -lscf +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + COMDIR= ../common AUDITD= $(SRC)/cmd/auditd diff --git a/usr/src/lib/libc/amd64/Makefile b/usr/src/lib/libc/amd64/Makefile index 1f71b06463..2f37212a55 100644 --- a/usr/src/lib/libc/amd64/Makefile +++ b/usr/src/lib/libc/amd64/Makefile @@ -973,6 +973,18 @@ CFLAGS64 += $(CTF_FLAGS) # We probably don't want any inlining anyway. CFLAGS64 += -xinline= +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-address + # Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...) # enables ASSERT() checking in the threads portion of the library. # This is automatically enabled for DEBUG builds, not for non-debug builds. diff --git a/usr/src/lib/libc/i386/Makefile.com b/usr/src/lib/libc/i386/Makefile.com index e01da08091..41721e4f3f 100644 --- a/usr/src/lib/libc/i386/Makefile.com +++ b/usr/src/lib/libc/i386/Makefile.com @@ -1016,6 +1016,18 @@ CFLAGS += $(CCVERBOSE) $(CTF_FLAGS) XINLINE = -xinline= CFLAGS += $(XINLINE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-address + # Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...) # enables ASSERT() checking in the threads portion of the library. # This is automatically enabled for DEBUG builds, not for non-debug builds. diff --git a/usr/src/lib/libc/sparc/Makefile.com b/usr/src/lib/libc/sparc/Makefile.com index 4267e4b6c1..8b27e58b92 100644 --- a/usr/src/lib/libc/sparc/Makefile.com +++ b/usr/src/lib/libc/sparc/Makefile.com @@ -1051,6 +1051,18 @@ CFLAGS += $(CCVERBOSE) # We probably don't want any inlining anyway. CFLAGS += -xinline= +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-address + # Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...) # enables ASSERT() checking in the threads portion of the library. # This is automatically enabled for DEBUG builds, not for non-debug builds. @@ -1206,10 +1218,6 @@ TIL= \ $(TIL:%=pics/%) := CFLAGS += $(LIBCBASE)/threads/sparc.il -# This hack is needed because sparc GCC3 generates DWARF data about TLS which -# The Sun assembler cannot process -$(__GNUC3)pics/tls_data.o := CC = env 'CW_NO_SHADOW=1' $(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc - # special kludge for inlines with 'cas': pics/rwlock.o pics/synch.o pics/lwp.o pics/door_calls.o := \ sparc_CFLAGS += -_gcc=-Wa,-xarch=v8plus diff --git a/usr/src/lib/libc/sparcv9/Makefile.com b/usr/src/lib/libc/sparcv9/Makefile.com index 518e255e36..fa727d133c 100644 --- a/usr/src/lib/libc/sparcv9/Makefile.com +++ b/usr/src/lib/libc/sparcv9/Makefile.com @@ -996,6 +996,18 @@ CFLAGS64 += $(CCVERBOSE) # We probably don't want any inlining anyway. CFLAGS64 += -xinline= +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-address + # Setting THREAD_DEBUG = -DTHREAD_DEBUG (make THREAD_DEBUG=-DTHREAD_DEBUG ...) # enables ASSERT() checking in the threads portion of the library. # This is automatically enabled for DEBUG builds, not for non-debug builds. @@ -1138,10 +1150,6 @@ TIL= \ $(TIL:%=pics/%) := CFLAGS64 += $(LIBCBASE)/threads/sparcv9.il -# This hack is needed because sparc GCC3 generates DWARF data about TLS which -# The Sun assembler cannot process -$(__GNUC3)pics/tls_data.o := CC = env 'CW_NO_SHADOW=1' $(ONBLD_TOOLS)/bin/$(MACH)/cw -_cc - # Files in fp, port/fp subdirectories that need base.il inline template IL= \ __flt_decim.o \ diff --git a/usr/src/lib/libc_db/Makefile.com b/usr/src/lib/libc_db/Makefile.com index ecd5baa67e..60f1f0cd96 100644 --- a/usr/src/lib/libc_db/Makefile.com +++ b/usr/src/lib/libc_db/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY = libc_db.a VERS = .1 @@ -46,9 +44,11 @@ $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) ASFLAGS += -P -D__STDC__ -D_ASM -DPIC CPPFLAGS += -I../../libc/inc -D_REENTRANT CFLAGS += $(CCVERBOSE) -CFLAGS += $(CCVERBOSE) LDLIBS += -lc +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/libcfgadm/Makefile.com b/usr/src/lib/libcfgadm/Makefile.com index e2d2ff8bd6..55747cb387 100644 --- a/usr/src/lib/libcfgadm/Makefile.com +++ b/usr/src/lib/libcfgadm/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY = libcfgadm.a VERS = .1 @@ -38,6 +36,8 @@ SRCDIR = ../common $(LINTLIB):= SRCS = $(SRCDIR)/$(LINTSRC) CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-unused-label .KEEP_STATE: diff --git a/usr/src/lib/libcmd/Makefile.com b/usr/src/lib/libcmd/Makefile.com index 2760d3dbdb..c3725e124b 100644 --- a/usr/src/lib/libcmd/Makefile.com +++ b/usr/src/lib/libcmd/Makefile.com @@ -132,6 +132,12 @@ CFLAGS += \ CFLAGS64 += \ $(ASTCFLAGS64) +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-implicit-function-declaration + pics/cut.o := CERRWARN += -erroff=E_END_OF_LOOP_CODE_NOT_REACHED pics/sync.o := CERRWARN += -erroff=E_END_OF_LOOP_CODE_NOT_REACHED pics/vmstate.o := CERRWARN += -erroff=E_NO_IMPLICIT_DECL_ALLOWED diff --git a/usr/src/lib/libcpc/Makefile.com b/usr/src/lib/libcpc/Makefile.com index b18942e533..428955e904 100644 --- a/usr/src/lib/libcpc/Makefile.com +++ b/usr/src/lib/libcpc/Makefile.com @@ -45,6 +45,9 @@ ASFLAGS += -P -D_ASM -I../common CPPFLAGS += -D_REENTRANT -I../common CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/libcrypt/Makefile.com b/usr/src/lib/libcrypt/Makefile.com index 2f93024301..8e98a38912 100644 --- a/usr/src/lib/libcrypt/Makefile.com +++ b/usr/src/lib/libcrypt/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libcrypt.a VERS= .1 @@ -48,6 +46,9 @@ CFLAGS += $(CCVERBOSE) CPPFLAGS += -D_REENTRANT -I../inc -I../../common/inc -I../../libgen/inc LDLIBS += -lgen -lc +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/libcryptoutil/Makefile.com b/usr/src/lib/libcryptoutil/Makefile.com index d4183effb9..b6df76e3c4 100644 --- a/usr/src/lib/libcryptoutil/Makefile.com +++ b/usr/src/lib/libcryptoutil/Makefile.com @@ -51,6 +51,9 @@ CFLAGS += $(CCVERBOSE) CPPFLAGS += -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -I$(SRCDIR) LINTFLAGS64 += -errchk=longptr64 +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + all: $(LIBS) lint: lintcheck diff --git a/usr/src/lib/libctf/Makefile.com b/usr/src/lib/libctf/Makefile.com index 267d67aa18..4d1e01d4eb 100644 --- a/usr/src/lib/libctf/Makefile.com +++ b/usr/src/lib/libctf/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY = libctf.a VERS = .1 @@ -55,6 +53,9 @@ SRCDIR = ../common CPPFLAGS += -I../common -I../../../common/ctf -DCTF_OLD_VERSIONS CFLAGS += $(CCVERBOSE) + +CERRWARN += -_gcc=-Wno-uninitialized + LDLIBS += -lc $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) diff --git a/usr/src/lib/libcurses/Makefile.com b/usr/src/lib/libcurses/Makefile.com index 19a25fc2ab..b295f4b536 100644 --- a/usr/src/lib/libcurses/Makefile.com +++ b/usr/src/lib/libcurses/Makefile.com @@ -148,6 +148,10 @@ CLEANFILES += $(LINTOUT) $(LINTLIB) CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + LDLIBS += -lc CPPFLAGS += -I../screen -I../../common/inc diff --git a/usr/src/lib/libdevice/Makefile.com b/usr/src/lib/libdevice/Makefile.com index 269cb501e7..49b8083fa6 100644 --- a/usr/src/lib/libdevice/Makefile.com +++ b/usr/src/lib/libdevice/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libdevice.a VERS= .1 @@ -39,6 +37,8 @@ $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) CFLAGS += $(CCVERBOSE) CPPFLAGS += -D_REENTRANT +CERRWARN += -_gcc=-Wno-parentheses + all: $(LIBS) lint: lintcheck diff --git a/usr/src/lib/libdevinfo/Makefile.com b/usr/src/lib/libdevinfo/Makefile.com index 6d010b8053..690d2aea59 100644 --- a/usr/src/lib/libdevinfo/Makefile.com +++ b/usr/src/lib/libdevinfo/Makefile.com @@ -30,7 +30,6 @@ OBJECTS= devfsinfo.o devinfo.o devinfo_prop_decode.o devinfo_devlink.o \ devinfo_devperm.o devfsmap.o devinfo_profile.o \ devinfo_finddev.o devinfo_dli.o devinfo_dim.o \ devinfo_realpath.o devinfo_retire.o - include ../../Makefile.lib include ../../Makefile.rootfs @@ -41,6 +40,8 @@ $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) CFLAGS += $(CCVERBOSE) CPPFLAGS += -I.. +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/lib/libdhcpagent/Makefile.com b/usr/src/lib/libdhcpagent/Makefile.com index 7b68b64299..c01532cac2 100644 --- a/usr/src/lib/libdhcpagent/Makefile.com +++ b/usr/src/lib/libdhcpagent/Makefile.com @@ -40,6 +40,7 @@ SRCDIR = ../common $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-type-limits .KEEP_STATE: diff --git a/usr/src/lib/libdhcpdu/Makefile.com b/usr/src/lib/libdhcpdu/Makefile.com index c758684255..cbab028471 100644 --- a/usr/src/lib/libdhcpdu/Makefile.com +++ b/usr/src/lib/libdhcpdu/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY = rfc2136.a VERS = .1 @@ -44,6 +42,9 @@ SRCDIR = ../common LINTFLAGS += -erroff=E_CONSTANT_CONDITION CPPFLAGS += -D_REENTRANT -I../../libresolv2/include +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + MAPFILES = ../common/mapfile .KEEP_STATE: diff --git a/usr/src/lib/libdhcpsvc/Makefile.com b/usr/src/lib/libdhcpsvc/Makefile.com index df7838be2e..30ba2e8b04 100644 --- a/usr/src/lib/libdhcpsvc/Makefile.com +++ b/usr/src/lib/libdhcpsvc/Makefile.com @@ -22,11 +22,11 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# include $(SRC)/lib/Makefile.lib COMDIR = $(SRC)/common/net/dhcp CPPFLAGS += -I$(SRC)/lib/libdhcpsvc/head -D_REENTRANT + +CERRWARN += -_gcc=-Wno-uninitialized diff --git a/usr/src/lib/libdhcputil/Makefile.com b/usr/src/lib/libdhcputil/Makefile.com index 342f71f16d..c8a695b368 100644 --- a/usr/src/lib/libdhcputil/Makefile.com +++ b/usr/src/lib/libdhcputil/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY = libdhcputil.a VERS = .1 @@ -46,6 +44,8 @@ SRCS = $(LOCOBJS:%.o=$(SRCDIR)/%.c) $(COMOBJS:%.o=$(COMDIR)/%.c) $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized CPPFLAGS += -I$(COMDIR) .KEEP_STATE: diff --git a/usr/src/lib/libdisasm/Makefile.com b/usr/src/lib/libdisasm/Makefile.com index 07280f6d5a..32614b2262 100644 --- a/usr/src/lib/libdisasm/Makefile.com +++ b/usr/src/lib/libdisasm/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# # # The build process for libdisasm is sightly different from that used by other @@ -100,6 +98,9 @@ ASFLAGS += -P $(ASFLAGS_$(CURTYPE)) -D_ASM $(LINTLIB) := SRCS = $(COMDIR)/$(LINTSRC) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # We want the thread-specific errno in the library, but we don't want it in # the standalone. $(DTS_ERRNO) is designed to add -D_TS_ERRNO to $(CPPFLAGS), # in order to enable this feature. Conveniently, -D_REENTRANT does the same diff --git a/usr/src/lib/libdiskmgt/Makefile.com b/usr/src/lib/libdiskmgt/Makefile.com index f840110dbf..37598c8fc5 100644 --- a/usr/src/lib/libdiskmgt/Makefile.com +++ b/usr/src/lib/libdiskmgt/Makefile.com @@ -44,6 +44,9 @@ SRCDIR = ../common $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized CPPFLAGS += -D_REENTRANT -I$(SRC)/lib/libdiskmgt/common .KEEP_STATE: diff --git a/usr/src/lib/libdladm/Makefile.com b/usr/src/lib/libdladm/Makefile.com index 5c61d566bc..5bb56d1440 100644 --- a/usr/src/lib/libdladm/Makefile.com +++ b/usr/src/lib/libdladm/Makefile.com @@ -42,6 +42,10 @@ SRCDIR = ../common $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized CPPFLAGS += -I$(SRCDIR) -D_REENTRANT .KEEP_STATE: diff --git a/usr/src/lib/libdll/Makefile.com b/usr/src/lib/libdll/Makefile.com index 20ec620bc7..745aabb9f1 100644 --- a/usr/src/lib/libdll/Makefile.com +++ b/usr/src/lib/libdll/Makefile.com @@ -83,6 +83,9 @@ CFLAGS += \ CFLAGS64 += \ $(ASTCFLAGS64) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/libdlpi/Makefile.com b/usr/src/lib/libdlpi/Makefile.com index 621cb0b217..474a349943 100644 --- a/usr/src/lib/libdlpi/Makefile.com +++ b/usr/src/lib/libdlpi/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY = libdlpi.a VERS = .1 @@ -42,6 +40,7 @@ SRCDIR = ../common $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized CPPFLAGS += -I$(SRCDIR) -D_REENTRANT .KEEP_STATE: diff --git a/usr/src/lib/libdns_sd/Makefile.com b/usr/src/lib/libdns_sd/Makefile.com index 4b6fe00f9b..4dfbabb468 100644 --- a/usr/src/lib/libdns_sd/Makefile.com +++ b/usr/src/lib/libdns_sd/Makefile.com @@ -21,8 +21,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# LIBRARY = libdns_sd.a VERS = .1 @@ -38,9 +36,12 @@ SRCDIR = ../common LDLIBS += -lsocket -lc C99MODE = $(C99_ENABLE) -CFLAGS += -erroff=E_ASSIGNMENT_TYPE_MISMATCH CPPFLAGS += -I$(SRCDIR) -DNOT_HAVE_SA_LEN +CERRWARN += -erroff=E_ASSIGNMENT_TYPE_MISMATCH + +CERRWARN += -_gcc=-Wno-implicit-function-declaration + .PARALLEL = $(OBJECTS) .KEEP_STATE: diff --git a/usr/src/lib/libdscfg/Makefile.com b/usr/src/lib/libdscfg/Makefile.com index 2aadbede42..b12fb3a2b8 100644 --- a/usr/src/lib/libdscfg/Makefile.com +++ b/usr/src/lib/libdscfg/Makefile.com @@ -53,6 +53,12 @@ LINTFLAGS += -erroff=E_BAD_FORMAT_ARG_TYPE2 LINTOUT= lint.out LINTOUT_INTER= lintinter.out +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-address + ROOTLINTDIR= $(ROOTLIBDIR) ROOTLINT= $(LINTSRC:%=$(ROOTLINTDIR)/%) diff --git a/usr/src/lib/libdtrace/Makefile.com b/usr/src/lib/libdtrace/Makefile.com index 085f5c5e28..d92d33dff7 100644 --- a/usr/src/lib/libdtrace/Makefile.com +++ b/usr/src/lib/libdtrace/Makefile.com @@ -123,6 +123,13 @@ CLOBBERFILES += drti.o CPPFLAGS += -I../common -I. CFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS) CFLAGS64 += $(CCVERBOSE) $(C_BIGPICFLAGS) + +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch + YYCFLAGS = LDLIBS += -lgen -lproc -lrtld_db -lnsl -lsocket -lctf -lelf -lc -lzonecfg DRTILDLIBS = $(LDLIBS.lib) -lc diff --git a/usr/src/lib/libdtrace_jni/Makefile.com b/usr/src/lib/libdtrace_jni/Makefile.com index 6d2aad2d0c..9d605b3c59 100644 --- a/usr/src/lib/libdtrace_jni/Makefile.com +++ b/usr/src/lib/libdtrace_jni/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY = libdtrace_jni.a VERS = .1 @@ -50,6 +48,9 @@ CPPFLAGS += -I$(JAVA_ROOT)/include -I$(JAVA_ROOT)/include/solaris CPPFLAGS += -I../java/native CFLAGS += $(CCVERBOSE) -K PIC CFLAGS64 += $(CCVERBOSE) -K PIC + +CERRWARN += -_gcc=-Wno-uninitialized + LDLIBS += -lc -luutil -ldtrace -lproc LINTLIB = diff --git a/usr/src/lib/libeti/form/Makefile.com b/usr/src/lib/libeti/form/Makefile.com index 932a603632..465eddae38 100644 --- a/usr/src/lib/libeti/form/Makefile.com +++ b/usr/src/lib/libeti/form/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libform.a VERS= .1 @@ -77,6 +75,10 @@ CPPFLAGS += -I../inc CFLAGS += $(CCVERBOSE) LDLIBS += -lcurses -lc +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-char-subscripts + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/libeti/menu/Makefile.com b/usr/src/lib/libeti/menu/Makefile.com index 14eeb40cfa..2782c3bc6c 100644 --- a/usr/src/lib/libeti/menu/Makefile.com +++ b/usr/src/lib/libeti/menu/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libmenu.a VERS= .1 @@ -75,6 +73,8 @@ CPPFLAGS += -I../inc CFLAGS += $(CCVERBOSE) LDLIBS += -lcurses -lc +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/libeti/panel/Makefile.com b/usr/src/lib/libeti/panel/Makefile.com index 4baeb2867d..2783c77ee4 100644 --- a/usr/src/lib/libeti/panel/Makefile.com +++ b/usr/src/lib/libeti/panel/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libpanel.a VERS= .1 @@ -51,6 +49,8 @@ CPPFLAGS += -I../inc CFLAGS += $(CCVERBOSE) LDLIBS += -lcurses -lc +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/libexacct/Makefile.com b/usr/src/lib/libexacct/Makefile.com index 82925b1906..bc3332a971 100644 --- a/usr/src/lib/libexacct/Makefile.com +++ b/usr/src/lib/libexacct/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY = libexacct.a VERS = .1 @@ -43,6 +41,7 @@ SRCDIR = ../common $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized CPPFLAGS += -D_FILE_OFFSET_BITS=64 debug := CPPFLAGS += -DLIBEXACCT_DEBUG diff --git a/usr/src/lib/libexacct/demo/Makefile b/usr/src/lib/libexacct/demo/Makefile index 1e0e7a313a..76159a4914 100644 --- a/usr/src/lib/libexacct/demo/Makefile +++ b/usr/src/lib/libexacct/demo/Makefile @@ -31,6 +31,7 @@ include ../../../cmd/Makefile.cmd LDLIBS += -lexacct -lproject -lsocket -lnsl CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/lib/libfdisk/Makefile.com b/usr/src/lib/libfdisk/Makefile.com index f253312c8e..7e05c8f947 100644 --- a/usr/src/lib/libfdisk/Makefile.com +++ b/usr/src/lib/libfdisk/Makefile.com @@ -52,6 +52,8 @@ CFLAGS64 += -D_FILE_OFFSET_BITS=64 LINTFLAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTFLAGS64 += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/libfru/libfruraw/Makefile.com b/usr/src/lib/libfru/libfruraw/Makefile.com index 1302bceca9..76bdea8a36 100644 --- a/usr/src/lib/libfru/libfruraw/Makefile.com +++ b/usr/src/lib/libfru/libfruraw/Makefile.com @@ -52,6 +52,8 @@ CPPFLAGS += -I.. \ CPPFLAGS += -D_REENTRANT CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized + $(LINTLIB) := LINTFLAGS = -nvx -I.. $(LINTLIB) := LINTFLAGS64 = -nvx -m64 -I.. diff --git a/usr/src/lib/libfru/libfrureg/Makefile.com b/usr/src/lib/libfru/libfrureg/Makefile.com index b377d791be..f52ae73c86 100644 --- a/usr/src/lib/libfru/libfrureg/Makefile.com +++ b/usr/src/lib/libfru/libfrureg/Makefile.com @@ -56,6 +56,8 @@ CPPFLAGS += -I.. \ CPPFLAGS += -D_REENTRANT CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-variable + $(LINTLIB) := LINTFLAGS = -nvx -I.. $(LINTLIB) := LINTFLAGS64 = -nvx -m64 -I.. diff --git a/usr/src/lib/libfru/libnvfru/Makefile.com b/usr/src/lib/libfru/libnvfru/Makefile.com index 1acea847d2..5dc2723b30 100644 --- a/usr/src/lib/libfru/libnvfru/Makefile.com +++ b/usr/src/lib/libfru/libnvfru/Makefile.com @@ -50,6 +50,8 @@ CPPFLAGS += -I.. \ CPPFLAGS += -D_REENTRANT CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-switch + $(LINTLIB) := LINTFLAGS = -nvx -I.. $(LINTLIB) := LINTFLAGS64 = -nvx -m64 -I.. diff --git a/usr/src/lib/libfruutils/Makefile.com b/usr/src/lib/libfruutils/Makefile.com index 63bb8347a3..37c2ba8a6d 100644 --- a/usr/src/lib/libfruutils/Makefile.com +++ b/usr/src/lib/libfruutils/Makefile.com @@ -50,6 +50,9 @@ CLEANFILES= $(LINTOUT) CPPFLAGS += -I.. -D_REENTRANT CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + $(LINTLIB) := LINTFLAGS = -nvx $(LINTLIB) := LINTFLAGS64 = -nvx -m64 diff --git a/usr/src/lib/libfsmgt/Makefile.com b/usr/src/lib/libfsmgt/Makefile.com index d0fd25a89d..c265c052dd 100644 --- a/usr/src/lib/libfsmgt/Makefile.com +++ b/usr/src/lib/libfsmgt/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY = libfsmgt.a VERS = .1 @@ -49,11 +47,13 @@ LDLIBS += -lc -lnsl -lkstat SRCDIR = ../common $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) -#add nfs/lib directory as part of the include path CFLAGS += $(CCVERBOSE) CPPFLAGS += -D_REENTRANT -I$(SRC)/lib/libfsmgt/common \ -I$(SRC)/cmd/fs.d/nfs/lib +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/libgen/Makefile.com b/usr/src/lib/libgen/Makefile.com index f3974592c4..52bace544f 100644 --- a/usr/src/lib/libgen/Makefile.com +++ b/usr/src/lib/libgen/Makefile.com @@ -42,6 +42,10 @@ $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) CFLAGS += $(CCVERBOSE) CPPFLAGS += -D_REENTRANT -D_LARGEFILE64_SOURCE -I../inc -I../../common/inc +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/libgss/Makefile.com b/usr/src/lib/libgss/Makefile.com index ee197cbb7b..48b984a96b 100644 --- a/usr/src/lib/libgss/Makefile.com +++ b/usr/src/lib/libgss/Makefile.com @@ -106,6 +106,11 @@ CPPFLAGS += -I$(GSSCRED_DIR) -I$(SRC)/uts/common/gssapi/include \ -I$(SRC)/lib/gss_mechs/mech_krb5/include/ \ -DHAVE_STDLIB_H +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-empty-body + $(EXPORT_RELEASE_BUILD)include $(CLOSED)/lib/libgss/Makefile.export .KEEP_STATE: diff --git a/usr/src/lib/libhotplug/Makefile.com b/usr/src/lib/libhotplug/Makefile.com index e463eca54d..92fb91de2a 100644 --- a/usr/src/lib/libhotplug/Makefile.com +++ b/usr/src/lib/libhotplug/Makefile.com @@ -36,6 +36,8 @@ SRCDIR = ../common CPPFLAGS += -I$(SRCDIR) -D_REENTRANT $(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC) +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/libidmap/Makefile.com b/usr/src/lib/libidmap/Makefile.com index e50bbe02a1..39f2ccd957 100644 --- a/usr/src/lib/libidmap/Makefile.com +++ b/usr/src/lib/libidmap/Makefile.com @@ -53,6 +53,9 @@ IDMAP_PROT_X = $(SRC)/uts/common/rpcsvc/idmap_prot.x CFLAGS += $(CCVERBOSE) CPPFLAGS += -D_REENTRANT -I$(SRCDIR) +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-switch + CLOBBERFILES += idmap_xdr.c lint := OBJECTS = $(LINT_OBJECTS) diff --git a/usr/src/lib/libima/Makefile.com b/usr/src/lib/libima/Makefile.com index 48f4c5b6e6..c9e20a1db4 100644 --- a/usr/src/lib/libima/Makefile.com +++ b/usr/src/lib/libima/Makefile.com @@ -39,17 +39,20 @@ LIBS = $(DYNLIB) $(LINTLIB) LDLIBS += -lc CFLAGS += -mt -CFLAGS += -v +CFLAGS += $(CCVERBOSE) CFLAGS += -xCC CFLAGS += -erroff=E_IMPLICIT_DECL_FUNC_RETURN_INT CFLAGS += -DSOLARIS CFLAGS64 += -mt -CFLAGS64 += -v +CFLAGS64 += $(CCVERBOSE) CFLAGS64 += -xCC CFLAGS64 += -erroff=E_IMPLICIT_DECL_FUNC_RETURN_INT CFLAGS64 += -DSOLARIS +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-implicit-function-declaration + LINTFLAGS += -DSOLARIS LINTFLAGS64 += -DSOLARIS diff --git a/usr/src/lib/libinetsvc/Makefile.com b/usr/src/lib/libinetsvc/Makefile.com index 164d31c196..be13b64f96 100644 --- a/usr/src/lib/libinetsvc/Makefile.com +++ b/usr/src/lib/libinetsvc/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY = libinetsvc.a VERS = .1 @@ -41,6 +39,10 @@ CFLAGS += $(CCVERBOSE) -Wp,-xc99=%all CPPFLAGS += -I../common -D_REENTRANT $(RELEASE_BUILD)CPPFLAGS += -DNDEBUG +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/libinetutil/Makefile.com b/usr/src/lib/libinetutil/Makefile.com index 231dadfb58..e866d1c434 100644 --- a/usr/src/lib/libinetutil/Makefile.com +++ b/usr/src/lib/libinetutil/Makefile.com @@ -48,6 +48,9 @@ LDLIBS += -lsocket -lc CFLAGS += $(CCVERBOSE) CPPFLAGS += -I$(SRCDIR) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/libinstzones/Makefile.com b/usr/src/lib/libinstzones/Makefile.com index 994d0e5e91..b00c58f370 100644 --- a/usr/src/lib/libinstzones/Makefile.com +++ b/usr/src/lib/libinstzones/Makefile.com @@ -53,6 +53,10 @@ LINTFLAGS= -umx -errtags \ -erroff=E_BAD_PTR_CAST_ALIGN,E_BAD_PTR_CAST $(LINTLIB):= SRCS = $(SRCDIR)/$(LINTSRC) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-address + LIBS = $(DYNLIB) $(LINTLIB) DYNFLAGS += $(ZLAZYLOAD) diff --git a/usr/src/lib/libipadm/Makefile.com b/usr/src/lib/libipadm/Makefile.com index 3b6827a7fb..33685ff755 100644 --- a/usr/src/lib/libipadm/Makefile.com +++ b/usr/src/lib/libipadm/Makefile.com @@ -41,6 +41,8 @@ SRCDIR = ../common $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized CPPFLAGS += -I$(SRCDIR) -D_REENTRANT .KEEP_STATE: diff --git a/usr/src/lib/libipmi/Makefile.com b/usr/src/lib/libipmi/Makefile.com index 059c574685..eef10e59af 100644 --- a/usr/src/lib/libipmi/Makefile.com +++ b/usr/src/lib/libipmi/Makefile.com @@ -58,6 +58,8 @@ LDLIBS += -lc -lm -lnvpair -lsocket -lnsl CPPFLAGS += $(INCS) C99MODE = $(C99_ENABLE) +CERRWARN += -_gcc=-Wno-uninitialized + $(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC) .KEEP_STATE: diff --git a/usr/src/lib/libipsecutil/Makefile.com b/usr/src/lib/libipsecutil/Makefile.com index b0d4f6a190..de17899c49 100644 --- a/usr/src/lib/libipsecutil/Makefile.com +++ b/usr/src/lib/libipsecutil/Makefile.com @@ -41,6 +41,9 @@ LDLIBS += $(LAZYLIBS) CFLAGS += $(CCVERBOSE) CPPFLAGS += -I$(SRCDIR) +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/libiscsit/Makefile.com b/usr/src/lib/libiscsit/Makefile.com index ac7a6facc1..f733019450 100644 --- a/usr/src/lib/libiscsit/Makefile.com +++ b/usr/src/lib/libiscsit/Makefile.com @@ -43,6 +43,7 @@ C99MODE= -xc99=%all C99LMODE= -Xc99=%all LDLIBS += -lc -lnvpair -lstmf -luuid -lnsl -lscf CPPFLAGS += $(INCS) -D_REENTRANT +CERRWARN += -_gcc=-Wno-parentheses SRCS= $(OBJS_COMMON:%.o=$(SRCDIR)/%.c) \ $(ISCSIT_OBJS_SHARED:%.o=$(SRC)/common/iscsit/%.c) \ diff --git a/usr/src/lib/libkmf/ber_der/Makefile.com b/usr/src/lib/libkmf/ber_der/Makefile.com index bbf6f26209..6654e7cfde 100644 --- a/usr/src/lib/libkmf/ber_der/Makefile.com +++ b/usr/src/lib/libkmf/ber_der/Makefile.com @@ -49,6 +49,8 @@ CPPFLAGS64 += -I$(ADJUNCT_PROTO)/usr/include/libxml2 \ -I$(INCDIR) -I../../include LDLIBS += -lc +CERRWARN += -_gcc=-Wno-unused-label + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/libkmf/libkmf/Makefile.com b/usr/src/lib/libkmf/libkmf/Makefile.com index c5aa4f8db8..a704d1e5a8 100644 --- a/usr/src/lib/libkmf/libkmf/Makefile.com +++ b/usr/src/lib/libkmf/libkmf/Makefile.com @@ -66,6 +66,11 @@ $(DYNLIB64) := LDLIBS64 += -lxml2 CPPFLAGS += -I$(INCDIR) -I$(ADJUNCT_PROTO)/usr/include/libxml2 \ -I../../ber_der/inc -I$(SRCDIR) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/libkmf/plugins/kmf_nss/Makefile.com b/usr/src/lib/libkmf/plugins/kmf_nss/Makefile.com index 3034f44bc6..3b5f23aa92 100644 --- a/usr/src/lib/libkmf/plugins/kmf_nss/Makefile.com +++ b/usr/src/lib/libkmf/plugins/kmf_nss/Makefile.com @@ -55,6 +55,10 @@ PICS= $(OBJECTS:%=pics/%) LINTFLAGS += -erroff=E_STATIC_UNUSED LINTFLAGS64 += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-uninitialized + lint:= NSSLIBS = $(BERLIB) lint:= NSSLIBS64 = $(BERLIB64) diff --git a/usr/src/lib/libkmf/plugins/kmf_openssl/Makefile.com b/usr/src/lib/libkmf/plugins/kmf_openssl/Makefile.com index abcbd6173a..76ecd38479 100644 --- a/usr/src/lib/libkmf/plugins/kmf_openssl/Makefile.com +++ b/usr/src/lib/libkmf/plugins/kmf_openssl/Makefile.com @@ -50,6 +50,10 @@ CFLAGS += $(CCVERBOSE) CPPFLAGS += -D_REENTRANT $(KMFINC) \ -I$(INCDIR) -I$(ADJUNCT_PROTO)/usr/include/libxml2 +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-uninitialized + PICS= $(OBJECTS:%=pics/%) lint:= OPENSSLLIBS= $(LINTSSLLIBS) diff --git a/usr/src/lib/libkmf/plugins/kmf_pkcs11/Makefile.com b/usr/src/lib/libkmf/plugins/kmf_pkcs11/Makefile.com index a81e2515a0..0b69e23fd6 100644 --- a/usr/src/lib/libkmf/plugins/kmf_pkcs11/Makefile.com +++ b/usr/src/lib/libkmf/plugins/kmf_pkcs11/Makefile.com @@ -53,6 +53,8 @@ CPPFLAGS += -D_REENTRANT $(KMFINC) -I$(INCDIR) \ -I$(ADJUNCT_PROTO)/usr/include/libxml2 -I$(BIGNUMDIR) LINTFLAGS64 += -errchk=longptr64 +CERRWARN += -_gcc=-Wno-unused-label + PICS= $(OBJECTS:%=pics/%) LDLIBS += $(PKCS11LIBS) diff --git a/usr/src/lib/libkvm/Makefile.com b/usr/src/lib/libkvm/Makefile.com index f85c414bf4..9bef6968ba 100644 --- a/usr/src/lib/libkvm/Makefile.com +++ b/usr/src/lib/libkvm/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libkvm.a VERS= .1 @@ -48,6 +46,8 @@ LDLIBS += -lelf -lc CPPFLAGS = -D_KMEMUSER -D_LARGEFILE64_SOURCE=1 -I.. $(CPPFLAGS.master) +CERRWARN += -_gcc=-Wno-uninitialized + CLOBBERFILES += test test.o .KEEP_STATE: diff --git a/usr/src/lib/libldap5/Makefile.com b/usr/src/lib/libldap5/Makefile.com index 4761f423c9..ee48739eea 100644 --- a/usr/src/lib/libldap5/Makefile.com +++ b/usr/src/lib/libldap5/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libldap.a VERS= .5 @@ -113,6 +111,15 @@ sparcv9_C_PICFLAGS = $(sparcv9_C_BIGPICFLAGS) CFLAGS += $(CCVERBOSE) $(LOCFLAGS) CFLAGS64 += $(LOCFLAGS) + +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-address + LDLIBS += -lsasl -lsocket -lnsl -lmd -lc .KEEP_STATE: diff --git a/usr/src/lib/libmapid/Makefile.com b/usr/src/lib/libmapid/Makefile.com index 895cb8f898..2b1eaac8a5 100644 --- a/usr/src/lib/libmapid/Makefile.com +++ b/usr/src/lib/libmapid/Makefile.com @@ -54,6 +54,9 @@ LDLIBS += -lresolv -lc -lscf CFLAGS += $(CCVERBOSE) CPPFLAGS += -I$(SRCDIR) -I$(SMF_DIR) -D_REENTRANT +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/lib/libmtmalloc/Makefile.com b/usr/src/lib/libmtmalloc/Makefile.com index a141c2d208..ae66153665 100644 --- a/usr/src/lib/libmtmalloc/Makefile.com +++ b/usr/src/lib/libmtmalloc/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY = libmtmalloc.a VERS = .1 @@ -46,6 +44,8 @@ DYNFLAGS += $(ZINTERPOSE) $(LINTLIB) lint := LINTFLAGS += -erroff=E_BAD_PTR_CAST_ALIGN $(LINTLIB) lint := LINTFLAGS64 += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/libndmp/Makefile.com b/usr/src/lib/libndmp/Makefile.com index 8b81a2dc50..0100610434 100644 --- a/usr/src/lib/libndmp/Makefile.com +++ b/usr/src/lib/libndmp/Makefile.com @@ -52,6 +52,9 @@ LIBS= $(DYNLIB) $(LINTLIB) LDLIBS += -lc -lscf CPPFLAGS += $(INCS) -D_REENTRANT +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-uninitialized + SRCS= $(OBJECTS:%.o=$(SRCDIR)/%.c) $(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC) diff --git a/usr/src/lib/libnisdb/Makefile b/usr/src/lib/libnisdb/Makefile index d8983800be..08d1cf8ad8 100644 --- a/usr/src/lib/libnisdb/Makefile +++ b/usr/src/lib/libnisdb/Makefile @@ -136,6 +136,13 @@ $(LARGEPICS) := i386_C_PICFLAGS = $(C_BIGPICFLAGS) CPPFLAGS += -D_REENTRANT +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses + # Extra includes, from yp, for yptol files. CPPFLAGS += -I$(SRC)/cmd/ypcmd diff --git a/usr/src/lib/libnls/Makefile.com b/usr/src/lib/libnls/Makefile.com index e19d456bb1..ad699dfca7 100644 --- a/usr/src/lib/libnls/Makefile.com +++ b/usr/src/lib/libnls/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libnls.a VERS= .1 @@ -42,6 +40,8 @@ LINTSRC= $(LINTLIB:%.ln=%) CFLAGS += $(CCVERBOSE) LDLIBS += -lnsl -lc +CERRWARN += -_gcc=-Wno-unused-variable + .KEEP_STATE: lint: lintcheck diff --git a/usr/src/lib/libnsl/Makefile.com b/usr/src/lib/libnsl/Makefile.com index 8469102553..809a7edf4a 100644 --- a/usr/src/lib/libnsl/Makefile.com +++ b/usr/src/lib/libnsl/Makefile.com @@ -200,6 +200,15 @@ CFLAGS64 += $(XSTRCONST) CCFLAGS += -_CC=-features=conststrings CCFLAGS64 += -_CC=-features=conststrings +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-empty-body +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-clobbered + LIBMP = -lmp lint := LIBMP = LDLIBS += $(LIBMP) -lmd -lc diff --git a/usr/src/lib/libnsl/nsl/t_error.c b/usr/src/lib/libnsl/nsl/t_error.c index cc316dea2a..4bd7448e07 100644 --- a/usr/src/lib/libnsl/nsl/t_error.c +++ b/usr/src/lib/libnsl/nsl/t_error.c @@ -26,10 +26,9 @@ /* * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright (c) 2012 Gary Mills */ -#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.2 */ - #include "mt.h" #include <xti.h> #include <errno.h> @@ -42,21 +41,19 @@ int _tx_error(const char *s, int api_semantics) { const char *c; - int n; + int errnum = errno; /* In case a system call fails. */ c = t_strerror(t_errno); if (s != NULL && *s != '\0') { - n = strlen(s); - if (n) { - (void) write(2, s, (unsigned)n); - (void) write(2, ": ", 2); - } + (void) write(2, s, strlen(s)); + (void) write(2, ": ", 2); } - (void) write(2, c, (unsigned)strlen(c)); + (void) write(2, c, strlen(c)); if (t_errno == TSYSERR) { + c = strerror(errnum); (void) write(2, ": ", 2); - perror(""); - } else - (void) write(2, "\n", 1); + (void) write(2, c, strlen(c)); + } + (void) write(2, "\n", 1); return (0); } diff --git a/usr/src/lib/libnvpair/Makefile.com b/usr/src/lib/libnvpair/Makefile.com index b278c85672..6a21376eb3 100644 --- a/usr/src/lib/libnvpair/Makefile.com +++ b/usr/src/lib/libnvpair/Makefile.com @@ -56,6 +56,10 @@ LINTFLAGS64 += -erroff=E_BAD_PTR_CAST_ALIGN LINTFLAGS += -erroff=E_BAD_FORMAT_STR2 LINTFLAGS64 += -erroff=E_BAD_FORMAT_STR2 +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + CFLAGS += $(CCVERBOSE) CPPFLAGS += -D_REENTRANT diff --git a/usr/src/lib/libnwam/Makefile.com b/usr/src/lib/libnwam/Makefile.com index e193da49d5..b569916b63 100644 --- a/usr/src/lib/libnwam/Makefile.com +++ b/usr/src/lib/libnwam/Makefile.com @@ -51,6 +51,9 @@ $(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC) CFLAGS += $(CCVERBOSE) CPPFLAGS += -I$(SRCDIR) -D_REENTRANT +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/libpam/Makefile.com b/usr/src/lib/libpam/Makefile.com index 4e0262afb9..3eb16f8baf 100644 --- a/usr/src/lib/libpam/Makefile.com +++ b/usr/src/lib/libpam/Makefile.com @@ -39,6 +39,8 @@ LDLIBS += -lc CFLAGS += $(CCVERBOSE) CPPFLAGS += -I $(SRCDIR) +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/libparted/Makefile.com b/usr/src/lib/libparted/Makefile.com index 28cb243da9..2d79d23cc4 100644 --- a/usr/src/lib/libparted/Makefile.com +++ b/usr/src/lib/libparted/Makefile.com @@ -117,6 +117,10 @@ CPPFLAGS += -I$(SRCDIR)/lib -I$(SRCDIR)/include DYNFLAGS += $(ZINTERPOSE) LDLIBS += -ldiskmgt -luuid -lc -lnvpair +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-type-limits + .KEEP_STATE: # diff --git a/usr/src/lib/libpcp/Makefile.com b/usr/src/lib/libpcp/Makefile.com index 43328dbebd..21f26dd465 100644 --- a/usr/src/lib/libpcp/Makefile.com +++ b/usr/src/lib/libpcp/Makefile.com @@ -47,6 +47,7 @@ LINKED_LLIBLPCP_DIR = \ LIBS = $(DYNLIB) $(LINTLIB) CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += -lc -lumem -ldevinfo PLATLIBS = $(USR_PLAT_DIR)/$(PLATFORM)/lib INS.slink6= $(RM) -r $@; $(SYMLINK) ../../$(PLATFORM)/lib/libpcp.so.1 $@ diff --git a/usr/src/lib/libpicltree/Makefile.com b/usr/src/lib/libpicltree/Makefile.com index bb88e33d2e..e444c69527 100644 --- a/usr/src/lib/libpicltree/Makefile.com +++ b/usr/src/lib/libpicltree/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libpicltree.a VERS= .1 @@ -38,6 +36,8 @@ $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) CPPFLAGS += -D_REENTRANT -I.. -I../../libpicl -I$(SRC)/cmd/picl/plugins/inc CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all : $(LIBS) diff --git a/usr/src/lib/libpkg/Makefile.com b/usr/src/lib/libpkg/Makefile.com index 054752764f..8f56a61423 100644 --- a/usr/src/lib/libpkg/Makefile.com +++ b/usr/src/lib/libpkg/Makefile.com @@ -67,6 +67,12 @@ LIBS = $(DYNLIB) $(LINTLIB) LDLIBS += -lc -lssl -lwanboot -lcrypto -lscf -ladm CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-value CPPFLAGS += -I$(SRCDIR) -D_FILE_OFFSET_BITS=64 .KEEP_STATE: diff --git a/usr/src/lib/libpool/Makefile.com b/usr/src/lib/libpool/Makefile.com index ffad924f32..13b8a05cc1 100644 --- a/usr/src/lib/libpool/Makefile.com +++ b/usr/src/lib/libpool/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY = libpool.a VERS = .1 @@ -53,6 +51,9 @@ CFLAGS += $(CCVERBOSE) CPPFLAGS += -D_REENTRANT -D_FILE_OFFSET_BITS=64 \ -I$(ADJUNCT_PROTO)/usr/include/libxml2 +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/lib/libpp/Makefile.com b/usr/src/lib/libpp/Makefile.com index ebdedc2806..1b3923d70e 100644 --- a/usr/src/lib/libpp/Makefile.com +++ b/usr/src/lib/libpp/Makefile.com @@ -98,6 +98,12 @@ CFLAGS += \ CFLAGS64 += \ $(ASTCFLAGS64) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-empty-body +CERRWARN += -_gcc=-Wno-unused-value + pics/ppcall.o := CERRWARN += -erroff=E_INTEGER_OVERFLOW_DETECTED pics/ppcontrol.o := CERRWARN += -erroff=E_INTEGER_OVERFLOW_DETECTED pics/ppcpp.o := CERRWARN += -erroff=E_INTEGER_OVERFLOW_DETECTED diff --git a/usr/src/lib/libproc/Makefile.com b/usr/src/lib/libproc/Makefile.com index 042b42fd53..794c54f3eb 100644 --- a/usr/src/lib/libproc/Makefile.com +++ b/usr/src/lib/libproc/Makefile.com @@ -20,6 +20,7 @@ # # # Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright 2012 DEY Storage Systems, Inc. All rights reserved. # LIBRARY = libproc.a @@ -30,6 +31,7 @@ CMNOBJS = \ Pcontrol.o \ Pcore.o \ Pexecname.o \ + Pfdinfo.o \ Pgcore.o \ Pidle.o \ Pisprocdir.o \ @@ -72,7 +74,14 @@ CMNOBJS = \ ISAOBJS = \ Pisadep.o -OBJECTS = $(CMNOBJS) $(ISAOBJS) +amd64_SAVEOBJS = \ + saveargs.o + +amd64_CPPFLAGS = -I$(SRC)/common/saveargs + +SAVEOBJS = $($(MACH64)_SAVEOBJS) + +OBJECTS = $(CMNOBJS) $(ISAOBJS) $(SAVEOBJS) # include library definitions include ../../Makefile.lib @@ -82,6 +91,7 @@ SRCS = $(CMNOBJS:%.o=../common/%.c) $(ISAOBJS:%.o=%.c) LIBS = $(DYNLIB) $(LINTLIB) LDLIBS += -lrtld_db -lelf -lctf -lc +CPPFLAGS += $($(MACH64)_CPPFLAGS) SRCDIR = ../common $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) @@ -89,6 +99,11 @@ $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) CFLAGS += $(CCVERBOSE) CPPFLAGS += -I$(SRCDIR) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-unused-label + # All interfaces are interposable, therefore don't allow direct binding to # libproc. Disable libproc from directly binding to itself, but allow libperl # to directly bind to its dependencies (ie. map -Bdirect -> -zdirect). Ensure @@ -108,3 +123,7 @@ include ../../Makefile.targ objs/%.o pics/%.o: %.c $(COMPILE.c) -o $@ $< $(POST_PROCESS_O) + +objs/%.o pics/%.o: $(SRC)/common/saveargs/%.c + $(COMPILE.c) -o $@ $< + $(POST_PROCESS_O) diff --git a/usr/src/lib/libproc/amd64/Pisadep.c b/usr/src/lib/libproc/amd64/Pisadep.c index a78e304d4c..8ef8340b02 100644 --- a/usr/src/lib/libproc/amd64/Pisadep.c +++ b/usr/src/lib/libproc/amd64/Pisadep.c @@ -36,6 +36,7 @@ #include <errno.h> #include <string.h> +#include <saveargs.h> #include "Pcontrol.h" #include "Pstack.h" @@ -346,6 +347,121 @@ ucontext_n_to_prgregs(const ucontext_t *src, prgregset_t dst) (void) memcpy(dst, src->uc_mcontext.gregs, sizeof (gregset_t)); } +/* + * Read arguments from the frame indicated by regs into args, return the + * number of arguments successfully read + */ +static int +read_args(struct ps_prochandle *P, uintptr_t fp, uintptr_t pc, prgreg_t *args, + size_t argsize) +{ + GElf_Sym sym; + ctf_file_t *ctfp = NULL; + ctf_funcinfo_t finfo; + prsyminfo_t si = {0}; + uint8_t ins[SAVEARGS_INSN_SEQ_LEN]; + size_t insnsize; + int argc = 0; + int rettype = 0; + int start_index = 0; + int args_style = 0; + int i; + ctf_id_t args_types[5]; + + if (Pxlookup_by_addr(P, pc, NULL, 0, &sym, &si) != 0) + return (0); + + if ((ctfp = Paddr_to_ctf(P, pc)) == NULL) + return (0); + + if (ctf_func_info(ctfp, si.prs_id, &finfo) == CTF_ERR) + return (0); + + argc = finfo.ctc_argc; + + if (argc == 0) + return (0); + + rettype = ctf_type_kind(ctfp, finfo.ctc_return); + + /* + * If the function returns a structure or union greater than 16 bytes + * in size %rdi contains the address in which to store the return + * value rather than for an argument. + */ + if (((rettype == CTF_K_STRUCT) || (rettype == CTF_K_UNION)) && + ctf_type_size(ctfp, finfo.ctc_return) > 16) + start_index = 1; + else + start_index = 0; + + /* + * If any of the first 5 arguments are a structure less than 16 bytes + * in size, it will be passed spread across two argument registers, + * and we will not cope. + */ + if (ctf_func_args(ctfp, si.prs_id, 5, args_types) == CTF_ERR) + return (0); + + for (i = 0; i < MIN(5, finfo.ctc_argc); i++) { + int t = ctf_type_kind(ctfp, args_types[i]); + + if (((t == CTF_K_STRUCT) || (t == CTF_K_UNION)) && + ctf_type_size(ctfp, args_types[i]) <= 16) + return (0); + } + + /* + * The number of instructions to search for argument saving is limited + * such that only instructions prior to %pc are considered and we + * never read arguments from a function where the saving code has not + * in fact yet executed. + */ + insnsize = MIN(MIN(sym.st_size, SAVEARGS_INSN_SEQ_LEN), + pc - sym.st_value); + + if (Pread(P, ins, insnsize, sym.st_value) != insnsize) + return (0); + + if ((argc != 0) && + ((args_style = saveargs_has_args(ins, insnsize, argc, + start_index)) != SAVEARGS_NO_ARGS)) { + int regargs = MIN((6 - start_index), argc); + size_t size = regargs * sizeof (long); + int i; + + /* + * If Studio pushed a structure return address as an argument, + * we need to read one more argument than actually exists (the + * addr) to make everything line up. + */ + if (args_style == SAVEARGS_STRUCT_ARGS) + size += sizeof (long); + + if (Pread(P, args, size, (fp - size)) != size) + return (0); + + for (i = 0; i < (regargs / 2); i++) { + prgreg_t t = args[i]; + + args[i] = args[regargs - i - 1]; + args[regargs - i - 1] = t; + } + + if (argc > regargs) { + size = MIN((argc - regargs) * sizeof (long), + argsize - (regargs * sizeof (long))); + + if (Pread(P, &args[regargs], size, fp + + (sizeof (uintptr_t) * 2)) != size) + return (6); + } + + return (argc); + } else { + return (0); + } +} int Pstack_iter(struct ps_prochandle *P, const prgregset_t regs, @@ -381,7 +497,7 @@ Pstack_iter(struct ps_prochandle *P, const prgregset_t regs, prgreg_t signo; siginfo_t *sip; } sigframe_t; - prgreg_t args[32]; + prgreg_t args[32] = {0}; if (P->status.pr_dmodel != PR_MODEL_LP64) return (Pstack_iter32(P, regs, func, arg)); @@ -400,20 +516,16 @@ Pstack_iter(struct ps_prochandle *P, const prgregset_t regs, if (fp != 0 && Pread(P, &frame, sizeof (frame), (uintptr_t)fp) == sizeof (frame)) { - - if (frame.pc != -1) { - /* - * Function arguments are not available on - * amd64 without extensive DWARF processing. - */ - argc = 0; - } else { + if (frame.pc == -1) { argc = 3; args[2] = fp + sizeof (sigframe_t); if (Pread(P, &args, 2 * sizeof (prgreg_t), fp + 2 * sizeof (prgreg_t)) != 2 * sizeof (prgreg_t)) argc = 0; + } else { + argc = read_args(P, fp, pc, args, + sizeof (args)); } } else { (void) memset(&frame, 0, sizeof (frame)); diff --git a/usr/src/lib/libproc/common/Pcontrol.c b/usr/src/lib/libproc/common/Pcontrol.c index 2a32522e0c..1e7ce1556e 100644 --- a/usr/src/lib/libproc/common/Pcontrol.c +++ b/usr/src/lib/libproc/common/Pcontrol.c @@ -24,6 +24,7 @@ * Use is subject to license terms. * * Portions Copyright 2007 Chad Mynhier + * Copyright 2012 DEY Storage Systems, Inc. All rights reserved. */ #include <assert.h> @@ -986,6 +987,13 @@ Pfree(struct ps_prochandle *P) } free(P->hashtab); } + + while (P->num_fd > 0) { + fd_info_t *fip = list_next(&P->fd_head); + list_unlink(fip); + free(fip); + P->num_fd--; + } (void) mutex_unlock(&P->proc_lock); (void) mutex_destroy(&P->proc_lock); diff --git a/usr/src/lib/libproc/common/Pcontrol.h b/usr/src/lib/libproc/common/Pcontrol.h index 192038b9b6..4774093b6d 100644 --- a/usr/src/lib/libproc/common/Pcontrol.h +++ b/usr/src/lib/libproc/common/Pcontrol.h @@ -22,6 +22,9 @@ * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2012 DEY Storage Systems, Inc. All rights reserved. + */ #ifndef _PCONTROL_H #define _PCONTROL_H @@ -136,6 +139,11 @@ typedef struct lwp_info { /* per-lwp information from core file */ #endif } lwp_info_t; +typedef struct fd_info { + plist_t fd_list; /* linked list */ + prfdinfo_t fd_info; /* fd info */ +} fd_info_t; + typedef struct core_info { /* information specific to core files */ char core_dmodel; /* data model for core file */ int core_errno; /* error during initialization if != 0 */ @@ -223,6 +231,8 @@ struct ps_prochandle { uintptr_t *ucaddrs; /* ucontext-list addresses */ uint_t ucnelems; /* number of elements in the ucaddrs list */ char *zoneroot; /* cached path to zone root */ + plist_t fd_head; /* head of file desc info list */ + int num_fd; /* number of file descs in list */ }; /* flags */ @@ -269,6 +279,8 @@ extern char *Plofspath(const char *, char *, size_t); extern char *Pzoneroot(struct ps_prochandle *, char *, size_t); extern char *Pzonepath(struct ps_prochandle *, const char *, char *, size_t); +extern fd_info_t *Pfd2info(struct ps_prochandle *, int); + extern char *Pfindmap(struct ps_prochandle *, map_info_t *, char *, size_t); diff --git a/usr/src/lib/libproc/common/Pcore.c b/usr/src/lib/libproc/common/Pcore.c index de868725db..3e0350eb04 100644 --- a/usr/src/lib/libproc/common/Pcore.c +++ b/usr/src/lib/libproc/common/Pcore.c @@ -22,6 +22,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2012 DEY Storage Systems, Inc. All rights reserved. + */ #include <sys/types.h> #include <sys/utsname.h> @@ -300,6 +303,26 @@ err: } static int +note_fdinfo(struct ps_prochandle *P, size_t nbytes) +{ + prfdinfo_t prfd; + fd_info_t *fip; + + if ((nbytes < sizeof (prfd)) || + (read(P->asfd, &prfd, sizeof (prfd)) != sizeof (prfd))) { + dprintf("Pgrab_core: failed to read NT_FDINFO\n"); + return (-1); + } + + if ((fip = Pfd2info(P, prfd.pr_fd)) == NULL) { + dprintf("Pgrab_core: failed to add NT_FDINFO\n"); + return (-1); + } + (void) memcpy(&fip->fd_info, &prfd, sizeof (prfd)); + return (0); +} + +static int note_platform(struct ps_prochandle *P, size_t nbytes) { char *plat; @@ -701,6 +724,7 @@ static int (*nhdlrs[])(struct ps_prochandle *, size_t) = { note_priv_info, /* 19 NT_PRPRIVINFO */ note_content, /* 20 NT_CONTENT */ note_zonename, /* 21 NT_ZONENAME */ + note_fdinfo, /* 22 NT_FDINFO */ }; /* diff --git a/usr/src/lib/libproc/common/Pfdinfo.c b/usr/src/lib/libproc/common/Pfdinfo.c new file mode 100644 index 0000000000..0d41b5606d --- /dev/null +++ b/usr/src/lib/libproc/common/Pfdinfo.c @@ -0,0 +1,168 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright 2012 DEY Storage Systems, Inc. All rights reserved. + */ + +#include <limits.h> +#include <stdio.h> +#include <errno.h> +#include <unistd.h> +#include <dirent.h> +#include <ctype.h> +#include <string.h> +#include <sys/mkdev.h> + +#include "libproc.h" +#include "Pcontrol.h" + +/* + * Pfdinfo.c - obtain open file information. + */ + +/* + * Allocate an fd_info structure and stick it on the list. + * (Unless one already exists.) The list is sorted in + * reverse order. We will traverse it in that order later. + * This makes the usual ordered insert *fast*. + */ +fd_info_t * +Pfd2info(struct ps_prochandle *P, int fd) +{ + fd_info_t *fip = list_next(&P->fd_head); + fd_info_t *next; + int i; + + if (fip == NULL) { + list_link(&P->fd_head, NULL); + fip = list_next(&P->fd_head); + } + + for (i = 0; i < P->num_fd; i++, fip = list_next(fip)) { + if (fip->fd_info.pr_fd == fd) { + return (fip); + } + if (fip->fd_info.pr_fd < fd) { + break; + } + } + + next = fip; + if ((fip = calloc(1, sizeof (*fip))) == NULL) + return (NULL); + + fip->fd_info.pr_fd = fd; + list_link(fip, next ? next : (void *)&(P->fd_head)); + P->num_fd++; + return (fip); +} + +/* + * Attempt to load the open file information from a live process. + */ +static void +load_fdinfo(struct ps_prochandle *P) +{ + /* + * In the unlikely case there are *no* file descriptors open, + * we will keep rescanning the proc directory, which will be empty. + * This is an edge case it isn't worth adding additional state to + * to eliminate. + */ + if (P->num_fd > 0) { + return; + } + + if (P->state != PS_DEAD && P->state != PS_IDLE) { + char dir_name[PATH_MAX]; + char path[PATH_MAX]; + struct dirent *ent; + DIR *dirp; + int fd; + + /* + * Try to get the path information first. + */ + (void) snprintf(dir_name, sizeof (dir_name), + "%s/%d/path", procfs_path, (int)P->pid); + dirp = opendir(dir_name); + if (dirp == NULL) { + return; + } + ent = NULL; + while ((ent = readdir(dirp)) != NULL) { + fd_info_t *fip; + prfdinfo_t *info; + int len; + struct stat64 stat; + + if (!isdigit(ent->d_name[0])) + continue; + + fd = atoi(ent->d_name); + + fip = Pfd2info(P, fd); + info = &fip->fd_info; + info->pr_fd = fd; + + if (pr_fstat64(P, fd, &stat) == 0) { + info->pr_mode = stat.st_mode; + info->pr_uid = stat.st_uid; + info->pr_gid = stat.st_gid; + info->pr_major = major(stat.st_dev); + info->pr_minor = minor(stat.st_dev); + info->pr_rmajor = major(stat.st_rdev); + info->pr_rminor = minor(stat.st_rdev); + info->pr_size = stat.st_size; + info->pr_ino = stat.st_ino; + } + + info->pr_fileflags = pr_fcntl(P, fd, F_GETXFL, 0); + info->pr_fdflags = pr_fcntl(P, fd, F_GETFD, 0); + info->pr_offset = pr_llseek(P, fd, 0, SEEK_CUR); + + /* attempt to determine the path to it */ + (void) snprintf(path, sizeof (path), + "%s/%d/path/%d", procfs_path, (int)P->pid, fd); + len = readlink(path, info->pr_path, + sizeof (info->pr_path) - 1); + + if (len < 0) { + info->pr_path[0] = 0; + } else { + info->pr_path[len] = 0; + } + } + (void) closedir(dirp); + + } +} + +int +Pfdinfo_iter(struct ps_prochandle *P, proc_fdinfo_f *func, void *cd) +{ + fd_info_t *fip; + int rv; + + /* Make sure we have live data, if appropriate */ + load_fdinfo(P); + + /* NB: We walk the list backwards. */ + + for (fip = list_prev(&P->fd_head); + fip != (void *)&P->fd_head; + fip = list_prev(fip)) { + if ((rv = func(cd, &fip->fd_info)) != 0) + return (rv); + } + return (0); +} diff --git a/usr/src/lib/libproc/common/Pgcore.c b/usr/src/lib/libproc/common/Pgcore.c index 590c55142a..f409e96259 100644 --- a/usr/src/lib/libproc/common/Pgcore.c +++ b/usr/src/lib/libproc/common/Pgcore.c @@ -23,6 +23,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2012 DEY Storage Systems, Inc. All rights reserved. + */ #define _STRUCTURED_PROC 1 @@ -84,6 +87,11 @@ typedef struct { shstrtab_t pgc_shstrtab; } pgcore_t; +typedef struct { + int fd_fd; + off64_t *fd_doff; +} fditer_t; + static void shstrtab_init(shstrtab_t *s) { @@ -543,6 +551,17 @@ new_per_lwp(void *data, const lwpstatus_t *lsp, const lwpsinfo_t *lip) return (0); } +static int +iter_fd(void *data, prfdinfo_t *fdinfo) +{ + fditer_t *iter = data; + + if (write_note(iter->fd_fd, NT_FDINFO, fdinfo, + sizeof (*fdinfo), iter->fd_doff) != 0) + return (1); + return (0); +} + static uint_t count_sections(pgcore_t *pgc) { @@ -1341,6 +1360,15 @@ Pfgcore(struct ps_prochandle *P, int fd, core_content_t content) &doff) != 0) goto err; + { + fditer_t iter; + iter.fd_fd = fd; + iter.fd_doff = &doff; + + if (Pfdinfo_iter(P, iter_fd, &iter) != 0) + goto err; + } + #if defined(__i386) || defined(__amd64) /* CSTYLED */ { diff --git a/usr/src/lib/libproc/common/libproc.h b/usr/src/lib/libproc/common/libproc.h index b4374324a1..1e59b5089f 100644 --- a/usr/src/lib/libproc/common/libproc.h +++ b/usr/src/lib/libproc/common/libproc.h @@ -24,6 +24,7 @@ * Use is subject to license terms. * * Portions Copyright 2007 Chad Mynhier + * Copyright 2012 DEY Storage Systems, Inc. All rights reserved. */ /* @@ -713,6 +714,12 @@ extern int proc_initstdio(void); extern int proc_flushstdio(void); extern int proc_finistdio(void); +/* + * Iterate over all open files. + */ +typedef int proc_fdinfo_f(void *, prfdinfo_t *); +extern int Pfdinfo_iter(struct ps_prochandle *, proc_fdinfo_f *, void *); + #ifdef __cplusplus } #endif diff --git a/usr/src/lib/libproc/common/mapfile-vers b/usr/src/lib/libproc/common/mapfile-vers index c3e2eb2e8a..9482a53145 100644 --- a/usr/src/lib/libproc/common/mapfile-vers +++ b/usr/src/lib/libproc/common/mapfile-vers @@ -20,6 +20,7 @@ # # # Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright 2012 DEY Storage Systems, Inc. All rights reserved. # # @@ -298,6 +299,7 @@ SYMBOL_VERSION SUNWprivate_1.1 { Pzonename; Pzonepath; Pzoneroot; + Pfdinfo_iter; $if _x86 && _ELF32 Pldt; diff --git a/usr/src/lib/libproject/Makefile.com b/usr/src/lib/libproject/Makefile.com index f40d9365e2..9f5984e877 100644 --- a/usr/src/lib/libproject/Makefile.com +++ b/usr/src/lib/libproject/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY = libproject.a VERS = .1 @@ -50,6 +48,8 @@ CLEANFILES += $(LINTOUT) $(LINTLIB) CPPFLAGS += -D_REENTRANT CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized LDLIBS += -lc -lsecdb -lproc -lpool $(LINTLIB) := SRCS = ../common/llib-lproject diff --git a/usr/src/lib/libprtdiag/Makefile.com b/usr/src/lib/libprtdiag/Makefile.com index 0375fd3fe9..b0fb2b65bb 100644 --- a/usr/src/lib/libprtdiag/Makefile.com +++ b/usr/src/lib/libprtdiag/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# # # Create default so empty rules don't @@ -46,6 +44,11 @@ IFLAGS += -I $(UTSBASE)/sun4u/sunfire IFLAGS += -I $(UTSBASE)/sun4u/serengeti CPPFLAGS = $(IFLAGS) $(CPPFLAGS.master) CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-unused-label LDLIBS += -lc -lkstat DYNFLAGS += -Wl,-f/usr/platform/\$$PLATFORM/lib/$(DYNLIBPSR) diff --git a/usr/src/lib/libprtdiag_psr/sparc/Makefile.com b/usr/src/lib/libprtdiag_psr/sparc/Makefile.com index bdc057b8df..3c58df4d3b 100644 --- a/usr/src/lib/libprtdiag_psr/sparc/Makefile.com +++ b/usr/src/lib/libprtdiag_psr/sparc/Makefile.com @@ -49,6 +49,12 @@ LIBS = $(DYNLIB) MAPFILES = CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-address IFLAGS += -I $(UTSBASE)/sun4u IFLAGS += -I $(UTSCLOSED)/sun4u IFLAGS += -I $(UTSCLOSED)/sun4u/sunfire -I $(UTSBASE)/sun4u/sunfire diff --git a/usr/src/lib/libraidcfg/Makefile.com b/usr/src/lib/libraidcfg/Makefile.com index c624f858af..1aeed69bfd 100644 --- a/usr/src/lib/libraidcfg/Makefile.com +++ b/usr/src/lib/libraidcfg/Makefile.com @@ -39,6 +39,7 @@ SRCDIR = ../common $(LINTLIB):= SRCS = $(LINTSRC:%=$(SRCDIR)/%) CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-type-limits .KEEP_STATE: diff --git a/usr/src/lib/librcm/Makefile.com b/usr/src/lib/librcm/Makefile.com index 8d7fe5f117..cecf34f9fc 100644 --- a/usr/src/lib/librcm/Makefile.com +++ b/usr/src/lib/librcm/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= librcm.a VERS= .1 @@ -40,6 +38,8 @@ $(LINTLIB) := SRCS = ../llib-lrcm CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/librdc/Makefile.com b/usr/src/lib/librdc/Makefile.com index b44b02abd2..1819191a1c 100644 --- a/usr/src/lib/librdc/Makefile.com +++ b/usr/src/lib/librdc/Makefile.com @@ -50,6 +50,10 @@ LINTFLAGS += -erroff=E_BAD_FORMAT_ARG_TYPE2 LINTOUT= lint.out LINTOUT_INTER= lintinter.out +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-address + LINTSRC= $(LINTLIB:%.ln=%) ROOTLINTDIR= $(ROOTLIBDIR) ROOTLINT= $(LINTSRC:%=$(ROOTLINTDIR)/%) diff --git a/usr/src/lib/libresolv/Makefile b/usr/src/lib/libresolv/Makefile index b2637e6f89..7351ef9048 100644 --- a/usr/src/lib/libresolv/Makefile +++ b/usr/src/lib/libresolv/Makefile @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libresolv.a VERS= .1 @@ -57,6 +55,13 @@ C99MODE= $(C99_DISABLE) CPPFLAGS = -I. -I../common/inc $(CPPFLAGS.master) -DDEBUG -DSYSV -D_REENTRANT LDLIBS += -lsocket -lnsl -lc +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-implicit-int +CERRWARN += -_gcc=-Wno-extra + ROOTDYNLIBS= $(DYNLIB:%=$(ROOTLIBDIR)/%) .KEEP_STATE: diff --git a/usr/src/lib/libresolv2/Makefile.com b/usr/src/lib/libresolv2/Makefile.com index 3c69a169b6..c02ae222a1 100644 --- a/usr/src/lib/libresolv2/Makefile.com +++ b/usr/src/lib/libresolv2/Makefile.com @@ -109,6 +109,9 @@ LOCFLAGS += -D_SYS_STREAM_H -D_REENTRANT -DSVR4 -DSUNW_OPTIONS \ $(SOLCOMPAT) -I../include -I../../common/inc CPPFLAGS += $(LOCFLAGS) + +CERRWARN += -_gcc=-Wno-implicit-function-declaration + DYNFLAGS += $(ZNODELETE) LDLIBS += -lsocket -lnsl -lc -lmd diff --git a/usr/src/lib/librpcsvc/Makefile.com b/usr/src/lib/librpcsvc/Makefile.com index 21741282d0..64a77e161e 100644 --- a/usr/src/lib/librpcsvc/Makefile.com +++ b/usr/src/lib/librpcsvc/Makefile.com @@ -23,8 +23,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= librpcsvc.a VERS = .1 @@ -50,6 +48,11 @@ LIBS = $(DYNLIB) $(LINTLIB) CPPFLAGS += -DYP +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + $(LINTLIB):= SRCS = $(SRCDIR)/$(LINTSRC) LDLIBS += -lnsl -lc diff --git a/usr/src/lib/librsm/Makefile.com b/usr/src/lib/librsm/Makefile.com index ec648ce30e..5323366ddd 100644 --- a/usr/src/lib/librsm/Makefile.com +++ b/usr/src/lib/librsm/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= librsm.a VERS= .2 @@ -50,6 +48,9 @@ $(NOT_RELEASE_BUILD)COPTFLAG64 = CPPFLAGS = -I../inc -I../../common/inc $(CPPFLAGS.master) -D_REENTRANT $(DEBUG) +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses + LDLIBS += -lc .KEEP_STATE: diff --git a/usr/src/lib/libscf/Makefile.com b/usr/src/lib/libscf/Makefile.com index 5c53b8803f..66b02c4fa7 100644 --- a/usr/src/lib/libscf/Makefile.com +++ b/usr/src/lib/libscf/Makefile.com @@ -56,6 +56,12 @@ CFLAGS += $(CCVERBOSE) -Wp,-xc99=%all CPPFLAGS += -I../inc -I../../common/inc -I$(COMDIR) -I$(ROOTHDRDIR) $(NOT_RELEASE_BUILD) CPPFLAGS += -DFASTREBOOT_DEBUG +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # For native builds, we compile and link against the native version # of libuutil. diff --git a/usr/src/lib/libsec/Makefile.com b/usr/src/lib/libsec/Makefile.com index 245c41b762..1f83f66516 100644 --- a/usr/src/lib/libsec/Makefile.com +++ b/usr/src/lib/libsec/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libsec.a VERS= .1 @@ -48,6 +46,11 @@ CFLAGS += $(CCVERBOSE) CPPFLAGS += -I$(SRCDIR) -I. -I../../../common/acl LDLIBS += -lc -lavl -lidmap +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable + # install this library in the root filesystem include ../../Makefile.rootfs diff --git a/usr/src/lib/libsecdb/Makefile.com b/usr/src/lib/libsecdb/Makefile.com index 3a9678d730..1c2076cdc7 100644 --- a/usr/src/lib/libsecdb/Makefile.com +++ b/usr/src/lib/libsecdb/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY = libsecdb.a VERS = .1 @@ -46,6 +44,9 @@ CPPFLAGS += -D_REENTRANT LINTFLAGS += -DPIC LINTFLAGS64 += -DPIC +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/libshare/Makefile.com b/usr/src/lib/libshare/Makefile.com index 92d1b89000..b5f057d694 100644 --- a/usr/src/lib/libshare/Makefile.com +++ b/usr/src/lib/libshare/Makefile.com @@ -44,6 +44,10 @@ $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) CFLAGS += $(CCVERBOSE) CPPFLAGS += -D_REENTRANT -I$(NFSLIB_DIR) \ -I$(ADJUNCT_PROTO)/usr/include/libxml2 +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch +CPPFLAGS += -D_REENTRANT -I$(NFSLIB_DIR) -I/usr/include/libxml2 .KEEP_STATE: diff --git a/usr/src/lib/libshare/autofs/Makefile.com b/usr/src/lib/libshare/autofs/Makefile.com index 65fc6fc379..0538ec55fa 100644 --- a/usr/src/lib/libshare/autofs/Makefile.com +++ b/usr/src/lib/libshare/autofs/Makefile.com @@ -47,7 +47,11 @@ LDLIBS += -lshare -lscf -lumem -lc -lxml2 #add nfs/lib directory as part of the include path CFLAGS += $(CCVERBOSE) CPPFLAGS += -D_REENTRANT -I$(AUTOFSSMFLIB_DIR) \ - -I$(ADJUNCT_PROTO)/usr/include/libxml2 \ + -I$(ADJUNCT_PROTO)/usr/include/libxml2 +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized +CPPFLAGS += -D_REENTRANT -I$(AUTOFSSMFLIB_DIR) -I/usr/include/libxml2 \ -I$(SRCDIR)../common .KEEP_STATE: diff --git a/usr/src/lib/libshare/nfs/Makefile.com b/usr/src/lib/libshare/nfs/Makefile.com index fa7a7e3aaf..44e661bbe2 100644 --- a/usr/src/lib/libshare/nfs/Makefile.com +++ b/usr/src/lib/libshare/nfs/Makefile.com @@ -48,6 +48,12 @@ LDLIBS += -lshare -lnsl -lscf -lumem -lc -lxml2 CFLAGS += $(CCVERBOSE) CPPFLAGS += -D_REENTRANT -I$(NFSLIB_DIR) \ -I$(ADJUNCT_PROTO)/usr/include/libxml2 -I$(SRCDIR)/../common +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized +CPPFLAGS += -D_REENTRANT -I$(NFSLIB_DIR) -I/usr/include/libxml2 \ + -I$(SRCDIR)/../common .KEEP_STATE: diff --git a/usr/src/lib/libshare/smb/Makefile.com b/usr/src/lib/libshare/smb/Makefile.com index 18ced31487..3fe65dff3c 100644 --- a/usr/src/lib/libshare/smb/Makefile.com +++ b/usr/src/lib/libshare/smb/Makefile.com @@ -49,7 +49,10 @@ LDLIBS += -lshare -ldlpi -lnsl -lnvpair -lscf -lumem -lc all install := LDLIBS += -lxml2 CFLAGS += $(CCVERBOSE) -CPPFLAGS += -D_REENTRANT -I$(ADJUNCT_PROTO)/usr/include/libxml2 \ +CPPFLAGS += -D_REENTRANT -I$(ADJUNCT_PROTO)/usr/include/libxml2 +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-switch +CPPFLAGS += -D_REENTRANT -I/usr/include/libxml2 \ -I$(SRCDIR)/../common $(ENABLE_SMB_PRINTING) CPPFLAGS += -DHAVE_CUPS diff --git a/usr/src/lib/libshare/smbfs/Makefile.com b/usr/src/lib/libshare/smbfs/Makefile.com index 501ebcfe52..fbd4b80000 100644 --- a/usr/src/lib/libshare/smbfs/Makefile.com +++ b/usr/src/lib/libshare/smbfs/Makefile.com @@ -19,8 +19,6 @@ # CDDL HEADER END # # -# ident "%Z%%M% %I% %E% SMI" -# # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -45,6 +43,10 @@ LDLIBS += -lshare -lscf -lumem -luuid -lc -lxml2 -lsmbfs CFLAGS += $(CCVERBOSE) CPPFLAGS += -D_REENTRANT -I$(ADJUNCT_PROTO)/usr/include/libxml2 \ -I$(SRCDIR)/../common -I$(SRC)/lib/libsmbfs -I$(SRC)/uts/common +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CPPFLAGS += -D_REENTRANT -I/usr/include/libxml2 -I$(SRCDIR)/../common \ + -I$(SRC)/lib/libsmbfs -I$(SRC)/uts/common .KEEP_STATE: diff --git a/usr/src/lib/libshell/Makefile.com b/usr/src/lib/libshell/Makefile.com index 32bba5796e..8dd5057867 100644 --- a/usr/src/lib/libshell/Makefile.com +++ b/usr/src/lib/libshell/Makefile.com @@ -107,11 +107,11 @@ OBJDIRS = \ PICSDIRS= $(OBJDIRS:%=pics/%) mkpicdirs: @mkdir -p $(PICSDIRS) - + # Specify the MACH we currently use to build and test ksh LIBSHELLMACH= $(TARGETMACH) LIBSHELLBASE=.. - + include ../../Makefile.astmsg include ../../Makefile.lib @@ -153,6 +153,14 @@ CFLAGS += \ CFLAGS64 += \ $(ASTCFLAGS64) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-char-subscripts + pics/sh/macro.o := CERRWARN += -erroff=E_NO_IMPLICIT_DECL_ALLOWED pics/sh/nvdisc.o := CERRWARN += -erroff=E_END_OF_LOOP_CODE_NOT_REACHED diff --git a/usr/src/lib/libsldap/Makefile.com b/usr/src/lib/libsldap/Makefile.com index 3eb70828f3..0d35b1f794 100644 --- a/usr/src/lib/libsldap/Makefile.com +++ b/usr/src/lib/libsldap/Makefile.com @@ -22,9 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# -# lib/libsldap/Makefile.com LIBRARY= libsldap.a VERS= .1 @@ -54,6 +51,10 @@ CPPFLAGS += -I../common -I$(SRC)/lib/libldap5/include/ldap \ LINTFLAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTFLAGS64 += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/libsldap/common/ns_connect.c b/usr/src/lib/libsldap/common/ns_connect.c index 68387eaa52..a8a03c16b1 100644 --- a/usr/src/lib/libsldap/common/ns_connect.c +++ b/usr/src/lib/libsldap/common/ns_connect.c @@ -21,6 +21,7 @@ /* * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. */ #include <stdlib.h> @@ -475,10 +476,10 @@ printCred(FILE *fp, const ns_cred_t *cred) return; } - (void) fprintf(fp, "tid= %d: AuthType=%d", t, cred->auth.type); - (void) fprintf(fp, "tid= %d: TlsType=%d", t, cred->auth.tlstype); - (void) fprintf(fp, "tid= %d: SaslMech=%d", t, cred->auth.saslmech); - (void) fprintf(fp, "tid= %d: SaslOpt=%d", t, cred->auth.saslopt); + (void) fprintf(fp, "tid= %d: AuthType=%d\n", t, cred->auth.type); + (void) fprintf(fp, "tid= %d: TlsType=%d\n", t, cred->auth.tlstype); + (void) fprintf(fp, "tid= %d: SaslMech=%d\n", t, cred->auth.saslmech); + (void) fprintf(fp, "tid= %d: SaslOpt=%d\n", t, cred->auth.saslopt); if (cred->hostcertpath) (void) fprintf(fp, "tid= %d: hostCertPath=%s\n", t, cred->hostcertpath); @@ -701,7 +702,8 @@ makeConnection(Connection **conp, const char *serverAddr, if (conp == NULL || errorp == NULL || auth == NULL) return (NS_LDAP_INVALID_PARAM); - *errorp = NULL; + if (*errorp) + (void) __ns_ldap_freeError(errorp); *conp = NULL; (void) memset(&sinfo, 0, sizeof (sinfo)); diff --git a/usr/src/lib/libsldap/common/ns_standalone.c b/usr/src/lib/libsldap/common/ns_standalone.c index 169efc9f3b..e18f1067f5 100644 --- a/usr/src/lib/libsldap/common/ns_standalone.c +++ b/usr/src/lib/libsldap/common/ns_standalone.c @@ -22,6 +22,7 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * Copyright 2012 Milan Jurik. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. */ #define __STANDALONE_MODULE__ @@ -1450,6 +1451,7 @@ __ns_ldap_getRootDSE(const char *server_addr, } __s_api_conn_user_free(cu); + DropConnection(sessionId, NS_LDAP_NEW_CONN); return (NS_LDAP_OP_FAILED); } __s_api_conn_user_free(cu); diff --git a/usr/src/lib/libslp/Makefile.com b/usr/src/lib/libslp/Makefile.com index c7b8fa21b8..80c1cc01e4 100644 --- a/usr/src/lib/libslp/Makefile.com +++ b/usr/src/lib/libslp/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY = libslp.a VERS = .1 @@ -47,6 +45,9 @@ CFLAGS += $(CCVERBOSE) CPPFLAGS += -D_REENTRANT -I../clib -I$(JAVA_ROOT)/include \ -I$(JAVA_ROOT)/include/solaris +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: all: diff --git a/usr/src/lib/libsmbfs/Makefile.com b/usr/src/lib/libsmbfs/Makefile.com index f7a6c06790..a3ec0fb397 100644 --- a/usr/src/lib/libsmbfs/Makefile.com +++ b/usr/src/lib/libsmbfs/Makefile.com @@ -97,6 +97,9 @@ LDLIBS += -lsocket -lnsl -lc -lmd -lpkcs11 -lkrb5 -lsec -lidmap # normal warnings... CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable + CPPFLAGS += -D__EXTENSIONS__ -D_REENTRANT -DMIA \ -I$(SRCDIR) -I.. \ -I$(SRC)/uts/common \ diff --git a/usr/src/lib/libsmedia/library/Makefile.com b/usr/src/lib/libsmedia/library/Makefile.com index afd20c4864..e570948866 100644 --- a/usr/src/lib/libsmedia/library/Makefile.com +++ b/usr/src/lib/libsmedia/library/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libsmedia.a VERS=.1 @@ -54,6 +52,8 @@ CPPFLAGS += -D_REENTRANT -I$(SRC)/cmd/smserverd/ CFLAGS += $(CCVERBOSE) CFLAGS64 += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-variable + LDLIBS += -lnsl -lc .KEEP_STATE: diff --git a/usr/src/lib/libsocket/Makefile.com b/usr/src/lib/libsocket/Makefile.com index e2dd0778df..1d22540eee 100644 --- a/usr/src/lib/libsocket/Makefile.com +++ b/usr/src/lib/libsocket/Makefile.com @@ -56,6 +56,11 @@ CFLAGS64 += $(XSTRCONST) CPPFLAGS += -DSYSV -D_REENTRANT -I../../common/inc %/rcmd.o := CPPFLAGS += -DNIS +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: all: diff --git a/usr/src/lib/libsqlite/Makefile.com b/usr/src/lib/libsqlite/Makefile.com index 5c2b47ae64..ecafa30d6c 100644 --- a/usr/src/lib/libsqlite/Makefile.com +++ b/usr/src/lib/libsqlite/Makefile.com @@ -2,8 +2,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# SQLITE_VERSION = 2.8.15-repcached @@ -93,6 +91,11 @@ SRCS = \ MYCPPFLAGS = -D_REENTRANT -DTHREADSAFE=1 -DHAVE_USLEEP=1 -I. -I.. -I$(SRCDIR) CPPFLAGS += $(MYCPPFLAGS) +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-label + MAPFILES = ../mapfile-sqlite # Header files used by all library source files. diff --git a/usr/src/lib/libstmf/Makefile.com b/usr/src/lib/libstmf/Makefile.com index 35c04ac4a2..99ca037802 100644 --- a/usr/src/lib/libstmf/Makefile.com +++ b/usr/src/lib/libstmf/Makefile.com @@ -41,6 +41,8 @@ C99LMODE= -Xc99=%all LDLIBS += -lc -lnvpair -lscf -lm CPPFLAGS += $(INCS) -D_REENTRANT +CERRWARN += -_gcc=-Wno-unused-label + $(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC) .KEEP_STATE: diff --git a/usr/src/lib/libsum/Makefile.com b/usr/src/lib/libsum/Makefile.com index 244bf290f5..5fdf850a78 100644 --- a/usr/src/lib/libsum/Makefile.com +++ b/usr/src/lib/libsum/Makefile.com @@ -74,6 +74,8 @@ CFLAGS += \ CFLAGS64 += \ $(ASTCFLAGS64) +CERRWARN += -_gcc=-Wno-parentheses + # This codepath is performance-critical sparc_COPTFLAG=-xO5 -_cc=-xprefetch=auto,explicit sparcv9_COPTFLAG=-xO5 -_cc=-xprefetch=auto,explicit diff --git a/usr/src/lib/libsun_ima/Makefile.com b/usr/src/lib/libsun_ima/Makefile.com index fd1779de3e..321b966a83 100644 --- a/usr/src/lib/libsun_ima/Makefile.com +++ b/usr/src/lib/libsun_ima/Makefile.com @@ -45,10 +45,11 @@ LDLIBS += -ldevinfo LDLIBS += -lsysevent CFLAGS += -mt -CFLAGS += -v +CFLAGS += $(CCVERBOSE) +CFLAGS64 += -mt +CFLAGS64 += $(CCVERBOSE) -CFLAGS64 += -mt -CFLAGS64 += -v +CERRWARN += -_gcc=-Wno-parentheses CPPFLAGS += -DSOLARIS diff --git a/usr/src/lib/libtecla/Makefile.com b/usr/src/lib/libtecla/Makefile.com index f80b1320b6..1f52c6b878 100644 --- a/usr/src/lib/libtecla/Makefile.com +++ b/usr/src/lib/libtecla/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libtecla.a VERS= .1 @@ -46,6 +44,8 @@ CPPFLAGS += -I$(SRCDIR) -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 \ -DPREFER_REENTRANT $(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC) +CERRWARN += -_gcc=-Wno-type-limits + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/libtnf/Makefile b/usr/src/lib/libtnf/Makefile index 8c6a1143c5..85abde990e 100644 --- a/usr/src/lib/libtnf/Makefile +++ b/usr/src/lib/libtnf/Makefile @@ -70,6 +70,8 @@ CPPFLAGS += -D_DATUM_MACROS -D_REENTRANT LINTFLAGS += -y +CERRWARN += -_gcc=-Wno-unused-variable + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/libtnfctl/Makefile.com b/usr/src/lib/libtnfctl/Makefile.com index 0f64791b28..569b7e92d7 100644 --- a/usr/src/lib/libtnfctl/Makefile.com +++ b/usr/src/lib/libtnfctl/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libtnfctl.a VERS= .1 @@ -78,6 +76,10 @@ CPPFLAGS += -I$(SRC)/lib/libtnfprobe -D_REENTRANT -I$(SRC)/cmd/sgs/include LINTFLAGS += -y +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-empty-body +CERRWARN += -_gcc=-Wno-parentheses + ASFLAGS += -P $(ROOTHDRS) := FILEMODE = 644 diff --git a/usr/src/lib/libtnfprobe/Makefile.com b/usr/src/lib/libtnfprobe/Makefile.com index d599d5fc7e..9dd31dd6f6 100644 --- a/usr/src/lib/libtnfprobe/Makefile.com +++ b/usr/src/lib/libtnfprobe/Makefile.com @@ -62,6 +62,10 @@ CPPFLAGS += -I.. -I$(UFSDIR) -D_REENTRANT -D_TNF_LIBRARY LINTFLAGS += -y +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + $(ROOTHDRS) := FILEMODE = 644 LDLIBS += -lc diff --git a/usr/src/lib/libtsnet/Makefile.com b/usr/src/lib/libtsnet/Makefile.com index 5e73758b4e..4eb55a843f 100644 --- a/usr/src/lib/libtsnet/Makefile.com +++ b/usr/src/lib/libtsnet/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY = libtsnet.a VERS = .1 @@ -49,6 +47,7 @@ LDLIBS += -lsocket -lnsl -lc -lsecdb -ltsol LIBTSOLINC = $(SRC)/lib/libtsol/common CPPFLAGS += -D_REENTRANT -I$(LIBTSOLINC) +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/lib/libtsol/Makefile.com b/usr/src/lib/libtsol/Makefile.com index fb46ac31c6..f58f6f63ec 100644 --- a/usr/src/lib/libtsol/Makefile.com +++ b/usr/src/lib/libtsol/Makefile.com @@ -59,6 +59,8 @@ CPPFLAGS += -D_REENTRANT -I$(SRCDIR) -I$(COMMONDIR) LINTFLAGS64 += -m64 +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/libumem/Makefile.com b/usr/src/lib/libumem/Makefile.com index 1507bb78c3..9c10ded585 100644 --- a/usr/src/lib/libumem/Makefile.com +++ b/usr/src/lib/libumem/Makefile.com @@ -129,6 +129,9 @@ ASFLAGS_standalone = -DUMEM_STANDALONE ASFLAGS_library = ASFLAGS += -P $(ASFLAGS_$(CURTYPE)) -D_ASM +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + $(LINTLIB) := SRCS = ../common/$(LINTSRC) # We want the thread-specific errno in the library, but we don't want it in diff --git a/usr/src/lib/libunistat/Makefile.com b/usr/src/lib/libunistat/Makefile.com index b737f5736b..522a938a4b 100644 --- a/usr/src/lib/libunistat/Makefile.com +++ b/usr/src/lib/libunistat/Makefile.com @@ -55,6 +55,9 @@ LINTFLAGS += -erroff=E_FUNC_RET_ALWAYS_IGNOR2 LINTOUT= lint.out LINTOUT_INTER= lintinter.out +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable + LINTSRC= $(LINTLIB:%.ln=%) ROOTLINTDIR= $(ROOTLIBDIR) ROOTLINT= $(LINTSRC:%=$(ROOTLINTDIR)/%) @@ -90,10 +93,10 @@ DFLAGS = -DISSTATIC=static # development (debug) - cstyle prohibits use of "STATIC" DFLAGS = -g -DISSTATIC=" " -CFLAGS += -v $(DFLAGS) -I. -DLIBSPCS_CLIENT\ +CFLAGS += $(CCVERBOSE) $(DFLAGS) -I. -DLIBSPCS_CLIENT\ -I$(JAVAINC) -I$(JAVAINCSOL)\ -DLIBUNISTAT_LOCALE=\"/usr/install/unistat/locale\" -CFLAGS64 += -v $(DFLAGS) -I. -DLIBSPCS_CLIENT\ +CFLAGS64 += $(CCVERBOSE) $(DFLAGS) -I. -DLIBSPCS_CLIENT\ -I$(JAVAINC) -I$(JAVAINCSOL)\ -DLIBUNISTAT_LOCALE=\"/usr/install/unistat/locale\" LDLIBS += -lc diff --git a/usr/src/lib/libv12n/Makefile.com b/usr/src/lib/libv12n/Makefile.com index 869beaf2d5..e8321c0a6b 100644 --- a/usr/src/lib/libv12n/Makefile.com +++ b/usr/src/lib/libv12n/Makefile.com @@ -39,6 +39,8 @@ SRCS = $(MACHCOBJS:%.o=../$(MACH)/%.c) CFLAGS += $(CCVERBOSE) $(C_BIGPICFLAGS) CFLAGS64 += $(CCVERBOSE) $(C_BIGPICFLAGS) +CERRWARN += -_gcc=-Wno-uninitialized + $(LINTLIB) := SRCS = ../common/llib-lv12n .KEEP_STATE: diff --git a/usr/src/lib/libvolmgt/Makefile.com b/usr/src/lib/libvolmgt/Makefile.com index c91a0027a1..7b26a99461 100644 --- a/usr/src/lib/libvolmgt/Makefile.com +++ b/usr/src/lib/libvolmgt/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libvolmgt.a VERS=.1 @@ -44,6 +42,8 @@ LINTSRC= $(LINTLIB:%.ln=%) CPPFLAGS = -I.. $(CPPFLAGS.master) CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-variable + LDLIBS += -ladm -lc .KEEP_STATE: diff --git a/usr/src/lib/libwanboot/Makefile.com b/usr/src/lib/libwanboot/Makefile.com index 5c1f561b35..54a5b54119 100644 --- a/usr/src/lib/libwanboot/Makefile.com +++ b/usr/src/lib/libwanboot/Makefile.com @@ -58,8 +58,12 @@ include ../../Makefile.lib LIBS += $(LINTLIB) LDLIBS += -lnvpair -lresolv -lnsl -lsocket -ldevinfo -ldhcputil \ - -linetutil -lc -lcrypto -lssl + -linetutil -lc -lcrypto -lssl CPPFLAGS = -I$(SRC)/common/net/wanboot/crypt $(CPPFLAGS.master) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-uninitialized # Must override SRCS from Makefile.lib since sources have # multiple source directories. diff --git a/usr/src/lib/libwanbootutil/Makefile.com b/usr/src/lib/libwanbootutil/Makefile.com index 56b7a96871..29434247e6 100644 --- a/usr/src/lib/libwanbootutil/Makefile.com +++ b/usr/src/lib/libwanbootutil/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY = libwanbootutil.a VERS = .1 @@ -66,6 +64,10 @@ LINTFLAGS += -erroff=E_FUNC_VAR_UNUSED CPPFLAGS += -I$(CRYPTO_DIR) +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized + install: all all: $(LIBS) diff --git a/usr/src/lib/libwrap/Makefile.com b/usr/src/lib/libwrap/Makefile.com index aeafc46ffe..f63bdd517f 100644 --- a/usr/src/lib/libwrap/Makefile.com +++ b/usr/src/lib/libwrap/Makefile.com @@ -48,10 +48,16 @@ CPPFLAGS += $(NETGROUP) $(TLI) $(ALWAYS_HOSTNAME) $(AUTH) \ $(STYLE) $(TABLES) $(DOT) $(BUGS) \ -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \ -I$(SRCDIR) -CFLAGS += $(CCVERBOSE) -erroff=E_FUNC_EXPECTS_TO_RETURN_VALUE \ - -erroff=E_IMPLICIT_DECL_FUNC_RETURN_INT \ - -erroff=E_OLD_STYLE_DECL_HIDES_PROTO \ - -_gcc=-Wno-return-type +CFLAGS += $(CCVERBOSE) + +CERRWARN += -erroff=E_FUNC_EXPECTS_TO_RETURN_VALUE +CERRWARN += -erroff=E_IMPLICIT_DECL_FUNC_RETURN_INT +CERRWARN += -erroff=E_OLD_STYLE_DECL_HIDES_PROTO + +CERRWARN += -_gcc=-Wno-return-type +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/lib/libxcurses/Makefile.com b/usr/src/lib/libxcurses/Makefile.com index 65374166ef..15658cc686 100644 --- a/usr/src/lib/libxcurses/Makefile.com +++ b/usr/src/lib/libxcurses/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libcurses.a VERS= .1 @@ -115,6 +113,11 @@ ROOTLIBS= $(LIBS:%=$(ROOTLIBDIR)/%) $(LINTLIB):= SRCS=../src/libc/llib-lcurses $(LINTLIB):= CPPFLAGS += -D_XOPEN_SOURCE_EXTENDED +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-function + LINTSRC= $(LINTLIB:%.ln=%) LDLIBS += -lc diff --git a/usr/src/lib/libxcurses2/Makefile.com b/usr/src/lib/libxcurses2/Makefile.com index 022b180a59..c1629d2435 100644 --- a/usr/src/lib/libxcurses2/Makefile.com +++ b/usr/src/lib/libxcurses2/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libcurses.a VERS= .2 @@ -98,6 +96,8 @@ LINTSRC= $(LINTLIB:%.ln=%) LDLIBS += -lc CPPFLAGS = -I../h -I../src/libc/xcurses $(CPPFLAGS.master) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-value # # If and when somebody gets around to messaging this, CLOBBERFILE should not diff --git a/usr/src/lib/libzdoor/Makefile.com b/usr/src/lib/libzdoor/Makefile.com index 09bde0f1b4..139c1e117c 100644 --- a/usr/src/lib/libzdoor/Makefile.com +++ b/usr/src/lib/libzdoor/Makefile.com @@ -22,6 +22,10 @@ # Use is subject to license terms. # +LIBRARY = libpapi-common.a +VERS = .0 +OBJECTS = attribute.o common.o library.o list.o misc.o status.o uri.o + LIBRARY= libzdoor.a VERS= .1 OBJECTS= zdoor.o \ @@ -35,9 +39,16 @@ include ../../Makefile.rootfs SRCDIR = ../common SRCS = $(OBJECTS:%.o=$(SRCDIR)/%.c) -CPPFLAGS += -I$(SRCDIR) -D_REENTRANT -D_FILE_OFFSET_BITS=64 -LIBS = $(DYNLIB) $(LINTLIB) -LDLIBS += -lc -lzonecfg -lcontract +LIBS = $(DYNLIB) + +$(LINTLIB):= SRCS = $(SRCDIR)/$(LINTSRC) + +CFLAGS += $(CCVERBOSE) +CPPFLAGS += -I$(SRCDIR) + +CERRWARN += -_gcc=-Wno-switch + +MAPFILES = $(SRCDIR)/mapfile $(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC) diff --git a/usr/src/lib/libzfs/Makefile.com b/usr/src/lib/libzfs/Makefile.com index 67aa4f4695..e7d33f3a02 100644 --- a/usr/src/lib/libzfs/Makefile.com +++ b/usr/src/lib/libzfs/Makefile.com @@ -72,6 +72,11 @@ LDLIBS += -lc -lm -ldevid -lgen -lnvpair -luutil -lavl -lefi \ -ladm -lidmap -ltsol -lmd -lumem -lzfs_core CPPFLAGS += $(INCS) -D_LARGEFILE64_SOURCE=1 -D_REENTRANT +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-function + SRCS= $(OBJS_COMMON:%.o=$(SRCDIR)/%.c) \ $(OBJS_SHARED:%.o=$(SRC)/common/zfs/%.c) $(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC) diff --git a/usr/src/lib/libzfs/common/llib-lzfs b/usr/src/lib/libzfs/common/llib-lzfs index bd026bcbbb..3552601183 100644 --- a/usr/src/lib/libzfs/common/llib-lzfs +++ b/usr/src/lib/libzfs/common/llib-lzfs @@ -20,13 +20,13 @@ */ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Copyright 2010 Nexenta Systems, Inc. All rights reserved. * Use is subject to license terms. */ - /* - * Copyright (c) 2012 by Delphix. All rights reserved. - */ +/* + * Copyright 2010 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /*LINTLIBRARY*/ /*PROTOLIB1*/ diff --git a/usr/src/lib/libzfs_jni/Makefile.com b/usr/src/lib/libzfs_jni/Makefile.com index ac81f03073..e9781efe61 100644 --- a/usr/src/lib/libzfs_jni/Makefile.com +++ b/usr/src/lib/libzfs_jni/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libzfs_jni.a VERS= .1 @@ -46,6 +44,8 @@ INCS += -I$(JAVA_ROOT)/include \ LDLIBS += -lc -lnvpair -ldiskmgt -lzfs CPPFLAGS += $(INCS) $(NOT_RELEASE_BUILD) CPPFLAGS += -DDEBUG +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized SRCDIR = ../common $(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC) diff --git a/usr/src/lib/libzonecfg/Makefile.com b/usr/src/lib/libzonecfg/Makefile.com index 62565705ef..ce29f58a9b 100644 --- a/usr/src/lib/libzonecfg/Makefile.com +++ b/usr/src/lib/libzonecfg/Makefile.com @@ -36,6 +36,9 @@ $(DYNLIB) := LDLIBS += -lxml2 SRCDIR = ../common CPPFLAGS += -I$(ADJUNCT_PROTO)/usr/include/libxml2 -I$(SRCDIR) -D_REENTRANT +CPPFLAGS += -I/usr/include/libxml2 -I$(SRCDIR) -D_REENTRANT +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses $(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC) .KEEP_STATE: diff --git a/usr/src/lib/libzonestat/Makefile.com b/usr/src/lib/libzonestat/Makefile.com index 65ab999206..be23af3d93 100644 --- a/usr/src/lib/libzonestat/Makefile.com +++ b/usr/src/lib/libzonestat/Makefile.com @@ -35,6 +35,8 @@ SRCDIR = ../common CPPFLAGS += -I../common -mt -D_POSIX_PTHREAD_SEMANTICS $(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC) +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/libzpool/Makefile.com b/usr/src/lib/libzpool/Makefile.com index 2485f7350f..3fbcd02844 100644 --- a/usr/src/lib/libzpool/Makefile.com +++ b/usr/src/lib/libzpool/Makefile.com @@ -62,6 +62,15 @@ CFLAGS64 += -g $(CCVERBOSE) $(CNOGLOBAL) LDLIBS += -lcmdutils -lumem -lavl -lnvpair -lz -lc -lsysevent -lmd CPPFLAGS += $(INCS) -DDEBUG +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-empty-body +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-label + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/libzpool/common/kernel.c b/usr/src/lib/libzpool/common/kernel.c index 04d530727f..c698c23ef6 100644 --- a/usr/src/lib/libzpool/common/kernel.c +++ b/usr/src/lib/libzpool/common/kernel.c @@ -46,6 +46,7 @@ int aok; uint64_t physmem; vnode_t *rootdir = (vnode_t *)0xabcd1234; char hw_serial[HW_HOSTID_LEN]; +kmutex_t cpu_lock; vmem_t *zio_arena = NULL; struct utsname utsname = { @@ -790,6 +791,26 @@ ddi_strtoull(const char *str, char **nptr, int base, u_longlong_t *result) return (0); } +/* ARGSUSED */ +cyclic_id_t +cyclic_add(cyc_handler_t *hdlr, cyc_time_t *when) +{ + return (1); +} + +/* ARGSUSED */ +void +cyclic_remove(cyclic_id_t id) +{ +} + +/* ARGSUSED */ +int +cyclic_reprogram(cyclic_id_t id, hrtime_t expiration) +{ + return (1); +} + /* * ========================================================================= * kernel emulation setup & teardown @@ -823,6 +844,8 @@ kernel_init(int mode) system_taskq_init(); + mutex_init(&cpu_lock, NULL, MUTEX_DEFAULT, NULL); + spa_init(mode); } @@ -989,3 +1012,48 @@ zfs_onexit_cb_data(minor_t minor, uint64_t action_handle, void **data) { return (0); } + +void +bioinit(buf_t *bp) +{ + bzero(bp, sizeof (buf_t)); +} + +void +biodone(buf_t *bp) +{ + if (bp->b_iodone != NULL) { + (*(bp->b_iodone))(bp); + return; + } + ASSERT((bp->b_flags & B_DONE) == 0); + bp->b_flags |= B_DONE; +} + +void +bioerror(buf_t *bp, int error) +{ + ASSERT(bp != NULL); + ASSERT(error >= 0); + + if (error != 0) { + bp->b_flags |= B_ERROR; + } else { + bp->b_flags &= ~B_ERROR; + } + bp->b_error = error; +} + + +int +geterror(struct buf *bp) +{ + int error = 0; + + if (bp->b_flags & B_ERROR) { + error = bp->b_error; + if (!error) + error = EIO; + } + return (error); +} diff --git a/usr/src/lib/libzpool/common/sys/zfs_context.h b/usr/src/lib/libzpool/common/sys/zfs_context.h index 9e6fd4455c..c638482d2e 100644 --- a/usr/src/lib/libzpool/common/sys/zfs_context.h +++ b/usr/src/lib/libzpool/common/sys/zfs_context.h @@ -453,6 +453,9 @@ extern vnode_t *rootdir; extern void delay(clock_t ticks); +#define SEC_TO_TICK(sec) ((sec) * hz) +#define NSEC_TO_TICK(usec) ((usec) / (NANOSEC / hz)) + #define gethrestime_sec() time(NULL) #define gethrestime(t) \ do {\ @@ -572,6 +575,64 @@ void ksiddomain_rele(ksiddomain_t *); #define ddi_log_sysevent(_a, _b, _c, _d, _e, _f, _g) \ sysevent_post_event(_c, _d, _b, "libzpool", _e, _f) +/* + * Cyclic information + */ +extern kmutex_t cpu_lock; + +typedef uintptr_t cyclic_id_t; +typedef uint16_t cyc_level_t; +typedef void (*cyc_func_t)(void *); + +#define CY_LOW_LEVEL 0 +#define CY_INFINITY INT64_MAX +#define CYCLIC_NONE ((cyclic_id_t)0) + +typedef struct cyc_time { + hrtime_t cyt_when; + hrtime_t cyt_interval; +} cyc_time_t; + +typedef struct cyc_handler { + cyc_func_t cyh_func; + void *cyh_arg; + cyc_level_t cyh_level; +} cyc_handler_t; + +extern cyclic_id_t cyclic_add(cyc_handler_t *, cyc_time_t *); +extern void cyclic_remove(cyclic_id_t); +extern int cyclic_reprogram(cyclic_id_t, hrtime_t); + +/* + * Buf structure + */ +#define B_BUSY 0x0001 +#define B_DONE 0x0002 +#define B_ERROR 0x0004 +#define B_READ 0x0040 /* read when I/O occurs */ +#define B_WRITE 0x0100 /* non-read pseudo-flag */ + +typedef struct buf { + int b_flags; + size_t b_bcount; + union { + caddr_t b_addr; + } b_un; + + lldaddr_t _b_blkno; +#define b_lblkno _b_blkno._f + size_t b_resid; + size_t b_bufsize; + int (*b_iodone)(struct buf *); + int b_error; + void *b_private; +} buf_t; + +extern void bioinit(buf_t *); +extern void biodone(buf_t *); +extern void bioerror(buf_t *, int); +extern int geterror(buf_t *); + #ifdef __cplusplus } #endif diff --git a/usr/src/lib/lvm/Makefile.lvm b/usr/src/lib/lvm/Makefile.lvm index 99a4d94727..30b8d4c804 100644 --- a/usr/src/lib/lvm/Makefile.lvm +++ b/usr/src/lib/lvm/Makefile.lvm @@ -23,8 +23,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# include $(SRC)/lib/Makefile.lib @@ -37,3 +35,8 @@ ROOTDIRS = $(ROOT)/usr $(ROOTHDRDIR) $(ROOTLIBDIR) RPCGENFLAGS = -C -M CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-label diff --git a/usr/src/lib/madv/Makefile.com b/usr/src/lib/madv/Makefile.com index 4304a8ed83..955c8287e1 100644 --- a/usr/src/lib/madv/Makefile.com +++ b/usr/src/lib/madv/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY = madv.a VERS = .1 @@ -42,6 +40,9 @@ CFLAGS += $(CCVERBOSE) CPPFLAGS += -D_REENTRANT DYNFLAGS += $(ZNOVERSION) $(ZINTERPOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/mpapi/libmpapi/Makefile.com b/usr/src/lib/mpapi/libmpapi/Makefile.com index dfff08bd39..892120bbf9 100644 --- a/usr/src/lib/mpapi/libmpapi/Makefile.com +++ b/usr/src/lib/mpapi/libmpapi/Makefile.com @@ -38,11 +38,15 @@ LDLIBS += -lc $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) CFLAGS += $(CCVERBOSE) -CPPFLAGS += -I$(SRCDIR) -mt -v -D_POSIX_PTHREAD_SEMANTICS +CPPFLAGS += -I$(SRCDIR) -mt $(CCVERBOSE) -D_POSIX_PTHREAD_SEMANTICS CPPFLAGS += -DBUILD_TIME='"Wed Sep 24 12:00:00 2008"' DYNFLAGS += -z finiarray=ExitLibrary DYNFLAGS += -z initarray=InitLibrary +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized + ROOTETC = $(ROOT)/etc CONFDIR = ../common CONFFILE = $(CONFDIR)/mpapi.conf diff --git a/usr/src/lib/mpss/Makefile.com b/usr/src/lib/mpss/Makefile.com index 2b6d6fbd0a..6988a90742 100644 --- a/usr/src/lib/mpss/Makefile.com +++ b/usr/src/lib/mpss/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY = mpss.a VERS = .1 @@ -42,6 +40,9 @@ CFLAGS += $(CCVERBOSE) CPPFLAGS += -D_REENTRANT DYNFLAGS += $(BLOCAL) $(ZNOVERSION) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/nsswitch/Makefile.com b/usr/src/lib/nsswitch/Makefile.com index ea411ea488..9cbd34291b 100644 --- a/usr/src/lib/nsswitch/Makefile.com +++ b/usr/src/lib/nsswitch/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# include $(SRC)/lib/Makefile.lib @@ -37,6 +35,12 @@ LINTOUT = lint.out CPPFLAGS += -D_REENTRANT +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-address + LDLIBS += -lc HSONAME = diff --git a/usr/src/lib/nsswitch/ldap/common/getgrent.c b/usr/src/lib/nsswitch/ldap/common/getgrent.c index bfcec21fbb..2682e6e2f8 100644 --- a/usr/src/lib/nsswitch/ldap/common/getgrent.c +++ b/usr/src/lib/nsswitch/ldap/common/getgrent.c @@ -25,6 +25,7 @@ #include <grp.h> #include "ldap_common.h" +#include <string.h> /* String which may need to be removed from beginning of group password */ #define _CRYPT "{CRYPT}" @@ -40,8 +41,21 @@ #define _F_GETGRNAM_SSD "(&(%%s)(cn=%s))" #define _F_GETGRGID "(&(objectClass=posixGroup)(gidNumber=%u))" #define _F_GETGRGID_SSD "(&(%%s)(gidNumber=%u))" -#define _F_GETGRMEM "(&(objectClass=posixGroup)(memberUid=%s))" -#define _F_GETGRMEM_SSD "(&(%%s)(memberUid=%s))" +/* + * Group membership can be defined by either username or DN, so when searching + * for groups by member we need to consider both. The first parameter in the + * filter is replaced by username, the second by DN. + */ +#define _F_GETGRMEM \ + "(&(objectClass=posixGroup)(|(memberUid=%s)(memberUid=%s)))" +#define _F_GETGRMEM_SSD "(&(%%s)(|(memberUid=%s)(memberUid=%s)))" + +/* + * Copied from getpwnam.c, needed to look up user DN. + * Would it be better to move to ldap_common.h rather than duplicate? + */ +#define _F_GETPWNAM "(&(objectClass=posixAccount)(uid=%s))" +#define _F_GETPWNAM_SSD "(&(%%s)(uid=%s))" static const char *gr_attrs[] = { _G_NAME, @@ -75,6 +89,7 @@ _nss_ldap_group2str(ldap_backend_ptr be, nss_XbyY_args_t *argp) char **gname, **passwd, **gid, *password, *end; char gid_nobody[NOBODY_STR_LEN]; char *gid_nobody_v[1]; + char *member_str, *strtok_state; ns_ldap_attr_t *members; (void) snprintf(gid_nobody, sizeof (gid_nobody), "%u", GID_NOBODY); @@ -140,15 +155,34 @@ _nss_ldap_group2str(ldap_backend_ptr be, nss_XbyY_args_t *argp) nss_result = NSS_STR_PARSE_PARSE; goto result_grp2str; } - if (firstime) { - len = snprintf(buffer, buflen, "%s", - members->attrvalue[i]); - TEST_AND_ADJUST(len, buffer, buflen, result_grp2str); - firstime = 0; + /* + * If we find an '=' in the member attribute value, treat it as + * a DN, otherwise as a username. + */ + if (member_str = strchr(members->attrvalue[i], '=')) { + member_str++; /* skip over the '=' */ + /* Fail if we can't pull a username out of the RDN */ + if (! (member_str = strtok_r(member_str, + ",", &strtok_state))) { + nss_result = NSS_STR_PARSE_PARSE; + goto result_grp2str; + } } else { - len = snprintf(buffer, buflen, ",%s", - members->attrvalue[i]); - TEST_AND_ADJUST(len, buffer, buflen, result_grp2str); + member_str = members->attrvalue[i]; + } + if (*member_str != '\0') { + if (firstime) { + len = snprintf(buffer, buflen, "%s", + member_str); + TEST_AND_ADJUST(len, buffer, buflen, + result_grp2str); + firstime = 0; + } else { + len = snprintf(buffer, buflen, ",%s", + member_str); + TEST_AND_ADJUST(len, buffer, buflen, + result_grp2str); + } } } nomember: @@ -250,7 +284,8 @@ getbymember(ldap_backend_ptr be, void *a) { int i, j, k; int gcnt = (int)0; - char **groupvalue, **membervalue; + char **groupvalue, **membervalue, *member_str; + char *strtok_state; nss_status_t lstat; struct nss_groupsbymem *argp = (struct nss_groupsbymem *)a; char searchfilter[SEARCHFILTERLEN]; @@ -258,7 +293,7 @@ getbymember(ldap_backend_ptr be, void *a) char name[SEARCHFILTERLEN]; ns_ldap_result_t *result; ns_ldap_entry_t *curEntry; - char *username; + char *username, **dn_attr, *dn; gid_t gid; int ret; @@ -269,14 +304,45 @@ getbymember(ldap_backend_ptr be, void *a) if (_ldap_filter_name(name, argp->username, sizeof (name)) != 0) return ((nss_status_t)NSS_NOTFOUND); - ret = snprintf(searchfilter, sizeof (searchfilter), _F_GETGRMEM, name); + ret = snprintf(searchfilter, sizeof (searchfilter), _F_GETPWNAM, name); + if (ret >= sizeof (searchfilter) || ret < 0) + return ((nss_status_t)NSS_NOTFOUND); + + ret = snprintf(userdata, sizeof (userdata), _F_GETPWNAM_SSD, name); + if (ret >= sizeof (userdata) || ret < 0) + return ((nss_status_t)NSS_NOTFOUND); + + /* + * Look up the user DN in ldap. If it's not found, search solely by + * username. + */ + lstat = (nss_status_t)_nss_ldap_nocb_lookup(be, NULL, + _PASSWD, searchfilter, NULL, _merge_SSD_filter, userdata); + if (lstat != (nss_status_t)NS_LDAP_SUCCESS) + return ((nss_status_t)lstat); + + if (be->result == NULL || + !(dn_attr = __ns_ldap_getAttr(be->result->entry, "dn"))) + dn = name; + else + dn = dn_attr[0]; + + ret = snprintf(searchfilter, sizeof (searchfilter), _F_GETGRMEM, name, + dn); if (ret >= sizeof (searchfilter) || ret < 0) return ((nss_status_t)NSS_NOTFOUND); - ret = snprintf(userdata, sizeof (userdata), _F_GETGRMEM_SSD, name); + ret = snprintf(userdata, sizeof (userdata), _F_GETGRMEM_SSD, name, + dn); if (ret >= sizeof (userdata) || ret < 0) return ((nss_status_t)NSS_NOTFOUND); + /* + * Free up resources from user DN search before performing group + * search. + */ + (void) __ns_ldap_freeResult((ns_ldap_result_t **)&be->result); + gcnt = (int)argp->numgids; lstat = (nss_status_t)_nss_ldap_nocb_lookup(be, NULL, _GROUP, searchfilter, NULL, _merge_SSD_filter, userdata); @@ -291,7 +357,20 @@ getbymember(ldap_backend_ptr be, void *a) membervalue = __ns_ldap_getAttr(curEntry, "memberUid"); if (membervalue) { for (j = 0; membervalue[j]; j++) { - if (strcmp(membervalue[j], username) == NULL) { + /* + * If we find an '=' in the member attribute + * value, treat it as a DN, otherwise as a + * username. + */ + if (member_str = strchr(membervalue[j], '=')) { + member_str++; /* skip over the '=' */ + member_str = strtok_r(member_str, ",", + &strtok_state); + } else { + member_str = membervalue[j]; + } + if (member_str && + strcmp(member_str, username) == NULL) { groupvalue = __ns_ldap_getAttr(curEntry, "gidnumber"); gid = (gid_t)strtol(groupvalue[0], diff --git a/usr/src/lib/pam_modules/authtok_check/Makefile.com b/usr/src/lib/pam_modules/authtok_check/Makefile.com index 29b29c2372..79332c6e90 100644 --- a/usr/src/lib/pam_modules/authtok_check/Makefile.com +++ b/usr/src/lib/pam_modules/authtok_check/Makefile.com @@ -22,10 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# -# usr/src/lib/pam_modules/authtok_check/Makefile.com -# LIBRARY= pam_authtok_check.a VERS= .1 @@ -37,6 +33,7 @@ include ../../Makefile.pam_modules LDLIBS += -lpam -lc CPPFLAGS += -D_FILE_OFFSET_BITS=64 +CERRWARN += -_gcc=-Wno-parentheses all: $(LIBS) diff --git a/usr/src/lib/pam_modules/dhkeys/Makefile.com b/usr/src/lib/pam_modules/dhkeys/Makefile.com index f430c3285c..c5a0391025 100644 --- a/usr/src/lib/pam_modules/dhkeys/Makefile.com +++ b/usr/src/lib/pam_modules/dhkeys/Makefile.com @@ -25,7 +25,6 @@ # # usr/src/lib/pam_modules/dhkeys/Makefile.com # -# ident "%Z%%M% %I% %E% SMI" LIBRARY= pam_dhkeys.a VERS= .1 @@ -36,6 +35,7 @@ include ../../Makefile.pam_modules LDLIBS += -lpam -lnsl -lc CPPFLAGS += -I$(SRC)/lib/libnsl/include +CERRWARN += -_gcc=-Wno-parentheses all: $(LIBS) diff --git a/usr/src/lib/pam_modules/krb5/Makefile.com b/usr/src/lib/pam_modules/krb5/Makefile.com index b4e93ccbfd..222f064fad 100644 --- a/usr/src/lib/pam_modules/krb5/Makefile.com +++ b/usr/src/lib/pam_modules/krb5/Makefile.com @@ -48,6 +48,9 @@ CPPFLAGS += -I../../../gss_mechs/mech_krb5/include \ -I$(SRC)/lib/krb5 \ -I. +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-function + # module needs to be unloadable because the key destructor might be # called after dlclose() DYNFLAGS += $(ZNODELETE) diff --git a/usr/src/lib/pam_modules/krb5_migrate/Makefile.com b/usr/src/lib/pam_modules/krb5_migrate/Makefile.com index 6871d9f713..498b00f83b 100644 --- a/usr/src/lib/pam_modules/krb5_migrate/Makefile.com +++ b/usr/src/lib/pam_modules/krb5_migrate/Makefile.com @@ -38,6 +38,9 @@ CPPFLAGS += -I../../../gss_mechs/mech_krb5/include \ -I$(SRC)/lib/gss_mechs/mech_krb5 \ -I$(SRC)/lib/krb5 +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-function + LDLIBS += -lpam -lc all: $(LIBS) diff --git a/usr/src/lib/pam_modules/ldap/Makefile.com b/usr/src/lib/pam_modules/ldap/Makefile.com index a0251f7355..8166a466b1 100644 --- a/usr/src/lib/pam_modules/ldap/Makefile.com +++ b/usr/src/lib/pam_modules/ldap/Makefile.com @@ -24,8 +24,6 @@ # # usr/src/lib/pam_modules/ldap/Makefile.com # -#ident "%Z%%M% %I% %E% SMI" -# LIBRARY= pam_ldap.a VERS= .1 @@ -42,6 +40,7 @@ include ../../Makefile.pam_modules LDLIBS += -lpam -lsldap -lc CPPFLAGS += -I$(SRC)/lib/libsldap/common +CERRWARN += -_gcc=-Wno-parentheses all: $(LIBS) diff --git a/usr/src/lib/pam_modules/unix_account/Makefile.com b/usr/src/lib/pam_modules/unix_account/Makefile.com index bc1af34425..9971e8b296 100644 --- a/usr/src/lib/pam_modules/unix_account/Makefile.com +++ b/usr/src/lib/pam_modules/unix_account/Makefile.com @@ -22,10 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# -# usr/src/lib/pam_modules/unix_account/Makefile.com -# LIBRARY= pam_unix_account.a VERS= .1 @@ -36,6 +32,7 @@ include ../../Makefile.pam_modules LDLIBS += -lpam -lc # Enable large file support for reading the lastlog file. CPPFLAGS += -D_FILE_OFFSET_BITS=64 +CERRWARN += -_gcc=-Wno-parentheses all: $(LIBS) diff --git a/usr/src/lib/pam_modules/unix_cred/Makefile.com b/usr/src/lib/pam_modules/unix_cred/Makefile.com index b5de4963b7..45c444f9b2 100644 --- a/usr/src/lib/pam_modules/unix_cred/Makefile.com +++ b/usr/src/lib/pam_modules/unix_cred/Makefile.com @@ -22,10 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# -# usr/src/lib/pam_modules/unix_cred/Makefile.com -# LIBRARY= pam_unix_cred.a VERS= .1 @@ -34,6 +30,8 @@ OBJECTS= unix_cred.o include ../../Makefile.pam_modules LDLIBS += -lbsm -lpam -lsecdb -lproject -lc +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized all: $(LIBS) diff --git a/usr/src/lib/passwdutil/Makefile.com b/usr/src/lib/passwdutil/Makefile.com index e1064ca799..0b7c1ec4c4 100644 --- a/usr/src/lib/passwdutil/Makefile.com +++ b/usr/src/lib/passwdutil/Makefile.com @@ -56,6 +56,10 @@ CPPFLAGS += -DENABLE_SUNOS_AGING -D_REENTRANT \ -I$(SRC)/lib/libsldap/common -I$(SRC)/lib/libnsl/include CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label + lint := SRCS= $(OBJ:%.o=$(SRCDIR)/%.c) .KEEP_STATE: diff --git a/usr/src/lib/pkcs11/libpkcs11/Makefile.com b/usr/src/lib/pkcs11/libpkcs11/Makefile.com index bf99fa50df..33283e66e1 100644 --- a/usr/src/lib/pkcs11/libpkcs11/Makefile.com +++ b/usr/src/lib/pkcs11/libpkcs11/Makefile.com @@ -75,6 +75,9 @@ CPPFLAGS += -I$(INCDIR) -I$(SRCDIR) -D_REENTRANT LINTFLAGS64 += -errchk=longptr64 +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/lib/pkcs11/libsoftcrypto/amd64/Makefile b/usr/src/lib/pkcs11/libsoftcrypto/amd64/Makefile index b2e7d90ee7..e5062536aa 100644 --- a/usr/src/lib/pkcs11/libsoftcrypto/amd64/Makefile +++ b/usr/src/lib/pkcs11/libsoftcrypto/amd64/Makefile @@ -35,6 +35,10 @@ BIGNUM_PSM_OBJS = bignum_amd64.o bignum_amd64_asm.o include $(SRC)/lib/Makefile.lib include $(SRC)/lib/Makefile.lib.64 +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + AES_PSM_SRC = $(AES_DIR)/$(MACH64)/aes_amd64.s \ $(AES_DIR)/$(MACH64)/aes_intel.s \ $(AES_DIR)/$(MACH64)/aeskey.c diff --git a/usr/src/lib/pkcs11/libsoftcrypto/capabilities/intel/i386/Makefile b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/intel/i386/Makefile index 3d80d13627..87f618b38a 100644 --- a/usr/src/lib/pkcs11/libsoftcrypto/capabilities/intel/i386/Makefile +++ b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/intel/i386/Makefile @@ -38,6 +38,8 @@ CFLAGS += $(CCVERBOSE) CPPFLAGS += -I$(CRYPTODIR) -I$(UTSDIR) -D_POSIX_PTHREAD_SEMANTICS BIGNUM_FLAGS += -DMMX_MANAGE -DHWCAP -DPSR_MUL -DNO_BIG_ONE -DNO_BIG_TWO +CERRWARN += -_gcc=-Wno-unused-variable + .KEEP_STATE: all install: $(SYMCAP) diff --git a/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/Makefile.com b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/Makefile.com index 6027025c55..1bb12a3b2f 100644 --- a/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/Makefile.com +++ b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4u/Makefile.com @@ -41,6 +41,10 @@ include $(SRC)/lib/Makefile.lib AS_CPPFLAGS += -D__STDC__ -D_ASM -DPIC -D_REENTRANT -D$(MACH) ASFLAGS += $(AS_PICFLAGS) -P CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function CPPFLAGS += -D$(PLATFORM) -I$(CRYPTODIR) -I$(UTSDIR) \ -D_POSIX_PTHREAD_SEMANTICS BIGNUM_FLAGS += -DUSE_FLOATING_POINT -DNO_BIG_ONE -DNO_BIG_TWO diff --git a/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4v/Makefile.com b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4v/Makefile.com index 48a72842a7..ad19150a23 100644 --- a/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4v/Makefile.com +++ b/usr/src/lib/pkcs11/libsoftcrypto/capabilities/sun4v/Makefile.com @@ -35,6 +35,10 @@ include $(SRC)/lib/Makefile.lib AS_CPPFLAGS += -D__STDC__ -D_ASM -DPIC -D_REENTRANT -D$(MACH) ASFLAGS += $(AS_PICFLAGS) -P CFLAGS += $(CCVERBOSE) -xO5 -xbuiltin=%all -dalign +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function CPPFLAGS += -D$(PLATFORM) -I$(CRYPTODIR) -I$(UTSDIR) \ -D_POSIX_PTHREAD_SEMANTICS BIGNUM_FLAGS += -DUMUL64 -DNO_BIG_ONE -DNO_BIG_TWO diff --git a/usr/src/lib/pkcs11/libsoftcrypto/i386/Makefile b/usr/src/lib/pkcs11/libsoftcrypto/i386/Makefile index 750bb15482..897a2da6cd 100644 --- a/usr/src/lib/pkcs11/libsoftcrypto/i386/Makefile +++ b/usr/src/lib/pkcs11/libsoftcrypto/i386/Makefile @@ -30,6 +30,10 @@ include ../Makefile.com include $(SRC)/lib/Makefile.lib +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # Sources need to be redefined after Makefile.lib inclusion. SRCS = $(AES_SRC) $(ARCFOUR_SRC) $(BIGNUM_SRC) $(BLOWFISH_SRC) \ $(DES_SRC) $(MODES_SRC) $(DH_SRC) $(DSA_SRC) $(RSA_SRC) \ diff --git a/usr/src/lib/pkcs11/libsoftcrypto/sparc/Makefile b/usr/src/lib/pkcs11/libsoftcrypto/sparc/Makefile index a5442e51ab..deea108eac 100644 --- a/usr/src/lib/pkcs11/libsoftcrypto/sparc/Makefile +++ b/usr/src/lib/pkcs11/libsoftcrypto/sparc/Makefile @@ -41,6 +41,11 @@ LIBS = $(DYNLIB) $(LINTLIB) MAPFILEDIR = ../common CFLAGS += $(CCVERBOSE) + +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + CPPFLAGS += -I$(CRYPTODIR) -I$(UTSDIR) -D_POSIX_PTHREAD_SEMANTICS LDLIBS += -lcryptoutil -lc LINTFLAGS += $(EXTRA_LINT_FLAGS) diff --git a/usr/src/lib/pkcs11/libsoftcrypto/sparcv9/Makefile b/usr/src/lib/pkcs11/libsoftcrypto/sparcv9/Makefile index 0dc3a48308..8bde047675 100644 --- a/usr/src/lib/pkcs11/libsoftcrypto/sparcv9/Makefile +++ b/usr/src/lib/pkcs11/libsoftcrypto/sparcv9/Makefile @@ -42,6 +42,11 @@ LIBS = $(DYNLIB) $(LINTLIB) MAPFILEDIR = ../common CFLAGS += $(CCVERBOSE) + +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + CPPFLAGS += -I$(CRYPTODIR) -I$(UTSDIR) -D_POSIX_PTHREAD_SEMANTICS LDLIBS += -lcryptoutil -lc LINTFLAGS64 += $(EXTRA_LINT_FLAGS) diff --git a/usr/src/lib/pkcs11/pkcs11_kernel/Makefile.com b/usr/src/lib/pkcs11/pkcs11_kernel/Makefile.com index 4e71cf6202..d71ccc01aa 100644 --- a/usr/src/lib/pkcs11/pkcs11_kernel/Makefile.com +++ b/usr/src/lib/pkcs11/pkcs11_kernel/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= pkcs11_kernel.a VERS= .1 @@ -86,6 +84,9 @@ LDLIBS += -lc -lcryptoutil -lmd CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label + ROOTLIBDIR= $(ROOT)/usr/lib/security ROOTLIBDIR64= $(ROOT)/usr/lib/security/$(MACH64) diff --git a/usr/src/lib/pkcs11/pkcs11_softtoken/Makefile.com b/usr/src/lib/pkcs11/pkcs11_softtoken/Makefile.com index dd6ad1a7c7..f50cbedabe 100644 --- a/usr/src/lib/pkcs11/pkcs11_softtoken/Makefile.com +++ b/usr/src/lib/pkcs11/pkcs11_softtoken/Makefile.com @@ -125,6 +125,13 @@ LDLIBS += -lc -lmd -lcryptoutil -lsoftcrypto -lgen CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-empty-body + CPPFLAGS += -I$(AESDIR) -I$(BLOWFISHDIR) -I$(ARCFOURDIR) -I$(DESDIR) \ -I$(DHDIR) -I$(DSADIR) -I$(ECCDIR) -I$(SRC)/common/crypto \ -I$(MPIDIR) -I$(RSADIR) -I$(RNGDIR) \ diff --git a/usr/src/lib/pkcs11/pkcs11_tpm/Makefile.com b/usr/src/lib/pkcs11/pkcs11_tpm/Makefile.com index 4a18468622..323f311dec 100644 --- a/usr/src/lib/pkcs11/pkcs11_tpm/Makefile.com +++ b/usr/src/lib/pkcs11/pkcs11_tpm/Makefile.com @@ -78,6 +78,10 @@ CPPFLAGS += -xCC -D_POSIX_PTHREAD_SEMANTICS $(TSSINC) CPPFLAGS64 += $(CPPFLAGS) C99MODE= $(C99_ENABLE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + LINTSRC= $(OBJECTS:%.o=$(SRCDIR)/%.c) $(LINTLIB):= SRCS = $(SRCDIR)/$(LINTSRC) diff --git a/usr/src/lib/policykit/Makefile.com b/usr/src/lib/policykit/Makefile.com index 2dc67c1614..77f2328313 100644 --- a/usr/src/lib/policykit/Makefile.com +++ b/usr/src/lib/policykit/Makefile.com @@ -22,14 +22,14 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# include $(SRC)/lib/Makefile.lib include $(SRC)/lib/policykit/Makefile.policykit CPPFLAGS = $(POLICYKIT_DBUS_CPPFLAGS) $(POLICYKIT_GLIB_CPPFLAGS) $(CPPFLAGS.master) +CERRWARN += -_gcc=-Wno-unused-variable + C99MODE = $(C99_ENABLE) ROOTLIBPCDIR = $(ROOT)/usr/lib/pkgconfig diff --git a/usr/src/lib/pysolaris/Makefile.com b/usr/src/lib/pysolaris/Makefile.com index 0dbd77826e..0e5b385bd8 100644 --- a/usr/src/lib/pysolaris/Makefile.com +++ b/usr/src/lib/pysolaris/Makefile.com @@ -45,6 +45,8 @@ LIBS = $(DYNLIB) LDLIBS += -lc -lsec -lidmap -lpython2.6 CFLAGS += $(CCVERBOSE) CPPFLAGS += -I$(ADJUNCT_PROTO)/usr/include/python2.6 +CERRWARN += -_gcc=-Wno-unused-variable +CPPFLAGS += -I/usr/include/python2.6 .KEEP_STATE: diff --git a/usr/src/lib/pyzfs/Makefile.com b/usr/src/lib/pyzfs/Makefile.com index 20e1c59171..a565ed8059 100644 --- a/usr/src/lib/pyzfs/Makefile.com +++ b/usr/src/lib/pyzfs/Makefile.com @@ -48,6 +48,8 @@ LIBS = $(DYNLIB) LDLIBS += -lc -lnvpair -lpython2.6 -lzfs CFLAGS += $(CCVERBOSE) CPPFLAGS += -I$(ADJUNCT_PROTO)/usr/include/python2.6 +CERRWARN += -_gcc=-Wno-unused-variable +CPPFLAGS += -I/usr/include/python2.6 CPPFLAGS += -I../../../uts/common/fs/zfs CPPFLAGS += -I../../../common/zfs diff --git a/usr/src/lib/rpcsec_gss/Makefile.com b/usr/src/lib/rpcsec_gss/Makefile.com index 7908550600..53287d4664 100644 --- a/usr/src/lib/rpcsec_gss/Makefile.com +++ b/usr/src/lib/rpcsec_gss/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= rpcsec.a VERS = .1 @@ -35,10 +33,13 @@ include ../../Makefile.lib CPPFLAGS += -D_REENTRANT -I$(SRC)/uts/common/gssapi/include \ -I$(SRC)/uts/common - + CFLAGS += $(XFFLAG) CFLAGS64 += $(XFFLAG) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + DYNFLAGS += $(ZIGNORE) LINTSRC= $(LINTLIB:%.ln=%) diff --git a/usr/src/lib/sasl_plugins/Makefile.com b/usr/src/lib/sasl_plugins/Makefile.com index 231d20fdca..043c3eb01c 100644 --- a/usr/src/lib/sasl_plugins/Makefile.com +++ b/usr/src/lib/sasl_plugins/Makefile.com @@ -30,6 +30,8 @@ include $(SRC)/lib/Makefile.lib CPPFLAGS += -I$(SRC)/lib/libsasl/include +CERRWARN += -_gcc=-Wno-uninitialized + LIBS = $(DYNLIB) SRCS= $(PLUG_OBJS:%.o=../%.c) \ $(COMMONOBJS:%.o=$(SRC)/lib/libsasl/plugin/%.c) diff --git a/usr/src/lib/scsi/libscsi/Makefile.com b/usr/src/lib/scsi/libscsi/Makefile.com index 88e3f7fa4c..c9dafcb29b 100644 --- a/usr/src/lib/scsi/libscsi/Makefile.com +++ b/usr/src/lib/scsi/libscsi/Makefile.com @@ -23,7 +23,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" LIBRARY = libscsi.a VERS = .1 @@ -42,6 +41,9 @@ C99MODE = $(C99_ENABLE) CPPFLAGS += -I../common -I. -D_REENTRANT $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG CFLAGS += $(CCVERBOSE) + +CERRWARN += -_gcc=-Wno-type-limits + LDLIBS += \ -lumem \ -lc diff --git a/usr/src/lib/scsi/libses/Makefile.defs b/usr/src/lib/scsi/libses/Makefile.defs index c4772bd68f..e3615d0665 100644 --- a/usr/src/lib/scsi/libses/Makefile.defs +++ b/usr/src/lib/scsi/libses/Makefile.defs @@ -29,6 +29,10 @@ CPPFLAGS += -I../common -I. -D_REENTRANT $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label + ROOTLIBDIR = $(ROOTSCSILIBDIR) ROOTLIBDIR64 = $(ROOTSCSILIBDIR)/$(MACH64) @@ -49,11 +53,4 @@ LIBS = $(DYNLIB) $(LINTLIB) CLEANFILES += \ ../common/ses_errno.c -# -# On SPARC, gcc 3.4 emits DWARF assembler directives for TLS data that are not -# understood by the Sun assembler. Until this problem is fixed, we turn down -# the amount of generated debugging information, which seems to do the trick. -# -$(__GNUC3)$(SPARC_BLD)CTF_FLAGS += -_gcc=-g1 - $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) diff --git a/usr/src/lib/scsi/libsmp/Makefile.com b/usr/src/lib/scsi/libsmp/Makefile.com index 4316313877..95b666e4fb 100644 --- a/usr/src/lib/scsi/libsmp/Makefile.com +++ b/usr/src/lib/scsi/libsmp/Makefile.com @@ -40,6 +40,10 @@ C99MODE = $(C99_ENABLE) CPPFLAGS += -I../common -I. -D_REENTRANT $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG CFLAGS += $(CCVERBOSE) + +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized + LDLIBS += \ -lumem \ -lc @@ -50,13 +54,6 @@ ROOTLIBDIR64 = $(ROOTSCSILIBDIR)/$(MACH64) CLEANFILES += \ ../common/smp_errno.c -# -# On SPARC, gcc 3.4 emits DWARF assembler directives for TLS data that are not -# understood by the Sun assembler. Until this problem is fixed, we turn down -# the amount of generated debugging information, which seems to do the trick. -# -$(__GNUC3)$(SPARC_BLD)CTF_FLAGS += -_gcc=-g1 - $(LINTLIB) := SRCS = $(SRCDIR)/$(LINTSRC) .KEEP_STATE: diff --git a/usr/src/lib/scsi/plugins/ses/SUN-Storage-J4400/Makefile.com b/usr/src/lib/scsi/plugins/ses/SUN-Storage-J4400/Makefile.com index d54d99a89e..1d55f54d69 100644 --- a/usr/src/lib/scsi/plugins/ses/SUN-Storage-J4400/Makefile.com +++ b/usr/src/lib/scsi/plugins/ses/SUN-Storage-J4400/Makefile.com @@ -23,7 +23,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = SUN-Storage-J4400 SRCS = riverwalk.c @@ -32,3 +31,5 @@ PLUGINTYPE = vendor ALIASES = SUN-Storage-J4200 include ../../Makefile.lib + +CERRWARN += -_gcc=-Wno-switch diff --git a/usr/src/lib/scsi/plugins/ses/ses2/Makefile.com b/usr/src/lib/scsi/plugins/ses/ses2/Makefile.com index 2f020ac65a..2526c79447 100644 --- a/usr/src/lib/scsi/plugins/ses/ses2/Makefile.com +++ b/usr/src/lib/scsi/plugins/ses/ses2/Makefile.com @@ -23,7 +23,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" MODULE = ses2 SRCS = ses2.c \ @@ -37,3 +36,5 @@ SRCDIR = ../common PLUGINTYPE = framework include ../../Makefile.lib + +CERRWARN += -_gcc=-Wno-switch diff --git a/usr/src/lib/scsi/plugins/smp/sas2/Makefile.com b/usr/src/lib/scsi/plugins/smp/sas2/Makefile.com index 6c6f48fba0..85c6559089 100644 --- a/usr/src/lib/scsi/plugins/smp/sas2/Makefile.com +++ b/usr/src/lib/scsi/plugins/smp/sas2/Makefile.com @@ -31,3 +31,5 @@ SRCDIR = ../common PLUGINTYPE = framework include ../../Makefile.lib + +CERRWARN += -_gcc=-Wno-unused-variable diff --git a/usr/src/lib/smbsrv/libmlsvc/Makefile.com b/usr/src/lib/smbsrv/libmlsvc/Makefile.com index be2472157f..f00731b1c0 100644 --- a/usr/src/lib/smbsrv/libmlsvc/Makefile.com +++ b/usr/src/lib/smbsrv/libmlsvc/Makefile.com @@ -89,6 +89,9 @@ LDLIBS += -lmlrpc -lsmb -lsmbns -lshare -lsmbfs -lresolv -lnsl -lpkcs11 \ CPPFLAGS += $(INCS) -D_REENTRANT $(ENABLE_SMB_PRINTING) CPPFLAGS += -DHAVE_CUPS +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized + SRCS= $(OBJS_COMMON:%.o=$(SRCDIR)/%.c) include ../../Makefile.targ diff --git a/usr/src/lib/smbsrv/libsmb/Makefile.com b/usr/src/lib/smbsrv/libsmb/Makefile.com index f916b6a4db..4b86caeb95 100644 --- a/usr/src/lib/smbsrv/libsmb/Makefile.com +++ b/usr/src/lib/smbsrv/libsmb/Makefile.com @@ -77,6 +77,9 @@ LDLIBS += $(MACH_LDLIBS) LDLIBS += -lscf -lmd -luuid -lnsl -lpkcs11 -lsec -lsocket -lresolv LDLIBS += -lidmap -lreparse -lnvpair -lcmdutils -lavl -lc CPPFLAGS += $(INCS) -D_REENTRANT +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-switch SRCS= $(OBJS_COMMON:%.o=$(SRCDIR)/%.c) \ $(OBJS_SHARED:%.o=$(SRC)/common/smbsrv/%.c) diff --git a/usr/src/lib/smbsrv/libsmb/common/mapfile-vers b/usr/src/lib/smbsrv/libsmb/common/mapfile-vers index acb7df1a7b..7b7f222d2d 100644 --- a/usr/src/lib/smbsrv/libsmb/common/mapfile-vers +++ b/usr/src/lib/smbsrv/libsmb/common/mapfile-vers @@ -19,7 +19,7 @@ # # # Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. -# Copyright 2011 Nexenta Systems, Inc. All rights reserved. +# Copyright 2012 Nexenta Systems, Inc. All rights reserved. # # @@ -269,7 +269,6 @@ SYMBOL_VERSION SUNWprivate { smb_mac_init; smb_mac_sign; smb_match; - smb_match_ci; smb_match_netlogon_seqnum; smb_mbstos; smb_mbstowcs; diff --git a/usr/src/lib/smbsrv/libsmbns/Makefile.com b/usr/src/lib/smbsrv/libsmbns/Makefile.com index 7ab36a6127..840d6392c6 100644 --- a/usr/src/lib/smbsrv/libsmbns/Makefile.com +++ b/usr/src/lib/smbsrv/libsmbns/Makefile.com @@ -51,6 +51,8 @@ LDLIBS += $(MACH_LDLIBS) LDLIBS += -lsmb -lgss -lcmdutils -lldap -lresolv -lnsl -lsocket LDLIBS += -lc -lcryptoutil CPPFLAGS += -D_REENTRANT +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized # DYNLIB libraries do not have lint libs and are not linted $(DYNLIB) := LDLIBS += -lkrb5 diff --git a/usr/src/lib/smhba/Makefile.com b/usr/src/lib/smhba/Makefile.com index a19413dc27..61a498eaeb 100644 --- a/usr/src/lib/smhba/Makefile.com +++ b/usr/src/lib/smhba/Makefile.com @@ -45,6 +45,10 @@ CFLAGS += -DUSESYSLOG CPPFLAGS += $(INCS) CPPFLAGS += -DPOSIX_THREADS +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-function + LDLIBS += -lc $(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC) diff --git a/usr/src/lib/smhba/common/SMHBAAPILIB.c b/usr/src/lib/smhba/common/SMHBAAPILIB.c index ae2fd4b0d8..e6471b6b19 100644 --- a/usr/src/lib/smhba/common/SMHBAAPILIB.c +++ b/usr/src/lib/smhba/common/SMHBAAPILIB.c @@ -1403,7 +1403,7 @@ HBA_GetAdapterName( HBA_STATUS ret = HBA_STATUS_ERROR_ILLEGAL_INDEX; if (adaptername == NULL) { - DEBUG(1, "HBA_GetAdapterName: NULL pointer adatpername", + DEBUG(1, "HBA_GetAdapterName: NULL pointer adaptername", 0, 0, 0); return (HBA_STATUS_ERROR_ARG); } @@ -1451,7 +1451,7 @@ HBA_OpenAdapter(char *adaptername) return (handle); } if (adaptername == NULL) { - DEBUG(1, "HBA_OpenAdapter: NULL pointer adatpername", + DEBUG(1, "HBA_OpenAdapter: NULL pointer adaptername", 0, 0, 0); return (handle); } @@ -4329,7 +4329,7 @@ SMHBA_SendSMPPassThru( * Following the similar logic of HBAAPI addaspterevents_callback. * * Unlike other events Adapter Add Event is not limited to a specific - * adpater(i.e. no adatper handle is passed for registration) so + * adapter(i.e. no adapter handle is passed for registration) so * the event should be passed to all registrants. The routine below * is passed to the VSLs as a callback and when Adapter Add event is detected * by VSL it will call smhba_adapteraddevents_callback() which in turn check diff --git a/usr/src/lib/storage/liba5k/Makefile.com b/usr/src/lib/storage/liba5k/Makefile.com index f90deb93ae..202c11bdfd 100644 --- a/usr/src/lib/storage/liba5k/Makefile.com +++ b/usr/src/lib/storage/liba5k/Makefile.com @@ -44,6 +44,9 @@ COMMON_LINTFLAGS += -erroff=E_SEC_PRINTF_VAR_FMT LINTFLAGS += $(COMMON_LINTFLAGS) LINTFLAGS64 += $(COMMON_LINTFLAGS) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + LDLIBS += -lc -ldevice -lg_fc $(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC) diff --git a/usr/src/lib/storage/libg_fc/Makefile.com b/usr/src/lib/storage/libg_fc/Makefile.com index c953ece3e8..2b8c54f021 100644 --- a/usr/src/lib/storage/libg_fc/Makefile.com +++ b/usr/src/lib/storage/libg_fc/Makefile.com @@ -49,6 +49,9 @@ COMMON_LINTFLAGS += -erroff=E_SEC_PRINTF_VAR_FMT LINTFLAGS += $(COMMON_LINTFLAGS) LINTFLAGS64 += $(COMMON_LINTFLAGS) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + $(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC) .KEEP_STATE: diff --git a/usr/src/lib/sun_fc/common/FCHBA.cc b/usr/src/lib/sun_fc/common/FCHBA.cc index 5aba01e338..1c7c26acac 100644 --- a/usr/src/lib/sun_fc/common/FCHBA.cc +++ b/usr/src/lib/sun_fc/common/FCHBA.cc @@ -447,7 +447,7 @@ void FCHBA::loadAdapters(vector<HBA*> &list) { if (pathList->numAdapters > HBAList::HBA_MAX_PER_LIST) { delete(pathList); throw InternalError( - "Exceeds max number of adatpers that VSL supports."); + "Exceeds max number of adapters that VSL supports."); } delete (pathList); } diff --git a/usr/src/lib/sun_fc/common/TgtFCHBA.cc b/usr/src/lib/sun_fc/common/TgtFCHBA.cc index 7d162b2dbd..8c3274f2d5 100644 --- a/usr/src/lib/sun_fc/common/TgtFCHBA.cc +++ b/usr/src/lib/sun_fc/common/TgtFCHBA.cc @@ -330,7 +330,7 @@ void TgtFCHBA::loadAdapters(vector<HBA*> &list) if (tgthbaList->numPorts > HBAList::HBA_MAX_PER_LIST) { delete(tgthbaList); throw InternalError( - "Exceeds max number of adatpers that VSL supports."); + "Exceeds max number of adapters that VSL supports."); } delete (tgthbaList); } diff --git a/usr/src/lib/sun_sas/Makefile.com b/usr/src/lib/sun_sas/Makefile.com index d3ddf2f450..f6457c7c8e 100644 --- a/usr/src/lib/sun_sas/Makefile.com +++ b/usr/src/lib/sun_sas/Makefile.com @@ -75,12 +75,15 @@ INCS += -I$(SRC)/lib/hbaapi/common INCS += -I$(SRC)/lib/libdevid CFLAGS += -mt -CFLAGS += -v +CFLAGS += $(CCVERBOSE) CFLAGS64 += -mt -CFLAGS64 += -v +CFLAGS64 += $(CCVERBOSE) CPPFLAGS += $(INCS) -D_POSIX_PTHREAD_SEMANTICS CPPFLAGS += -DBUILD_TIME='"Wed Feb 4 12:00:00 2009"' +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-value + LDLIBS += -ldevinfo LDLIBS += -lsysevent LDLIBS += -lnvpair diff --git a/usr/src/lib/sun_sas/common/sun_sas.c b/usr/src/lib/sun_sas/common/sun_sas.c index 152a25a723..3211a5924f 100644 --- a/usr/src/lib/sun_sas/common/sun_sas.c +++ b/usr/src/lib/sun_sas/common/sun_sas.c @@ -133,7 +133,7 @@ RetrieveOpenHandle(HBA_HANDLE handle) struct open_handle *open_handle_ptr = NULL; if (global_hba_head == NULL) { - log(LOG_DEBUG, ROUTINE, "No adpater is found."); + log(LOG_DEBUG, ROUTINE, "No adapter is found."); return (NULL); } diff --git a/usr/src/lib/udapl/libdat/Makefile.com b/usr/src/lib/udapl/libdat/Makefile.com index 22d7dc9e00..254241680d 100644 --- a/usr/src/lib/udapl/libdat/Makefile.com +++ b/usr/src/lib/udapl/libdat/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY= libdat.a VERS= .1 @@ -53,6 +51,8 @@ LINTFLAGS += -DDEBUG LINTFLAGS64 += -DDEBUG $(LINTLIB):= SRCS = $(SRCDIR)/$(LINTSRC) +CERRWARN += -_gcc=-Wno-type-limits + $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG debug := COPTFLAG = -g debug := COPTFLAG64 = -g diff --git a/usr/src/lib/udapl/udapl_tavor/Makefile.com b/usr/src/lib/udapl/udapl_tavor/Makefile.com index b23927eaa1..75780c71be 100644 --- a/usr/src/lib/udapl/udapl_tavor/Makefile.com +++ b/usr/src/lib/udapl/udapl_tavor/Makefile.com @@ -148,6 +148,10 @@ CFLAGS += $(CCVERBOSE) LINTFLAGS += -DDAPL_DBG LINTFLAGS64 += -DDAPL_DBG +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch + $(NOT_RELEASE_BUILD)CPPFLAGS += -DDAPL_DBG debug := COPTFLAG = -g debug := COPTFLAG64 = -g diff --git a/usr/src/lib/watchmalloc/Makefile.com b/usr/src/lib/watchmalloc/Makefile.com index 58f9e072aa..eabd4993bc 100644 --- a/usr/src/lib/watchmalloc/Makefile.com +++ b/usr/src/lib/watchmalloc/Makefile.com @@ -22,8 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY = watchmalloc.a VERS = .1 @@ -42,6 +40,8 @@ CFLAGS64 += $(CCVERBOSE) CPPFLAGS += -I../common -I../../common/inc -D_REENTRANT DYNFLAGS += $(ZINTERPOSE) +CERRWARN += -_gcc=-Wno-unused-label + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/man/man1/grep.1 b/usr/src/man/man1/grep.1 index e93f3a19ca..0269a5c7dc 100644 --- a/usr/src/man/man1/grep.1 +++ b/usr/src/man/man1/grep.1 @@ -16,26 +16,28 @@ grep \- search a file for a pattern .SH SYNOPSIS .LP .nf -\fB/usr/bin/grep\fR [\fB-c\fR | \fB-l\fR | \fB-q\fR] [\fB-bhinsvw\fR] \fIlimited-regular-expression\fR - [\fIfilename\fR]... +\fB/usr/bin/grep\fR [\fB-c\fR | \fB-l\fR |\fB-q\fR] [\fB-r\fR | \fB-R\fR] [\fB-bhinsvw\fR] + \fIlimited-regular-expression\fR [\fIfilename\fR]... .fi .LP .nf -\fB/usr/xpg4/bin/grep\fR [\fB-E\fR | \fB-F\fR] [\fB-c\fR | \fB-l\fR | \fB-q\fR] [\fB-bhinsvwx\fR] \fB-e\fR \fIpattern_list\fR... - [\fB-f\fR \fIpattern_file\fR]... [\fIfile\fR]... +\fB/usr/xpg4/bin/grep\fR [\fB-E\fR | \fB-F\fR] [\fB-c\fR | \fB-l\fR | \fB-q\fR] [\fB-r\fR | \fB-R\fR] + [\fB-bhinsvwx\fR] \fB-e\fR \fIpattern_list\fR... [\fB-f\fR \fIpattern_file\fR]... + [\fIfile\fR]... .fi .LP .nf -\fB/usr/xpg4/bin/grep\fR [\fB-E\fR | \fB-F\fR] [\fB-c\fR | \fB-l\fR | \fB-q\fR] [\fB-bhinsvwx\fR] - [\fB-e\fR \fIpattern_list\fR]... \fB-f\fR \fIpattern_file\fR... [\fIfile\fR]... +\fB/usr/xpg4/bin/grep\fR [\fB-E\fR | \fB-F\fR] [\fB-c\fR | \fB-l\fR | \fB-q\fR] [\fB-r\fR | \fB-R\fR] + [\fB-bhinsvwx\fR] [\fB-e\fR \fIpattern_list\fR]... \fB-f\fR \fIpattern_file\fR... + [\fIfile\fR]... .fi .LP .nf -\fB/usr/xpg4/bin/grep\fR [\fB-E\fR | \fB-F\fR] [\fB-c\fR | \fB-l\fR | \fB-q\fR] [\fB-bhinsvwx\fR] \fIpattern\fR - [\fIfile\fR]... +\fB/usr/xpg4/bin/grep\fR [\fB-E\fR | \fB-F\fR] [\fB-c\fR | \fB-l\fR | \fB-q\fR] [\fB-r\fR | \fB-R\fR] + [\fB-bhinsvwx\fR] \fIpattern\fR [\fIfile\fR]... .fi .SH DESCRIPTION @@ -135,6 +137,26 @@ Precedes each line by its line number in the file (first line is 1). .sp .ne 2 .na +\fB\fB-r\fR\fR +.ad +.RS 6n +Read all files under each directory, recursively. Follow symbolic links on +the command line, but skip symlinks that are encountered recursively. If file +is a device, FIFO, or socket, skip it. +.RE + +.sp +.ne 2 +.na +\fB\fB-R\fR\fR +.ad +.RS 6n +Read all files under each directory, recursively, following all symbolic links. +.RE + +.sp +.ne 2 +.na \fB\fB-q\fR\fR .ad .RS 6n diff --git a/usr/src/man/man1/ld.1 b/usr/src/man/man1/ld.1 index e448bf51f0..be9394d829 100644 --- a/usr/src/man/man1/ld.1 +++ b/usr/src/man/man1/ld.1 @@ -5,7 +5,7 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. .\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH LD 1 "Sep 18, 2009" +.TH LD 1 "Oct 24, 2012" .SH NAME ld \- link-editor for object files .SH SYNOPSIS @@ -25,6 +25,7 @@ ld \- link-editor for object files [\fB-z\fR direct | nodirect] [\fB-z\fR endfiltee] [\fB-z\fR fatal-warnings | nofatal-warnings ] [\fB-z\fR finiarray=\fIfunction\fR] [\fB-z\fR globalaudit] [\fB-z\fR groupperm | nogroupperm] [\fB-z\fR help ] +[\fB-z\fR guidance[=\fIid1\fR,\fIid2\fR...] [\fB-z\fR help ] [\fB-z\fR ignore | record] [\fB-z\fR initarray=\fIfunction\fR] [\fB-z\fR initfirst] [\fB-z\fR interpose] [\fB-z\fR lazyload | nolazyload] [\fB-z\fR ld32=\fIarg1\fR,\fIarg2\fR,...] [\fB-z\fR ld64=\fIarg1\fR,\fIarg2\fR,...] @@ -1013,6 +1014,102 @@ had been built using the \fB-B\fR \fBgroup\fR option. .sp .ne 2 .na +\fB-z\fR \fBguidance\fR[=\fIid1\fR,\fIid2\fR...] +.ad +.sp .6 +.RS 4n +Give messages suggesting link-editor features that could improve the resulting +dynamic object. +.LP +Specific classes of suggestion can be silenced by specifying an optional comma separated +list of guidance identifiers. +.LP +The current classes of suggestion provided are: + +.sp +.ne 2 +.na +Enable use of direct binding +.ad +.sp .6 +.RS 4n +Suggests that \fB-z direct\fR or \fB-B direct\fR be present prior to any +specified dependency. This allows predictable symbol binding at runtime. + +Can be disabled with \fB-z guidance=nodirect\fR +.RE + +.sp +.ne 2 +.na +Enable lazy dependency loading +.ad +.sp .6 +.RS 4n +Suggests that \fB-z lazyload\fR be present prior to any specified dependency. +This allows the dynamic object to be loaded more quickly. + +Can be disabled with \fB-z guidance=nolazyload\fR. +.RE + +.sp +.ne 2 +.na +Shared objects should define all their dependencies. +.ad +.sp .6 +.RS 4n +Suggests that \fB-z defs\fR be specified on the link-editor command line. +Shared objects that explicitly state all their dependencies behave more +predictably when used. + +Can be be disabled with \fB-z guidance=nodefs\fR +.RE + +.sp +.ne 2 +.na +Version 2 mapfile syntax +.ad +.sp .6 +.RS 4n +Suggests that any specified mapfiles use the more readable version 2 syntax. + +Can be disabled with \fB-z guidance=nomapfile\fR. +.RE + +.sp +.ne 2 +.na +Read-only text segment +.ad +.sp .6 +.RS 4n +Should any runtime relocations within the text segment exist, suggests that +the object be compiled with position independent code (PIC). Keeping large +allocatable sections read-only allows them to be shared between processes +using a given shared object. + +Can be disabled with \fB-z guidance=notext\fR +.RE + +.sp +.ne 2 +.na +No unused dependencies +.ad +.sp .6 +.RS 4n +Suggests that any dependency not referenced by the resulting dynamic object be +removed from the link-editor command line. + +Can be disabled with \fB-z guidance=nounused\fR. +.RE +.RE + +.sp +.ne 2 +.na \fB\fB-z\fR \fBhelp\fR\fR .ad .br diff --git a/usr/src/man/man1/ld.so.1.1 b/usr/src/man/man1/ld.so.1.1 index b86dfdce5e..4b14ca4f1a 100644 --- a/usr/src/man/man1/ld.so.1.1 +++ b/usr/src/man/man1/ld.so.1.1 @@ -1,9 +1,9 @@ -'\" te +'\" .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. .\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH LD.SO.1 1 "Aug 26, 2009" +.TH LD.SO.1 1 "Oct 5, 2012" .SH NAME ld.so.1 \- runtime linker for dynamic objects .SH SYNOPSIS @@ -232,6 +232,21 @@ If both \fBLD_BIND_NOW\fR and \fBLD_BIND_LAZY\fR are specified, then .sp .ne 2 .na +\fBLD_CAP_FILES\fR, \fBLD_CAP_FILES_32\fR, and \fBLD_CAP_FILES_64\fR +.ad +.sp .6 +.RS 4n +A comma-separated list of executables and shared libraries to which the +alternative capabilities specified by \fBLD_MACHCAP\fR, \fBLD_PLATCAP\fR, +\fBLD_HWCAP\fR and \fBLD_SFCAP\fR should apply. +.LP +Executables and libraries may be specified either by their SONAME or their +full real pathname. +.RE + +.sp +.ne 2 +.na \fB\fBLD_CONFIG\fR, \fBLD_CONFIG_32\fR, and \fBLD_CONFIG_64\fR\fR .ad .sp .6 @@ -285,6 +300,37 @@ EXAMPLES. .sp .ne 2 .na +\fBLD_HWCAP\fR, \fBLD_HWCAP_32\fR, and \fBLD_HWCAP_64\fR +.ad +.sp .6 +.RS 4n +Specify a comma-separated set of alternative hardware capabilities. A +leading '+' indicates that the capabilities should be included in addition to +the default set, a leading '-' indicates that the capabilities should be +excluded from the default set, and neither indicates that the set should +replace the default set. +.LP +Capabilities may be specified either by name, or as hexadecimal integers with +an optional leading bracketed index number specifying the capabilities family. +.nf +LD_HWCAP=[1]01 # Sets CA_SUN_HW_1 to 0x1 +LD_HWCAP=[2]20 # Sets CA_SUN_HW_2 to 0x20 +.fi +.RE + +.sp +.ne 2 +.na +\fBLD_MACHCAP\fR +.ad +.sp .6 +.RS 4n +Specify an alternative machine hardware capability name. +.RE + +.sp +.ne 2 +.na \fB\fBLD_LIBRARY_PATH\fR, \fBLD_LIBRARY_PATH_32\fR, and \fBLD_LIBRARY_PATH_64\fR\fR .ad @@ -445,6 +491,16 @@ default thus making this option redundant. .sp .ne 2 .na +\fBLD_PLATCAP\fR +.ad +.sp .6 +.RS 4n +Specify an alternative platform hardware capability name. +.RE + +.sp +.ne 2 +.na \fB\fBLD_PRELOAD\fR, \fBLD_PRELOAD_32\fR, and \fBLD_PRELOAD_64\fR\fR .ad .sp .6 @@ -489,6 +545,22 @@ objects. .sp .ne 2 .na +\fBLD_SFCAP\fR, \fBLD_SFCAP_32\fR, and \fBLD_SFCAP_64\fR +.ad +.sp .6 +.RS 4n +Specify a comma-separated set of alternative software capabilities. A +leading '+' indicates that the capabilities should be included in addition to +the default set, a leading '-' indicates that the capabilities should be +excluded from the default set, and neither indicates that the set should +replace the default set. +.LP +Capabilities may be specified either by name, or as hexadecimal integers. +.RE + +.sp +.ne 2 +.na \fB\fBLD_SIGNAL\fR, \fBLD_SIGNAL_32\fR, and \fBLD_SIGNAL_64\fR\fR .ad .sp .6 diff --git a/usr/src/man/man1/proc.1 b/usr/src/man/man1/proc.1 index 21a9134844..cd20e215e3 100644 --- a/usr/src/man/man1/proc.1 +++ b/usr/src/man/man1/proc.1 @@ -1,10 +1,11 @@ '\" te .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved .\" Portions Copyright 2008 Chad Mynhier +.\" Copyright 2012 DEY Storage Systems, Inc. All rights reserved. .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH PROC 1 "Dec 10, 2008" +.TH PROC 1 "Oct 23, 2012" .SH NAME proc, pflags, pcred, pldd, psig, pstack, pfiles, pwdx, pstop, prun, pwait, ptime \- proc tools @@ -46,7 +47,7 @@ ptime \- proc tools .LP .nf -\fB/usr/bin/pfiles\fR [\fB-Fn\fR] \fIpid\fR... +\fB/usr/bin/pfiles\fR [\fB-Fn\fR] \fIpid\fR | \fIcore\fR... .fi .LP diff --git a/usr/src/man/man1/ps.1 b/usr/src/man/man1/ps.1 index 1713a18502..674e326e29 100644 --- a/usr/src/man/man1/ps.1 +++ b/usr/src/man/man1/ps.1 @@ -1104,8 +1104,8 @@ The home lgroup of the process. \fB\fBdmodel\fR\fR .ad .RS 11n -The data model of the process, printed in the same manner as -via \fBpflags\fR(1). +The data model of the process, printed in the same manner as via +\fBpflags\fR(1). The currently supported data models are _ILP32 and _LP64. .RE .sp diff --git a/usr/src/man/man1m/ldapclient.1m b/usr/src/man/man1m/ldapclient.1m index 75fa32e9e3..14e7eec02a 100644 --- a/usr/src/man/man1m/ldapclient.1m +++ b/usr/src/man/man1m/ldapclient.1m @@ -235,6 +235,10 @@ following authentication methods: .in -2 .br .in +2 +\fBtls:none\fR +.in -2 +.br +.in +2 \fBtls:simple\fR .in -2 .br @@ -251,7 +255,9 @@ Note that some directory servers may not support all of these authentication methods. For \fBsimple\fR, be aware that the bind password will be sent in the clear to the LDAP server. For those authentication methods using TLS (transport layer security), the entire session is encrypted. You will need to install the -appropriate certificate databases to use TLS. +appropriate certificate databases to use TLS. Note that the \fBtls:none\fR +authentication method requires a \fBcredentialLevel\fR of \fBproxy\fR to +take effect. .SS "Commands" .sp .LP @@ -371,6 +377,25 @@ attributeMap: passwd:uid=employeeNumber the LDAP client would use the LDAP attribute \fBemployeeNumber\fR rather than \fBuid\fR for the \fBpasswd\fR service. This is a multivalued attribute. +.sp +To use rfc2307bis style groups (with a DN rather than username as the +attribute value), map the \fBmemberUid\fR attribute to the group attribute +being used (typically either \fBuniqueMember\fR or \fBmember\fR), for example: +.sp +.in +2 +.nf +attributeMap: group:memberUid=uniqueMember +.fi +.in -2 +.sp + +Group membership in a given directory is expected to be maintained with +either username format member attributes, or DN format member attributes. If +both are present they must describe identical memberships or unexpected +results may be obtained. For DN format attributes, the username is required +to be the RDN of the entry. Note that nested groups are not currently +supported, and unexpected results may be obtained if they are used. + .RE .sp diff --git a/usr/src/man/man1m/zdb.1m b/usr/src/man/man1m/zdb.1m index 106dcfbb59..5336e1e25f 100644 --- a/usr/src/man/man1m/zdb.1m +++ b/usr/src/man/man1m/zdb.1m @@ -11,6 +11,7 @@ .\" .\" .\" Copyright 2012, Richard Lowe. +.\" Copyright (c) 2012 by Delphix. All rights reserved. .\" .TH "ZDB" "1M" "February 15, 2012" "" "" @@ -19,21 +20,23 @@ .SH "SYNOPSIS" \fBzdb\fR [-CumdibcsDvhLXFPA] [-e [-p \fIpath\fR...]] [-t \fItxg\fR] - \fIpoolname\fR [\fIobject\fR ...] + [-U \fIcache\fR] [-M \fIinflight I/Os\fR] [\fIpoolname\fR + [\fIobject\fR ...]] .P -\fBzdb\fR [-divPA] [-e [-p \fIpath\fR...]] \fIdataset\fR [\fIobject\fR ...] +\fBzdb\fR [-divPA] [-e [-p \fIpath\fR...]] [-U \fIcache\fR] + \fIdataset\fR [\fIobject\fR ...] .P -\fBzdb\fR -m [-LXFPA] [-t \fItxg\fR] [-e [-p \fIpath\fR...]] \fIpoolname\fR - [\fIvdev\fR [\fImetaslab\fR ...]] +\fBzdb\fR -m [-LXFPA] [-t \fItxg\fR] [-e [-p \fIpath\fR...]] [-U \fIcache\fR] + \fIpoolname\fR [\fIvdev\fR [\fImetaslab\fR ...]] .P -\fBzdb\fR -R [-A] [-e [-p \fIpath\fR...]] \fIpoolname\fR +\fBzdb\fR -R [-A] [-e [-p \fIpath\fR...]] [-U \fIcache\fR] \fIpoolname\fR \fIvdev\fR:\fIoffset\fR:\fIsize\fR[:\fIflags\fR] .P -\fBzdb\fR -S [-AP] [-e [-p \fIpath\fR...]] \fIpoolname\fR +\fBzdb\fR -S [-AP] [-e [-p \fIpath\fR...]] [-U \fIcache\fR] \fIpoolname\fR .P \fBzdb\fR -l [-uA] \fIdevice\fR @@ -357,6 +360,18 @@ transactions. .sp .ne 2 .na +\fB-M \fIinflight I/Os\fR \fR +.ad +.sp .6 +.RS 4n +Limit the number of outstanding checksum I/Os to the specified value. The +default value is 200. This option affects the performance of the \fB-c\fR +option. +.RE + +.sp +.ne 2 +.na \fB-P\fR .ad .sp .6 @@ -384,8 +399,7 @@ and their associated transaction numbers. .ad .sp .6 .RS 4n -Use a cache file other than \fB/etc/zfs/zpool.cache\fR. This option is only -valid with \fB-C\fR +Use a cache file other than \fB/etc/zfs/zpool.cache\fR. .RE .sp diff --git a/usr/src/man/man1m/zpool.1m b/usr/src/man/man1m/zpool.1m index a55ca387cc..19d6dda8eb 100644 --- a/usr/src/man/man1m/zpool.1m +++ b/usr/src/man/man1m/zpool.1m @@ -114,6 +114,11 @@ zpool \- configures ZFS storage pools .LP .nf +\fBzpool reopen\fR \fIpool\fR +.fi + +.LP +.nf \fBzpool remove\fR \fIpool\fR \fIdevice\fR ... .fi @@ -1574,8 +1579,18 @@ become available to the pool. .ad .sp .6 .RS 4n -Generates a new unique identifier for the pool. You must ensure that all devices in this pool are online and -healthy before performing this action. +Generates a new unique identifier for the pool. You must ensure that all +devices in this pool are online and healthy before performing this action. +.RE + +.sp +.ne 2 +.na +\fB\fBzpool reopen\fR \fIpool\fR +.ad +.sp .6 +.RS 4n +Reopen all the vdevs associated with the pool. .RE .sp diff --git a/usr/src/man/man4/core.4 b/usr/src/man/man4/core.4 index 6c0d1e2006..c6bc9ea373 100644 --- a/usr/src/man/man4/core.4 +++ b/usr/src/man/man4/core.4 @@ -1,10 +1,11 @@ '\" te .\" Copyright (C) 2008, Sun Microsystems, Inc. All Rights Reserved. +.\" Copyright 2012 DEY Storage Systems, Inc. All rights reserved. .\" Copyright 1989 AT&T .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH CORE 4 "May 13, 2008" +.TH CORE 4 "Oct 23, 2012" .SH NAME core \- process core file .SH DESCRIPTION @@ -307,7 +308,7 @@ is defined in <\fBsys/utsname.h\fR>. .RS 20n \fBn_type\fR: \fBNT_PRCRED\fR. This structure contains the process credentials, including the real, saved, and effective user and group IDs. The \fBprcred_t\fR -structure is defined in <\fBaasys/procfs.h\fR>. Following the structure is an +structure is defined in <\fBsys/procfs.h\fR>. Following the structure is an optional array of supplementary group IDs. The total number of supplementary group IDs is given by the \fBpr_ngroups\fR member of the \fBprcred_t\fR structure, and the structure includes space for one supplementary group. If @@ -330,6 +331,18 @@ with the numerical ID returned by \fBgetzoneid\fR(3C). .sp .ne 2 .na +\fB\fBprfdinfo_t\fR\fR +.ad +.RS 20n +\fBn_type\fR: \fBNT_FDINFO\fR. This structure contains information about +any open file descriptors, including the path, flags, and +\fBstat\fR(2) information. The \fBprfdinfo_t\fR structure is defined in +<\fBsys/procfs.h\fR>. +.RE + +.sp +.ne 2 +.na \fB\fBstruct ssd\fR array\fR .ad .RS 20n diff --git a/usr/src/man/man7d/ipmi.7d b/usr/src/man/man7d/ipmi.7d index 1ce5594d23..50e80253de 100644 --- a/usr/src/man/man7d/ipmi.7d +++ b/usr/src/man/man7d/ipmi.7d @@ -1,8 +1,25 @@ -'\" te +'\" +.\" CDDL HEADER START +.\" +.\" The contents of this file are subject to the terms of the +.\" Common Development and Distribution License (the "License"). +.\" You may not use this file except in compliance with the License. +.\" +.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +.\" or http://www.opensolaris.org/os/licensing. +.\" See the License for the specific language governing permissions +.\" and limitations under the License. +.\" +.\" When distributing Covered Code, include this CDDL HEADER in each +.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE. +.\" If applicable, add the following below this CDDL HEADER, with the +.\" fields enclosed by brackets "[]" replaced with your own identifying +.\" information: Portions Copyright [yyyy] [name of copyright owner] +.\" +.\" CDDL HEADER END +.\" .\" Copyright (c) 2012, Joyent, Inc. All Rights Reserved -.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. -.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. -.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] +.\" .TH IMPI 7D "Apr 21, 2012" .SH NAME ipmi \- OpenIPMI compatible IPMI interface driver diff --git a/usr/src/man/man9f/inb.9f b/usr/src/man/man9f/inb.9f index 0f4ea2df4d..61fc3c1444 100644 --- a/usr/src/man/man9f/inb.9f +++ b/usr/src/man/man9f/inb.9f @@ -3,7 +3,7 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH INB 9F "Jan 16, 2006" +.TH INB 9F "Oct 24, 2012" .SH NAME inb, inw, inl, repinsb, repinsw, repinsd \- read from an I/O port .SH SYNOPSIS @@ -49,9 +49,9 @@ inb, inw, inl, repinsb, repinsw, repinsd \- read from an I/O port .LP The functions described here are obsolete. For the \fBinb()\fR, \fBinw()\fR, and \fBinl()\fR functions, use, respectively, \fBddi_get8\fR(9F), -\fBddi_get8\fR(9F), and \fBddi_get8\fR(9F) instead. For \fBrepinsb()\fR, +\fBddi_get16\fR(9F), and \fBddi_get32\fR(9F) instead. For \fBrepinsb()\fR, \fBrepinsw()\fR, and\fBrepinsl()\fR, use, respectively, \fBddi_rep_get8\fR(9F), -\fBddi_rep_get8\fR(9F), and \fBddi_rep_get8\fR(9F) instead. +\fBddi_rep_get16\fR(9F), and \fBddi_rep_get32\fR(9F) instead. .SH PARAMETERS .sp .ne 2 @@ -126,9 +126,9 @@ Stability Level Obsolete .SH SEE ALSO .sp .LP -\fBisa\fR(4), \fBattributes\fR(5), \fBddi_get8\fR(9F), \fBddi_get8\fR(9F), -\fBddi_get8\fR(9F), \fBddi_rep_get8\fR(9F), \fBddi_rep_get8\fR(9F), -\fBddi_rep_get8\fR(9F), \fBoutb\fR(9F) +\fBisa\fR(4), \fBattributes\fR(5), \fBddi_get8\fR(9F), \fBddi_get16\fR(9F), +\fBddi_get32\fR(9F), \fBddi_rep_get8\fR(9F), \fBddi_rep_get16\fR(9F), +\fBddi_rep_get32\fR(9F), \fBoutb\fR(9F) .sp .LP \fIWriting Device Drivers\fR diff --git a/usr/src/man/man9f/ldi_ev_register_callbacks.9f b/usr/src/man/man9f/ldi_ev_register_callbacks.9f index 68dddced81..07f41c8f2f 100644 --- a/usr/src/man/man9f/ldi_ev_register_callbacks.9f +++ b/usr/src/man/man9f/ldi_ev_register_callbacks.9f @@ -3,7 +3,7 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH LDI_EV_REGISTER_CALLBACKS 9F "Aug 21, 2007" +.TH LDI_EV_REGISTER_CALLBACKS 9F "Oct 24, 2012" .SH NAME ldi_ev_register_callbacks \- add a notify and/or finalize callback .SH SYNOPSIS @@ -11,8 +11,9 @@ ldi_ev_register_callbacks \- add a notify and/or finalize callback .nf #include <sys/sunldi.h> -\fBint\fR \fBldi_ev_get_cookie\fR(\fIldi_handle_t lh\fR, \fIldi_ev_cookie_t *cookie\fR, - \fIldi_ev_callback_t *callb\fR, \fBvoid\fR \fI*arg\fR, \fIldi_ev_callback_id_t *id\fR); +\fBint\fR \fBldi_ev_register_callbacks\fR(\fIldi_handle_t lh\fR, + \fIldi_ev_cookie_t *cookie\fR, \fIldi_ev_callback_t *callb\fR, + \fBvoid\fR \fI*arg\fR, \fIldi_callback_id_t *id\fR); .fi .SH INTERFACE LEVEL @@ -106,7 +107,7 @@ Event specific data. .sp .ne 2 .na -\fB\fBvoid *arg\fR\fR +\fB\fBvoid\fR *\fIarg\fR\fR .ad .sp .6 .RS 4n @@ -116,7 +117,7 @@ A pointer to opaque caller private data. .sp .ne 2 .na -\fB\fBldi_ev_callback_id_t *id\fR\fR +\fB\fIldi_callback_id_t *id\fR\fR .ad .sp .6 .RS 4n @@ -322,7 +323,7 @@ and \fBldi_ev_finalize\fR(9F)). .sp .LP Once the registration of the callback(s) is successful, an opaque -\fIldi_ev_callback_id_t\fR structure is returned which may be used to +\fIldi_callback_id_t\fR structure is returned which may be used to unregister the callback(s) later. .SH RETURN VALUES .sp @@ -385,7 +386,7 @@ event_register(void) } static void -event_unregister(ldi_ev_callback_id_t id) +event_unregister(ldi_callback_id_t id) { ldi_ev_remove_callbacks(id); } @@ -495,7 +496,7 @@ event_register(void) } static void -event_unregister(ldi_ev_callback_id_t id) +event_unregister(ldi_callback_id_t id) { ldi_ev_remove_callbacks(id); } diff --git a/usr/src/man/man9f/ldi_ev_remove_callbacks.9f b/usr/src/man/man9f/ldi_ev_remove_callbacks.9f index 6f32406473..2a5a1b27cf 100644 --- a/usr/src/man/man9f/ldi_ev_remove_callbacks.9f +++ b/usr/src/man/man9f/ldi_ev_remove_callbacks.9f @@ -3,7 +3,7 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH LDI_EV_REMOVE_CALLBACKS 9F "Aug 21, 2007" +.TH LDI_EV_REMOVE_CALLBACKS 9F "Oct 24, 2012" .SH NAME ldi_ev_remove_callbacks \- remove all callbacks for a given callback ID .SH SYNOPSIS @@ -11,7 +11,7 @@ ldi_ev_remove_callbacks \- remove all callbacks for a given callback ID .nf #include <sys/sunldi.h> -\fBvoid\fR \fBldi_ev_remove_callbacks\fR(\fIldi_ev_callback_id_t id\fR); +\fBvoid\fR \fBldi_ev_remove_callbacks\fR(\fIldi_callback_id_t id\fR); .fi .SH INTERFACE LEVEL @@ -22,7 +22,7 @@ Solaris DDI specific (Solaris DDI) .sp .ne 2 .na -\fB\fIldi_ev_callback_id_t id\fR\fR +\fB\fIldi_callback_id_t id\fR\fR .ad .sp .6 .RS 4n diff --git a/usr/src/man/man9f/outb.9f b/usr/src/man/man9f/outb.9f index cacd669d30..d839c2f012 100644 --- a/usr/src/man/man9f/outb.9f +++ b/usr/src/man/man9f/outb.9f @@ -3,7 +3,7 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH OUTB 9F "Jan 16, 2006" +.TH OUTB 9F "Oct 24, 2012" .SH NAME outb, outw, outl, repoutsb, repoutsw, repoutsd \- write to an I/O port .SH SYNOPSIS @@ -45,9 +45,9 @@ outb, outw, outl, repoutsb, repoutsw, repoutsd \- write to an I/O port .LP The functions described here are obsolete. For the \fBoutb()\fR, \fBoutw()\fR, and \fBoutl()\fR functions use, respectively, \fBddi_put8\fR(9F), -\fBddi_put8\fR(9F), and \fBddi_put8\fR(9F) instead. For \fBrepoutsb()\fR, +\fBddi_put16\fR(9F), and \fBddi_put32\fR(9F) instead. For \fBrepoutsb()\fR, \fBrepoutsw()\fR, and\fBrepoutsl()\fR, use, respectively, -\fBddi_rep_put8\fR(9F), \fBddi_rep_put8\fR(9F), and \fBddi_rep_put8\fR(9F) +\fBddi_rep_put8\fR(9F), \fBddi_rep_put16\fR(9F), and \fBddi_rep_put32\fR(9F) instead. .SH PARAMETERS .sp @@ -127,9 +127,9 @@ Interface Stability Obsolete .SH SEE ALSO .sp .LP -\fBisa\fR(4), \fBattributes\fR(5), \fBddi_put8\fR(9F), \fBddi_put8\fR(9F), -\fBddi_put8\fR(9F), \fBddi_rep_put8\fR(9F), \fBddi_rep_put8\fR(9F), -\fBddi_rep_put8\fR(9F), \fBinb\fR(9F) +\fBisa\fR(4), \fBattributes\fR(5), \fBddi_put8\fR(9F), \fBddi_put16\fR(9F), +\fBddi_put32\fR(9F), \fBddi_rep_put8\fR(9F), \fBddi_rep_put16\fR(9F), +\fBddi_rep_put32\fR(9F), \fBinb\fR(9F) .sp .LP \fIWriting Device Drivers\fR diff --git a/usr/src/pkg/manifests/developer-build-onbld.mf b/usr/src/pkg/manifests/developer-build-onbld.mf index dbb194fb77..bf01650e0f 100644 --- a/usr/src/pkg/manifests/developer-build-onbld.mf +++ b/usr/src/pkg/manifests/developer-build-onbld.mf @@ -22,6 +22,7 @@ # # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. # Copyright 2010, Richard Lowe +# Copyright 2012, Piotr Jasiukajtis # set name=pkg.fmri value=pkg:/developer/build/onbld@$(PKGVERS) @@ -47,11 +48,6 @@ dir path=opt/onbld/gk dir path=opt/onbld/lib dir path=opt/onbld/lib/$(ARCH) dir path=opt/onbld/lib/perl -dir path=opt/onbld/lib/python2.4 -dir path=opt/onbld/lib/python2.4/onbld -dir path=opt/onbld/lib/python2.4/onbld/Checks -dir path=opt/onbld/lib/python2.4/onbld/Scm -dir path=opt/onbld/lib/python2.4/onbld/hgext dir path=opt/onbld/lib/python2.6 dir path=opt/onbld/lib/python2.6/onbld dir path=opt/onbld/lib/python2.6/onbld/Checks @@ -149,43 +145,6 @@ file path=opt/onbld/gk/gen_make.machines mode=0755 file path=opt/onbld/lib/$(ARCH)/libdwarf.so.1 file path=opt/onbld/lib/perl/onbld_elfmod.pm file path=opt/onbld/lib/perl/onbld_elfmod_vertype.pm -file path=opt/onbld/lib/python2.4/onbld/Checks/CStyle.py mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Checks/CStyle.pyc mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Checks/Cddl.py mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Checks/Cddl.pyc mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Checks/CmtBlk.py mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Checks/CmtBlk.pyc mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Checks/Comments.py mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Checks/Comments.pyc mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Checks/Copyright.py mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Checks/Copyright.pyc mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Checks/DbLookups.py mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Checks/DbLookups.pyc mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Checks/HdrChk.py mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Checks/HdrChk.pyc mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Checks/JStyle.py mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Checks/JStyle.pyc mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Checks/Keywords.py mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Checks/Keywords.pyc mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Checks/Mapfile.py mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Checks/Mapfile.pyc mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Checks/ProcessCheck.py mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Checks/ProcessCheck.pyc mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Checks/__init__.py mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Checks/__init__.pyc mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Scm/Backup.py mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Scm/Backup.pyc mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Scm/Version.py mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Scm/Version.pyc mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Scm/WorkSpace.py mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Scm/WorkSpace.pyc mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Scm/__init__.py mode=0444 -file path=opt/onbld/lib/python2.4/onbld/Scm/__init__.pyc mode=0444 -file path=opt/onbld/lib/python2.4/onbld/__init__.py mode=0444 -file path=opt/onbld/lib/python2.4/onbld/__init__.pyc mode=0444 -file path=opt/onbld/lib/python2.4/onbld/hgext/__init__.py mode=0444 -file path=opt/onbld/lib/python2.4/onbld/hgext/__init__.pyc mode=0444 -file path=opt/onbld/lib/python2.4/onbld/hgext/cdm.py mode=0444 file path=opt/onbld/lib/python2.6/onbld/Checks/CStyle.py mode=0444 file path=opt/onbld/lib/python2.6/onbld/Checks/CStyle.pyc mode=0444 file path=opt/onbld/lib/python2.6/onbld/Checks/Cddl.py mode=0444 @@ -266,10 +225,8 @@ license usr/src/tools/ctf/dwarf/THIRDPARTYLICENSE \ license usr/src/tools/onbld/THIRDPARTYLICENSE \ license=usr/src/tools/onbld/THIRDPARTYLICENSE link path=opt/onbld/bin/git-nits target=git-pbchk -link path=opt/onbld/lib/python target=python2.4 +link path=opt/onbld/lib/python target=python2.6 link path=opt/onbld/man/man1/git-nits.1 target=git-pbchk.1 -# DbLookups.py requires elementtree -depend fmri=library/python-2/python-extra-24 type=require # webrev(1) requires ps2pdf depend fmri=print/filter/ghostscript type=require # hgsetup(1) uses check-hostname(1) and nightly sendmail(1M) diff --git a/usr/src/pkg/manifests/developer-opensolaris-osnet.mf b/usr/src/pkg/manifests/developer-opensolaris-osnet.mf index d05fbd7291..9632c7d614 100644 --- a/usr/src/pkg/manifests/developer-opensolaris-osnet.mf +++ b/usr/src/pkg/manifests/developer-opensolaris-osnet.mf @@ -34,7 +34,7 @@ depend fmri=data/docbook@0.5.11-0.133 type=require depend fmri=developer/astdev@0.5.11-0.133 type=require depend fmri=developer/build/make@0.5.11-0.133 type=require depend fmri=developer/build/onbld@0.5.11-0.133 type=require -depend fmri=developer/gcc-3@3.4.3-0.133 type=require +$(i386_ONLY)depend fmri=developer/gnu-binutils@2.19-0.133 type=require depend fmri=developer/java/jdk@0.5.11-0.133 type=require depend fmri=developer/lexer/flex@2.5.35-0.133 type=require depend fmri=developer/object-file@0.5.11-0.133 type=require diff --git a/usr/src/pkg/manifests/driver-ipmi.mf b/usr/src/pkg/manifests/driver-ipmi.mf new file mode 100644 index 0000000000..e6eea4cb99 --- /dev/null +++ b/usr/src/pkg/manifests/driver-ipmi.mf @@ -0,0 +1,45 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +<include global_zone_only_component> +set name=pkg.fmri value=pkg:/driver/ipmi@$(PKGVERS) +set name=pkg.summary \ + value="Intelligent Platform Management Interface baseboard driver" +set name=info.classification value=org.opensolaris.category.2008:Drivers/Ports +set name=variant.arch value=i386 +dir path=usr/include +dir path=usr/include/sys +dir path=usr/include/sys +dir path=usr/kernel group=sys +dir path=usr/kernel/drv group=sys +dir path=usr/kernel/drv/$(ARCH64) group=sys +dir path=usr/share +dir path=usr/share/man +dir path=usr/share/man/man7d +driver name=ipmi perms="* 0600 root sys" +file path=usr/include/sys/ipmi.h +file path=usr/kernel/drv/amd64/ipmi +file path=usr/kernel/drv/ipmi +file path=usr/kernel/drv/ipmi.conf +file path=usr/share/man/man7d/ipmi.7d +license lic_CDDL license=lic_CDDL +license usr/src/uts/intel/io/ipmi/THIRDPARTYLICENSE \ + license=usr/src/uts/intel/io/ipmi/THIRDPARTYLICENSE diff --git a/usr/src/pkg/manifests/driver-misc-virtio.mf b/usr/src/pkg/manifests/driver-misc-virtio.mf new file mode 100644 index 0000000000..805f52137d --- /dev/null +++ b/usr/src/pkg/manifests/driver-misc-virtio.mf @@ -0,0 +1,43 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright (c) 2012 Nexenta Systems, Inc. All rights reserved. +# + +# +# The default for payload-bearing actions in this package is to appear in the +# global zone only. See the include file for greater detail, as well as +# information about overriding the defaults. +# +<include global_zone_only_component> +set name=pkg.fmri value=pkg:/driver/misc/virtio@$(PKGVERS) +set name=pkg.description value="Virtio core" +set name=pkg.summary value="Virtio core" +set name=info.classification \ + value=org.opensolaris.category.2008:System/Hardware +set name=variant.arch value=i386 +dir path=kernel group=sys +dir path=kernel/misc group=sys +dir path=kernel/misc/$(ARCH64) group=sys +file path=kernel/misc/$(ARCH64)/virtio group=sys mode=0755 +file path=kernel/misc/virtio group=sys mode=0755 +license lic_CDDL license=lic_CDDL diff --git a/usr/src/pkg/manifests/driver-storage-mpt_sas.mf b/usr/src/pkg/manifests/driver-storage-mpt_sas.mf index 6d4bb62965..2ea1c67aea 100644 --- a/usr/src/pkg/manifests/driver-storage-mpt_sas.mf +++ b/usr/src/pkg/manifests/driver-storage-mpt_sas.mf @@ -49,6 +49,7 @@ driver name=mpt_sas class=scsi-self-identifying \ alias=pciex1000,70 \ alias=pciex1000,72 \ alias=pciex1000,76 \ + alias=pciex1000,86 \ alias=pciex1000,87 file path=kernel/drv/$(ARCH64)/mpt_sas group=sys $(i386_ONLY)file path=kernel/drv/mpt_sas group=sys diff --git a/usr/src/pkg/manifests/driver-storage-vioblk.mf b/usr/src/pkg/manifests/driver-storage-vioblk.mf new file mode 100644 index 0000000000..f3bc3ef128 --- /dev/null +++ b/usr/src/pkg/manifests/driver-storage-vioblk.mf @@ -0,0 +1,45 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2012 Nexenta Systems, Inc. All rights reserved. +# + +# +# The default for payload-bearing actions in this package is to appear in the +# global zone only. See the include file for greater detail, as well as +# information about overriding the defaults. +# +<include global_zone_only_component> +set name=pkg.fmri value=pkg:/driver/storage/vioblk@$(PKGVERS) +set name=pkg.description value="Virtio block driver" +set name=pkg.summary value="Virtio block" +set name=info.classification \ + value=org.opensolaris.category.2008:System/Hardware +set name=variant.arch value=i386 +dir path=kernel group=sys +dir path=kernel/drv group=sys +dir path=kernel/drv/$(ARCH64) group=sys +driver name=vioblk alias=pci1af4,1001 clone_perms="vioblk 0666 root sys" \ + perms="* 0666 root sys" +file path=kernel/drv/$(ARCH64)/vioblk group=sys +file path=kernel/drv/vioblk group=sys +license lic_CDDL license=lic_CDDL diff --git a/usr/src/pkg/manifests/system-zones.mf b/usr/src/pkg/manifests/system-zones.mf index de67c46f80..ff5787a608 100644 --- a/usr/src/pkg/manifests/system-zones.mf +++ b/usr/src/pkg/manifests/system-zones.mf @@ -59,8 +59,8 @@ dir path=usr/share/man/man1m dir path=usr/share/man/man5 dir path=usr/share/man/man7d driver name=zcons -file path=etc/zones/SUNWblank.xml mode=0444 -file path=etc/zones/SUNWdefault.xml mode=0444 +file path=etc/zones/SUNWblank.xml mode=0444 variant.opensolaris.zone=global +file path=etc/zones/SUNWdefault.xml mode=0444 variant.opensolaris.zone=global file path=etc/zones/index group=sys original_name=SUNWzone:etc/zones/index \ preserve=true variant.opensolaris.zone=global file path=lib/svc/manifest/system/resource-mgmt.xml group=sys mode=0444 \ diff --git a/usr/src/prototypes/README b/usr/src/prototypes/README index e622b1aeba..1ec179bb56 100644 --- a/usr/src/prototypes/README +++ b/usr/src/prototypes/README @@ -17,5 +17,5 @@ CDDL version 1.0 for each new file introduced in illumos. */ /* - * Copyright 2010 <contributor>. All rights reserved. + * Copyright 2012 <contributor>. All rights reserved. */ diff --git a/usr/src/prototypes/prototype.Makefile b/usr/src/prototypes/prototype.Makefile index 9539bab329..b12c91d527 100644 --- a/usr/src/prototypes/prototype.Makefile +++ b/usr/src/prototypes/prototype.Makefile @@ -10,6 +10,6 @@ # # -# Copyright 2011 <contributor>. All rights reserved. +# Copyright 2012 <contributor>. All rights reserved. # diff --git a/usr/src/prototypes/prototype.c b/usr/src/prototypes/prototype.c index 5154139aba..816c5475b9 100644 --- a/usr/src/prototypes/prototype.c +++ b/usr/src/prototypes/prototype.c @@ -10,7 +10,7 @@ */ /* - * Copyright 2011 <contributor>. All rights reserved. + * Copyright 2012 <contributor>. All rights reserved. */ /* diff --git a/usr/src/prototypes/prototype.csh b/usr/src/prototypes/prototype.csh index f1a7fc2ad9..38f17e0a09 100644 --- a/usr/src/prototypes/prototype.csh +++ b/usr/src/prototypes/prototype.csh @@ -12,6 +12,6 @@ # # -# Copyright 2011 <contributor>. All rights reserved. +# Copyright 2012 <contributor>. All rights reserved. # diff --git a/usr/src/prototypes/prototype.h b/usr/src/prototypes/prototype.h index 16016b2a5d..4082ec8eae 100644 --- a/usr/src/prototypes/prototype.h +++ b/usr/src/prototypes/prototype.h @@ -10,7 +10,7 @@ */ /* - * Copyright 2011 <contributor>. All rights reserved. + * Copyright 2012 <contributor>. All rights reserved. */ #ifndef _PROTOTYPE_H diff --git a/usr/src/prototypes/prototype.java b/usr/src/prototypes/prototype.java index 4673163b91..b9ffa24112 100644 --- a/usr/src/prototypes/prototype.java +++ b/usr/src/prototypes/prototype.java @@ -10,7 +10,7 @@ */ /* - * Copyright 2011 <contributor>. All rights reserved. + * Copyright 2012 <contributor>. All rights reserved. */ /* diff --git a/usr/src/prototypes/prototype.ksh b/usr/src/prototypes/prototype.ksh index 4f211f4466..44c20c48c9 100644 --- a/usr/src/prototypes/prototype.ksh +++ b/usr/src/prototypes/prototype.ksh @@ -12,6 +12,6 @@ # # -# Copyright 2011 <contributor>. All rights reserved. +# Copyright 2012 <contributor>. All rights reserved. # diff --git a/usr/src/prototypes/prototype.man b/usr/src/prototypes/prototype.man index b9b3db4423..4c07f19993 100644 --- a/usr/src/prototypes/prototype.man +++ b/usr/src/prototypes/prototype.man @@ -1,4 +1,3 @@ -'\" t .\" .\" This file and its contents are supplied under the terms of the .\" Common Development and Distribution License ("CDDL"), version 1.0. @@ -10,5 +9,5 @@ .\" http://www.illumos.org/license/CDDL. .\" .\" -.\" Copyright 2011 <contributor>. All rights reserved. +.\" Copyright 2012 <contributor>. All rights reserved. .\" diff --git a/usr/src/prototypes/prototype.mapfile-vers b/usr/src/prototypes/prototype.mapfile-vers index 3f44813564..780ef6c1ef 100644 --- a/usr/src/prototypes/prototype.mapfile-vers +++ b/usr/src/prototypes/prototype.mapfile-vers @@ -10,7 +10,7 @@ # # -# Copyright 2011 <contributor>. All rights reserved. +# Copyright 2012 <contributor>. All rights reserved. # # diff --git a/usr/src/prototypes/prototype.pl b/usr/src/prototypes/prototype.pl index 92ef47f3c1..53cb464b27 100644 --- a/usr/src/prototypes/prototype.pl +++ b/usr/src/prototypes/prototype.pl @@ -11,7 +11,7 @@ # # -# Copyright 2011 <contributor>. All rights reserved. +# Copyright 2012 <contributor>. All rights reserved. # # diff --git a/usr/src/prototypes/prototype.py b/usr/src/prototypes/prototype.py index 17edc4d88d..484eb8c9ba 100644 --- a/usr/src/prototypes/prototype.py +++ b/usr/src/prototypes/prototype.py @@ -11,7 +11,7 @@ # # -# Copyright 2011 <contributor>. All rights reserved. +# Copyright 2012 <contributor>. All rights reserved. # # diff --git a/usr/src/prototypes/prototype.s b/usr/src/prototypes/prototype.s index 81feaf7682..5a48f83716 100644 --- a/usr/src/prototypes/prototype.s +++ b/usr/src/prototypes/prototype.s @@ -10,7 +10,7 @@ */ /* - * Copyright 2011 <contributor>. All rights reserved. + * Copyright 2012 <contributor>. All rights reserved. */ .file "prototype.s" diff --git a/usr/src/prototypes/prototype.sh b/usr/src/prototypes/prototype.sh index 0b054bcb4d..9216640337 100644 --- a/usr/src/prototypes/prototype.sh +++ b/usr/src/prototypes/prototype.sh @@ -12,6 +12,6 @@ # # -# Copyright 2011 <contributor>. All rights reserved. +# Copyright 2012 <contributor>. All rights reserved. # diff --git a/usr/src/psm/stand/boot/Makefile.boot b/usr/src/psm/stand/boot/Makefile.boot index 1003bc32b9..8c9a50381a 100644 --- a/usr/src/psm/stand/boot/Makefile.boot +++ b/usr/src/psm/stand/boot/Makefile.boot @@ -63,3 +63,7 @@ DIRMODE = 755 # LINTFLAGS = -nmsF -erroff=E_BAD_PTR_CAST_ALIGN \ -erroff=E_NAME_DECL_NOT_USED_DEF2 -erroff=E_NAME_DEF_NOT_USED2 + +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-char-subscripts diff --git a/usr/src/psm/stand/bootlst/sparc/sun4u/Makefile b/usr/src/psm/stand/bootlst/sparc/sun4u/Makefile index 93b6be8a61..b6f46097fb 100644 --- a/usr/src/psm/stand/bootlst/sparc/sun4u/Makefile +++ b/usr/src/psm/stand/bootlst/sparc/sun4u/Makefile @@ -57,6 +57,7 @@ ALL = bootlst include ../../common/Makefile.com include $(TOPDIR)/psm/Makefile.psm.64 CFLAGS64 += -xchip=ultra $(CCABS32) +CERRWARN += -_gcc=-Wno-char-subscripts POST_PROCESS += ; $(CHK4UBINARY) diff --git a/usr/src/psm/stand/bootlst/sparc/sun4v/Makefile b/usr/src/psm/stand/bootlst/sparc/sun4v/Makefile index aaf6f6ddc1..0ed2387d35 100644 --- a/usr/src/psm/stand/bootlst/sparc/sun4v/Makefile +++ b/usr/src/psm/stand/bootlst/sparc/sun4v/Makefile @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# TOPDIR = ../../../../.. SPARCDIR = .. @@ -59,6 +57,6 @@ ALL = bootlst include ../../common/Makefile.com include $(TOPDIR)/psm/Makefile.psm.64 CFLAGS64 += -xchip=ultra $(CCABS32) - +CERRWARN += -_gcc=-Wno-char-subscripts .KEEP_STATE: diff --git a/usr/src/psm/stand/cpr/sparcv9/sun4u/Makefile b/usr/src/psm/stand/cpr/sparcv9/sun4u/Makefile index b687625d6d..5ae3235236 100644 --- a/usr/src/psm/stand/cpr/sparcv9/sun4u/Makefile +++ b/usr/src/psm/stand/cpr/sparcv9/sun4u/Makefile @@ -23,8 +23,6 @@ # Copyright 1995-1999,2002-2003 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# TOPDIR = ../../../../.. @@ -51,6 +49,7 @@ ALL = cprboot include ../../common/Makefile.com include $(TOPDIR)/psm/Makefile.psm.64 CFLAGS64 += -xchip=ultra $(CCABS32) +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/common/Makefile b/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/common/Makefile index e24b92b763..e9b9ba1721 100644 --- a/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/common/Makefile +++ b/usr/src/psm/stand/lib/promif/sparcv9/ieee1275/common/Makefile @@ -23,8 +23,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# # psm/stand/lib/promif/sparcv9/ieee1275/common/Makefile # @@ -37,6 +35,7 @@ include $(TOPDIR)/psm/stand/lib/Makefile.lib include $(TOPDIR)/psm/Makefile.psm.64 CFLAGS64 += -xchip=ultra $(CCABS32) +CERRWARN += -_gcc=-Wno-parentheses PROMDIR = $(TOPDIR)/psm/promif/ieee1275/common SYSDIR = $(TOPDIR)/uts diff --git a/usr/src/stand/lib/crypto/Makefile b/usr/src/stand/lib/crypto/Makefile index bcbb3cc874..49fb1ad711 100644 --- a/usr/src/stand/lib/crypto/Makefile +++ b/usr/src/stand/lib/crypto/Makefile @@ -218,6 +218,11 @@ CRYPTO_ULONG_OBJ = \ $(CRYPTO_ULONG_OBJ:%.o=objs/%.o) := CPPFLAGS += \ -erroff=E_CONST_PROMOTED_UNSIGNED_LONG +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-address +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable + objs/md5_dgst.o := CPPFLAGS += -DMD5_ASM objs/md5-sparcv9.o := CPPFLAGS += -DMD5_BLOCK_DATA_ORDER diff --git a/usr/src/stand/lib/fs/Makefile.com b/usr/src/stand/lib/fs/Makefile.com index 9f4d8e8124..f434526f78 100644 --- a/usr/src/stand/lib/fs/Makefile.com +++ b/usr/src/stand/lib/fs/Makefile.com @@ -23,8 +23,6 @@ # Copyright 2003 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# DIRREL = ../ @@ -35,3 +33,9 @@ include ../../Makefile.com # needs to go finish cleaning them up, at which point this can be removed. # lint lintcheck := LINTFLAGS += -y + +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-char-subscripts diff --git a/usr/src/stand/lib/inet/Makefile b/usr/src/stand/lib/inet/Makefile index 9c66f0b449..37f8dd9db2 100644 --- a/usr/src/stand/lib/inet/Makefile +++ b/usr/src/stand/lib/inet/Makefile @@ -23,8 +23,6 @@ # Copyright 2003 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY = libinet.a LOCOBJS = ipv4.o icmp4.o udp.o mac.o ethernet.o dhcpv4.o ibd.o @@ -38,4 +36,7 @@ SRCS = $(LOCOBJS:%.o=$(SRCDIR)/%.c) $(CMNOBJS:%.o=$(CMNDIR)/%.c) LDLIBS += -lsock CPPFLAGS += $(SOCKCPPFLAGS) -I$(TOPDIR)/psm/stand +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-uninitialized + include ../Makefile.targ diff --git a/usr/src/stand/lib/nvpair/Makefile b/usr/src/stand/lib/nvpair/Makefile index 58fc4e374b..c989738c35 100644 --- a/usr/src/stand/lib/nvpair/Makefile +++ b/usr/src/stand/lib/nvpair/Makefile @@ -23,8 +23,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY = libnvpair.a LOCOBJS = nvpair_alloc_system.o @@ -37,4 +35,7 @@ CMNDIR = $(TOPDIR)/common/nvpair SRCS = $(LOCOBJS:%.o=$(SRCDIR)/%.c) $(CMNOBJS:%.o=$(CMNDIR)/%.c) LDLIBS += -lxdr +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + include ../Makefile.targ diff --git a/usr/src/stand/lib/sa/Makefile b/usr/src/stand/lib/sa/Makefile index f419a548ac..9bc49adbf3 100644 --- a/usr/src/stand/lib/sa/Makefile +++ b/usr/src/stand/lib/sa/Makefile @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY = libsa.a LOCOBJS = assert.o ctype.o errno.o libintl.o malloc.o memlist.o \ @@ -58,6 +56,9 @@ SRCS = $(LOCOBJS:%.o=$(SRCDIR)/%.c) $(CMNOBJS:%.o=$(CMNDIR)/%.c) \ LDLIBS += -lsock CPPFLAGS += $(SOCKCPPFLAGS) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + objs/%.o: $(MACH)/%.s $(COMPILE.s) -o $@ $< $(POST_PROCESS_O) diff --git a/usr/src/stand/lib/sock/Makefile b/usr/src/stand/lib/sock/Makefile index 3e1c4f0454..2c247e8e68 100644 --- a/usr/src/stand/lib/sock/Makefile +++ b/usr/src/stand/lib/sock/Makefile @@ -23,8 +23,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY = libsock.a OBJECTS = socket.o sock_test.o @@ -33,5 +31,5 @@ include ../Makefile.com LDLIBS += -linet -ltcp CPPFLAGS += -I../inet -I../tcp $(SOCKCPPFLAGS) - +CERRWARN += -_gcc=-Wno-type-limits include ../Makefile.targ diff --git a/usr/src/stand/lib/ssl/Makefile b/usr/src/stand/lib/ssl/Makefile index 656bc37db1..f7be48f783 100644 --- a/usr/src/stand/lib/ssl/Makefile +++ b/usr/src/stand/lib/ssl/Makefile @@ -51,6 +51,8 @@ SRCS = $(LOCOBJS:%.o=$(SRCDIR)/%.c) \ CPPFLAGS += $(OPENSSL_BUILD_CPPFLAGS) $(SOCKCPPFLAGS) $(LINTLIB) := SRCS = $(CMNDIR)/$(LINTSRC) +CERRWARN += -_gcc=-Wno-unused-value + objs/%.o: $(TOPDIR)/common/openssl/crypto/comp/%.c $(COMPILE.c) -o $@ $< $(POST_PROCESS_O) diff --git a/usr/src/stand/lib/tcp/Makefile b/usr/src/stand/lib/tcp/Makefile index 2de436749f..6ea216557f 100644 --- a/usr/src/stand/lib/tcp/Makefile +++ b/usr/src/stand/lib/tcp/Makefile @@ -23,8 +23,6 @@ # Copyright 2003 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# LIBRARY = libtcp.a OBJECTS = tcp.o tcp_sack.o @@ -35,4 +33,7 @@ CMNDIR = $(CMNNETDIR)/dhcp LDLIBS += -linet CPPFLAGS += -I../inet $(SOCKCPPFLAGS) +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + include ../Makefile.targ diff --git a/usr/src/stand/lib/wanboot/Makefile b/usr/src/stand/lib/wanboot/Makefile index 0b6caf4d96..0d060d2921 100644 --- a/usr/src/stand/lib/wanboot/Makefile +++ b/usr/src/stand/lib/wanboot/Makefile @@ -42,5 +42,10 @@ CPPFLAGS += -I$(CMNNETDIR)/dhcp -I$(TOPDIR)/common/net/wanboot/crypt \ # CPPFLAGS += -I.. +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-value include ../Makefile.targ diff --git a/usr/src/tools/Makefile b/usr/src/tools/Makefile index 670c2de281..fe263c4d79 100644 --- a/usr/src/tools/Makefile +++ b/usr/src/tools/Makefile @@ -90,11 +90,6 @@ ROOTDIRS= \ $(ROOTONBLD)/lib \ $(ROOTONBLD)/lib/$(MACH) \ $(ROOTONBLD)/lib/perl \ - $(ROOTONBLD)/lib/python2.4 \ - $(ROOTONBLD)/lib/python2.4/onbld \ - $(ROOTONBLD)/lib/python2.4/onbld/Checks \ - $(ROOTONBLD)/lib/python2.4/onbld/hgext \ - $(ROOTONBLD)/lib/python2.4/onbld/Scm \ $(ROOTONBLD)/lib/python2.6 \ $(ROOTONBLD)/lib/python2.6/onbld \ $(ROOTONBLD)/lib/python2.6/onbld/Checks \ @@ -146,6 +141,6 @@ $(ROOTDIRS): $(INS.dir) $(ROOTONBLDLIBPY): $(ROOTDIRS) - $(RM) -r $@; $(SYMLINK) python2.4 $@ + $(RM) -r $@; $(SYMLINK) python2.6 $@ FRC: diff --git a/usr/src/tools/Makefile.python b/usr/src/tools/Makefile.python index a68ff026f6..dcf7c06360 100644 --- a/usr/src/tools/Makefile.python +++ b/usr/src/tools/Makefile.python @@ -63,43 +63,34 @@ PYFILES = $(PYSRCS) $(PYOBJS) -ROOTPYDIR_24 = $(PYTOPDIR)/python2.4/$(PYMODDIR) -ROOTPYFILES_24 = $(PYFILES:%=$(ROOTPYDIR_24)/%) - ROOTPYDIR_26 = $(PYTOPDIR)/python2.6/$(PYMODDIR) ROOTPYFILES_26 = $(PYFILES:%=$(ROOTPYDIR_26)/%) -ROOTPYFILES = $(ROOTPYFILES_24) $(ROOTPYFILES_26) +ROOTPYFILES = $(ROOTPYFILES_26) $(ROOTPYFILES) := FILEMODE = 0444 -PYVERSDIRS = python2.4 python2.6 - -PY24OBJS = $(PYOBJS:%=python2.4/%) -$(PY24OBJS) := PYTHON = $(PYTHON_24) +PYVERSDIRS = python2.6 PY26OBJS = $(PYOBJS:%=python2.6/%) $(PY26OBJS) := PYTHON = $(PYTHON_26) -PYVERSOBJS = $(PY24OBJS) $(PY26OBJS) +PYVERSOBJS = $(PY26OBJS) CLOBBERFILES += $(PYVERSOBJS) CLOBBERDIRS += $(PYVERSDIRS) .KEEP_STATE: -python2.4/%.pyc python2.6/%.pyc: %.py +python2.6/%.pyc: %.py @[ -d $(@D) ] || mkdir $(@D) $(RM) $@ $(PYTHON) -mpy_compile $< $(MV) $(*).pyc $@ -$(ROOTPYDIR_24)/%.pyc: python2.4/%.pyc - $(INS.pyfile) - $(ROOTPYDIR_26)/%.pyc: python2.6/%.pyc $(INS.pyfile) -$(ROOTPYDIR_24)/%.py $(ROOTPYDIR_26)/%.py: %.py +$(ROOTPYDIR_26)/%.py: %.py $(INS.pyfile) pyclobber: diff --git a/usr/src/tools/Makefile.tools b/usr/src/tools/Makefile.tools index c2bfdefd74..974543107d 100644 --- a/usr/src/tools/Makefile.tools +++ b/usr/src/tools/Makefile.tools @@ -38,7 +38,6 @@ ROOTONBLDLIB= $(ROOTONBLD)/lib ROOTONBLDLIBMACH= $(ROOTONBLD)/lib/$(MACH) ROOTONBLDLIBPERL= $(ROOTONBLD)/lib/perl ROOTONBLDLIBPY= $(ROOTONBLD)/lib/python -ROOTONBLDLIBPY_24= $(ROOTONBLD)/lib/python2.4 ROOTONBLDLIBPY_26= $(ROOTONBLD)/lib/python2.6 ROOTONBLDENV= $(ROOTONBLD)/env ROOTONBLDGK= $(ROOTONBLD)/gk diff --git a/usr/src/tools/aw/Makefile b/usr/src/tools/aw/Makefile index 77ad41aff0..af2bf8f735 100644 --- a/usr/src/tools/aw/Makefile +++ b/usr/src/tools/aw/Makefile @@ -23,16 +23,13 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# -# tools/aw/Makefile -# PROG = aw include ../Makefile.tools CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized LINTFLAGS += -ux -Xa -errchk=locfmtchk,parentheses diff --git a/usr/src/tools/codereview/Makefile b/usr/src/tools/codereview/Makefile index fb826203d3..ba126eb340 100644 --- a/usr/src/tools/codereview/Makefile +++ b/usr/src/tools/codereview/Makefile @@ -22,7 +22,6 @@ # Copyright 1999 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" PROG= codereview @@ -33,6 +32,8 @@ TMPDIR= /tmp include ../Makefile.tools +CERRWARN += -_gcc=-Wno-parentheses + MAN1FILES= codereview.1 $(ROOTONBLDMAN1FILES) := FILEMODE= 644 diff --git a/usr/src/tools/cscope-fast/Makefile b/usr/src/tools/cscope-fast/Makefile index b37183c3cb..6a2270bbed 100644 --- a/usr/src/tools/cscope-fast/Makefile +++ b/usr/src/tools/cscope-fast/Makefile @@ -19,11 +19,11 @@ # # CDDL HEADER END # -# -# ident "%Z%%M% %I% %E% SMI" + # # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. +# PROG= cscope-fast @@ -45,6 +45,10 @@ PATLEN= 250 STMTMAX= 10000 YYLMAX= 10251 CFLAGS += -DPATLEN=$(PATLEN) -DSTMTMAX=$(STMTMAX) -DYYLMAX=$(YYLMAX) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused +CERRWARN += -_gcc=-Wno-uninitialized CFLAGS += $(CCVERBOSE) LDLIBS += -lcurses -ll diff --git a/usr/src/tools/ctf/Makefile.ctf b/usr/src/tools/ctf/Makefile.ctf index e8fee40a21..7c5b041746 100644 --- a/usr/src/tools/ctf/Makefile.ctf +++ b/usr/src/tools/ctf/Makefile.ctf @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# include ../../../Makefile.tools @@ -47,3 +45,4 @@ HDRDIRS= \ CPPFLAGS += $(HDRDIRS) CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses diff --git a/usr/src/tools/ctf/ctfstrip/Makefile b/usr/src/tools/ctf/ctfstrip/Makefile index d28a9e925e..dee8591408 100644 --- a/usr/src/tools/ctf/ctfstrip/Makefile +++ b/usr/src/tools/ctf/ctfstrip/Makefile @@ -13,10 +13,11 @@ PROG = ctfstrip SRCS = \ - ctfstrip.c + ctfstrip.c CFLAGS += $(CCVERBOSE) include $(SRC)/tools/Makefile.tools +CERRWARN += -_gcc=-Wno-unused-variable OBJS = $(SRCS:%.c=%.o) LINTFILES = $(SRCS:%.c=%.ln) diff --git a/usr/src/tools/ctf/ctfstrip/ctfstrip.c b/usr/src/tools/ctf/ctfstrip/ctfstrip.c index a14e8d5957..60180c6921 100644 --- a/usr/src/tools/ctf/ctfstrip/ctfstrip.c +++ b/usr/src/tools/ctf/ctfstrip/ctfstrip.c @@ -126,7 +126,8 @@ fix_file(const char *filename, mode_t mode) } cmd[4] = filename; - if ((rc = posix_spawn(&pid, MCS, NULL, &attr, (char *const *)cmd, environ)) != 0) { + if ((rc = posix_spawn(&pid, MCS, NULL, &attr, + (char *const *)cmd, environ)) != 0) { warnx("could not exec mcs: %s", strerror(rc)); return (B_FALSE); } diff --git a/usr/src/tools/ctf/cvt/Makefile.com b/usr/src/tools/ctf/cvt/Makefile.com index 43b507bb3e..5385b3769f 100644 --- a/usr/src/tools/ctf/cvt/Makefile.com +++ b/usr/src/tools/ctf/cvt/Makefile.com @@ -79,6 +79,10 @@ CPPFLAGS += -D_REENTRANT CFLAGS += $(CTF_FLAGS) LINTFLAGS += -mnux +CERRWARN += -_gcc=-Wno-unused +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch + C99MODE = $(C99_ENABLE) ctfconvert := LDFLAGS += $(DWARFLDFLAGS) diff --git a/usr/src/tools/ctf/dump/Makefile.com b/usr/src/tools/ctf/dump/Makefile.com index 3aa6caf47c..9877fa06a3 100644 --- a/usr/src/tools/ctf/dump/Makefile.com +++ b/usr/src/tools/ctf/dump/Makefile.com @@ -37,6 +37,8 @@ LDLIBS += -lelf -lz OBJS = $(SRCS:%.c=%.o) LINTFILES = $(SRCS:%.c=%.ln) +CERRWARN += -_gcc=-Wno-uninitialized + .NO_PARALLEL: .PARALLEL: $(OBJS) $(LINTFILES) diff --git a/usr/src/tools/ctf/dwarf/Makefile.com b/usr/src/tools/ctf/dwarf/Makefile.com index 4c25cdda1d..51e788ff04 100644 --- a/usr/src/tools/ctf/dwarf/Makefile.com +++ b/usr/src/tools/ctf/dwarf/Makefile.com @@ -74,6 +74,8 @@ FILEMODE = 0755 SRCDIR = ../common/ CPPFLAGS += -I$(SRCDIR) -DELF_TARGET_ALL=1 +CERRWARN += -_gcc=-Wno-unused +CERRWARN += -_gcc=-Wno-implicit-function-declaration LDLIBS = -lelf -lc diff --git a/usr/src/tools/ctf/stabs/Makefile.com b/usr/src/tools/ctf/stabs/Makefile.com index e3f8e9689a..6703c34f06 100644 --- a/usr/src/tools/ctf/stabs/Makefile.com +++ b/usr/src/tools/ctf/stabs/Makefile.com @@ -44,6 +44,8 @@ OBJS = $(SRCS:%.c=%.o) LINTFILES = $(SRCS:%.c=%.ln) LINTFLAGS = -mnux -L$(ROOT)/usr/lib +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused .NO_PARALLEL: .PARALLEL: $(OBJS) $(LINTFILES) diff --git a/usr/src/tools/cw/cw.c b/usr/src/tools/cw/cw.c index 7e27294770..ded39c12ff 100644 --- a/usr/src/tools/cw/cw.c +++ b/usr/src/tools/cw/cw.c @@ -526,17 +526,12 @@ warnings(struct aelist *h) if (warningsonce++) return; + /* + * Enable as many warnings as exist, then disable those that we never + * ever want. + */ newae(h, "-Wall"); - newae(h, "-Wno-unknown-pragmas"); - newae(h, "-Wno-missing-braces"); - newae(h, "-Wno-sign-compare"); - newae(h, "-Wno-parentheses"); - newae(h, "-Wno-uninitialized"); - newae(h, "-Wno-implicit-function-declaration"); - newae(h, "-Wno-unused"); - newae(h, "-Wno-trigraphs"); - newae(h, "-Wno-char-subscripts"); - newae(h, "-Wno-switch"); + newae(h, "-Wextra"); } static void @@ -655,6 +650,7 @@ do_gcc(cw_ictx_t *ctx) newae(ctx->i_ae, "-fno-inline-functions"); newae(ctx->i_ae, "-fno-builtin"); newae(ctx->i_ae, "-fno-asm"); + newae(ctx->i_ae, "-fdiagnostics-show-option"); newae(ctx->i_ae, "-nodefaultlibs"); #if defined(__sparc) diff --git a/usr/src/tools/elfextract/Makefile b/usr/src/tools/elfextract/Makefile index 7a3e6838d4..9f153231fb 100644 --- a/usr/src/tools/elfextract/Makefile +++ b/usr/src/tools/elfextract/Makefile @@ -23,7 +23,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" include ../Makefile.tools @@ -31,6 +30,8 @@ PROG = elfextract include ../Makefile.tools +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-implicit-function-declaration .KEEP_STATE: diff --git a/usr/src/tools/elfsign/Makefile b/usr/src/tools/elfsign/Makefile index 29e18c13d9..ece759e450 100644 --- a/usr/src/tools/elfsign/Makefile +++ b/usr/src/tools/elfsign/Makefile @@ -49,6 +49,8 @@ CPPFLAGS += -I$(SRC)/lib/libkmf/include CPPFLAGS += -I$(SRC)/lib/libcryptoutil/common LDFLAGS += -lmd -lelf -lkmf -lcryptoutil -lc +CERRWARN += -_gcc=-Wno-unused + .KEEP_STATE: all: $(PROG) $(SHFILES) diff --git a/usr/src/tools/findunref/Makefile b/usr/src/tools/findunref/Makefile index 752174a9f6..7023c2ab35 100644 --- a/usr/src/tools/findunref/Makefile +++ b/usr/src/tools/findunref/Makefile @@ -31,6 +31,9 @@ LINTFLAGS += -ux include ../Makefile.tools +CERRWARN += -_gcc=-Wno-unused +CERRWARN += -_gcc=-Wno-parentheses + $(ROOTONBLDMAN1FILES) := FILEMODE= 644 EXCEPTION_SRC= common open diff --git a/usr/src/tools/findunref/exception_list.open b/usr/src/tools/findunref/exception_list.open index 573843afe1..5b0c90ea1a 100644 --- a/usr/src/tools/findunref/exception_list.open +++ b/usr/src/tools/findunref/exception_list.open @@ -132,6 +132,7 @@ ./usr/src/lib/crypt_modules/sha256/test.c ./usr/src/lib/efcode/fcode_test ./usr/src/lib/libkvm/common/test.c +./usr/src/common/saveargs/tests/ # # Ignore debugging code. diff --git a/usr/src/tools/install.bin/Makefile b/usr/src/tools/install.bin/Makefile index a049e94ccd..216e79e63e 100644 --- a/usr/src/tools/install.bin/Makefile +++ b/usr/src/tools/install.bin/Makefile @@ -31,6 +31,7 @@ SRCS= $(PROG).c ../protocmp/stdusers.c include ../Makefile.tools CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-type-limits CPPFLAGS += -I../protocmp LDLIBS += -lgen CLEANFILES += $(OBJS) diff --git a/usr/src/tools/ndrgen/Makefile b/usr/src/tools/ndrgen/Makefile index 1a94e3128e..a60e584989 100644 --- a/usr/src/tools/ndrgen/Makefile +++ b/usr/src/tools/ndrgen/Makefile @@ -34,6 +34,8 @@ SRCS= $(OBJS:%.o=%.c) include ../Makefile.tools CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused CLEANFILES += $(OBJS) y.tab.c y.tab.h diff --git a/usr/src/tools/pmodes/Makefile b/usr/src/tools/pmodes/Makefile index 6552242279..7f669bb433 100644 --- a/usr/src/tools/pmodes/Makefile +++ b/usr/src/tools/pmodes/Makefile @@ -32,6 +32,8 @@ CLEANFILES += $(OBJS) include ../Makefile.tools CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/tools/protocmp/Makefile b/usr/src/tools/protocmp/Makefile index 32f804c009..ace2b982b3 100644 --- a/usr/src/tools/protocmp/Makefile +++ b/usr/src/tools/protocmp/Makefile @@ -33,6 +33,8 @@ CLEANFILES += $(CMP_OBJS) include ../Makefile.tools CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused .KEEP_STATE: diff --git a/usr/src/tools/protolist/Makefile b/usr/src/tools/protolist/Makefile index 7fd71a1762..5f93e59df8 100644 --- a/usr/src/tools/protolist/Makefile +++ b/usr/src/tools/protolist/Makefile @@ -30,6 +30,7 @@ include ../Makefile.tools CFLAGS += $(CCVERBOSE) CPPFLAGS += -I../protocmp +CERRWARN += -_gcc=-Wno-parentheses CLEANFILES += $(OBJS) .KEEP_STATE: diff --git a/usr/src/tools/scripts/cddlchk.py b/usr/src/tools/scripts/cddlchk.py index 62a2695946..816d2f33a7 100644 --- a/usr/src/tools/scripts/cddlchk.py +++ b/usr/src/tools/scripts/cddlchk.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2.4 +#!/usr/bin/python2.6 # # CDDL HEADER START # diff --git a/usr/src/tools/scripts/copyrightchk.py b/usr/src/tools/scripts/copyrightchk.py index 1426a69bfa..210ef1b46c 100644 --- a/usr/src/tools/scripts/copyrightchk.py +++ b/usr/src/tools/scripts/copyrightchk.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2.4 +#!/usr/bin/python2.6 # # CDDL HEADER START # diff --git a/usr/src/tools/scripts/git-pbchk.py b/usr/src/tools/scripts/git-pbchk.py index 74be6a4818..656e22f6b4 100644 --- a/usr/src/tools/scripts/git-pbchk.py +++ b/usr/src/tools/scripts/git-pbchk.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2.4 +#!/usr/bin/python2.6 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 @@ -140,13 +140,13 @@ def git_parent_branch(branch): def git_comments(parent): """Return a list of any checkin comments on this git branch""" - p = git('log --pretty=format:%%B %s..' % parent) + p = git('log --pretty=tformat:%%B:SEP: %s..' % parent) if not p: sys.stderr.write("Failed getting git comments\n") sys.exit(err) - return map(lambda x: x.strip(), p.readlines()) + return [x.strip() for x in p.readlines() if x != ':SEP:\n'] def git_file_list(parent, paths=None): diff --git a/usr/src/tools/scripts/hdrchk.py b/usr/src/tools/scripts/hdrchk.py index 3ecec6b3f2..84acbc8616 100644 --- a/usr/src/tools/scripts/hdrchk.py +++ b/usr/src/tools/scripts/hdrchk.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2.4 +#!/usr/bin/python2.6 # # CDDL HEADER START # diff --git a/usr/src/tools/scripts/hg-active.py b/usr/src/tools/scripts/hg-active.py index 7e49a18db5..88394e98e5 100644 --- a/usr/src/tools/scripts/hg-active.py +++ b/usr/src/tools/scripts/hg-active.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2.4 +#!/usr/bin/python2.6 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 diff --git a/usr/src/tools/scripts/mapfilechk.py b/usr/src/tools/scripts/mapfilechk.py index 83d3d9d70c..9cf2000c7a 100644 --- a/usr/src/tools/scripts/mapfilechk.py +++ b/usr/src/tools/scripts/mapfilechk.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2.4 +#!/usr/bin/python2.6 # # CDDL HEADER START # diff --git a/usr/src/tools/scripts/nightly.sh b/usr/src/tools/scripts/nightly.sh index 9ecb8f471b..ef3ca0015b 100644 --- a/usr/src/tools/scripts/nightly.sh +++ b/usr/src/tools/scripts/nightly.sh @@ -2582,7 +2582,7 @@ echo | tee -a $build_environ_file >> $LOGFILE whence ld | tee -a $build_environ_file >> $LOGFILE LDVER=`ld -V 2>&1` echo $LDVER | tee -a $build_environ_file >> $LOGFILE -LDVER=`echo $LDVER | sed -e "s/.*-1\.//" -e "s/:.*//"` +LDVER=`echo $LDVER | sed -e "s/.*-1\.\([0-9]*\).*/\1/"` if [ `expr $LDVER \< 422` -eq 1 ]; then echo "The link-editor needs to be at version 422 or higher to build" | \ tee -a $build_environ_file >> $LOGFILE diff --git a/usr/src/tools/scripts/webrev.sh b/usr/src/tools/scripts/webrev.sh index 3b962ad917..afcab07abc 100644 --- a/usr/src/tools/scripts/webrev.sh +++ b/usr/src/tools/scripts/webrev.sh @@ -1806,11 +1806,11 @@ function git_wxfile chomp; if (/^R(\d+)\s+([^ ]+)\s+([^ ]+)/) { # rename if ($1 >= 75) { # Probably worth treating as a rename - $realfiles{$3} = $2 + $realfiles{$3} = $2; } else { $realfiles{$3} = $3; $realfiles{$2} = $2; - } + } } else { my $f = (split /\s+/, $_)[1]; $realfiles{$f} = $f; @@ -1826,7 +1826,8 @@ function git_wxfile my $fname = (split /\t/, $_)[1]; next if !defined($realfiles{$fname}); # No real change $state = 1; - $files{$fname} = $msg; + chomp $msg; + $files{$fname} .= $msg; } else { if ($state == 1) { $state = 0; @@ -1839,9 +1840,9 @@ function git_wxfile for (sort keys %files) { if ($realfiles{$_} ne $_) { - print "$_ $realfiles{$_}\n$files{$_}\n"; + print "$_ $realfiles{$_}\n$files{$_}\n\n"; } else { - print "$_\n$files{$_}\n" + print "$_\n$files{$_}\n\n" } }' ${parent} > $TMPFLIST diff --git a/usr/src/ucbcmd/chown/Makefile b/usr/src/ucbcmd/chown/Makefile index cc85a9941a..7c1ba6f850 100644 --- a/usr/src/ucbcmd/chown/Makefile +++ b/usr/src/ucbcmd/chown/Makefile @@ -23,8 +23,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= chown @@ -33,6 +31,8 @@ include ../Makefile.ucbcmd FILEMODE= 755 CPPFLAGS += -D_FILE_OFFSET_BITS=64 +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses LDFLAGS += $(MAPFILE.NGB:%=-M%) .KEEP_STATE: diff --git a/usr/src/ucbcmd/expr/Makefile b/usr/src/ucbcmd/expr/Makefile index 6f1610dbda..83bc7561ed 100644 --- a/usr/src/ucbcmd/expr/Makefile +++ b/usr/src/ucbcmd/expr/Makefile @@ -21,14 +21,16 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= expr include ../Makefile.ucbcmd FILEMODE= 755 +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-extra +CERRWARN += -_gcc=-Wno-char-subscripts LDFLAGS += $(MAPFILE.NGB:%=-M%) diff --git a/usr/src/ucbcmd/from/Makefile b/usr/src/ucbcmd/from/Makefile index 1aff6fc3bf..4471e6379b 100644 --- a/usr/src/ucbcmd/from/Makefile +++ b/usr/src/ucbcmd/from/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" -# # Copyright (c) 1990 by Sun Microsystems, Inc. # @@ -31,6 +29,8 @@ include ../Makefile.ucbcmd FILEMODE= 755 +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/ucbcmd/groups/Makefile b/usr/src/ucbcmd/groups/Makefile index fddf23ae6f..c0759fe2dd 100644 --- a/usr/src/ucbcmd/groups/Makefile +++ b/usr/src/ucbcmd/groups/Makefile @@ -19,8 +19,7 @@ # # CDDL HEADER END # -# -#ident "%Z%%M% %I% %E% SMI" + # # Copyright (c) 1989 by Sun Microsystems, Inc. # @@ -31,6 +30,8 @@ include ../Makefile.ucbcmd FILEMODE= 755 +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/ucbcmd/install.d/Makefile b/usr/src/ucbcmd/install.d/Makefile index b674fc0a22..fef3ba8707 100644 --- a/usr/src/ucbcmd/install.d/Makefile +++ b/usr/src/ucbcmd/install.d/Makefile @@ -19,8 +19,7 @@ # # CDDL HEADER END # -# -#ident "%Z%%M% %I% %E% SMI" + # # Copyright (c) 1989,1996 by Sun Microsystems, Inc. # All rights reserved. @@ -37,6 +36,7 @@ include ../Makefile.ucbcmd CPPFLAGS += -D_FILE_OFFSET_BITS=64 FILEMODE= 755 +CERRWARN += -_gcc=-Wno-implicit-function-declaration # for messaging catalog # diff --git a/usr/src/ucbcmd/ln/Makefile b/usr/src/ucbcmd/ln/Makefile index f1c082b821..3eed7f4896 100644 --- a/usr/src/ucbcmd/ln/Makefile +++ b/usr/src/ucbcmd/ln/Makefile @@ -19,8 +19,7 @@ # # CDDL HEADER END # -# -#ident "%Z%%M% %I% %E% SMI" + # # Copyright (c) 1989 by Sun Microsystems, Inc. # @@ -31,6 +30,9 @@ include ../Makefile.ucbcmd FILEMODE= 755 +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-label + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/ucbcmd/ls/Makefile b/usr/src/ucbcmd/ls/Makefile index 323e1e38a0..d14cba8845 100644 --- a/usr/src/ucbcmd/ls/Makefile +++ b/usr/src/ucbcmd/ls/Makefile @@ -19,13 +19,12 @@ # # CDDL HEADER END # -# -#ident "%Z%%M% %I% %E% SMI" + # # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ucbcmd/ls/Makefile + PROG= ls @@ -33,6 +32,7 @@ include ../Makefile.ucbcmd CFLAGS += $(CCVERBOSE) CPPFLAGS += -D_FILE_OFFSET_BITS=64 +CERRWARN += -_gcc=-Wno-parentheses FILEMODE= 755 diff --git a/usr/src/ucbcmd/mkstr/Makefile b/usr/src/ucbcmd/mkstr/Makefile index 3e0d2accc9..212f945731 100644 --- a/usr/src/ucbcmd/mkstr/Makefile +++ b/usr/src/ucbcmd/mkstr/Makefile @@ -19,8 +19,7 @@ # # CDDL HEADER END # -# -#ident "%Z%%M% %I% %E% SMI" + # # Copyright (c) 1989 by Sun Microsystems, Inc. # @@ -32,6 +31,8 @@ include ../Makefile.ucbcmd # For messaging XGETFLAGS += -a -x mkstr.xcl +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(PROG) diff --git a/usr/src/ucbcmd/rusage/Makefile b/usr/src/ucbcmd/rusage/Makefile index 7981a4a614..94907e4de0 100644 --- a/usr/src/ucbcmd/rusage/Makefile +++ b/usr/src/ucbcmd/rusage/Makefile @@ -34,6 +34,7 @@ FILEMODE= 755 LDLIBS += -L$(ROOT)/usr/ucblib -R /usr/ucblib -lucb CPPFLAGS = -I$(INC1) $(CPPFLAGS.master) +CERRWARN += -_gcc=-Wno-implicit-function-declaration .KEEP_STATE: diff --git a/usr/src/ucbcmd/sbcp/Makefile b/usr/src/ucbcmd/sbcp/Makefile index 69b4e748a2..8417665637 100644 --- a/usr/src/ucbcmd/sbcp/Makefile +++ b/usr/src/ucbcmd/sbcp/Makefile @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= sbcp @@ -49,6 +47,8 @@ LDFLAGS= -R /usr/4lib:/usr/ucblib -e _start -G -t \ -I/usr/lib/ld.so.1 LIBS= $(LDLIBS.lib) -lmapmalloc $(LIBBC) $(LIBUCB) -lnsl -lc +CERRWARN += -_gcc=-Wno-unused-variable + all: $(PROG) install: all $(ROOT4LIBPROG) diff --git a/usr/src/ucbcmd/sed/Makefile b/usr/src/ucbcmd/sed/Makefile index 21f2d1008b..1a801f689c 100644 --- a/usr/src/ucbcmd/sed/Makefile +++ b/usr/src/ucbcmd/sed/Makefile @@ -24,10 +24,6 @@ # All rights reserved. # -# -#ident "%Z%%M% %I% %E% SMI" -# - PROG= sed OBJS= sed0.o sed1.o @@ -36,6 +32,9 @@ SRCS= $(OBJS:%.o=%.c) include ../Makefile.ucbcmd CPPFLAGS += -D_FILE_OFFSET_BITS=64 +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses .KEEP_STATE: diff --git a/usr/src/ucbcmd/shutdown/Makefile b/usr/src/ucbcmd/shutdown/Makefile index e1fed0c17b..b170ea6df8 100644 --- a/usr/src/ucbcmd/shutdown/Makefile +++ b/usr/src/ucbcmd/shutdown/Makefile @@ -37,6 +37,9 @@ FILEMODE= 755 LDLIBS += -lsocket -lrpcsvc -lnsl -L$(ROOT)/usr/ucblib -R /usr/ucblib -lucb -lbsm CPPFLAGS = -I$(INC1) $(CPPFLAGS.master) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-clobbered XGETFLAGS += -a -x shutdown.xcl diff --git a/usr/src/ucbcmd/stty/Makefile b/usr/src/ucbcmd/stty/Makefile index 54925f1087..2e4da9e793 100644 --- a/usr/src/ucbcmd/stty/Makefile +++ b/usr/src/ucbcmd/stty/Makefile @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# PROG= stty @@ -33,6 +31,8 @@ OBJS= $(PROGSRC:%.c=%.o) include ../Makefile.ucbcmd FILEMODE= 755 +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses .KEEP_STATE: diff --git a/usr/src/ucbcmd/test/Makefile b/usr/src/ucbcmd/test/Makefile index 89cf95fe31..1d07eb4854 100644 --- a/usr/src/ucbcmd/test/Makefile +++ b/usr/src/ucbcmd/test/Makefile @@ -19,8 +19,7 @@ # # CDDL HEADER END # -# -#ident "%Z%%M% %I% %E% SMI" + # # Copyright (c) 1989,1996, by Sun Microsystems, Inc. # All rights reserved. @@ -33,6 +32,7 @@ include ../Makefile.ucbcmd FILEMODE= 755 CPPFLAGS += -D_FILE_OFFSET_BITS=64 +CERRWARN += -_gcc=-Wno-parentheses .KEEP_STATE: diff --git a/usr/src/ucbcmd/touch/Makefile b/usr/src/ucbcmd/touch/Makefile index 8207a9be32..798988d2e4 100644 --- a/usr/src/ucbcmd/touch/Makefile +++ b/usr/src/ucbcmd/touch/Makefile @@ -24,16 +24,14 @@ # All rights reserved. # -# -#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 -# - PROG= touch include ../Makefile.ucbcmd FILEMODE= 755 CPPFLAGS += -D_FILE_OFFSET_BITS=64 +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-implicit-function-declaration .KEEP_STATE: diff --git a/usr/src/ucbcmd/tr/Makefile b/usr/src/ucbcmd/tr/Makefile index 11cb0eacbf..b7465117bb 100644 --- a/usr/src/ucbcmd/tr/Makefile +++ b/usr/src/ucbcmd/tr/Makefile @@ -19,8 +19,7 @@ # # CDDL HEADER END # -# -#ident "%Z%%M% %I% %E% SMI" + # # Copyright (c) 1989 by Sun Microsystems, Inc. # @@ -30,6 +29,8 @@ PROG= tr include ../Makefile.ucbcmd FILEMODE= 755 +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses .KEEP_STATE: diff --git a/usr/src/ucbcmd/tset/Makefile b/usr/src/ucbcmd/tset/Makefile index 8309b5730a..7130f11f5f 100644 --- a/usr/src/ucbcmd/tset/Makefile +++ b/usr/src/ucbcmd/tset/Makefile @@ -32,6 +32,10 @@ FILEMODE= 755 LDLIBS = -L$(ROOT)/usr/ucblib -R /usr/ucblib $(LDLIBS.cmd) -lucb -ltermcap CPPFLAGS = -I$(SRC)/ucbhead $(CPPFLAGS.master) +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized ROOTSYMLINK= $(ROOTBIN)/reset diff --git a/usr/src/ucbcmd/vipw/Makefile b/usr/src/ucbcmd/vipw/Makefile index a006d2f0b2..53fb35631e 100644 --- a/usr/src/ucbcmd/vipw/Makefile +++ b/usr/src/ucbcmd/vipw/Makefile @@ -30,8 +30,10 @@ include ../Makefile.ucbcmd INC1 = $(SRC)/ucbhead LDLIBS = -L$(ROOT)/usr/ucblib -R /usr/ucblib $(LDLIBS.cmd) -lucb - + CPPFLAGS = -I$(INC1) $(CPPFLAGS.master) +CERRWARN += -_gcc=-Wno-implicit-function-declaration +CERRWARN += -_gcc=-Wno-unused-variable .KEEP_STATE: diff --git a/usr/src/ucbcmd/whereis/Makefile b/usr/src/ucbcmd/whereis/Makefile index c34916c983..decddebb18 100644 --- a/usr/src/ucbcmd/whereis/Makefile +++ b/usr/src/ucbcmd/whereis/Makefile @@ -19,8 +19,7 @@ # # CDDL HEADER END # -# -#ident "%Z%%M% %I% %E% SMI" + # # Copyright (c) 1989 by Sun Microsystems, Inc. # @@ -30,6 +29,7 @@ PROG= whereis include ../Makefile.ucbcmd FILEMODE= 755 +CERRWARN += -_gcc=-Wno-implicit-function-declaration .KEEP_STATE: diff --git a/usr/src/ucblib/libcurses/Makefile.com b/usr/src/ucblib/libcurses/Makefile.com index 0db5f7836c..4c1d763415 100644 --- a/usr/src/ucblib/libcurses/Makefile.com +++ b/usr/src/ucblib/libcurses/Makefile.com @@ -85,6 +85,10 @@ LDLIBS += -ltermcap -lucb -lc CPPFLAGS = -I$(SRC)/ucbhead -I../../../lib/libc/inc $(CPPFLAGS.master) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/ucblib/libdbm/Makefile.com b/usr/src/ucblib/libdbm/Makefile.com index 668444cfc8..e3d5c9e10a 100644 --- a/usr/src/ucblib/libdbm/Makefile.com +++ b/usr/src/ucblib/libdbm/Makefile.com @@ -41,6 +41,8 @@ LDLIBS += -lc CPPFLAGS = -I$(SRC)/ucbhead $(CPPFLAGS.master) +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: all: $(LIBS) diff --git a/usr/src/ucblib/librpcsoc/Makefile.com b/usr/src/ucblib/librpcsoc/Makefile.com index 9931ff87ab..5807512ec3 100644 --- a/usr/src/ucblib/librpcsoc/Makefile.com +++ b/usr/src/ucblib/librpcsoc/Makefile.com @@ -49,6 +49,8 @@ ROOTLIBDIR64= $(ROOT)/usr/ucblib/$(MACH64) CPPFLAGS = -I$(SRC)/ucbhead -I../../../lib/libc/inc $(CPPFLAGS.master) +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: lint: lintcheck diff --git a/usr/src/ucblib/libucb/Makefile.com b/usr/src/ucblib/libucb/Makefile.com index b1a0dd1d60..70b5ff2703 100644 --- a/usr/src/ucblib/libucb/Makefile.com +++ b/usr/src/ucblib/libucb/Makefile.com @@ -93,6 +93,11 @@ LDLIBS += -lelf -lc CPPFLAGS = -D$(MACH) -I$(SRC)/ucbhead -I../inc \ -I../../../lib/libc/inc $(CPPFLAGS.master) +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-uninitialized + ASFLAGS= -P -D__STDC__ -DLOCORE -D_SYS_SYS_S -D_ASM $(CPPFLAGS) pics/%.o:= ASFLAGS += $(AS_PICFLAGS) diff --git a/usr/src/uts/Makefile.uts b/usr/src/uts/Makefile.uts index bbcdd0fe15..6928510468 100644 --- a/usr/src/uts/Makefile.uts +++ b/usr/src/uts/Makefile.uts @@ -214,6 +214,17 @@ AS_CPPFLAGS = $(ALWAYS_DEFS) $(ALL_DEFS) $(CONFIG_DEFS) $(AS_DEFS) \ CERRWARN = -errtags=yes -errwarn=%all $(__GNUC4)CERRWARN += -_gcc=-Wno-address +CERRWARN += -_gcc=-Wno-missing-braces +CERRWARN += -_gcc=-Wno-sign-compare +CERRWARN += -_gcc=-Wno-unknown-pragmas +CERRWARN += -_gcc=-Wno-unused-parameter +CERRWARN += -_gcc=-Wno-missing-field-initializers + +# DEBUG v. -nd make for frequent unused variables, empty conditions, etc. in +# -nd builds +$(RELEASE_BUILD)CERRWARN += -_gcc=-Wno-unused +$(RELEASE_BUILD)CERRWARN += -_gcc=-Wno-empty-body + C99MODE = $(C99_ENABLE) CFLAGS_uts = @@ -221,7 +232,7 @@ CFLAGS_uts += $(STAND_FLAGS_$(CLASS)) CFLAGS_uts += $(CCVERBOSE) CFLAGS_uts += $(ILDOFF) CFLAGS_uts += $(XAOPT) -CFLAGS_uts += $(CTF_FLAGS) +CFLAGS_uts += $(CTF_FLAGS_$(CLASS)) CFLAGS_uts += $(CERRWARN) CFLAGS_uts += $(CCNOAUTOINLINE) CFLAGS_uts += $(CGLOBALSTATIC) diff --git a/usr/src/uts/common/Makefile.files b/usr/src/uts/common/Makefile.files index d91379be96..fa9a3a4bf4 100644 --- a/usr/src/uts/common/Makefile.files +++ b/usr/src/uts/common/Makefile.files @@ -21,8 +21,8 @@ # # Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved. -# Copyright 2011 Nexenta Systems, Inc. All rights reserved. # Copyright (c) 2012 Joyent, Inc. All rights reserved. +# Copyright (c) 2012 Nexenta Systems, Inc. All rights reserved. # Copyright (c) 2012 by Delphix. All rights reserved. # @@ -1953,6 +1953,16 @@ NXGE_HCALL_OBJS = \ nxge_hcall.o # +# Virtio modules +# + +# Virtio core +VIRTIO_OBJS = virtio.o + +# Virtio block driver +VIOBLK_OBJS = vioblk.o + +# # kiconv modules # KICONV_EMEA_OBJS += kiconv_emea.o diff --git a/usr/src/uts/common/Makefile.rules b/usr/src/uts/common/Makefile.rules index b420a7d8e1..27478a210d 100644 --- a/usr/src/uts/common/Makefile.rules +++ b/usr/src/uts/common/Makefile.rules @@ -24,8 +24,8 @@ # # -# Copyright 2011 Nexenta Systems, Inc. All rights reserved. # Copyright (c) 2012 Joyent, Inc. All rights reserved. +# Copyright (c) 2012 Nexenta Systems, Inc. All rights reserved. # # @@ -1420,6 +1420,14 @@ $(OBJS_DIR)/%.o: $(UTSBASE)/common/io/yge/%.c $(COMPILE.c) -o $@ $< $(CTFCONVERT_O) +$(OBJS_DIR)/%.o: $(UTSBASE)/common/io/virtio/%.c + $(COMPILE.c) -o $@ $< + $(CTFCONVERT_O) + +$(OBJS_DIR)/%.o: $(UTSBASE)/common/io/vioblk/%.c + $(COMPILE.c) -o $@ $< + $(CTFCONVERT_O) + # # krtld must refer to its own bzero/bcopy until the kernel is fully linked # @@ -2671,6 +2679,12 @@ $(LINTS_DIR)/%.ln: $(COMMONBASE)/iscsi/%.c $(LINTS_DIR)/%.ln: $(UTSBASE)/common/inet/kifconf/%.c @($(LHEAD) $(LINT.c) $< $(LTAIL)) +$(LINTS_DIR)/%.ln: $(UTSBASE)/common/io/virtio/%.c + @($(LHEAD) $(LINT.c) $< $(LTAIL)) + +$(LINTS_DIR)/%.ln: $(UTSBASE)/common/io/vioblk/%.c + @($(LHEAD) $(LINT.c) $< $(LTAIL)) + ZMODLINTFLAGS = -erroff=E_CONSTANT_CONDITION $(LINTS_DIR)/%.ln: $(UTSBASE)/common/zmod/%.c diff --git a/usr/src/uts/common/cpr/cpr_main.c b/usr/src/uts/common/cpr/cpr_main.c index 68a4040186..15e8c6c8d8 100644 --- a/usr/src/uts/common/cpr/cpr_main.c +++ b/usr/src/uts/common/cpr/cpr_main.c @@ -166,7 +166,7 @@ cpr_main(int sleeptype) */ rc = i_cpr_power_down(sleeptype); if (rc == 0) { - PMD(PMD_SX, ("back from succssful suspend\n")) + PMD(PMD_SX, ("back from successful suspend\n")) } /* * We do care about the return value from cpr_resume diff --git a/usr/src/uts/common/exec/elf/elf_notes.c b/usr/src/uts/common/exec/elf/elf_notes.c index 8649e64d48..719d215dd5 100644 --- a/usr/src/uts/common/exec/elf/elf_notes.c +++ b/usr/src/uts/common/exec/elf/elf_notes.c @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright 2012 DEY Storage Systems, Inc. All rights reserved. + */ #include <sys/types.h> #include <sys/param.h> @@ -34,8 +36,11 @@ #include <sys/cred.h> #include <sys/priv.h> #include <sys/user.h> +#include <sys/file.h> #include <sys/errno.h> #include <sys/vnode.h> +#include <sys/mode.h> +#include <sys/vfs.h> #include <sys/mman.h> #include <sys/kmem.h> #include <sys/proc.h> @@ -57,6 +62,7 @@ #include <sys/modctl.h> #include <sys/systeminfo.h> #include <sys/machelf.h> +#include <sys/sunddi.h> #include "elf_impl.h" #if defined(__i386) || defined(__i386_COMPAT) #include <sys/sysi86.h> @@ -67,12 +73,27 @@ setup_note_header(Phdr *v, proc_t *p) { int nlwp = p->p_lwpcnt; int nzomb = p->p_zombcnt; + int nfd; size_t size; prcred_t *pcrp; + uf_info_t *fip; + uf_entry_t *ufp; + int fd; + + fip = P_FINFO(p); + nfd = 0; + mutex_enter(&fip->fi_lock); + for (fd = 0; fd < fip->fi_nfiles; fd++) { + UF_ENTER(ufp, fip, fd); + if ((ufp->uf_file != NULL) && (ufp->uf_file->f_count > 0)) + nfd++; + UF_EXIT(ufp); + } + mutex_exit(&fip->fi_lock); v[0].p_type = PT_NOTE; v[0].p_flags = PF_R; - v[0].p_filesz = (sizeof (Note) * (9 + 2 * nlwp + nzomb)) + v[0].p_filesz = (sizeof (Note) * (9 + 2 * nlwp + nzomb + nfd)) + roundup(sizeof (psinfo_t), sizeof (Word)) + roundup(sizeof (pstatus_t), sizeof (Word)) + roundup(prgetprivsize(), sizeof (Word)) @@ -83,7 +104,8 @@ setup_note_header(Phdr *v, proc_t *p) + roundup(sizeof (utsname), sizeof (Word)) + roundup(sizeof (core_content_t), sizeof (Word)) + (nlwp + nzomb) * roundup(sizeof (lwpsinfo_t), sizeof (Word)) - + nlwp * roundup(sizeof (lwpstatus_t), sizeof (Word)); + + nlwp * roundup(sizeof (lwpstatus_t), sizeof (Word)) + + nfd * roundup(sizeof (prfdinfo_t), sizeof (Word)); size = sizeof (prcred_t) + sizeof (gid_t) * (ngroups_max - 1); pcrp = kmem_alloc(size, KM_SLEEP); @@ -97,6 +119,7 @@ setup_note_header(Phdr *v, proc_t *p) } kmem_free(pcrp, size); + #if defined(__i386) || defined(__i386_COMPAT) mutex_enter(&p->p_ldtlock); size = prnldt(p) * sizeof (struct ssd); @@ -159,7 +182,7 @@ write_elfnotes(proc_t *p, int sig, vnode_t *vp, offset_t offset, size_t crsize = sizeof (prcred_t) + sizeof (gid_t) * (ngroups_max - 1); size_t psize = prgetprivsize(); size_t bigsize = MAX(psize, MAX(sizeof (*bigwad), - MAX(xregsize, crsize))); + MAX(xregsize, crsize))); priv_impl_info_t *prii; @@ -173,6 +196,10 @@ write_elfnotes(proc_t *p, int sig, vnode_t *vp, offset_t offset, int nzomb; int error; uchar_t oldsig; + uf_info_t *fip; + int fd; + vnode_t *vroot; + #if defined(__i386) || defined(__i386_COMPAT) struct ssd *ssd; size_t ssdsize; @@ -293,6 +320,89 @@ write_elfnotes(proc_t *p, int sig, vnode_t *vp, offset_t offset, if (error) goto done; + + /* open file table */ + vroot = PTOU(p)->u_rdir; + if (vroot == NULL) + vroot = rootdir; + + VN_HOLD(vroot); + + fip = P_FINFO(p); + + for (fd = 0; fd < fip->fi_nfiles; fd++) { + uf_entry_t *ufp; + vnode_t *fvp; + struct file *fp; + vattr_t vattr; + prfdinfo_t fdinfo; + + bzero(&fdinfo, sizeof (fdinfo)); + + mutex_enter(&fip->fi_lock); + UF_ENTER(ufp, fip, fd); + if (((fp = ufp->uf_file) == NULL) || (fp->f_count < 1)) { + UF_EXIT(ufp); + mutex_exit(&fip->fi_lock); + continue; + } + + fdinfo.pr_fd = fd; + fdinfo.pr_fdflags = ufp->uf_flag; + fdinfo.pr_fileflags = fp->f_flag2; + fdinfo.pr_fileflags <<= 16; + fdinfo.pr_fileflags |= fp->f_flag; + if ((fdinfo.pr_fileflags & (FSEARCH | FEXEC)) == 0) + fdinfo.pr_fileflags += FOPEN; + fdinfo.pr_offset = fp->f_offset; + + + fvp = fp->f_vnode; + VN_HOLD(fvp); + UF_EXIT(ufp); + mutex_exit(&fip->fi_lock); + + /* + * There are some vnodes that have no corresponding + * path. Its reasonable for this to fail, in which + * case the path will remain an empty string. + */ + (void) vnodetopath(vroot, fvp, fdinfo.pr_path, + sizeof (fdinfo.pr_path), credp); + + error = VOP_GETATTR(fvp, &vattr, 0, credp, NULL); + if (error != 0) { + VN_RELE(fvp); + VN_RELE(vroot); + goto done; + } + + if (fvp->v_type == VSOCK) + fdinfo.pr_fileflags |= sock_getfasync(fvp); + + VN_RELE(fvp); + + /* + * This logic mirrors fstat(), which we cannot use + * directly, as it calls copyout(). + */ + fdinfo.pr_major = getmajor(vattr.va_fsid); + fdinfo.pr_minor = getminor(vattr.va_fsid); + fdinfo.pr_ino = (ino64_t)vattr.va_nodeid; + fdinfo.pr_mode = VTTOIF(vattr.va_type) | vattr.va_mode; + fdinfo.pr_uid = vattr.va_uid; + fdinfo.pr_gid = vattr.va_gid; + fdinfo.pr_rmajor = getmajor(vattr.va_rdev); + fdinfo.pr_rminor = getminor(vattr.va_rdev); + fdinfo.pr_size = (off64_t)vattr.va_size; + + error = elfnote(vp, &offset, NT_FDINFO, + sizeof (fdinfo), &fdinfo, rlimit, credp); + if (error) { + goto done; + } + } + #if defined(__i386) || defined(__i386_COMPAT) mutex_enter(&p->p_ldtlock); ssdsize = prnldt(p) * sizeof (struct ssd); diff --git a/usr/src/uts/common/fs/nfs/nfs3_srv.c b/usr/src/uts/common/fs/nfs/nfs3_srv.c index c72f823cd3..4acbe92ad9 100644 --- a/usr/src/uts/common/fs/nfs/nfs3_srv.c +++ b/usr/src/uts/common/fs/nfs/nfs3_srv.c @@ -433,16 +433,25 @@ rfs3_lookup(LOOKUP3args *args, LOOKUP3res *resp, struct exportinfo *exi, goto out1; } + exi_hold(exi); + /* * If the public filehandle is used then allow * a multi-component lookup */ if (PUBLIC_FH3(&args->what.dir)) { + struct exportinfo *new; + publicfh_flag = TRUE; + error = rfs_publicfh_mclookup(name, dvp, cr, &vp, - &exi, &sec); - if (error && exi != NULL) - exi_rele(exi); /* See comment below Re: publicfh_flag */ + &new, &sec); + + if (error == 0) { + exi_rele(exi); + exi = new; + } + /* * Since WebNFS may bypass MOUNT, we need to ensure this * request didn't come from an unlabeled admin_low client. @@ -464,8 +473,6 @@ rfs3_lookup(LOOKUP3args *args, LOOKUP3res *resp, struct exportinfo *exi, if (tp == NULL || tp->tpc_tp.tp_doi != l_admin_low->tsl_doi || tp->tpc_tp.host_type != SUN_CIPSO) { - if (exi != NULL) - exi_rele(exi); VN_RELE(vp); resp->status = NFS3ERR_ACCES; error = 1; @@ -491,8 +498,6 @@ rfs3_lookup(LOOKUP3args *args, LOOKUP3res *resp, struct exportinfo *exi, if (!blequal(&l_admin_low->tsl_label, clabel)) { if (!do_rfs_label_check(clabel, dvp, DOMINANCE_CHECK, exi)) { - if (publicfh_flag && exi != NULL) - exi_rele(exi); VN_RELE(vp); resp->status = NFS3ERR_ACCES; error = 1; @@ -519,18 +524,10 @@ rfs3_lookup(LOOKUP3args *args, LOOKUP3res *resp, struct exportinfo *exi, goto out; } - /* - * If publicfh_flag is true then we have called rfs_publicfh_mclookup - * and have obtained a new exportinfo in exi which needs to be - * released. Note the the original exportinfo pointed to by exi - * will be released by the caller, common_dispatch. - */ - if (publicfh_flag) - exi_rele(exi); - va.va_mask = AT_ALL; vap = rfs4_delegated_getattr(vp, &va, 0, cr) ? NULL : &va; + exi_rele(exi); VN_RELE(vp); resp->status = NFS3_OK; @@ -552,6 +549,12 @@ rfs3_lookup(LOOKUP3args *args, LOOKUP3res *resp, struct exportinfo *exi, return; out: + /* + * The passed argument exportinfo is released by the + * caller, common_dispatch + */ + exi_rele(exi); + if (curthread->t_flag & T_WOULDBLOCK) { curthread->t_flag &= ~T_WOULDBLOCK; resp->status = NFS3ERR_JUKEBOX; diff --git a/usr/src/uts/common/fs/nfs/nfs4_srv.c b/usr/src/uts/common/fs/nfs/nfs4_srv.c index 29a9d67497..f2a9734541 100644 --- a/usr/src/uts/common/fs/nfs/nfs4_srv.c +++ b/usr/src/uts/common/fs/nfs/nfs4_srv.c @@ -21,6 +21,9 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. */ +/* + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. + */ /* * Copyright (c) 1983,1984,1985,1986,1987,1988,1989 AT&T. @@ -1131,6 +1134,7 @@ rfs4_op_secinfo(nfs_argop4 *argop, nfs_resop4 *resop, struct svc_req *req, char *nm; struct sockaddr *ca; char *name = NULL; + nfsstat4 status = NFS4_OK; DTRACE_NFSV4_2(op__secinfo__start, struct compound_state *, cs, SECINFO4args *, args); @@ -1154,11 +1158,12 @@ rfs4_op_secinfo(nfs_argop4 *argop, nfs_resop4 *resop, struct svc_req *req, * do not error out if the component name is a "..". * SECINFO will return its parents secinfo data for SECINFO "..". */ - if (!utf8_dir_verify(utfnm)) { + status = utf8_dir_verify(utfnm); + if (status != NFS4_OK) { if (utfnm->utf8string_len != 2 || utfnm->utf8string_val[0] != '.' || utfnm->utf8string_val[1] != '.') { - *cs->statusp = resp->status = NFS4ERR_INVAL; + *cs->statusp = resp->status = status; goto out; } } @@ -1336,7 +1341,8 @@ rfs4_op_access(nfs_argop4 *argop, nfs_resop4 *resop, struct svc_req *req, blequal(clabel, slabel))) resp->access |= (args->access & (ACCESS4_MODIFY | ACCESS4_EXTEND)); - resp->supported |= (ACCESS4_MODIFY | ACCESS4_EXTEND); + resp->supported |= + resp->access & (ACCESS4_MODIFY | ACCESS4_EXTEND); } if (checkwriteperm && @@ -1570,8 +1576,9 @@ rfs4_op_create(nfs_argop4 *argop, nfs_resop4 *resop, struct svc_req *req, *cs->statusp = resp->status = NFS4ERR_NOTDIR; goto out; } - if (!utf8_dir_verify(&args->objname)) { - *cs->statusp = resp->status = NFS4ERR_INVAL; + status = utf8_dir_verify(&args->objname); + if (status != NFS4_OK) { + *cs->statusp = resp->status = status; goto out; } @@ -2446,6 +2453,7 @@ rfs4_op_link(nfs_argop4 *argop, nfs_resop4 *resop, struct svc_req *req, uint_t len; struct sockaddr *ca; char *name = NULL; + nfsstat4 status; DTRACE_NFSV4_2(op__link__start, struct compound_state *, cs, LINK4args *, args); @@ -2495,8 +2503,9 @@ rfs4_op_link(nfs_argop4 *argop, nfs_resop4 *resop, struct svc_req *req, goto out; } - if (!utf8_dir_verify(&args->newname)) { - *cs->statusp = resp->status = NFS4ERR_INVAL; + status = utf8_dir_verify(&args->newname); + if (status != NFS4_OK) { + *cs->statusp = resp->status = status; goto out; } @@ -2886,6 +2895,7 @@ rfs4_op_lookup(nfs_argop4 *argop, nfs_resop4 *resop, struct svc_req *req, uint_t len; struct sockaddr *ca; char *name = NULL; + nfsstat4 status; DTRACE_NFSV4_2(op__lookup__start, struct compound_state *, cs, LOOKUP4args *, args); @@ -2905,8 +2915,9 @@ rfs4_op_lookup(nfs_argop4 *argop, nfs_resop4 *resop, struct svc_req *req, goto out; } - if (!utf8_dir_verify(&args->objname)) { - *cs->statusp = resp->status = NFS4ERR_INVAL; + status = utf8_dir_verify(&args->objname); + if (status != NFS4_OK) { + *cs->statusp = resp->status = status; goto out; } @@ -3655,30 +3666,6 @@ out: } /* - * A directory entry is a valid nfsv4 entry if - * - it has a non-zero ino - * - it is not a dot or dotdot name - * - it is visible in a pseudo export or in a real export that can - * only have a limited view. - */ -static bool_t -valid_nfs4_entry(struct exportinfo *exi, struct dirent64 *dp, - int *expseudo, int check_visible) -{ - if (dp->d_ino == 0 || NFS_IS_DOTNAME(dp->d_name)) { - *expseudo = 0; - return (FALSE); - } - - if (! check_visible) { - *expseudo = 0; - return (TRUE); - } - - return (nfs_visible_inode(exi, dp->d_ino, expseudo)); -} - -/* * set_rdattr_params sets up the variables used to manage what information * to get for each directory entry. */ @@ -4101,6 +4088,7 @@ rfs4_op_remove(nfs_argop4 *argop, nfs_resop4 *resop, struct svc_req *req, bslabel_t *clabel; struct sockaddr *ca; char *name = NULL; + nfsstat4 status; DTRACE_NFSV4_2(op__remove__start, struct compound_state *, cs, REMOVE4args *, args); @@ -4131,8 +4119,9 @@ rfs4_op_remove(nfs_argop4 *argop, nfs_resop4 *resop, struct svc_req *req, goto out; } - if (!utf8_dir_verify(&args->target)) { - *cs->statusp = resp->status = NFS4ERR_INVAL; + status = utf8_dir_verify(&args->target); + if (status != NFS4_OK) { + *cs->statusp = resp->status = status; goto out; } @@ -4398,6 +4387,7 @@ rfs4_op_rename(nfs_argop4 *argop, nfs_resop4 *resop, struct svc_req *req, struct sockaddr *ca; char *converted_onm = NULL; char *converted_nnm = NULL; + nfsstat4 status; DTRACE_NFSV4_2(op__rename__start, struct compound_state *, cs, RENAME4args *, args); @@ -4454,13 +4444,15 @@ rfs4_op_rename(nfs_argop4 *argop, nfs_resop4 *resop, struct svc_req *req, goto out; } - if (!utf8_dir_verify(&args->oldname)) { - *cs->statusp = resp->status = NFS4ERR_INVAL; + status = utf8_dir_verify(&args->oldname); + if (status != NFS4_OK) { + *cs->statusp = resp->status = status; goto out; } - if (!utf8_dir_verify(&args->newname)) { - *cs->statusp = resp->status = NFS4ERR_INVAL; + status = utf8_dir_verify(&args->newname); + if (status != NFS4_OK) { + *cs->statusp = resp->status = status; goto out; } @@ -5789,6 +5781,8 @@ rfs4_compound(COMPOUND4args *args, COMPOUND4res *resp, struct exportinfo *exi, cs.statusp = &resp->status; cs.req = req; + resp->array = NULL; + resp->array_len = 0; /* * XXX for now, minorversion should be zero @@ -5796,14 +5790,17 @@ rfs4_compound(COMPOUND4args *args, COMPOUND4res *resp, struct exportinfo *exi, if (args->minorversion != NFS4_MINORVERSION) { DTRACE_NFSV4_2(compound__start, struct compound_state *, &cs, COMPOUND4args *, args); - resp->array_len = 0; - resp->array = NULL; resp->status = NFS4ERR_MINOR_VERS_MISMATCH; DTRACE_NFSV4_2(compound__done, struct compound_state *, &cs, COMPOUND4res *, resp); return; } + if (args->array_len == 0) { + resp->status = NFS4_OK; + return; + } + ASSERT(exi == NULL); ASSERT(cr == NULL); @@ -6079,8 +6076,9 @@ rfs4_lookup(component4 *component, struct svc_req *req, return (NFS4ERR_NOTDIR); } - if (!utf8_dir_verify(component)) - return (NFS4ERR_INVAL); + status = utf8_dir_verify(component); + if (status != NFS4_OK) + return (status); nm = utf8_to_fn(component, &len, NULL); if (nm == NULL) { @@ -6372,8 +6370,9 @@ rfs4_createfile(OPEN4args *args, struct svc_req *req, struct compound_state *cs, * the including directory on success. */ component = &args->open_claim4_u.file; - if (!utf8_dir_verify(component)) - return (NFS4ERR_INVAL); + status = utf8_dir_verify(component); + if (status != NFS4_OK) + return (status); nm = utf8_to_fn(component, &buflen, NULL); @@ -7594,6 +7593,12 @@ rfs4_op_open_confirm(nfs_argop4 *argop, nfs_resop4 *resop, goto out; } + if (cs->vp->v_type != VREG) { + *cs->statusp = resp->status = + cs->vp->v_type == VDIR ? NFS4ERR_ISDIR : NFS4ERR_INVAL; + return; + } + status = rfs4_get_state(&args->open_stateid, &sp, RFS4_DBS_VALID); if (status != NFS4_OK) { *cs->statusp = resp->status = status; @@ -7709,6 +7714,11 @@ rfs4_op_open_downgrade(nfs_argop4 *argop, nfs_resop4 *resop, goto out; } + if (cs->vp->v_type != VREG) { + *cs->statusp = resp->status = NFS4ERR_INVAL; + return; + } + status = rfs4_get_state(&args->open_stateid, &sp, RFS4_DBS_VALID); if (status != NFS4_OK) { *cs->statusp = resp->status = status; diff --git a/usr/src/uts/common/fs/nfs/nfs4_srv_attr.c b/usr/src/uts/common/fs/nfs/nfs4_srv_attr.c index dbd3263608..855cd8cd92 100644 --- a/usr/src/uts/common/fs/nfs/nfs4_srv_attr.c +++ b/usr/src/uts/common/fs/nfs/nfs4_srv_attr.c @@ -22,6 +22,9 @@ * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. + */ #include <sys/systm.h> #include <sys/cmn_err.h> @@ -1585,7 +1588,8 @@ rfs4_fattr4_fs_locations(nfs4_attr_cmd_t cmd, struct nfs4_svgetit_arg *sarg, case NFS4ATTR_GETIT: fsl = fetch_referral(sarg->cs->vp, sarg->cs->cr); if (fsl == NULL) - error = EINVAL; + (void) memset(&(na->fs_locations), 0, + sizeof (fs_locations4)); else { na->fs_locations = *fsl; kmem_free(fsl, sizeof (fs_locations4)); diff --git a/usr/src/uts/common/fs/nfs/nfs4_subr.c b/usr/src/uts/common/fs/nfs/nfs4_subr.c index c14117c009..cfac742707 100644 --- a/usr/src/uts/common/fs/nfs/nfs4_subr.c +++ b/usr/src/uts/common/fs/nfs/nfs4_subr.c @@ -22,6 +22,9 @@ * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. + */ /* * Copyright (c) 1983,1984,1985,1986,1987,1988,1989 AT&T. @@ -713,33 +716,33 @@ utf8_compare(const utf8string *a, const utf8string *b) /* * utf8_dir_verify - checks that the utf8 string is valid */ -int +nfsstat4 utf8_dir_verify(utf8string *str) { char *nm; int len; if (str == NULL) - return (0); + return (NFS4ERR_INVAL); nm = str->utf8string_val; len = str->utf8string_len; if (nm == NULL || len == 0) { - return (0); + return (NFS4ERR_INVAL); } if (len == 1 && nm[0] == '.') - return (0); + return (NFS4ERR_BADNAME); if (len == 2 && nm[0] == '.' && nm[1] == '.') - return (0); + return (NFS4ERR_BADNAME); if (utf8_strchr(str, '/') != NULL) - return (0); + return (NFS4ERR_BADNAME); if (utf8_strchr(str, '\0') != NULL) - return (0); + return (NFS4ERR_BADNAME); - return (1); + return (NFS4_OK); } /* diff --git a/usr/src/uts/common/fs/nfs/nfs_server.c b/usr/src/uts/common/fs/nfs/nfs_server.c index bb625bb175..22d1ad4d68 100644 --- a/usr/src/uts/common/fs/nfs/nfs_server.c +++ b/usr/src/uts/common/fs/nfs/nfs_server.c @@ -22,6 +22,7 @@ * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 Bayard G. Bell. All rights reserved. * Copyright (c) 2012 Joyent, Inc. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. */ /* @@ -2804,8 +2805,8 @@ rfs_publicfh_mclookup(char *p, vnode_t *dvp, cred_t *cr, vnode_t **vpp, */ /* Release the reference on the old exi value */ - ASSERT(*exi != NULL); exi_rele(*exi); + *exi = NULL; if (error = nfs_check_vpexi(mc_dvp, *vpp, kcred, exi)) { VN_RELE(*vpp); @@ -2818,6 +2819,9 @@ publicfh_done: if (mc_dvp) VN_RELE(mc_dvp); + if (error && *exi != NULL) + exi_rele(*exi); + return (error); } @@ -2963,16 +2967,19 @@ URLparse(char *str) /* * Get the export information for the lookup vnode, and verify its * useable. + * + * Set @exip only in success */ int nfs_check_vpexi(vnode_t *mc_dvp, vnode_t *vp, cred_t *cr, - struct exportinfo **exi) + struct exportinfo **exip) { int walk; int error = 0; + struct exportinfo *exi; - *exi = nfs_vptoexi(mc_dvp, vp, cr, &walk, NULL, FALSE); - if (*exi == NULL) + exi = nfs_vptoexi(mc_dvp, vp, cr, &walk, NULL, FALSE); + if (exi == NULL) error = EACCES; else { /* @@ -2981,10 +2988,13 @@ nfs_check_vpexi(vnode_t *mc_dvp, vnode_t *vp, cred_t *cr, * must not terminate below the * exported directory. */ - if ((*exi)->exi_export.ex_flags & EX_NOSUB && walk > 0) + if (exi->exi_export.ex_flags & EX_NOSUB && walk > 0) { error = EACCES; + exi_rele(exi); + } } - + if (error == 0) + *exip = exi; return (error); } diff --git a/usr/src/uts/common/fs/nfs/nfs_srv.c b/usr/src/uts/common/fs/nfs/nfs_srv.c index 8ca8ee5d1d..f0cd9633aa 100644 --- a/usr/src/uts/common/fs/nfs/nfs_srv.c +++ b/usr/src/uts/common/fs/nfs/nfs_srv.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. */ /* @@ -399,6 +400,8 @@ rfs_lookup(struct nfsdiropargs *da, struct nfsdiropres *dr, return; } + exi_hold(exi); + /* * If the public filehandle is used then allow * a multi-component lookup, i.e. evaluate @@ -409,9 +412,16 @@ rfs_lookup(struct nfsdiropargs *da, struct nfsdiropres *dr, * which is OK as long as the filesystem is exported. */ if (PUBLIC_FH2(fhp)) { + struct exportinfo *new; + publicfh_flag = TRUE; - error = rfs_publicfh_mclookup(name, dvp, cr, &vp, &exi, + error = rfs_publicfh_mclookup(name, dvp, cr, &vp, &new, &sec); + + if (error == 0) { + exi_rele(exi); + exi = new; + } } else { /* * Do a normal single component lookup. @@ -452,13 +462,10 @@ rfs_lookup(struct nfsdiropargs *da, struct nfsdiropres *dr, VN_RELE(dvp); /* - * If publicfh_flag is true then we have called rfs_publicfh_mclookup - * and have obtained a new exportinfo in exi which needs to be - * released. Note the the original exportinfo pointed to by exi - * will be released by the caller, comon_dispatch. + * The passed argument exportinfo is released by the + * caller, comon_dispatch */ - if (publicfh_flag && exi != NULL) - exi_rele(exi); + exi_rele(exi); /* * If it's public fh, no 0x81, and client's flavor is diff --git a/usr/src/uts/common/fs/smbsrv/smb_delete.c b/usr/src/uts/common/fs/smbsrv/smb_delete.c index 43f6d733bd..8a27b7408e 100644 --- a/usr/src/uts/common/fs/smbsrv/smb_delete.c +++ b/usr/src/uts/common/fs/smbsrv/smb_delete.c @@ -21,6 +21,7 @@ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. */ #include <smbsrv/smb_kproto.h> @@ -553,7 +554,7 @@ smb_delete_check_path(smb_request_t *sr) /* fname component is, or resolves to, '.' (dot) */ if ((strcmp(pn->pn_fname, ".") == 0) || (SMB_SEARCH_DIRECTORY(fqi->fq_sattr) && - (smb_match(pn->pn_fname, ".")))) { + (smb_match(pn->pn_fname, ".", B_FALSE)))) { smbsr_error(sr, NT_STATUS_OBJECT_NAME_INVALID, ERRDOS, ERROR_INVALID_NAME); return (-1); diff --git a/usr/src/uts/common/fs/smbsrv/smb_kutil.c b/usr/src/uts/common/fs/smbsrv/smb_kutil.c index 5d45081e2e..aed58277be 100644 --- a/usr/src/uts/common/fs/smbsrv/smb_kutil.c +++ b/usr/src/uts/common/fs/smbsrv/smb_kutil.c @@ -18,8 +18,10 @@ * * CDDL HEADER END */ + /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. */ #include <sys/param.h> @@ -98,116 +100,34 @@ smb_ascii_or_unicode_null_len(struct smb_request *sr) } /* - * Return B_TRUE if pattern contains wildcards - */ -boolean_t -smb_contains_wildcards(const char *pattern) -{ - static const char *wildcards = "*?"; - - return (strpbrk(pattern, wildcards) != NULL); -} - -/* - * When converting wildcards a '.' in a name is treated as a base and - * extension separator even if the name is longer than 8.3. - * - * The '*' character matches an entire part of the name. For example, - * "*.abc" matches any name with an extension of "abc". * - * The '?' character matches a single character. - * If the base contains all ? (8 or more) then it is treated as *. - * If the extension contains all ? (3 or more) then it is treated as *. - * - * Clients convert ASCII wildcards to Unicode wildcards as follows: + * Convert old-style (DOS, LanMan) wildcard strings to NT style. + * This should ONLY happen to patterns that come from old clients, + * meaning dialect LANMAN2_1 etc. (dialect < NT_LM_0_12). * * ? is converted to > - * . is converted to " if it is followed by ? or * * * is converted to < if it is followed by . + * . is converted to " if it is followed by ? or * or end of pattern * - * Note that clients convert "*." to '< and drop the '.' but "*.txt" - * is sent as "<.TXT", i.e. - * - * dir *. -> dir < - * dir *.txt -> dir <.TXT - * - * Since " and < are illegal in Windows file names, we always convert - * these Unicode wildcards without checking the following character. + * Note: modifies pattern in place. */ void smb_convert_wildcards(char *pattern) { - static char *match_all[] = { - "*.", - "*.*" - }; - char *extension; char *p; - int len; - int i; - /* - * Special case "<" for "dir *.", and fast-track for "*". - */ - if ((*pattern == '<') || (*pattern == '*')) { - if (*(pattern + 1) == '\0') { - *pattern = '*'; - return; - } - } - - for (p = pattern; *p != '\0'; ++p) { + for (p = pattern; *p != '\0'; p++) { switch (*p) { - case '<': - *p = '*'; - break; - case '>': - *p = '?'; + case '?': + *p = '>'; break; - case '\"': - *p = '.'; + case '*': + if (p[1] == '.') + *p = '<'; break; - default: - break; - } - } - - /* - * Replace "????????.ext" with "*.ext". - */ - p = pattern; - p += strspn(p, "?"); - if (*p == '.') { - *p = '\0'; - len = strlen(pattern); - *p = '.'; - if (len >= SMB_NAME83_BASELEN) { - *pattern = '*'; - (void) strlcpy(pattern + 1, p, MAXPATHLEN - 1); - } - } - - /* - * Replace "base.???" with 'base.*'. - */ - if ((extension = strrchr(pattern, '.')) != NULL) { - p = ++extension; - p += strspn(p, "?"); - if (*p == '\0') { - len = strlen(extension); - if (len >= SMB_NAME83_EXTLEN) { - *extension = '\0'; - (void) strlcat(pattern, "*", MAXPATHLEN); - } - } - } - - /* - * Replace anything that matches an entry in match_all with "*". - */ - for (i = 0; i < sizeof (match_all) / sizeof (match_all[0]); ++i) { - if (strcmp(pattern, match_all[i]) == 0) { - (void) strlcpy(pattern, "*", MAXPATHLEN); + case '.': + if (p[1] == '?' || p[1] == '*' || p[1] == '\0') + *p = '\"'; break; } } diff --git a/usr/src/uts/common/fs/smbsrv/smb_odir.c b/usr/src/uts/common/fs/smbsrv/smb_odir.c index ea9b505f0d..610126753b 100644 --- a/usr/src/uts/common/fs/smbsrv/smb_odir.c +++ b/usr/src/uts/common/fs/smbsrv/smb_odir.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. */ /* @@ -286,7 +287,8 @@ smb_odir_open(smb_request_t *sr, char *path, uint16_t sattr, uint32_t flags) tree = sr->tid_tree; - smb_convert_wildcards(path); + if (sr->session->dialect < NT_LM_0_12) + smb_convert_wildcards(path); rc = smb_pathname_reduce(sr, sr->user_cr, path, tree->t_snode, tree->t_snode, &dnode, pattern); @@ -1278,22 +1280,23 @@ smb_odir_lookup_link(smb_request_t *sr, smb_odir_t *od, * - If shortnames are supported, generate the shortname from * odirent->od_name and check if it matches od->d_pattern. */ -boolean_t +static boolean_t smb_odir_match_name(smb_odir_t *od, smb_odirent_t *odirent) { char *name = odirent->od_name; char shortname[SMB_SHORTNAMELEN]; ino64_t ino = odirent->od_ino; + boolean_t ci = (od->d_flags & SMB_ODIR_FLAG_IGNORE_CASE) != 0; if (smb_is_reserved_dos_name(name)) return (B_FALSE); - if (smb_match_ci(od->d_pattern, name)) + if (smb_match(od->d_pattern, name, ci)) return (B_TRUE); if (od->d_flags & SMB_ODIR_FLAG_SHORTNAMES) { smb_mangle(name, ino, shortname, SMB_SHORTNAMELEN); - if (smb_match_ci(od->d_pattern, shortname)) + if (smb_match(od->d_pattern, shortname, ci)) return (B_TRUE); } diff --git a/usr/src/uts/common/fs/smbsrv/smb_pathname.c b/usr/src/uts/common/fs/smbsrv/smb_pathname.c index e3ae3ffba2..db9883667e 100644 --- a/usr/src/uts/common/fs/smbsrv/smb_pathname.c +++ b/usr/src/uts/common/fs/smbsrv/smb_pathname.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. */ #include <smbsrv/smb_kproto.h> @@ -732,8 +733,8 @@ smb_pathname_preprocess(smb_request_t *sr, smb_pathname_t *pn) return; } - /* perform unicode wildcard conversion */ - smb_convert_wildcards(pn->pn_path); + if (sr->session->dialect < NT_LM_0_12) + smb_convert_wildcards(pn->pn_path); /* treat '/' as '\\' */ (void) strsubst(pn->pn_path, '/', '\\'); diff --git a/usr/src/uts/common/fs/vfs.c b/usr/src/uts/common/fs/vfs.c index abe3a23e75..8d5c741428 100644 --- a/usr/src/uts/common/fs/vfs.c +++ b/usr/src/uts/common/fs/vfs.c @@ -936,29 +936,33 @@ vfs_mountroot(void) } #endif /* __sparc */ - /* - * Look up the root device via devfs so that a dv_node is - * created for it. The vnode is never VN_RELE()ed. - * We allocate more than MAXPATHLEN so that the - * buffer passed to i_ddi_prompath_to_devfspath() is - * exactly MAXPATHLEN (the function expects a buffer - * of that length). - */ - plen = strlen("/devices"); - path = kmem_alloc(plen + MAXPATHLEN, KM_SLEEP); - (void) strcpy(path, "/devices"); + if (strcmp(rootfs.bo_fstype, "zfs") != 0) { + /* + * Look up the root device via devfs so that a dv_node is + * created for it. The vnode is never VN_RELE()ed. + * We allocate more than MAXPATHLEN so that the + * buffer passed to i_ddi_prompath_to_devfspath() is + * exactly MAXPATHLEN (the function expects a buffer + * of that length). + */ + plen = strlen("/devices"); + path = kmem_alloc(plen + MAXPATHLEN, KM_SLEEP); + (void) strcpy(path, "/devices"); - if (i_ddi_prompath_to_devfspath(rootfs.bo_name, path + plen) - != DDI_SUCCESS || - lookupname(path, UIO_SYSSPACE, FOLLOW, NULLVPP, &rvp)) { + if (i_ddi_prompath_to_devfspath(rootfs.bo_name, path + plen) + != DDI_SUCCESS || + lookupname(path, UIO_SYSSPACE, FOLLOW, NULLVPP, &rvp)) { - /* NUL terminate in case "path" has garbage */ - path[plen + MAXPATHLEN - 1] = '\0'; + /* NUL terminate in case "path" has garbage */ + path[plen + MAXPATHLEN - 1] = '\0'; #ifdef DEBUG - cmn_err(CE_WARN, "!Cannot lookup root device: %s", path); + cmn_err(CE_WARN, "!Cannot lookup root device: %s", + path); #endif + } + kmem_free(path, plen + MAXPATHLEN); } - kmem_free(path, plen + MAXPATHLEN); + vfs_mnttabvp_setup(); } diff --git a/usr/src/uts/common/fs/zfs/arc.c b/usr/src/uts/common/fs/zfs/arc.c index 5caabf8260..d8e9f26bdb 100644 --- a/usr/src/uts/common/fs/zfs/arc.c +++ b/usr/src/uts/common/fs/zfs/arc.c @@ -190,6 +190,7 @@ uint64_t zfs_arc_meta_limit = 0; int zfs_arc_grow_retry = 0; int zfs_arc_shrink_shift = 0; int zfs_arc_p_min_shift = 0; +int zfs_disable_dup_eviction = 0; /* * Note that buffers can be in one of 6 states: @@ -292,6 +293,9 @@ typedef struct arc_stats { kstat_named_t arcstat_l2_size; kstat_named_t arcstat_l2_hdr_size; kstat_named_t arcstat_memory_throttle_count; + kstat_named_t arcstat_duplicate_buffers; + kstat_named_t arcstat_duplicate_buffers_size; + kstat_named_t arcstat_duplicate_reads; } arc_stats_t; static arc_stats_t arc_stats = { @@ -347,7 +351,10 @@ static arc_stats_t arc_stats = { { "l2_io_error", KSTAT_DATA_UINT64 }, { "l2_size", KSTAT_DATA_UINT64 }, { "l2_hdr_size", KSTAT_DATA_UINT64 }, - { "memory_throttle_count", KSTAT_DATA_UINT64 } + { "memory_throttle_count", KSTAT_DATA_UINT64 }, + { "duplicate_buffers", KSTAT_DATA_UINT64 }, + { "duplicate_buffers_size", KSTAT_DATA_UINT64 }, + { "duplicate_reads", KSTAT_DATA_UINT64 } }; #define ARCSTAT(stat) (arc_stats.stat.value.ui64) @@ -1362,6 +1369,17 @@ arc_buf_clone(arc_buf_t *from) hdr->b_buf = buf; arc_get_data_buf(buf); bcopy(from->b_data, buf->b_data, size); + + /* + * This buffer already exists in the arc so create a duplicate + * copy for the caller. If the buffer is associated with user data + * then track the size and number of duplicates. These stats will be + * updated as duplicate buffers are created and destroyed. + */ + if (hdr->b_type == ARC_BUFC_DATA) { + ARCSTAT_BUMP(arcstat_duplicate_buffers); + ARCSTAT_INCR(arcstat_duplicate_buffers_size, size); + } hdr->b_datacnt += 1; return (buf); } @@ -1460,6 +1478,16 @@ arc_buf_destroy(arc_buf_t *buf, boolean_t recycle, boolean_t all) ASSERT3U(state->arcs_size, >=, size); atomic_add_64(&state->arcs_size, -size); buf->b_data = NULL; + + /* + * If we're destroying a duplicate buffer make sure + * that the appropriate statistics are updated. + */ + if (buf->b_hdr->b_datacnt > 1 && + buf->b_hdr->b_type == ARC_BUFC_DATA) { + ARCSTAT_BUMPDOWN(arcstat_duplicate_buffers); + ARCSTAT_INCR(arcstat_duplicate_buffers_size, -size); + } ASSERT(buf->b_hdr->b_datacnt > 0); buf->b_hdr->b_datacnt -= 1; } @@ -1644,6 +1672,48 @@ arc_buf_size(arc_buf_t *buf) } /* + * Called from the DMU to determine if the current buffer should be + * evicted. In order to ensure proper locking, the eviction must be initiated + * from the DMU. Return true if the buffer is associated with user data and + * duplicate buffers still exist. + */ +boolean_t +arc_buf_eviction_needed(arc_buf_t *buf) +{ + arc_buf_hdr_t *hdr; + boolean_t evict_needed = B_FALSE; + + if (zfs_disable_dup_eviction) + return (B_FALSE); + + mutex_enter(&buf->b_evict_lock); + hdr = buf->b_hdr; + if (hdr == NULL) { + /* + * We are in arc_do_user_evicts(); let that function + * perform the eviction. + */ + ASSERT(buf->b_data == NULL); + mutex_exit(&buf->b_evict_lock); + return (B_FALSE); + } else if (buf->b_data == NULL) { + /* + * We have already been added to the arc eviction list; + * recommend eviction. + */ + ASSERT3P(hdr, ==, &arc_eviction_hdr); + mutex_exit(&buf->b_evict_lock); + return (B_TRUE); + } + + if (hdr->b_datacnt > 1 && hdr->b_type == ARC_BUFC_DATA) + evict_needed = B_TRUE; + + mutex_exit(&buf->b_evict_lock); + return (evict_needed); +} + +/* * Evict buffers from list until we've removed the specified number of * bytes. Move the removed buffers to the appropriate evict state. * If the recycle flag is set, then attempt to "recycle" a buffer: @@ -2638,8 +2708,10 @@ arc_read_done(zio_t *zio) abuf = buf; for (acb = callback_list; acb; acb = acb->acb_next) { if (acb->acb_done) { - if (abuf == NULL) + if (abuf == NULL) { + ARCSTAT_BUMP(arcstat_duplicate_reads); abuf = arc_buf_clone(buf); + } acb->acb_buf = abuf; abuf = NULL; } @@ -3186,6 +3258,16 @@ arc_release(arc_buf_t *buf, void *tag) ASSERT3U(*size, >=, hdr->b_size); atomic_add_64(size, -hdr->b_size); } + + /* + * We're releasing a duplicate user data buffer, update + * our statistics accordingly. + */ + if (hdr->b_type == ARC_BUFC_DATA) { + ARCSTAT_BUMPDOWN(arcstat_duplicate_buffers); + ARCSTAT_INCR(arcstat_duplicate_buffers_size, + -hdr->b_size); + } hdr->b_datacnt -= 1; arc_cksum_verify(buf); arc_buf_unwatch(buf); diff --git a/usr/src/uts/common/fs/zfs/dbuf.c b/usr/src/uts/common/fs/zfs/dbuf.c index 437e0ac85c..e8bf55c321 100644 --- a/usr/src/uts/common/fs/zfs/dbuf.c +++ b/usr/src/uts/common/fs/zfs/dbuf.c @@ -2089,7 +2089,24 @@ dbuf_rele_and_unlock(dmu_buf_impl_t *db, void *tag) dbuf_evict(db); } else { VERIFY(arc_buf_remove_ref(db->db_buf, db) == 0); - if (!DBUF_IS_CACHEABLE(db)) + + /* + * A dbuf will be eligible for eviction if either the + * 'primarycache' property is set or a duplicate + * copy of this buffer is already cached in the arc. + * + * In the case of the 'primarycache' a buffer + * is considered for eviction if it matches the + * criteria set in the property. + * + * To decide if our buffer is considered a + * duplicate, we must call into the arc to determine + * if multiple buffers are referencing the same + * block on-disk. If so, then we simply evict + * ourselves. + */ + if (!DBUF_IS_CACHEABLE(db) || + arc_buf_eviction_needed(db->db_buf)) dbuf_clear(db); else mutex_exit(&db->db_mtx); diff --git a/usr/src/uts/common/fs/zfs/dmu_tx.c b/usr/src/uts/common/fs/zfs/dmu_tx.c index 190b26e5bf..a9308b0c08 100644 --- a/usr/src/uts/common/fs/zfs/dmu_tx.c +++ b/usr/src/uts/common/fs/zfs/dmu_tx.c @@ -574,7 +574,7 @@ dmu_tx_count_free(dmu_tx_hold_t *txh, uint64_t off, uint64_t len) (dn->dn_indblkshift - SPA_BLKPTRSHIFT); while (level++ < maxlevel) { - txh->txh_memory_tohold += MIN(blkcnt, (nl1blks >> epbs)) + txh->txh_memory_tohold += MAX(MIN(blkcnt, nl1blks), 1) << dn->dn_indblkshift; blkcnt = 1 + (blkcnt >> epbs); } diff --git a/usr/src/uts/common/fs/zfs/spa.c b/usr/src/uts/common/fs/zfs/spa.c index d9cd70f1c8..968fbd80d6 100644 --- a/usr/src/uts/common/fs/zfs/spa.c +++ b/usr/src/uts/common/fs/zfs/spa.c @@ -5983,6 +5983,10 @@ spa_sync(spa_t *spa, uint64_t txg) tx = dmu_tx_create_assigned(dp, txg); + spa->spa_sync_starttime = gethrtime(); + VERIFY(cyclic_reprogram(spa->spa_deadman_cycid, + spa->spa_sync_starttime + spa->spa_deadman_synctime)); + /* * If we are upgrading to SPA_VERSION_RAIDZ_DEFLATE this txg, * set spa_deflate if we have no raid-z vdevs. @@ -6111,6 +6115,8 @@ spa_sync(spa_t *spa, uint64_t txg) } dmu_tx_commit(tx); + VERIFY(cyclic_reprogram(spa->spa_deadman_cycid, CY_INFINITY)); + /* * Clear the dirty config list. */ diff --git a/usr/src/uts/common/fs/zfs/spa_misc.c b/usr/src/uts/common/fs/zfs/spa_misc.c index 30681b6464..a254c8d656 100644 --- a/usr/src/uts/common/fs/zfs/spa_misc.c +++ b/usr/src/uts/common/fs/zfs/spa_misc.c @@ -26,6 +26,7 @@ #include <sys/zfs_context.h> #include <sys/spa_impl.h> +#include <sys/spa_boot.h> #include <sys/zio.h> #include <sys/zio_checksum.h> #include <sys/zio_compress.h> @@ -249,6 +250,26 @@ int zfs_flags = 0; */ int zfs_recover = 0; +extern int zfs_txg_synctime_ms; + +/* + * Expiration time in units of zfs_txg_synctime_ms. This value has two + * meanings. First it is used to determine when the spa_deadman logic + * should fire. By default the spa_deadman will fire if spa_sync has + * not completed in 1000 * zfs_txg_synctime_ms (i.e. 1000 seconds). + * Secondly, the value determines if an I/O is considered "hung". + * Any I/O that has not completed in zfs_deadman_synctime is considered + * "hung" resulting in a system panic. + * 1000 zfs_txg_synctime_ms (i.e. 1000 seconds). + */ +uint64_t zfs_deadman_synctime = 1000ULL; + +/* + * Override the zfs deadman behavior via /etc/system. By default the + * deadman is enabled except on VMware and sparc deployments. + */ +int zfs_deadman_enabled = -1; + /* * ========================================================================== @@ -418,6 +439,23 @@ spa_lookup(const char *name) } /* + * Fires when spa_sync has not completed within zfs_deadman_synctime_ms. + * If the zfs_deadman_enabled flag is set then it inspects all vdev queues + * looking for potentially hung I/Os. + */ +void +spa_deadman(void *arg) +{ + spa_t *spa = arg; + + zfs_dbgmsg("slow spa_sync: started %llu seconds ago, calls %llu", + (gethrtime() - spa->spa_sync_starttime) / NANOSEC, + ++spa->spa_deadman_calls); + if (zfs_deadman_enabled) + vdev_deadman(spa->spa_root_vdev); +} + +/* * Create an uninitialized spa_t with the given name. Requires * spa_namespace_lock. The caller must ensure that the spa_t doesn't already * exist by calling spa_lookup() first. @@ -427,6 +465,8 @@ spa_add(const char *name, nvlist_t *config, const char *altroot) { spa_t *spa; spa_config_dirent_t *dp; + cyc_handler_t hdlr; + cyc_time_t when; ASSERT(MUTEX_HELD(&spa_namespace_lock)); @@ -458,6 +498,25 @@ spa_add(const char *name, nvlist_t *config, const char *altroot) spa->spa_proc = &p0; spa->spa_proc_state = SPA_PROC_NONE; + hdlr.cyh_func = spa_deadman; + hdlr.cyh_arg = spa; + hdlr.cyh_level = CY_LOW_LEVEL; + + spa->spa_deadman_synctime = zfs_deadman_synctime * + zfs_txg_synctime_ms * MICROSEC; + + /* + * This determines how often we need to check for hung I/Os after + * the cyclic has already fired. Since checking for hung I/Os is + * an expensive operation we don't want to check too frequently. + * Instead wait for 5 synctimes before checking again. + */ + when.cyt_interval = 5ULL * zfs_txg_synctime_ms * MICROSEC; + when.cyt_when = CY_INFINITY; + mutex_enter(&cpu_lock); + spa->spa_deadman_cycid = cyclic_add(&hdlr, &when); + mutex_exit(&cpu_lock); + refcount_create(&spa->spa_refcount); spa_config_lock_init(spa); @@ -540,6 +599,12 @@ spa_remove(spa_t *spa) nvlist_free(spa->spa_load_info); spa_config_set(spa, NULL); + mutex_enter(&cpu_lock); + if (spa->spa_deadman_cycid != CYCLIC_NONE) + cyclic_remove(spa->spa_deadman_cycid); + mutex_exit(&cpu_lock); + spa->spa_deadman_cycid = CYCLIC_NONE; + refcount_destroy(&spa->spa_refcount); spa_config_lock_destroy(spa); @@ -1507,6 +1572,12 @@ spa_prev_software_version(spa_t *spa) } uint64_t +spa_deadman_synctime(spa_t *spa) +{ + return (spa->spa_deadman_synctime); +} + +uint64_t dva_get_dsize_sync(spa_t *spa, const dva_t *dva) { uint64_t asize = DVA_GET_ASIZE(dva); @@ -1600,7 +1671,9 @@ spa_init(int mode) spa_mode_global = mode; -#ifndef _KERNEL +#ifdef _KERNEL + spa_arch_init(); +#else if (spa_mode_global != FREAD && dprintf_find_string("watch")) { arc_procfd = open("/proc/self/ctl", O_WRONLY); if (arc_procfd == -1) { diff --git a/usr/src/uts/common/fs/zfs/sys/arc.h b/usr/src/uts/common/fs/zfs/sys/arc.h index 28dbc57275..b109dcafbc 100644 --- a/usr/src/uts/common/fs/zfs/sys/arc.h +++ b/usr/src/uts/common/fs/zfs/sys/arc.h @@ -99,6 +99,7 @@ int arc_released(arc_buf_t *buf); int arc_has_callback(arc_buf_t *buf); void arc_buf_freeze(arc_buf_t *buf); void arc_buf_thaw(arc_buf_t *buf); +boolean_t arc_buf_eviction_needed(arc_buf_t *buf); #ifdef ZFS_DEBUG int arc_referenced(arc_buf_t *buf); #endif diff --git a/usr/src/uts/common/fs/zfs/sys/sa_impl.h b/usr/src/uts/common/fs/zfs/sys/sa_impl.h index 6661e47cfc..8ae05ce364 100644 --- a/usr/src/uts/common/fs/zfs/sys/sa_impl.h +++ b/usr/src/uts/common/fs/zfs/sys/sa_impl.h @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_SA_IMPL_H @@ -181,7 +182,7 @@ typedef struct sa_hdr_phys { */ #define SA_HDR_LAYOUT_NUM(hdr) BF32_GET(hdr->sa_layout_info, 0, 10) -#define SA_HDR_SIZE(hdr) BF32_GET_SB(hdr->sa_layout_info, 10, 16, 3, 0) +#define SA_HDR_SIZE(hdr) BF32_GET_SB(hdr->sa_layout_info, 10, 6, 3, 0) #define SA_HDR_LAYOUT_INFO_ENCODE(x, num, size) \ { \ BF32_SET_SB(x, 10, 6, 3, 0, size); \ diff --git a/usr/src/uts/common/fs/zfs/sys/spa.h b/usr/src/uts/common/fs/zfs/sys/spa.h index 1043f4038a..172a9f141e 100644 --- a/usr/src/uts/common/fs/zfs/sys/spa.h +++ b/usr/src/uts/common/fs/zfs/sys/spa.h @@ -604,6 +604,7 @@ extern boolean_t spa_suspended(spa_t *spa); extern uint64_t spa_bootfs(spa_t *spa); extern uint64_t spa_delegation(spa_t *spa); extern objset_t *spa_meta_objset(spa_t *spa); +extern uint64_t spa_deadman_synctime(spa_t *spa); /* Miscellaneous support routines */ extern void spa_activate_mos_feature(spa_t *spa, const char *feature); diff --git a/usr/src/uts/common/fs/zfs/sys/spa_boot.h b/usr/src/uts/common/fs/zfs/sys/spa_boot.h index 1d3622f5a1..8df5072a55 100644 --- a/usr/src/uts/common/fs/zfs/sys/spa_boot.h +++ b/usr/src/uts/common/fs/zfs/sys/spa_boot.h @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + #ifndef _SYS_SPA_BOOT_H #define _SYS_SPA_BOOT_H @@ -35,6 +39,8 @@ extern "C" { extern char *spa_get_bootprop(char *prop); extern void spa_free_bootprop(char *prop); +extern void spa_arch_init(void); + #ifdef __cplusplus } #endif diff --git a/usr/src/uts/common/fs/zfs/sys/spa_impl.h b/usr/src/uts/common/fs/zfs/sys/spa_impl.h index 027832e858..42ce5556d3 100644 --- a/usr/src/uts/common/fs/zfs/sys/spa_impl.h +++ b/usr/src/uts/common/fs/zfs/sys/spa_impl.h @@ -227,6 +227,10 @@ struct spa { uint64_t spa_feat_for_write_obj; /* required to write to pool */ uint64_t spa_feat_for_read_obj; /* required to read from pool */ uint64_t spa_feat_desc_obj; /* Feature descriptions */ + cyclic_id_t spa_deadman_cycid; /* cyclic id */ + uint64_t spa_deadman_calls; /* number of deadman calls */ + uint64_t spa_sync_starttime; /* starting time fo spa_sync */ + uint64_t spa_deadman_synctime; /* deadman expiration timer */ /* * spa_refcnt & spa_config_lock must be the last elements * because refcount_t changes size based on compilation options. diff --git a/usr/src/uts/common/fs/zfs/sys/vdev.h b/usr/src/uts/common/fs/zfs/sys/vdev.h index 7e34889b61..5a7836612b 100644 --- a/usr/src/uts/common/fs/zfs/sys/vdev.h +++ b/usr/src/uts/common/fs/zfs/sys/vdev.h @@ -79,6 +79,7 @@ extern void vdev_metaslab_fini(vdev_t *vd); extern void vdev_metaslab_set_size(vdev_t *); extern void vdev_expand(vdev_t *vd, uint64_t txg); extern void vdev_split(vdev_t *vd); +extern void vdev_deadman(vdev_t *vd); extern void vdev_get_stats(vdev_t *vd, vdev_stat_t *vs); diff --git a/usr/src/uts/common/fs/zfs/sys/vdev_impl.h b/usr/src/uts/common/fs/zfs/sys/vdev_impl.h index c772d954bb..e4c02bde1d 100644 --- a/usr/src/uts/common/fs/zfs/sys/vdev_impl.h +++ b/usr/src/uts/common/fs/zfs/sys/vdev_impl.h @@ -105,6 +105,8 @@ struct vdev_queue { avl_tree_t vq_write_tree; avl_tree_t vq_pending_tree; zoneid_t vq_last_zone_id; + uint64_t vq_io_complete_ts; + uint64_t vq_io_delta_ts; kmutex_t vq_lock; }; @@ -321,6 +323,14 @@ extern void vdev_set_min_asize(vdev_t *vd); */ extern int zfs_vdev_cache_size; +/* + * The vdev_buf_t is used to translate between zio_t and buf_t, and back again. + */ +typedef struct vdev_buf { + buf_t vb_buf; /* buffer that describes the io */ + zio_t *vb_io; /* pointer back to the original zio_t */ +} vdev_buf_t; + #ifdef __cplusplus } #endif diff --git a/usr/src/uts/common/fs/zfs/sys/zfs_context.h b/usr/src/uts/common/fs/zfs/sys/zfs_context.h index fdd0412fee..0dc8d8859c 100644 --- a/usr/src/uts/common/fs/zfs/sys/zfs_context.h +++ b/usr/src/uts/common/fs/zfs/sys/zfs_context.h @@ -22,8 +22,10 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ + /* * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_ZFS_CONTEXT_H @@ -67,6 +69,7 @@ extern "C" { #include <sys/sysevent/dev.h> #include <sys/fm/util.h> #include <sys/sunddi.h> +#include <sys/cyclic.h> #define CPU_SEQID (CPU->cpu_seqid) diff --git a/usr/src/uts/common/fs/zfs/sys/zfs_ioctl.h b/usr/src/uts/common/fs/zfs/sys/zfs_ioctl.h index 4d781ad2a4..86e901be0d 100644 --- a/usr/src/uts/common/fs/zfs/sys/zfs_ioctl.h +++ b/usr/src/uts/common/fs/zfs/sys/zfs_ioctl.h @@ -240,12 +240,24 @@ typedef struct zinject_record { uint32_t zi_iotype; int32_t zi_duration; uint64_t zi_timer; + uint32_t zi_cmd; + uint32_t zi_pad; } zinject_record_t; #define ZINJECT_NULL 0x1 #define ZINJECT_FLUSH_ARC 0x2 #define ZINJECT_UNLOAD_SPA 0x4 +typedef enum zinject_type { + ZINJECT_UNINITIALIZED, + ZINJECT_DATA_FAULT, + ZINJECT_DEVICE_FAULT, + ZINJECT_LABEL_FAULT, + ZINJECT_IGNORED_WRITES, + ZINJECT_PANIC, + ZINJECT_DELAY_IO, +} zinject_type_t; + typedef struct zfs_share { uint64_t z_exportdata; uint64_t z_sharedata; diff --git a/usr/src/uts/common/fs/zfs/sys/zio.h b/usr/src/uts/common/fs/zfs/sys/zio.h index ce3a983d9f..9c718f691a 100644 --- a/usr/src/uts/common/fs/zfs/sys/zio.h +++ b/usr/src/uts/common/fs/zfs/sys/zio.h @@ -21,8 +21,6 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - */ -/* * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright 2011 Joyent, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. @@ -406,6 +404,7 @@ struct zio { uint64_t io_offset; uint64_t io_deadline; + uint64_t io_timestamp; avl_node_t io_offset_node; avl_node_t io_deadline_node; avl_tree_t *io_vdev_tree; @@ -554,6 +553,7 @@ extern int zio_handle_fault_injection(zio_t *zio, int error); extern int zio_handle_device_injection(vdev_t *vd, zio_t *zio, int error); extern int zio_handle_label_injection(zio_t *zio, int error); extern void zio_handle_ignored_writes(zio_t *zio); +extern uint64_t zio_handle_io_delay(zio_t *zio); /* * Checksum ereport functions diff --git a/usr/src/uts/common/fs/zfs/vdev.c b/usr/src/uts/common/fs/zfs/vdev.c index fa0a579e66..18180ecad3 100644 --- a/usr/src/uts/common/fs/zfs/vdev.c +++ b/usr/src/uts/common/fs/zfs/vdev.c @@ -3153,3 +3153,41 @@ vdev_split(vdev_t *vd) } vdev_propagate_state(cvd); } + +void +vdev_deadman(vdev_t *vd) +{ + for (int c = 0; c < vd->vdev_children; c++) { + vdev_t *cvd = vd->vdev_child[c]; + + vdev_deadman(cvd); + } + + if (vd->vdev_ops->vdev_op_leaf) { + vdev_queue_t *vq = &vd->vdev_queue; + + mutex_enter(&vq->vq_lock); + if (avl_numnodes(&vq->vq_pending_tree) > 0) { + spa_t *spa = vd->vdev_spa; + zio_t *fio; + uint64_t delta; + + /* + * Look at the head of all the pending queues, + * if any I/O has been outstanding for longer than + * the spa_deadman_synctime we panic the system. + */ + fio = avl_first(&vq->vq_pending_tree); + delta = ddi_get_lbolt64() - fio->io_timestamp; + if (delta > NSEC_TO_TICK(spa_deadman_synctime(spa))) { + zfs_dbgmsg("SLOW IO: zio timestamp %llu, " + "delta %llu, last io %llu", + fio->io_timestamp, delta, + vq->vq_io_complete_ts); + fm_panic("I/O to pool '%s' appears to be " + "hung.", spa_name(spa)); + } + } + mutex_exit(&vq->vq_lock); + } +} diff --git a/usr/src/uts/common/fs/zfs/vdev_disk.c b/usr/src/uts/common/fs/zfs/vdev_disk.c index 1ba343226f..dfadeca9d4 100644 --- a/usr/src/uts/common/fs/zfs/vdev_disk.c +++ b/usr/src/uts/common/fs/zfs/vdev_disk.c @@ -42,11 +42,6 @@ extern ldi_ident_t zfs_li; -typedef struct vdev_disk_buf { - buf_t vdb_buf; - zio_t *vdb_io; -} vdev_disk_buf_t; - static void vdev_disk_hold(vdev_t *vd) { @@ -170,7 +165,7 @@ vdev_disk_open(vdev_t *vd, uint64_t *psize, uint64_t *max_psize, /* * When opening a disk device, we want to preserve the user's original * intent. We always want to open the device by the path the user gave - * us, even if it is one of multiple paths to the save device. But we + * us, even if it is one of multiple paths to the same device. But we * also want to be able to survive disks being removed/recabled. * Therefore the sequence of opening devices is: * @@ -416,8 +411,8 @@ vdev_disk_ldi_physio(ldi_handle_t vd_lh, caddr_t data, static void vdev_disk_io_intr(buf_t *bp) { - vdev_disk_buf_t *vdb = (vdev_disk_buf_t *)bp; - zio_t *zio = vdb->vdb_io; + vdev_buf_t *vb = (vdev_buf_t *)bp; + zio_t *zio = vb->vb_io; /* * The rest of the zio stack only deals with EIO, ECKSUM, and ENXIO. @@ -429,7 +424,7 @@ vdev_disk_io_intr(buf_t *bp) if (zio->io_error == 0 && bp->b_resid != 0) zio->io_error = EIO; - kmem_free(vdb, sizeof (vdev_disk_buf_t)); + kmem_free(vb, sizeof (vdev_buf_t)); zio_interrupt(zio); } @@ -460,7 +455,7 @@ vdev_disk_io_start(zio_t *zio) { vdev_t *vd = zio->io_vd; vdev_disk_t *dvd = vd->vdev_tsd; - vdev_disk_buf_t *vdb; + vdev_buf_t *vb; struct dk_callback *dkc; buf_t *bp; int error; @@ -524,10 +519,10 @@ vdev_disk_io_start(zio_t *zio) return (ZIO_PIPELINE_CONTINUE); } - vdb = kmem_alloc(sizeof (vdev_disk_buf_t), KM_SLEEP); + vb = kmem_alloc(sizeof (vdev_buf_t), KM_SLEEP); - vdb->vdb_io = zio; - bp = &vdb->vdb_buf; + vb->vb_io = zio; + bp = &vb->vb_buf; bioinit(bp); bp->b_flags = B_BUSY | B_NOCACHE | diff --git a/usr/src/uts/common/fs/zfs/vdev_file.c b/usr/src/uts/common/fs/zfs/vdev_file.c index 043fa51294..1fbce5e542 100644 --- a/usr/src/uts/common/fs/zfs/vdev_file.c +++ b/usr/src/uts/common/fs/zfs/vdev_file.c @@ -25,6 +25,7 @@ #include <sys/zfs_context.h> #include <sys/spa.h> +#include <sys/spa_impl.h> #include <sys/vdev_file.h> #include <sys/vdev_impl.h> #include <sys/zio.h> @@ -140,12 +141,55 @@ vdev_file_close(vdev_t *vd) vd->vdev_tsd = NULL; } +/* + * Implements the interrupt side for file vdev types. This routine will be + * called when the I/O completes allowing us to transfer the I/O to the + * interrupt taskqs. For consistency, the code structure mimics disk vdev + * types. + */ +static void +vdev_file_io_intr(buf_t *bp) +{ + vdev_buf_t *vb = (vdev_buf_t *)bp; + zio_t *zio = vb->vb_io; + + zio->io_error = (geterror(bp) != 0 ? EIO : 0); + if (zio->io_error == 0 && bp->b_resid != 0) + zio->io_error = ENOSPC; + + kmem_free(vb, sizeof (vdev_buf_t)); + zio_interrupt(zio); +} + +static void +vdev_file_io_strategy(void *arg) +{ + buf_t *bp = arg; + vnode_t *vp = bp->b_private; + ssize_t resid; + int error; + + error = vn_rdwr((bp->b_flags & B_READ) ? UIO_READ : UIO_WRITE, + vp, bp->b_un.b_addr, bp->b_bcount, ldbtob(bp->b_lblkno), + UIO_SYSSPACE, 0, RLIM64_INFINITY, kcred, &resid); + + if (error == 0) { + bp->b_resid = resid; + biodone(bp); + } else { + bioerror(bp, error); + biodone(bp); + } +} + static int vdev_file_io_start(zio_t *zio) { + spa_t *spa = zio->io_spa; vdev_t *vd = zio->io_vd; vdev_file_t *vf = vd->vdev_tsd; - ssize_t resid; + vdev_buf_t *vb; + buf_t *bp; if (zio->io_type == ZIO_TYPE_IOCTL) { /* XXPOLICY */ @@ -166,15 +210,22 @@ vdev_file_io_start(zio_t *zio) return (ZIO_PIPELINE_CONTINUE); } - zio->io_error = vn_rdwr(zio->io_type == ZIO_TYPE_READ ? - UIO_READ : UIO_WRITE, vf->vf_vnode, zio->io_data, - zio->io_size, zio->io_offset, UIO_SYSSPACE, - 0, RLIM64_INFINITY, kcred, &resid); + vb = kmem_alloc(sizeof (vdev_buf_t), KM_SLEEP); - if (resid != 0 && zio->io_error == 0) - zio->io_error = ENOSPC; + vb->vb_io = zio; + bp = &vb->vb_buf; - zio_interrupt(zio); + bioinit(bp); + bp->b_flags = (zio->io_type == ZIO_TYPE_READ ? B_READ : B_WRITE); + bp->b_bcount = zio->io_size; + bp->b_un.b_addr = zio->io_data; + bp->b_lblkno = lbtodb(zio->io_offset); + bp->b_bufsize = zio->io_size; + bp->b_private = vf->vf_vnode; + bp->b_iodone = (int (*)())vdev_file_io_intr; + + taskq_dispatch_ent(spa->spa_zio_taskq[ZIO_TYPE_FREE][ZIO_TASKQ_ISSUE], + vdev_file_io_strategy, bp, 0, &zio->io_tqent); return (ZIO_PIPELINE_STOP); } diff --git a/usr/src/uts/common/fs/zfs/vdev_queue.c b/usr/src/uts/common/fs/zfs/vdev_queue.c index 4ea958a9f6..8dec283fee 100644 --- a/usr/src/uts/common/fs/zfs/vdev_queue.c +++ b/usr/src/uts/common/fs/zfs/vdev_queue.c @@ -24,6 +24,10 @@ * Copyright (c) 2011, Joyent, Inc. All rights reserved. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + #include <sys/zfs_context.h> #include <sys/vdev_impl.h> #include <sys/zio.h> @@ -298,6 +302,7 @@ again: zio_buf_alloc(size), size, fio->io_type, ZIO_PRIORITY_AGG, flags | ZIO_FLAG_DONT_CACHE | ZIO_FLAG_DONT_QUEUE, vdev_queue_agg_io_done, NULL); + aio->io_timestamp = fio->io_timestamp; nio = fio; do { @@ -369,7 +374,8 @@ vdev_queue_io(zio_t *zio) mutex_enter(&vq->vq_lock); - zio->io_deadline = (ddi_get_lbolt64() >> zfs_vdev_time_shift) + + zio->io_timestamp = ddi_get_lbolt64(); + zio->io_deadline = (zio->io_timestamp >> zfs_vdev_time_shift) + zio->io_priority; vdev_queue_io_add(vq, zio); @@ -394,10 +400,16 @@ vdev_queue_io_done(zio_t *zio) { vdev_queue_t *vq = &zio->io_vd->vdev_queue; + if (zio_injection_enabled) + delay(SEC_TO_TICK(zio_handle_io_delay(zio))); + mutex_enter(&vq->vq_lock); avl_remove(&vq->vq_pending_tree, zio); + vq->vq_io_complete_ts = ddi_get_lbolt64(); + vq->vq_io_delta_ts = vq->vq_io_complete_ts - zio->io_timestamp; + for (int i = 0; i < zfs_vdev_ramp_rate; i++) { zio_t *nio = vdev_queue_io_to_issue(vq, zfs_vdev_max_pending); if (nio == NULL) diff --git a/usr/src/uts/common/fs/zfs/zfs_vfsops.c b/usr/src/uts/common/fs/zfs/zfs_vfsops.c index 2292f658b3..c7bfbbaec4 100644 --- a/usr/src/uts/common/fs/zfs/zfs_vfsops.c +++ b/usr/src/uts/common/fs/zfs/zfs_vfsops.c @@ -50,6 +50,7 @@ #include <sys/spa.h> #include <sys/zap.h> #include <sys/sa.h> +#include <sys/sa_impl.h> #include <sys/varargs.h> #include <sys/policy.h> #include <sys/atomic.h> @@ -64,7 +65,6 @@ #include <sys/dnlc.h> #include <sys/dmu_objset.h> #include <sys/spa_boot.h> -#include <sys/sa.h> #include "zfs_comutil.h" int zfsfstype; @@ -578,7 +578,6 @@ static int zfs_space_delta_cb(dmu_object_type_t bonustype, void *data, uint64_t *userp, uint64_t *groupp) { - znode_phys_t *znp = data; int error = 0; /* @@ -597,20 +596,18 @@ zfs_space_delta_cb(dmu_object_type_t bonustype, void *data, return (EEXIST); if (bonustype == DMU_OT_ZNODE) { + znode_phys_t *znp = data; *userp = znp->zp_uid; *groupp = znp->zp_gid; } else { int hdrsize; + sa_hdr_phys_t *sap = data; + sa_hdr_phys_t sa = *sap; + boolean_t swap = B_FALSE; ASSERT(bonustype == DMU_OT_SA); - hdrsize = sa_hdrsize(data); - if (hdrsize != 0) { - *userp = *((uint64_t *)((uintptr_t)data + hdrsize + - SA_UID_OFFSET)); - *groupp = *((uint64_t *)((uintptr_t)data + hdrsize + - SA_GID_OFFSET)); - } else { + if (sa.sa_magic == 0) { /* * This should only happen for newly created * files that haven't had the znode data filled @@ -618,6 +615,25 @@ zfs_space_delta_cb(dmu_object_type_t bonustype, void *data, */ *userp = 0; *groupp = 0; + return (0); + } + if (sa.sa_magic == BSWAP_32(SA_MAGIC)) { + sa.sa_magic = SA_MAGIC; + sa.sa_layout_info = BSWAP_16(sa.sa_layout_info); + swap = B_TRUE; + } else { + VERIFY3U(sa.sa_magic, ==, SA_MAGIC); + } + + hdrsize = sa_hdrsize(&sa); + VERIFY3U(hdrsize, >=, sizeof (sa_hdr_phys_t)); + *userp = *((uint64_t *)((uintptr_t)data + hdrsize + + SA_UID_OFFSET)); + *groupp = *((uint64_t *)((uintptr_t)data + hdrsize + + SA_GID_OFFSET)); + if (swap) { + *userp = BSWAP_64(*userp); + *groupp = BSWAP_64(*groupp); } } return (error); diff --git a/usr/src/uts/common/fs/zfs/zfs_znode.c b/usr/src/uts/common/fs/zfs/zfs_znode.c index 0c86cac427..92dc05f4a0 100644 --- a/usr/src/uts/common/fs/zfs/zfs_znode.c +++ b/usr/src/uts/common/fs/zfs/zfs_znode.c @@ -1947,13 +1947,16 @@ zfs_release_sa_handle(sa_handle_t *hdl, dmu_buf_t *db, void *tag) * or not the object is an extended attribute directory. */ static int -zfs_obj_to_pobj(sa_handle_t *hdl, sa_attr_type_t *sa_table, uint64_t *pobjp, - int *is_xattrdir) +zfs_obj_to_pobj(objset_t *osp, sa_handle_t *hdl, sa_attr_type_t *sa_table, + uint64_t *pobjp, int *is_xattrdir) { uint64_t parent; uint64_t pflags; uint64_t mode; + uint64_t parent_mode; sa_bulk_attr_t bulk[3]; + sa_handle_t *sa_hdl; + dmu_buf_t *sa_db; int count = 0; int error; @@ -1967,9 +1970,32 @@ zfs_obj_to_pobj(sa_handle_t *hdl, sa_attr_type_t *sa_table, uint64_t *pobjp, if ((error = sa_bulk_lookup(hdl, bulk, count)) != 0) return (error); - *pobjp = parent; + /* + * When a link is removed its parent pointer is not changed and will + * be invalid. There are two cases where a link is removed but the + * file stays around, when it goes to the delete queue and when there + * are additional links. + */ + error = zfs_grab_sa_handle(osp, parent, &sa_hdl, &sa_db, FTAG); + if (error != 0) + return (error); + + error = sa_lookup(sa_hdl, ZPL_MODE, &parent_mode, sizeof (parent_mode)); + zfs_release_sa_handle(sa_hdl, sa_db, FTAG); + if (error != 0) + return (error); + *is_xattrdir = ((pflags & ZFS_XATTR) != 0) && S_ISDIR(mode); + /* + * Extended attributes can be applied to files, directories, etc. + * Otherwise the parent must be a directory. + */ + if (!*is_xattrdir && !S_ISDIR(parent_mode)) + return (EINVAL); + + *pobjp = parent; + return (0); } @@ -2018,7 +2044,7 @@ zfs_obj_to_path_impl(objset_t *osp, uint64_t obj, sa_handle_t *hdl, if (prevdb) zfs_release_sa_handle(prevhdl, prevdb, FTAG); - if ((error = zfs_obj_to_pobj(sa_hdl, sa_table, &pobj, + if ((error = zfs_obj_to_pobj(osp, sa_hdl, sa_table, &pobj, &is_xattrdir)) != 0) break; diff --git a/usr/src/uts/common/fs/zfs/zio.c b/usr/src/uts/common/fs/zfs/zio.c index e2e98b7896..00964aa83f 100644 --- a/usr/src/uts/common/fs/zfs/zio.c +++ b/usr/src/uts/common/fs/zfs/zio.c @@ -2928,7 +2928,7 @@ zio_done(zio_t *zio) * Hand it off to the otherwise-unused claim taskq. */ ASSERT(zio->io_tqent.tqent_next == NULL); - (void) taskq_dispatch_ent( + taskq_dispatch_ent( spa->spa_zio_taskq[ZIO_TYPE_CLAIM][ZIO_TASKQ_ISSUE], (task_func_t *)zio_reexecute, zio, 0, &zio->io_tqent); diff --git a/usr/src/uts/common/fs/zfs/zio_inject.c b/usr/src/uts/common/fs/zfs/zio_inject.c index 9ae7d1f697..a9d4ab4070 100644 --- a/usr/src/uts/common/fs/zfs/zio_inject.c +++ b/usr/src/uts/common/fs/zfs/zio_inject.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ /* @@ -147,14 +148,8 @@ zio_handle_fault_injection(zio_t *zio, int error) for (handler = list_head(&inject_handlers); handler != NULL; handler = list_next(&inject_handlers, handler)) { - /* Ignore errors not destined for this pool */ - if (zio->io_spa != handler->zi_spa) - continue; - - /* Ignore device errors and panic injection */ - if (handler->zi_record.zi_guid != 0 || - handler->zi_record.zi_func[0] != '\0' || - handler->zi_record.zi_duration != 0) + if (zio->io_spa != handler->zi_spa || + handler->zi_record.zi_cmd != ZINJECT_DATA_FAULT) continue; /* If this handler matches, return EIO */ @@ -197,10 +192,7 @@ zio_handle_label_injection(zio_t *zio, int error) uint64_t start = handler->zi_record.zi_start; uint64_t end = handler->zi_record.zi_end; - /* Ignore device only faults or panic injection */ - if (handler->zi_record.zi_start == 0 || - handler->zi_record.zi_func[0] != '\0' || - handler->zi_record.zi_duration != 0) + if (handler->zi_record.zi_cmd != ZINJECT_LABEL_FAULT) continue; /* @@ -246,13 +238,7 @@ zio_handle_device_injection(vdev_t *vd, zio_t *zio, int error) for (handler = list_head(&inject_handlers); handler != NULL; handler = list_next(&inject_handlers, handler)) { - /* - * Ignore label specific faults, panic injection - * or fake writes - */ - if (handler->zi_record.zi_start != 0 || - handler->zi_record.zi_func[0] != '\0' || - handler->zi_record.zi_duration != 0) + if (handler->zi_record.zi_cmd != ZINJECT_DEVICE_FAULT) continue; if (vd->vdev_guid == handler->zi_record.zi_guid) { @@ -316,10 +302,8 @@ zio_handle_ignored_writes(zio_t *zio) handler = list_next(&inject_handlers, handler)) { /* Ignore errors not destined for this pool */ - if (zio->io_spa != handler->zi_spa) - continue; - - if (handler->zi_record.zi_duration == 0) + if (zio->io_spa != handler->zi_spa || + handler->zi_record.zi_cmd != ZINJECT_IGNORED_WRITES) continue; /* @@ -355,11 +339,8 @@ spa_handle_ignored_writes(spa_t *spa) for (handler = list_head(&inject_handlers); handler != NULL; handler = list_next(&inject_handlers, handler)) { - /* Ignore errors not destined for this pool */ - if (spa != handler->zi_spa) - continue; - - if (handler->zi_record.zi_duration == 0) + if (spa != handler->zi_spa || + handler->zi_record.zi_cmd != ZINJECT_IGNORED_WRITES) continue; if (handler->zi_record.zi_duration > 0) { @@ -379,6 +360,34 @@ spa_handle_ignored_writes(spa_t *spa) rw_exit(&inject_lock); } +uint64_t +zio_handle_io_delay(zio_t *zio) +{ + vdev_t *vd = zio->io_vd; + inject_handler_t *handler; + uint64_t seconds = 0; + + if (zio_injection_enabled == 0) + return (0); + + rw_enter(&inject_lock, RW_READER); + + for (handler = list_head(&inject_handlers); handler != NULL; + handler = list_next(&inject_handlers, handler)) { + + if (handler->zi_record.zi_cmd != ZINJECT_DELAY_IO) + continue; + + if (vd->vdev_guid == handler->zi_record.zi_guid) { + seconds = handler->zi_record.zi_timer; + break; + } + + } + rw_exit(&inject_lock); + return (seconds); +} + /* * Create a new handler for the given record. We add it to the list, adding * a reference to the spa_t in the process. We increment zio_injection_enabled, diff --git a/usr/src/uts/common/io/1394/adapters/hci1394_extern.c b/usr/src/uts/common/io/1394/adapters/hci1394_extern.c index 1da7580b6b..2faf274fb3 100644 --- a/usr/src/uts/common/io/1394/adapters/hci1394_extern.c +++ b/usr/src/uts/common/io/1394/adapters/hci1394_extern.c @@ -24,8 +24,6 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * hci1394_extern.c * Central location for externs. There are two exceptions to this, @@ -52,7 +50,7 @@ uint32_t hci1394_split_timeout = 800; /* - * 1394 address map for OpenHCI adpaters. + * 1394 address map for OpenHCI adapters. * * This is what is reported to the services layer. The hci1394 driver does not * modify the HW to reflect this. This should reflect what the OpenHCI 1.0 HW diff --git a/usr/src/uts/common/io/blkdev/blkdev.c b/usr/src/uts/common/io/blkdev/blkdev.c index 3410fad1ec..20e3a5737e 100644 --- a/usr/src/uts/common/io/blkdev/blkdev.c +++ b/usr/src/uts/common/io/blkdev/blkdev.c @@ -20,8 +20,9 @@ */ /* * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2011, 2012 Nexenta Systems, Inc. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. * Copyright 2012 Garrett D'Amore <garrett@damore.org>. All rights reserved. + * Copyright 2012 Alexey Zaytsev <alexey.zaytsev@gmail.com> All rights reserved. */ #include <sys/types.h> @@ -503,7 +504,7 @@ bd_xfer_ctor(void *buf, void *arg, int kmflag) bd_t *bd = arg; int (*dcb)(caddr_t); - if (kmflag == KM_SLEEP) { + if (kmflag == KM_PUSHPAGE || kmflag == KM_SLEEP) { dcb = DDI_DMA_SLEEP; } else { dcb = DDI_DMA_DONTWAIT; diff --git a/usr/src/uts/common/io/e1000g/e1000g_tx.c b/usr/src/uts/common/io/e1000g/e1000g_tx.c index a696aec5a5..1f8a51d291 100644 --- a/usr/src/uts/common/io/e1000g/e1000g_tx.c +++ b/usr/src/uts/common/io/e1000g/e1000g_tx.c @@ -668,10 +668,12 @@ e1000g_fill_tx_ring(e1000g_tx_ring_t *tx_ring, LIST_DESCRIBER *pending_list, * drivers do not have this issue because they (harmlessly) set the * POPTS field on every data descriptor to be the intended options for * the entire packet. To circumvent this QEMU bug, we engage in this - * same behavior iff our type matches that which is emulated by QEMU - * (the 82540). + * same behavior iff the subsystem vendor and device IDs indicate that + * this is an emulated QEMU device (1af4,1100). */ - if (hw->mac.type == e1000_82540 && cur_context->cksum_flags) { + if (hw->subsystem_vendor_id == 0x1af4 && + hw->subsystem_device_id == 0x1100 && + cur_context->cksum_flags) { if (cur_context->cksum_flags & HCK_IPV4_HDRCKSUM) zeroed.upper.fields.popts |= E1000_TXD_POPTS_IXSM; diff --git a/usr/src/uts/common/io/igb/igb_regs.h b/usr/src/uts/common/io/igb/igb_regs.h index a2b2450b67..b554ef6d23 100644 --- a/usr/src/uts/common/io/igb/igb_regs.h +++ b/usr/src/uts/common/io/igb/igb_regs.h @@ -216,7 +216,7 @@ extern "C" { /* Packet Buffer DWORD (_n) */ #define E1000_PBSLAD(_n) (0x03110 + (0x4 * (_n))) #define E1000_TXPBS 0x03404 /* Tx Packet Buffer Size - RW */ -/* Same as TXPBS, renamed for newer adpaters - RW */ +/* Same as TXPBS, renamed for newer adapters - RW */ #define E1000_ITPBS 0x03404 #define E1000_TDFH 0x03410 /* Tx Data FIFO Head - RW */ #define E1000_TDFT 0x03418 /* Tx Data FIFO Tail - RW */ diff --git a/usr/src/uts/common/io/ipw/ipw2100.c b/usr/src/uts/common/io/ipw/ipw2100.c index 2559c64762..8afe91725e 100644 --- a/usr/src/uts/common/io/ipw/ipw2100.c +++ b/usr/src/uts/common/io/ipw/ipw2100.c @@ -1273,7 +1273,7 @@ ipw2100_chip_reset(struct ipw2100_softc *sc) ipw2100_master_stop(sc); /* - * move adatper to DO state + * move adapter to DO state */ tmp = ipw2100_csr_get32(sc, IPW2100_CSR_CTL); ipw2100_csr_put32(sc, IPW2100_CSR_CTL, tmp | IPW2100_CTL_INIT); diff --git a/usr/src/uts/common/io/iwi/ipw2200.h b/usr/src/uts/common/io/iwi/ipw2200.h index b7676ffffa..58c3701ba2 100644 --- a/usr/src/uts/common/io/iwi/ipw2200.h +++ b/usr/src/uts/common/io/iwi/ipw2200.h @@ -38,7 +38,7 @@ extern "C" { #endif /* - * Intel Wireless PRO/2200 mini-pci adpater drier + * Intel Wireless PRO/2200 mini-pci adapter drier * ipw2200.h: common definitions and interface to user land application */ #include <sys/types.h> diff --git a/usr/src/uts/common/io/vioblk/vioblk.c b/usr/src/uts/common/io/vioblk/vioblk.c new file mode 100644 index 0000000000..4d63b7b7ea --- /dev/null +++ b/usr/src/uts/common/io/vioblk/vioblk.c @@ -0,0 +1,1072 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2012, Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2012, Alexey Zaytsev <alexey.zaytsev@gmail.com> + */ + + +#include <sys/modctl.h> +#include <sys/blkdev.h> +#include <sys/types.h> +#include <sys/errno.h> +#include <sys/param.h> +#include <sys/stropts.h> +#include <sys/stream.h> +#include <sys/strsubr.h> +#include <sys/kmem.h> +#include <sys/conf.h> +#include <sys/devops.h> +#include <sys/ksynch.h> +#include <sys/stat.h> +#include <sys/modctl.h> +#include <sys/debug.h> +#include <sys/pci.h> +#include <sys/sysmacros.h> +#include "virtiovar.h" +#include "virtioreg.h" + +/* Feature bits */ +#define VIRTIO_BLK_F_BARRIER (1<<0) +#define VIRTIO_BLK_F_SIZE_MAX (1<<1) +#define VIRTIO_BLK_F_SEG_MAX (1<<2) +#define VIRTIO_BLK_F_GEOMETRY (1<<4) +#define VIRTIO_BLK_F_RO (1<<5) +#define VIRTIO_BLK_F_BLK_SIZE (1<<6) +#define VIRTIO_BLK_F_SCSI (1<<7) +#define VIRTIO_BLK_F_FLUSH (1<<9) +#define VIRTIO_BLK_F_TOPOLOGY (1<<10) + +/* Configuration registers */ +#define VIRTIO_BLK_CONFIG_CAPACITY 0 /* 64bit */ +#define VIRTIO_BLK_CONFIG_SIZE_MAX 8 /* 32bit */ +#define VIRTIO_BLK_CONFIG_SEG_MAX 12 /* 32bit */ +#define VIRTIO_BLK_CONFIG_GEOMETRY_C 16 /* 16bit */ +#define VIRTIO_BLK_CONFIG_GEOMETRY_H 18 /* 8bit */ +#define VIRTIO_BLK_CONFIG_GEOMETRY_S 19 /* 8bit */ +#define VIRTIO_BLK_CONFIG_BLK_SIZE 20 /* 32bit */ +#define VIRTIO_BLK_CONFIG_TOPOLOGY 24 /* 32bit */ + +/* Command */ +#define VIRTIO_BLK_T_IN 0 +#define VIRTIO_BLK_T_OUT 1 +#define VIRTIO_BLK_T_SCSI_CMD 2 +#define VIRTIO_BLK_T_SCSI_CMD_OUT 3 +#define VIRTIO_BLK_T_FLUSH 4 +#define VIRTIO_BLK_T_FLUSH_OUT 5 +#define VIRTIO_BLK_T_GET_ID 8 +#define VIRTIO_BLK_T_BARRIER 0x80000000 + +#define VIRTIO_BLK_ID_BYTES 20 /* devid */ + +/* Statuses */ +#define VIRTIO_BLK_S_OK 0 +#define VIRTIO_BLK_S_IOERR 1 +#define VIRTIO_BLK_S_UNSUPP 2 + +#define DEF_MAXINDIRECT (128) +#define DEF_MAXSECTOR (4096) + +#define VIOBLK_POISON 0xdead0001dead0001 + +/* + * Static Variables. + */ +static char vioblk_ident[] = "VirtIO block driver"; + +/* Request header structure */ +struct vioblk_req_hdr { + uint32_t type; /* VIRTIO_BLK_T_* */ + uint32_t ioprio; + uint64_t sector; +}; + +struct vioblk_req { + struct vioblk_req_hdr hdr; + uint8_t status; + uint8_t unused[3]; + unsigned int ndmac; + ddi_dma_handle_t dmah; + ddi_dma_handle_t bd_dmah; + ddi_dma_cookie_t dmac; + bd_xfer_t *xfer; +}; + +struct vioblk_stats { + struct kstat_named sts_rw_outofmemory; + struct kstat_named sts_rw_badoffset; + struct kstat_named sts_rw_queuemax; + struct kstat_named sts_rw_cookiesmax; + struct kstat_named sts_rw_cacheflush; + struct kstat_named sts_intr_queuemax; + struct kstat_named sts_intr_total; + struct kstat_named sts_io_errors; + struct kstat_named sts_unsupp_errors; + struct kstat_named sts_nxio_errors; +}; + +struct vioblk_lstats { + uint64_t rw_cacheflush; + uint64_t intr_total; + unsigned int rw_cookiesmax; + unsigned int intr_queuemax; + unsigned int io_errors; + unsigned int unsupp_errors; + unsigned int nxio_errors; +}; + +struct vioblk_softc { + dev_info_t *sc_dev; /* mirrors virtio_softc->sc_dev */ + struct virtio_softc sc_virtio; + struct virtqueue *sc_vq; + bd_handle_t bd_h; + struct vioblk_req *sc_reqs; + struct vioblk_stats *ks_data; + kstat_t *sc_intrstat; + uint64_t sc_capacity; + uint64_t sc_nblks; + struct vioblk_lstats sc_stats; + short sc_blkflags; + boolean_t sc_in_poll_mode; + boolean_t sc_readonly; + int sc_blk_size; + int sc_seg_max; + int sc_seg_size_max; + kmutex_t lock_devid; + kcondvar_t cv_devid; + char devid[VIRTIO_BLK_ID_BYTES + 1]; +}; + +static int vioblk_read(void *arg, bd_xfer_t *xfer); +static int vioblk_write(void *arg, bd_xfer_t *xfer); +static int vioblk_flush(void *arg, bd_xfer_t *xfer); +static void vioblk_driveinfo(void *arg, bd_drive_t *drive); +static int vioblk_mediainfo(void *arg, bd_media_t *media); +static int vioblk_devid_init(void *, dev_info_t *, ddi_devid_t *); +uint_t vioblk_int_handler(caddr_t arg1, caddr_t arg2); + +static bd_ops_t vioblk_ops = { + BD_OPS_VERSION_0, + vioblk_driveinfo, + vioblk_mediainfo, + vioblk_devid_init, + vioblk_flush, + vioblk_read, + vioblk_write, +}; + +static int vioblk_quiesce(dev_info_t *); +static int vioblk_attach(dev_info_t *, ddi_attach_cmd_t); +static int vioblk_detach(dev_info_t *, ddi_detach_cmd_t); + +static struct dev_ops vioblk_dev_ops = { + DEVO_REV, + 0, + ddi_no_info, + nulldev, /* identify */ + nulldev, /* probe */ + vioblk_attach, /* attach */ + vioblk_detach, /* detach */ + nodev, /* reset */ + NULL, /* cb_ops */ + NULL, /* bus_ops */ + NULL, /* power */ + vioblk_quiesce /* quiesce */ +}; + + + +/* Standard Module linkage initialization for a Streams driver */ +extern struct mod_ops mod_driverops; + +static struct modldrv modldrv = { + &mod_driverops, /* Type of module. This one is a driver */ + vioblk_ident, /* short description */ + &vioblk_dev_ops /* driver specific ops */ +}; + +static struct modlinkage modlinkage = { + MODREV_1, + { + (void *)&modldrv, + NULL, + }, +}; + +ddi_device_acc_attr_t vioblk_attr = { + DDI_DEVICE_ATTR_V0, + DDI_NEVERSWAP_ACC, /* virtio is always native byte order */ + DDI_STORECACHING_OK_ACC, + DDI_DEFAULT_ACC +}; + +/* DMA attr for the header/status blocks. */ +static ddi_dma_attr_t vioblk_req_dma_attr = { + DMA_ATTR_V0, /* dma_attr version */ + 0, /* dma_attr_addr_lo */ + 0xFFFFFFFFFFFFFFFFull, /* dma_attr_addr_hi */ + 0x00000000FFFFFFFFull, /* dma_attr_count_max */ + 1, /* dma_attr_align */ + 1, /* dma_attr_burstsizes */ + 1, /* dma_attr_minxfer */ + 0xFFFFFFFFull, /* dma_attr_maxxfer */ + 0xFFFFFFFFFFFFFFFFull, /* dma_attr_seg */ + 1, /* dma_attr_sgllen */ + 1, /* dma_attr_granular */ + 0, /* dma_attr_flags */ +}; + +/* DMA attr for the data blocks. */ +static ddi_dma_attr_t vioblk_bd_dma_attr = { + DMA_ATTR_V0, /* dma_attr version */ + 0, /* dma_attr_addr_lo */ + 0xFFFFFFFFFFFFFFFFull, /* dma_attr_addr_hi */ + 0x00000000FFFFFFFFull, /* dma_attr_count_max */ + 1, /* dma_attr_align */ + 1, /* dma_attr_burstsizes */ + 1, /* dma_attr_minxfer */ + 0, /* dma_attr_maxxfer, set in attach */ + 0xFFFFFFFFFFFFFFFFull, /* dma_attr_seg */ + 0, /* dma_attr_sgllen, set in attach */ + 1, /* dma_attr_granular */ + 0, /* dma_attr_flags */ +}; + +static int +vioblk_rw(struct vioblk_softc *sc, bd_xfer_t *xfer, int type, + uint32_t len) +{ + struct vioblk_req *req; + struct vq_entry *ve_hdr; + int total_cookies, write; + + write = (type == VIRTIO_BLK_T_OUT || + type == VIRTIO_BLK_T_FLUSH_OUT) ? 1 : 0; + total_cookies = 2; + + if ((xfer->x_blkno + xfer->x_nblks) > sc->sc_nblks) { + sc->ks_data->sts_rw_badoffset.value.ui64++; + return (EINVAL); + } + + /* allocate top entry */ + ve_hdr = vq_alloc_entry(sc->sc_vq); + if (!ve_hdr) { + sc->ks_data->sts_rw_outofmemory.value.ui64++; + return (ENOMEM); + } + + /* getting request */ + req = &sc->sc_reqs[ve_hdr->qe_index]; + req->hdr.type = type; + req->hdr.ioprio = 0; + req->hdr.sector = xfer->x_blkno; + req->xfer = xfer; + + /* Header */ + virtio_ve_add_indirect_buf(ve_hdr, req->dmac.dmac_laddress, + sizeof (struct vioblk_req_hdr), B_TRUE); + + /* Payload */ + if (len > 0) { + virtio_ve_add_cookie(ve_hdr, xfer->x_dmah, xfer->x_dmac, + xfer->x_ndmac, write ? B_TRUE : B_FALSE); + total_cookies += xfer->x_ndmac; + } + + /* Status */ + virtio_ve_add_indirect_buf(ve_hdr, + req->dmac.dmac_laddress + sizeof (struct vioblk_req_hdr), + sizeof (uint8_t), B_FALSE); + + /* sending the whole chain to the device */ + virtio_push_chain(ve_hdr, B_TRUE); + + if (sc->sc_stats.rw_cookiesmax < total_cookies) + sc->sc_stats.rw_cookiesmax = total_cookies; + + return (DDI_SUCCESS); +} + +/* + * Now in polling mode. Interrupts are off, so we + * 1) poll for the already queued requests to complete. + * 2) push our request. + * 3) wait for our request to complete. + */ +static int +vioblk_rw_poll(struct vioblk_softc *sc, bd_xfer_t *xfer, + int type, uint32_t len) +{ + clock_t tmout; + int ret; + + ASSERT(xfer->x_flags & BD_XFER_POLL); + + /* Prevent a hard hang. */ + tmout = drv_usectohz(30000000); + + /* Poll for an empty queue */ + while (vq_num_used(sc->sc_vq)) { + /* Check if any pending requests completed. */ + ret = vioblk_int_handler((caddr_t)&sc->sc_virtio, NULL); + if (ret != DDI_INTR_CLAIMED) { + drv_usecwait(10); + tmout -= 10; + return (ETIMEDOUT); + } + } + + ret = vioblk_rw(sc, xfer, type, len); + if (ret) + return (ret); + + tmout = drv_usectohz(30000000); + /* Poll for an empty queue again. */ + while (vq_num_used(sc->sc_vq)) { + /* Check if any pending requests completed. */ + ret = vioblk_int_handler((caddr_t)&sc->sc_virtio, NULL); + if (ret != DDI_INTR_CLAIMED) { + drv_usecwait(10); + tmout -= 10; + return (ETIMEDOUT); + } + } + + return (DDI_SUCCESS); +} + +static int +vioblk_read(void *arg, bd_xfer_t *xfer) +{ + int ret; + struct vioblk_softc *sc = (void *)arg; + + if (xfer->x_flags & BD_XFER_POLL) { + if (!sc->sc_in_poll_mode) { + virtio_stop_vq_intr(sc->sc_vq); + sc->sc_in_poll_mode = 1; + } + + ret = vioblk_rw_poll(sc, xfer, VIRTIO_BLK_T_IN, + xfer->x_nblks * DEV_BSIZE); + } else { + if (sc->sc_in_poll_mode) { + virtio_start_vq_intr(sc->sc_vq); + sc->sc_in_poll_mode = 0; + } + + ret = vioblk_rw(sc, xfer, VIRTIO_BLK_T_IN, + xfer->x_nblks * DEV_BSIZE); + } + + return (ret); +} + +static int +vioblk_write(void *arg, bd_xfer_t *xfer) +{ + int ret; + struct vioblk_softc *sc = (void *)arg; + + if (xfer->x_flags & BD_XFER_POLL) { + if (!sc->sc_in_poll_mode) { + virtio_stop_vq_intr(sc->sc_vq); + sc->sc_in_poll_mode = 1; + } + + ret = vioblk_rw_poll(sc, xfer, VIRTIO_BLK_T_OUT, + xfer->x_nblks * DEV_BSIZE); + } else { + if (sc->sc_in_poll_mode) { + virtio_start_vq_intr(sc->sc_vq); + sc->sc_in_poll_mode = 0; + } + + ret = vioblk_rw(sc, xfer, VIRTIO_BLK_T_OUT, + xfer->x_nblks * DEV_BSIZE); + } + return (ret); +} + +static int +vioblk_flush(void *arg, bd_xfer_t *xfer) +{ + int ret; + struct vioblk_softc *sc = (void *)arg; + + ASSERT((xfer->x_flags & BD_XFER_POLL) == 0); + + ret = vioblk_rw(sc, xfer, VIRTIO_BLK_T_FLUSH_OUT, + xfer->x_nblks * DEV_BSIZE); + + if (!ret) + sc->sc_stats.rw_cacheflush++; + + return (ret); +} + + +static void +vioblk_driveinfo(void *arg, bd_drive_t *drive) +{ + struct vioblk_softc *sc = (void *)arg; + + drive->d_qsize = sc->sc_vq->vq_num; + drive->d_removable = B_FALSE; + drive->d_hotpluggable = B_TRUE; + drive->d_target = 0; + drive->d_lun = 0; +} + +static int +vioblk_mediainfo(void *arg, bd_media_t *media) +{ + struct vioblk_softc *sc = (void *)arg; + + media->m_nblks = sc->sc_nblks; + media->m_blksize = DEV_BSIZE; + media->m_readonly = sc->sc_readonly; + return (0); +} + +static int +vioblk_devid_init(void *arg, dev_info_t *devinfo, ddi_devid_t *devid) +{ + struct vioblk_softc *sc = (void *)arg; + clock_t deadline; + int ret; + bd_xfer_t xfer; + + deadline = ddi_get_lbolt() + (clock_t)drv_usectohz(3 * 1000000); + (void) memset(&xfer, 0, sizeof (bd_xfer_t)); + xfer.x_nblks = 1; + + ret = ddi_dma_alloc_handle(sc->sc_dev, &vioblk_bd_dma_attr, + DDI_DMA_SLEEP, NULL, &xfer.x_dmah); + if (ret != DDI_SUCCESS) + goto out_alloc; + + ret = ddi_dma_addr_bind_handle(xfer.x_dmah, NULL, (caddr_t)&sc->devid, + VIRTIO_BLK_ID_BYTES, DDI_DMA_READ | DDI_DMA_CONSISTENT, + DDI_DMA_SLEEP, NULL, &xfer.x_dmac, &xfer.x_ndmac); + if (ret != DDI_DMA_MAPPED) { + ret = DDI_FAILURE; + goto out_map; + } + + mutex_enter(&sc->lock_devid); + + ret = vioblk_rw(sc, &xfer, VIRTIO_BLK_T_GET_ID, + VIRTIO_BLK_ID_BYTES); + if (ret) { + mutex_exit(&sc->lock_devid); + goto out_rw; + } + + /* wait for reply */ + ret = cv_timedwait(&sc->cv_devid, &sc->lock_devid, deadline); + mutex_exit(&sc->lock_devid); + + (void) ddi_dma_unbind_handle(xfer.x_dmah); + ddi_dma_free_handle(&xfer.x_dmah); + + /* timeout */ + if (ret < 0) { + dev_err(devinfo, CE_WARN, "Cannot get devid from the device"); + return (DDI_FAILURE); + } + + ret = ddi_devid_init(devinfo, DEVID_ATA_SERIAL, + VIRTIO_BLK_ID_BYTES, sc->devid, devid); + if (ret != DDI_SUCCESS) { + dev_err(devinfo, CE_WARN, "Cannot build devid from the device"); + return (ret); + } + + dev_debug(sc->sc_dev, CE_NOTE, + "devid %x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x%x", + sc->devid[0], sc->devid[1], sc->devid[2], sc->devid[3], + sc->devid[4], sc->devid[5], sc->devid[6], sc->devid[7], + sc->devid[8], sc->devid[9], sc->devid[10], sc->devid[11], + sc->devid[12], sc->devid[13], sc->devid[14], sc->devid[15], + sc->devid[16], sc->devid[17], sc->devid[18], sc->devid[19]); + + return (0); + +out_rw: + (void) ddi_dma_unbind_handle(xfer.x_dmah); +out_map: + ddi_dma_free_handle(&xfer.x_dmah); +out_alloc: + return (ret); +} + +static void +vioblk_show_features(struct vioblk_softc *sc, const char *prefix, + uint32_t features) +{ + char buf[512]; + char *bufp = buf; + char *bufend = buf + sizeof (buf); + + /* LINTED E_PTRDIFF_OVERFLOW */ + bufp += snprintf(bufp, bufend - bufp, prefix); + + /* LINTED E_PTRDIFF_OVERFLOW */ + bufp += virtio_show_features(features, bufp, bufend - bufp); + + + /* LINTED E_PTRDIFF_OVERFLOW */ + bufp += snprintf(bufp, bufend - bufp, "Vioblk ( "); + + if (features & VIRTIO_BLK_F_BARRIER) + /* LINTED E_PTRDIFF_OVERFLOW */ + bufp += snprintf(bufp, bufend - bufp, "BARRIER "); + if (features & VIRTIO_BLK_F_SIZE_MAX) + /* LINTED E_PTRDIFF_OVERFLOW */ + bufp += snprintf(bufp, bufend - bufp, "SIZE_MAX "); + if (features & VIRTIO_BLK_F_SEG_MAX) + /* LINTED E_PTRDIFF_OVERFLOW */ + bufp += snprintf(bufp, bufend - bufp, "SEG_MAX "); + if (features & VIRTIO_BLK_F_GEOMETRY) + /* LINTED E_PTRDIFF_OVERFLOW */ + bufp += snprintf(bufp, bufend - bufp, "GEOMETRY "); + if (features & VIRTIO_BLK_F_RO) + /* LINTED E_PTRDIFF_OVERFLOW */ + bufp += snprintf(bufp, bufend - bufp, "RO "); + if (features & VIRTIO_BLK_F_BLK_SIZE) + /* LINTED E_PTRDIFF_OVERFLOW */ + bufp += snprintf(bufp, bufend - bufp, "BLK_SIZE "); + if (features & VIRTIO_BLK_F_SCSI) + /* LINTED E_PTRDIFF_OVERFLOW */ + bufp += snprintf(bufp, bufend - bufp, "SCSI "); + if (features & VIRTIO_BLK_F_FLUSH) + /* LINTED E_PTRDIFF_OVERFLOW */ + bufp += snprintf(bufp, bufend - bufp, "FLUSH "); + if (features & VIRTIO_BLK_F_TOPOLOGY) + /* LINTED E_PTRDIFF_OVERFLOW */ + bufp += snprintf(bufp, bufend - bufp, "TOPOLOGY "); + + /* LINTED E_PTRDIFF_OVERFLOW */ + bufp += snprintf(bufp, bufend - bufp, ")"); + *bufp = '\0'; + + dev_debug(sc->sc_dev, CE_NOTE, "%s", buf); +} + +static int +vioblk_dev_features(struct vioblk_softc *sc) +{ + uint32_t host_features; + + host_features = virtio_negotiate_features(&sc->sc_virtio, + VIRTIO_BLK_F_RO | + VIRTIO_BLK_F_GEOMETRY | + VIRTIO_BLK_F_BLK_SIZE | + VIRTIO_BLK_F_FLUSH | + VIRTIO_BLK_F_SEG_MAX | + VIRTIO_BLK_F_SIZE_MAX | + VIRTIO_F_RING_INDIRECT_DESC); + + vioblk_show_features(sc, "Host features: ", host_features); + vioblk_show_features(sc, "Negotiated features: ", + sc->sc_virtio.sc_features); + + if (!(sc->sc_virtio.sc_features & VIRTIO_F_RING_INDIRECT_DESC)) { + dev_err(sc->sc_dev, CE_NOTE, + "Host does not support RING_INDIRECT_DESC, bye."); + return (DDI_FAILURE); + } + + return (DDI_SUCCESS); +} + +/* ARGSUSED */ +uint_t +vioblk_int_handler(caddr_t arg1, caddr_t arg2) +{ + struct virtio_softc *vsc = (void *)arg1; + struct vioblk_softc *sc = container_of(vsc, + struct vioblk_softc, sc_virtio); + struct vq_entry *ve; + uint32_t len; + int i = 0, error; + + while ((ve = virtio_pull_chain(sc->sc_vq, &len))) { + struct vioblk_req *req = &sc->sc_reqs[ve->qe_index]; + bd_xfer_t *xfer = req->xfer; + uint8_t status = req->status; + uint32_t type = req->hdr.type; + + if (req->xfer == (void *)VIOBLK_POISON) { + dev_err(sc->sc_dev, CE_WARN, "Poisoned descriptor!"); + virtio_free_chain(ve); + return (DDI_INTR_CLAIMED); + } + + req->xfer = (void *) VIOBLK_POISON; + + /* Note: blkdev tears down the payload mapping for us. */ + virtio_free_chain(ve); + + /* returning payload back to blkdev */ + switch (status) { + case VIRTIO_BLK_S_OK: + error = 0; + break; + case VIRTIO_BLK_S_IOERR: + error = EIO; + sc->sc_stats.io_errors++; + break; + case VIRTIO_BLK_S_UNSUPP: + sc->sc_stats.unsupp_errors++; + error = ENOTTY; + break; + default: + sc->sc_stats.nxio_errors++; + error = ENXIO; + break; + } + + if (type == VIRTIO_BLK_T_GET_ID) { + /* notify devid_init */ + mutex_enter(&sc->lock_devid); + cv_broadcast(&sc->cv_devid); + mutex_exit(&sc->lock_devid); + } else + bd_xfer_done(xfer, error); + + i++; + } + + /* update stats */ + if (sc->sc_stats.intr_queuemax < i) + sc->sc_stats.intr_queuemax = i; + sc->sc_stats.intr_total++; + + return (DDI_INTR_CLAIMED); +} + +/* ARGSUSED */ +uint_t +vioblk_config_handler(caddr_t arg1, caddr_t arg2) +{ + return (DDI_INTR_CLAIMED); +} + +static int +vioblk_register_ints(struct vioblk_softc *sc) +{ + int ret; + + struct virtio_int_handler vioblk_conf_h = { + vioblk_config_handler + }; + + struct virtio_int_handler vioblk_vq_h[] = { + { vioblk_int_handler }, + { NULL }, + }; + + ret = virtio_register_ints(&sc->sc_virtio, + &vioblk_conf_h, vioblk_vq_h); + + return (ret); +} + +static void +vioblk_free_reqs(struct vioblk_softc *sc) +{ + int i, qsize; + + qsize = sc->sc_vq->vq_num; + + for (i = 0; i < qsize; i++) { + struct vioblk_req *req = &sc->sc_reqs[i]; + + if (req->ndmac) + (void) ddi_dma_unbind_handle(req->dmah); + + if (req->dmah) + ddi_dma_free_handle(&req->dmah); + } + + kmem_free(sc->sc_reqs, sizeof (struct vioblk_req) * qsize); +} + +static int +vioblk_alloc_reqs(struct vioblk_softc *sc) +{ + int i, qsize; + int ret; + + qsize = sc->sc_vq->vq_num; + + sc->sc_reqs = kmem_zalloc(sizeof (struct vioblk_req) * qsize, KM_SLEEP); + + for (i = 0; i < qsize; i++) { + struct vioblk_req *req = &sc->sc_reqs[i]; + + ret = ddi_dma_alloc_handle(sc->sc_dev, &vioblk_req_dma_attr, + DDI_DMA_SLEEP, NULL, &req->dmah); + if (ret != DDI_SUCCESS) { + + dev_err(sc->sc_dev, CE_WARN, + "Can't allocate dma handle for req " + "buffer %d", i); + goto exit; + } + + ret = ddi_dma_addr_bind_handle(req->dmah, NULL, + (caddr_t)&req->hdr, + sizeof (struct vioblk_req_hdr) + sizeof (uint8_t), + DDI_DMA_RDWR | DDI_DMA_CONSISTENT, DDI_DMA_SLEEP, + NULL, &req->dmac, &req->ndmac); + if (ret != DDI_DMA_MAPPED) { + dev_err(sc->sc_dev, CE_WARN, + "Can't bind req buffer %d", i); + goto exit; + } + } + + return (0); + +exit: + vioblk_free_reqs(sc); + return (ENOMEM); +} + + +static int +vioblk_ksupdate(kstat_t *ksp, int rw) +{ + struct vioblk_softc *sc = ksp->ks_private; + + if (rw == KSTAT_WRITE) + return (EACCES); + + sc->ks_data->sts_rw_cookiesmax.value.ui32 = sc->sc_stats.rw_cookiesmax; + sc->ks_data->sts_intr_queuemax.value.ui32 = sc->sc_stats.intr_queuemax; + sc->ks_data->sts_unsupp_errors.value.ui32 = sc->sc_stats.unsupp_errors; + sc->ks_data->sts_nxio_errors.value.ui32 = sc->sc_stats.nxio_errors; + sc->ks_data->sts_io_errors.value.ui32 = sc->sc_stats.io_errors; + sc->ks_data->sts_rw_cacheflush.value.ui64 = sc->sc_stats.rw_cacheflush; + sc->ks_data->sts_intr_total.value.ui64 = sc->sc_stats.intr_total; + + + return (0); +} + +static int +vioblk_attach(dev_info_t *devinfo, ddi_attach_cmd_t cmd) +{ + int ret = DDI_SUCCESS; + int instance; + struct vioblk_softc *sc; + struct virtio_softc *vsc; + struct vioblk_stats *ks_data; + + instance = ddi_get_instance(devinfo); + + switch (cmd) { + case DDI_ATTACH: + break; + + case DDI_RESUME: + case DDI_PM_RESUME: + dev_err(devinfo, CE_WARN, "resume not supported yet"); + ret = DDI_FAILURE; + goto exit; + + default: + dev_err(devinfo, CE_WARN, "cmd 0x%x not recognized", cmd); + ret = DDI_FAILURE; + goto exit; + } + + sc = kmem_zalloc(sizeof (struct vioblk_softc), KM_SLEEP); + ddi_set_driver_private(devinfo, sc); + + vsc = &sc->sc_virtio; + + /* Duplicate for faster access / less typing */ + sc->sc_dev = devinfo; + vsc->sc_dev = devinfo; + + cv_init(&sc->cv_devid, NULL, CV_DRIVER, NULL); + mutex_init(&sc->lock_devid, NULL, MUTEX_DRIVER, NULL); + + /* + * Initialize interrupt kstat. This should not normally fail, since + * we don't use a persistent stat. We do it this way to avoid having + * to test for it at run time on the hot path. + */ + sc->sc_intrstat = kstat_create("vioblk", instance, + "intrs", "controller", KSTAT_TYPE_NAMED, + sizeof (struct vioblk_stats) / sizeof (kstat_named_t), + KSTAT_FLAG_PERSISTENT); + if (sc->sc_intrstat == NULL) { + dev_err(devinfo, CE_WARN, "kstat_create failed"); + goto exit_intrstat; + } + ks_data = (struct vioblk_stats *)sc->sc_intrstat->ks_data; + kstat_named_init(&ks_data->sts_rw_outofmemory, + "total_rw_outofmemory", KSTAT_DATA_UINT64); + kstat_named_init(&ks_data->sts_rw_badoffset, + "total_rw_badoffset", KSTAT_DATA_UINT64); + kstat_named_init(&ks_data->sts_intr_total, + "total_intr", KSTAT_DATA_UINT64); + kstat_named_init(&ks_data->sts_io_errors, + "total_io_errors", KSTAT_DATA_UINT32); + kstat_named_init(&ks_data->sts_unsupp_errors, + "total_unsupp_errors", KSTAT_DATA_UINT32); + kstat_named_init(&ks_data->sts_nxio_errors, + "total_nxio_errors", KSTAT_DATA_UINT32); + kstat_named_init(&ks_data->sts_rw_cacheflush, + "total_rw_cacheflush", KSTAT_DATA_UINT64); + kstat_named_init(&ks_data->sts_rw_cookiesmax, + "max_rw_cookies", KSTAT_DATA_UINT32); + kstat_named_init(&ks_data->sts_intr_queuemax, + "max_intr_queue", KSTAT_DATA_UINT32); + sc->ks_data = ks_data; + sc->sc_intrstat->ks_private = sc; + sc->sc_intrstat->ks_update = vioblk_ksupdate; + kstat_install(sc->sc_intrstat); + + /* map BAR0 */ + ret = ddi_regs_map_setup(devinfo, 1, + (caddr_t *)&sc->sc_virtio.sc_io_addr, + 0, 0, &vioblk_attr, &sc->sc_virtio.sc_ioh); + if (ret != DDI_SUCCESS) { + dev_err(devinfo, CE_WARN, "unable to map bar0: [%d]", ret); + goto exit_map; + } + + virtio_device_reset(&sc->sc_virtio); + virtio_set_status(&sc->sc_virtio, VIRTIO_CONFIG_DEVICE_STATUS_ACK); + virtio_set_status(&sc->sc_virtio, VIRTIO_CONFIG_DEVICE_STATUS_DRIVER); + + if (vioblk_register_ints(sc)) { + dev_err(devinfo, CE_WARN, "Unable to add interrupt"); + goto exit_int; + } + + ret = vioblk_dev_features(sc); + if (ret) + goto exit_features; + + if (sc->sc_virtio.sc_features & VIRTIO_BLK_F_RO) + sc->sc_readonly = B_TRUE; + else + sc->sc_readonly = B_FALSE; + + sc->sc_capacity = virtio_read_device_config_8(&sc->sc_virtio, + VIRTIO_BLK_CONFIG_CAPACITY); + sc->sc_nblks = sc->sc_capacity; + + /* + * BLK_SIZE is just a hint for the optimal logical block + * granularity. Ignored for now. + */ + sc->sc_blk_size = DEV_BSIZE; + if (sc->sc_virtio.sc_features & VIRTIO_BLK_F_BLK_SIZE) { + sc->sc_blk_size = virtio_read_device_config_4(&sc->sc_virtio, + VIRTIO_BLK_CONFIG_BLK_SIZE); + } + + /* Flushing is not supported. */ + if (!(sc->sc_virtio.sc_features & VIRTIO_BLK_F_FLUSH)) { + vioblk_ops.o_sync_cache = NULL; + } + + sc->sc_seg_max = DEF_MAXINDIRECT; + /* The max number of segments (cookies) in a request */ + if (sc->sc_virtio.sc_features & VIRTIO_BLK_F_SEG_MAX) { + sc->sc_seg_max = virtio_read_device_config_4(&sc->sc_virtio, + VIRTIO_BLK_CONFIG_SEG_MAX); + + /* That's what Linux does. */ + if (!sc->sc_seg_max) + sc->sc_seg_max = 1; + + /* + * SEG_MAX corresponds to the number of _data_ + * blocks in a request + */ + sc->sc_seg_max += 2; + } + /* 2 descriptors taken for header/status */ + vioblk_bd_dma_attr.dma_attr_sgllen = sc->sc_seg_max - 2; + + + /* The maximum size for a cookie in a request. */ + sc->sc_seg_size_max = DEF_MAXSECTOR; + if (sc->sc_virtio.sc_features & VIRTIO_BLK_F_SIZE_MAX) { + sc->sc_seg_size_max = virtio_read_device_config_4( + &sc->sc_virtio, VIRTIO_BLK_CONFIG_SIZE_MAX); + } + + /* The maximum request size */ + vioblk_bd_dma_attr.dma_attr_maxxfer = + vioblk_bd_dma_attr.dma_attr_sgllen * sc->sc_seg_size_max; + + dev_debug(devinfo, CE_NOTE, + "nblks=%" PRIu64 " blksize=%d num_seg=%d, " + "seg_size=%d, maxxfer=%" PRIu64, + sc->sc_nblks, sc->sc_blk_size, + vioblk_bd_dma_attr.dma_attr_sgllen, + sc->sc_seg_size_max, + vioblk_bd_dma_attr.dma_attr_maxxfer); + + + sc->sc_vq = virtio_alloc_vq(&sc->sc_virtio, 0, 0, + sc->sc_seg_max, "I/O request"); + if (sc->sc_vq == NULL) { + goto exit_alloc1; + } + + ret = vioblk_alloc_reqs(sc); + if (ret) { + goto exit_alloc2; + } + + sc->bd_h = bd_alloc_handle(sc, &vioblk_ops, &vioblk_bd_dma_attr, + KM_SLEEP); + + + virtio_set_status(&sc->sc_virtio, + VIRTIO_CONFIG_DEVICE_STATUS_DRIVER_OK); + virtio_start_vq_intr(sc->sc_vq); + + ret = virtio_enable_ints(&sc->sc_virtio); + if (ret) + goto exit_enable_ints; + + ret = bd_attach_handle(devinfo, sc->bd_h); + if (ret != DDI_SUCCESS) { + dev_err(devinfo, CE_WARN, "Failed to attach blkdev"); + goto exit_attach_bd; + } + + return (DDI_SUCCESS); + +exit_attach_bd: + /* + * There is no virtio_disable_ints(), it's done in virtio_release_ints. + * If they ever get split, don't forget to add a call here. + */ +exit_enable_ints: + virtio_stop_vq_intr(sc->sc_vq); + bd_free_handle(sc->bd_h); + vioblk_free_reqs(sc); +exit_alloc2: + virtio_free_vq(sc->sc_vq); +exit_alloc1: +exit_features: + virtio_release_ints(&sc->sc_virtio); +exit_int: + virtio_set_status(&sc->sc_virtio, VIRTIO_CONFIG_DEVICE_STATUS_FAILED); + ddi_regs_map_free(&sc->sc_virtio.sc_ioh); +exit_map: + kstat_delete(sc->sc_intrstat); +exit_intrstat: + mutex_destroy(&sc->lock_devid); + cv_destroy(&sc->cv_devid); + kmem_free(sc, sizeof (struct vioblk_softc)); +exit: + return (ret); +} + +static int +vioblk_detach(dev_info_t *devinfo, ddi_detach_cmd_t cmd) +{ + struct vioblk_softc *sc = ddi_get_driver_private(devinfo); + + switch (cmd) { + case DDI_DETACH: + break; + + case DDI_PM_SUSPEND: + cmn_err(CE_WARN, "suspend not supported yet"); + return (DDI_FAILURE); + + default: + cmn_err(CE_WARN, "cmd 0x%x unrecognized", cmd); + return (DDI_FAILURE); + } + + (void) bd_detach_handle(sc->bd_h); + virtio_stop_vq_intr(sc->sc_vq); + virtio_release_ints(&sc->sc_virtio); + vioblk_free_reqs(sc); + virtio_free_vq(sc->sc_vq); + virtio_device_reset(&sc->sc_virtio); + ddi_regs_map_free(&sc->sc_virtio.sc_ioh); + kstat_delete(sc->sc_intrstat); + kmem_free(sc, sizeof (struct vioblk_softc)); + + return (DDI_SUCCESS); +} + +static int +vioblk_quiesce(dev_info_t *devinfo) +{ + struct vioblk_softc *sc = ddi_get_driver_private(devinfo); + + virtio_stop_vq_intr(sc->sc_vq); + virtio_device_reset(&sc->sc_virtio); + + return (DDI_SUCCESS); +} + +int +_init(void) +{ + int rv; + + bd_mod_init(&vioblk_dev_ops); + + if ((rv = mod_install(&modlinkage)) != 0) { + bd_mod_fini(&vioblk_dev_ops); + } + + return (rv); +} + +int +_fini(void) +{ + int rv; + + if ((rv = mod_remove(&modlinkage)) == 0) { + bd_mod_fini(&vioblk_dev_ops); + } + + return (rv); +} + +int +_info(struct modinfo *modinfop) +{ + return (mod_info(&modlinkage, modinfop)); +} diff --git a/usr/src/uts/common/io/virtio/virtio.c b/usr/src/uts/common/io/virtio/virtio.c new file mode 100644 index 0000000000..320dc0666a --- /dev/null +++ b/usr/src/uts/common/io/virtio/virtio.c @@ -0,0 +1,1348 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright 2012 Nexenta Systems, Inc. + * Copyright 2012 Alexey Zaytsev <alexey.zaytsev@gmail.com> + */ + +/* Based on the NetBSD virtio driver by Minoura Makoto. */ +/* + * Copyright (c) 2010 Minoura Makoto. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include <sys/conf.h> +#include <sys/kmem.h> +#include <sys/debug.h> +#include <sys/modctl.h> +#include <sys/autoconf.h> +#include <sys/ddi_impldefs.h> +#include <sys/ddi.h> +#include <sys/sunddi.h> +#include <sys/sunndi.h> +#include <sys/avintr.h> +#include <sys/spl.h> +#include <sys/promif.h> +#include <sys/list.h> +#include <sys/bootconf.h> +#include <sys/bootsvcs.h> +#include <sys/sysmacros.h> +#include <sys/pci.h> + +#include "virtiovar.h" +#include "virtioreg.h" +#define NDEVNAMES (sizeof (virtio_device_name) / sizeof (char *)) +#define MINSEG_INDIRECT 2 /* use indirect if nsegs >= this value */ +#define VIRTQUEUE_ALIGN(n) (((n)+(VIRTIO_PAGE_SIZE-1)) & \ + ~(VIRTIO_PAGE_SIZE-1)) + +void +virtio_set_status(struct virtio_softc *sc, unsigned int status) +{ + int old = 0; + + if (status != 0) + old = ddi_get8(sc->sc_ioh, + (uint8_t *)(sc->sc_io_addr + + VIRTIO_CONFIG_DEVICE_STATUS)); + + ddi_put8(sc->sc_ioh, + (uint8_t *)(sc->sc_io_addr + VIRTIO_CONFIG_DEVICE_STATUS), + status | old); +} + +/* + * Negotiate features, save the result in sc->sc_features + */ +uint32_t +virtio_negotiate_features(struct virtio_softc *sc, uint32_t guest_features) +{ + uint32_t host_features; + uint32_t features; + + host_features = ddi_get32(sc->sc_ioh, + /* LINTED E_BAD_PTR_CAST_ALIGN */ + (uint32_t *)(sc->sc_io_addr + VIRTIO_CONFIG_DEVICE_FEATURES)); + + dev_debug(sc->sc_dev, CE_NOTE, + "host features: %x, guest features: %x", + host_features, guest_features); + + features = host_features & guest_features; + ddi_put32(sc->sc_ioh, + /* LINTED E_BAD_PTR_CAST_ALIGN */ + (uint32_t *)(sc->sc_io_addr + VIRTIO_CONFIG_GUEST_FEATURES), + features); + + sc->sc_features = features; + + return (host_features); +} + +size_t +virtio_show_features(uint32_t features, + char *buf, size_t len) +{ + char *orig_buf = buf; + char *bufend = buf + len; + + /* LINTED E_PTRDIFF_OVERFLOW */ + buf += snprintf(buf, bufend - buf, "Generic ( "); + if (features & VIRTIO_F_RING_INDIRECT_DESC) + /* LINTED E_PTRDIFF_OVERFLOW */ + buf += snprintf(buf, bufend - buf, "INDIRECT_DESC "); + + /* LINTED E_PTRDIFF_OVERFLOW */ + buf += snprintf(buf, bufend - buf, ") "); + + /* LINTED E_PTRDIFF_OVERFLOW */ + return (buf - orig_buf); +} + +boolean_t +virtio_has_feature(struct virtio_softc *sc, uint32_t feature) +{ + return (sc->sc_features & feature); +} + +/* + * Device configuration registers. + */ +uint8_t +virtio_read_device_config_1(struct virtio_softc *sc, unsigned int index) +{ + ASSERT(sc->sc_config_offset); + return ddi_get8(sc->sc_ioh, + (uint8_t *)(sc->sc_io_addr + sc->sc_config_offset + index)); +} + +uint16_t +virtio_read_device_config_2(struct virtio_softc *sc, unsigned int index) +{ + ASSERT(sc->sc_config_offset); + return ddi_get16(sc->sc_ioh, + /* LINTED E_BAD_PTR_CAST_ALIGN */ + (uint16_t *)(sc->sc_io_addr + sc->sc_config_offset + index)); +} + +uint32_t +virtio_read_device_config_4(struct virtio_softc *sc, unsigned int index) +{ + ASSERT(sc->sc_config_offset); + return ddi_get32(sc->sc_ioh, + /* LINTED E_BAD_PTR_CAST_ALIGN */ + (uint32_t *)(sc->sc_io_addr + sc->sc_config_offset + index)); +} + +uint64_t +virtio_read_device_config_8(struct virtio_softc *sc, unsigned int index) +{ + uint64_t r; + + ASSERT(sc->sc_config_offset); + r = ddi_get32(sc->sc_ioh, + /* LINTED E_BAD_PTR_CAST_ALIGN */ + (uint32_t *)(sc->sc_io_addr + sc->sc_config_offset + + index + sizeof (uint32_t))); + + r <<= 32; + + r += ddi_get32(sc->sc_ioh, + /* LINTED E_BAD_PTR_CAST_ALIGN */ + (uint32_t *)(sc->sc_io_addr + sc->sc_config_offset + index)); + return (r); +} + +void +virtio_write_device_config_1(struct virtio_softc *sc, + unsigned int index, uint8_t value) +{ + ASSERT(sc->sc_config_offset); + ddi_put8(sc->sc_ioh, + (uint8_t *)(sc->sc_io_addr + sc->sc_config_offset + index), value); +} + +void +virtio_write_device_config_2(struct virtio_softc *sc, + unsigned int index, uint16_t value) +{ + ASSERT(sc->sc_config_offset); + ddi_put16(sc->sc_ioh, + /* LINTED E_BAD_PTR_CAST_ALIGN */ + (uint16_t *)(sc->sc_io_addr + sc->sc_config_offset + index), value); +} + +void +virtio_write_device_config_4(struct virtio_softc *sc, + unsigned int index, uint32_t value) +{ + ASSERT(sc->sc_config_offset); + ddi_put32(sc->sc_ioh, + /* LINTED E_BAD_PTR_CAST_ALIGN */ + (uint32_t *)(sc->sc_io_addr + sc->sc_config_offset + index), value); +} + +void +virtio_write_device_config_8(struct virtio_softc *sc, + unsigned int index, uint64_t value) +{ + ASSERT(sc->sc_config_offset); + ddi_put32(sc->sc_ioh, + /* LINTED E_BAD_PTR_CAST_ALIGN */ + (uint32_t *)(sc->sc_io_addr + sc->sc_config_offset + index), + value & 0xFFFFFFFF); + ddi_put32(sc->sc_ioh, + /* LINTED E_BAD_PTR_CAST_ALIGN */ + (uint32_t *)(sc->sc_io_addr + sc->sc_config_offset + + index + sizeof (uint32_t)), value >> 32); +} + +/* + * Start/stop vq interrupt. No guarantee. + */ +void +virtio_stop_vq_intr(struct virtqueue *vq) +{ + vq->vq_avail->flags |= VRING_AVAIL_F_NO_INTERRUPT; +} + +void +virtio_start_vq_intr(struct virtqueue *vq) +{ + vq->vq_avail->flags &= ~VRING_AVAIL_F_NO_INTERRUPT; +} + +static ddi_dma_attr_t virtio_vq_dma_attr = { + DMA_ATTR_V0, /* Version number */ + 0, /* low address */ + /* + * high address. Has to fit into 32 bits + * after page-shifting + */ + 0x00000FFFFFFFFFFF, + 0xFFFFFFFF, /* counter register max */ + VIRTIO_PAGE_SIZE, /* page alignment required */ + 0x3F, /* burst sizes: 1 - 32 */ + 0x1, /* minimum transfer size */ + 0xFFFFFFFF, /* max transfer size */ + 0xFFFFFFFF, /* address register max */ + 1, /* no scatter-gather */ + 1, /* device operates on bytes */ + 0, /* attr flag: set to 0 */ +}; + +static ddi_dma_attr_t virtio_vq_indirect_dma_attr = { + DMA_ATTR_V0, /* Version number */ + 0, /* low address */ + 0xFFFFFFFFFFFFFFFF, /* high address */ + 0xFFFFFFFF, /* counter register max */ + 1, /* No specific alignment */ + 0x3F, /* burst sizes: 1 - 32 */ + 0x1, /* minimum transfer size */ + 0xFFFFFFFF, /* max transfer size */ + 0xFFFFFFFF, /* address register max */ + 1, /* no scatter-gather */ + 1, /* device operates on bytes */ + 0, /* attr flag: set to 0 */ +}; + +/* Same for direct and indirect descriptors. */ +static ddi_device_acc_attr_t virtio_vq_devattr = { + DDI_DEVICE_ATTR_V0, + DDI_NEVERSWAP_ACC, + DDI_STORECACHING_OK_ACC, + DDI_DEFAULT_ACC +}; + +static void +virtio_free_indirect(struct vq_entry *entry) +{ + + (void) ddi_dma_unbind_handle(entry->qe_indirect_dma_handle); + ddi_dma_mem_free(&entry->qe_indirect_dma_acch); + ddi_dma_free_handle(&entry->qe_indirect_dma_handle); + + entry->qe_indirect_descs = NULL; +} + + +static int +virtio_alloc_indirect(struct virtio_softc *sc, struct vq_entry *entry) +{ + int allocsize, num; + size_t len; + unsigned int ncookies; + int ret; + + num = entry->qe_queue->vq_indirect_num; + ASSERT(num > 1); + + allocsize = sizeof (struct vring_desc) * num; + + ret = ddi_dma_alloc_handle(sc->sc_dev, &virtio_vq_indirect_dma_attr, + DDI_DMA_SLEEP, NULL, &entry->qe_indirect_dma_handle); + if (ret != DDI_SUCCESS) { + dev_err(sc->sc_dev, CE_WARN, + "Failed to allocate dma handle for indirect descriptors," + " entry %d, vq %d", entry->qe_index, + entry->qe_queue->vq_index); + goto out_alloc_handle; + } + + ret = ddi_dma_mem_alloc(entry->qe_indirect_dma_handle, + allocsize, &virtio_vq_devattr, + DDI_DMA_CONSISTENT, DDI_DMA_SLEEP, NULL, + (caddr_t *)&entry->qe_indirect_descs, &len, + &entry->qe_indirect_dma_acch); + if (ret != DDI_SUCCESS) { + dev_err(sc->sc_dev, CE_WARN, + "Failed to alocate dma memory for indirect descriptors," + " entry %d, vq %d,", entry->qe_index, + entry->qe_queue->vq_index); + goto out_alloc; + } + + (void) memset(entry->qe_indirect_descs, 0xff, allocsize); + + ret = ddi_dma_addr_bind_handle(entry->qe_indirect_dma_handle, NULL, + (caddr_t)entry->qe_indirect_descs, len, + DDI_DMA_RDWR | DDI_DMA_CONSISTENT, + DDI_DMA_SLEEP, NULL, &entry->qe_indirect_dma_cookie, &ncookies); + if (ret != DDI_DMA_MAPPED) { + dev_err(sc->sc_dev, CE_WARN, + "Failed to bind dma memory for indirect descriptors," + "entry %d, vq %d", entry->qe_index, + entry->qe_queue->vq_index); + goto out_bind; + } + + /* We asked for a single segment */ + ASSERT(ncookies == 1); + + return (0); + +out_bind: + ddi_dma_mem_free(&entry->qe_indirect_dma_acch); +out_alloc: + ddi_dma_free_handle(&entry->qe_indirect_dma_handle); +out_alloc_handle: + + return (ret); +} + +/* + * Initialize the vq structure. + */ +static int +virtio_init_vq(struct virtio_softc *sc, struct virtqueue *vq) +{ + int ret; + uint16_t i; + int vq_size = vq->vq_num; + int indirect_num = vq->vq_indirect_num; + + /* free slot management */ + list_create(&vq->vq_freelist, sizeof (struct vq_entry), + offsetof(struct vq_entry, qe_list)); + + for (i = 0; i < vq_size; i++) { + struct vq_entry *entry = &vq->vq_entries[i]; + list_insert_tail(&vq->vq_freelist, entry); + entry->qe_index = i; + entry->qe_desc = &vq->vq_descs[i]; + entry->qe_queue = vq; + + if (indirect_num) { + ret = virtio_alloc_indirect(sc, entry); + if (ret) + goto out_indirect; + } + } + + mutex_init(&vq->vq_freelist_lock, "virtio-freelist", + MUTEX_DRIVER, DDI_INTR_PRI(sc->sc_intr_prio)); + mutex_init(&vq->vq_avail_lock, "virtio-avail", + MUTEX_DRIVER, DDI_INTR_PRI(sc->sc_intr_prio)); + mutex_init(&vq->vq_used_lock, "virtio-used", + MUTEX_DRIVER, DDI_INTR_PRI(sc->sc_intr_prio)); + + return (0); + +out_indirect: + for (i = 0; i < vq_size; i++) { + struct vq_entry *entry = &vq->vq_entries[i]; + if (entry->qe_indirect_descs) + virtio_free_indirect(entry); + } + + return (ret); +} + + + +/* + * Allocate/free a vq. + */ +struct virtqueue * +virtio_alloc_vq(struct virtio_softc *sc, + unsigned int index, + unsigned int size, + unsigned int indirect_num, + const char *name) +{ + int vq_size, allocsize1, allocsize2, allocsize = 0; + int ret; + unsigned int ncookies; + size_t len; + struct virtqueue *vq; + + + ddi_put16(sc->sc_ioh, + /* LINTED E_BAD_PTR_CAST_ALIGN */ + (uint16_t *)(sc->sc_io_addr + VIRTIO_CONFIG_QUEUE_SELECT), index); + vq_size = ddi_get16(sc->sc_ioh, + /* LINTED E_BAD_PTR_CAST_ALIGN */ + (uint16_t *)(sc->sc_io_addr + VIRTIO_CONFIG_QUEUE_SIZE)); + if (vq_size == 0) { + dev_err(sc->sc_dev, CE_WARN, + "virtqueue dest not exist, index %d for %s\n", index, name); + goto out; + } + + vq = kmem_zalloc(sizeof (struct virtqueue), KM_SLEEP); + + /* size 0 => use native vq size, good for receive queues. */ + if (size) + vq_size = MIN(vq_size, size); + + /* allocsize1: descriptor table + avail ring + pad */ + allocsize1 = VIRTQUEUE_ALIGN(sizeof (struct vring_desc) * vq_size + + sizeof (struct vring_avail) + + sizeof (uint16_t) * vq_size); + /* allocsize2: used ring + pad */ + allocsize2 = VIRTQUEUE_ALIGN(sizeof (struct vring_used) + + sizeof (struct vring_used_elem) * vq_size); + + allocsize = allocsize1 + allocsize2; + + ret = ddi_dma_alloc_handle(sc->sc_dev, &virtio_vq_dma_attr, + DDI_DMA_SLEEP, NULL, &vq->vq_dma_handle); + if (ret != DDI_SUCCESS) { + dev_err(sc->sc_dev, CE_WARN, + "Failed to allocate dma handle for vq %d", index); + goto out_alloc_handle; + } + + ret = ddi_dma_mem_alloc(vq->vq_dma_handle, allocsize, + &virtio_vq_devattr, DDI_DMA_CONSISTENT, DDI_DMA_SLEEP, NULL, + (caddr_t *)&vq->vq_vaddr, &len, &vq->vq_dma_acch); + if (ret != DDI_SUCCESS) { + dev_err(sc->sc_dev, CE_WARN, + "Failed to alocate dma memory for vq %d", index); + goto out_alloc; + } + + + ret = ddi_dma_addr_bind_handle(vq->vq_dma_handle, NULL, + (caddr_t)vq->vq_vaddr, len, + DDI_DMA_RDWR | DDI_DMA_CONSISTENT, + DDI_DMA_SLEEP, NULL, &vq->vq_dma_cookie, &ncookies); + if (ret != DDI_DMA_MAPPED) { + dev_err(sc->sc_dev, CE_WARN, + "Failed to bind dma memory for vq %d", index); + goto out_bind; + } + + /* We asked for a single segment */ + ASSERT(ncookies == 1); + /* and page-ligned buffers. */ + ASSERT(vq->vq_dma_cookie.dmac_laddress % VIRTIO_PAGE_SIZE == 0); + + (void) memset(vq->vq_vaddr, 0, allocsize); + + /* Make sure all zeros hit the buffer before we point the host to it */ + membar_producer(); + + /* set the vq address */ + ddi_put32(sc->sc_ioh, + /* LINTED E_BAD_PTR_CAST_ALIGN */ + (uint32_t *)(sc->sc_io_addr + VIRTIO_CONFIG_QUEUE_ADDRESS), + (vq->vq_dma_cookie.dmac_laddress / VIRTIO_PAGE_SIZE)); + + /* remember addresses and offsets for later use */ + vq->vq_owner = sc; + vq->vq_num = vq_size; + vq->vq_index = index; + vq->vq_descs = vq->vq_vaddr; + vq->vq_availoffset = sizeof (struct vring_desc)*vq_size; + vq->vq_avail = (void *)(((char *)vq->vq_descs) + vq->vq_availoffset); + vq->vq_usedoffset = allocsize1; + vq->vq_used = (void *)(((char *)vq->vq_descs) + vq->vq_usedoffset); + + ASSERT(indirect_num == 0 || + virtio_has_feature(sc, VIRTIO_F_RING_INDIRECT_DESC)); + vq->vq_indirect_num = indirect_num; + + /* free slot management */ + vq->vq_entries = kmem_zalloc(sizeof (struct vq_entry) * vq_size, + KM_SLEEP); + + ret = virtio_init_vq(sc, vq); + if (ret) + goto out_init; + + dev_debug(sc->sc_dev, CE_NOTE, + "Allocated %d entries for vq %d:%s (%d incdirect descs)", + vq_size, index, name, indirect_num * vq_size); + + return (vq); + +out_init: + kmem_free(vq->vq_entries, sizeof (struct vq_entry) * vq_size); + (void) ddi_dma_unbind_handle(vq->vq_dma_handle); +out_bind: + ddi_dma_mem_free(&vq->vq_dma_acch); +out_alloc: + ddi_dma_free_handle(&vq->vq_dma_handle); +out_alloc_handle: + kmem_free(vq, sizeof (struct virtqueue)); +out: + return (NULL); +} + + +void +virtio_free_vq(struct virtqueue *vq) +{ + struct virtio_softc *sc = vq->vq_owner; + int i; + + /* tell device that there's no virtqueue any longer */ + ddi_put16(sc->sc_ioh, + /* LINTED E_BAD_PTR_CAST_ALIGN */ + (uint16_t *)(sc->sc_io_addr + VIRTIO_CONFIG_QUEUE_SELECT), + vq->vq_index); + ddi_put32(sc->sc_ioh, + /* LINTED E_BAD_PTR_CAST_ALIGN */ + (uint32_t *)(sc->sc_io_addr + VIRTIO_CONFIG_QUEUE_ADDRESS), 0); + + /* Free the indirect descriptors, if any. */ + for (i = 0; i < vq->vq_num; i++) { + struct vq_entry *entry = &vq->vq_entries[i]; + if (entry->qe_indirect_descs) + virtio_free_indirect(entry); + } + + kmem_free(vq->vq_entries, sizeof (struct vq_entry) * vq->vq_num); + + (void) ddi_dma_unbind_handle(vq->vq_dma_handle); + ddi_dma_mem_free(&vq->vq_dma_acch); + ddi_dma_free_handle(&vq->vq_dma_handle); + + mutex_destroy(&vq->vq_used_lock); + mutex_destroy(&vq->vq_avail_lock); + mutex_destroy(&vq->vq_freelist_lock); + + kmem_free(vq, sizeof (struct virtqueue)); +} + +/* + * Free descriptor management. + */ +struct vq_entry * +vq_alloc_entry(struct virtqueue *vq) +{ + struct vq_entry *qe; + + mutex_enter(&vq->vq_freelist_lock); + if (list_is_empty(&vq->vq_freelist)) { + mutex_exit(&vq->vq_freelist_lock); + return (NULL); + } + qe = list_remove_head(&vq->vq_freelist); + + ASSERT(vq->vq_used_entries >= 0); + vq->vq_used_entries++; + + mutex_exit(&vq->vq_freelist_lock); + + qe->qe_next = NULL; + qe->qe_indirect_next = 0; + (void) memset(qe->qe_desc, 0, sizeof (struct vring_desc)); + + return (qe); +} + +void +vq_free_entry(struct virtqueue *vq, struct vq_entry *qe) +{ + mutex_enter(&vq->vq_freelist_lock); + + list_insert_head(&vq->vq_freelist, qe); + vq->vq_used_entries--; + ASSERT(vq->vq_used_entries >= 0); + mutex_exit(&vq->vq_freelist_lock); +} + +/* + * We (intentionally) don't have a global vq mutex, so you are + * responsible for external locking to avoid allocting/freeing any + * entries before using the returned value. Have fun. + */ +uint_t +vq_num_used(struct virtqueue *vq) +{ + /* vq->vq_freelist_lock would not help here. */ + return (vq->vq_used_entries); +} + +static inline void +virtio_ve_set_desc(struct vring_desc *desc, uint64_t paddr, uint32_t len, + boolean_t write) +{ + desc->addr = paddr; + desc->len = len; + desc->next = 0; + desc->flags = 0; + + /* 'write' - from the driver's point of view */ + if (!write) + desc->flags = VRING_DESC_F_WRITE; + + +} + +void +virtio_ve_set(struct vq_entry *qe, uint64_t paddr, uint32_t len, + boolean_t write) +{ + virtio_ve_set_desc(qe->qe_desc, paddr, len, write); +} + +void +virtio_ve_add_indirect_buf(struct vq_entry *qe, uint64_t paddr, uint32_t len, + boolean_t write) +{ + struct vring_desc *indirect_desc; + + ASSERT(qe->qe_queue->vq_indirect_num); + ASSERT(qe->qe_indirect_next < qe->qe_queue->vq_indirect_num); + + indirect_desc = &qe->qe_indirect_descs[qe->qe_indirect_next]; + virtio_ve_set_desc(indirect_desc, paddr, len, write); + qe->qe_indirect_next++; +} + +void +virtio_ve_add_cookie(struct vq_entry *qe, ddi_dma_handle_t dma_handle, + ddi_dma_cookie_t dma_cookie, unsigned int ncookies, boolean_t write) +{ + int i; + + for (i = 0; i < ncookies; i++) { + virtio_ve_add_indirect_buf(qe, dma_cookie.dmac_laddress, + dma_cookie.dmac_size, write); + ddi_dma_nextcookie(dma_handle, &dma_cookie); + } +} + +void +virtio_sync_vq(struct virtqueue *vq) +{ + struct virtio_softc *vsc = vq->vq_owner; + + /* Make sure the avail ring update hit the buffer */ + membar_producer(); + + vq->vq_avail->idx = vq->vq_avail_idx; + + /* Make sure the avail idx update hits the buffer */ + membar_producer(); + + /* Make sure we see the flags update */ + membar_consumer(); + + if (!(vq->vq_used->flags & VRING_USED_F_NO_NOTIFY)) + ddi_put16(vsc->sc_ioh, + /* LINTED E_BAD_PTR_CAST_ALIGN */ + (uint16_t *)(vsc->sc_io_addr + + VIRTIO_CONFIG_QUEUE_NOTIFY), + vq->vq_index); +} + +void +virtio_push_chain(struct vq_entry *qe, boolean_t sync) +{ + struct virtqueue *vq = qe->qe_queue; + struct vq_entry *head = qe; + struct vring_desc *desc; + int idx; + + ASSERT(qe); + + /* + * Bind the descs together, paddr and len should be already + * set with virtio_ve_set + */ + do { + /* Bind the indirect descriptors */ + if (qe->qe_indirect_next > 1) { + uint16_t i = 0; + + /* + * Set the pointer/flags to the + * first indirect descriptor + */ + virtio_ve_set_desc(qe->qe_desc, + qe->qe_indirect_dma_cookie.dmac_laddress, + sizeof (struct vring_desc) * qe->qe_indirect_next, + B_FALSE); + qe->qe_desc->flags |= VRING_DESC_F_INDIRECT; + + /* For all but the last one, add the next index/flag */ + do { + desc = &qe->qe_indirect_descs[i]; + i++; + + desc->flags |= VRING_DESC_F_NEXT; + desc->next = i; + } while (i < qe->qe_indirect_next - 1); + + } + + if (qe->qe_next) { + qe->qe_desc->flags |= VRING_DESC_F_NEXT; + qe->qe_desc->next = qe->qe_next->qe_index; + } + + qe = qe->qe_next; + } while (qe); + + mutex_enter(&vq->vq_avail_lock); + idx = vq->vq_avail_idx; + vq->vq_avail_idx++; + + /* Make sure the bits hit the descriptor(s) */ + membar_producer(); + vq->vq_avail->ring[idx % vq->vq_num] = head->qe_index; + + /* Notify the device, if needed. */ + if (sync) + virtio_sync_vq(vq); + + mutex_exit(&vq->vq_avail_lock); +} + +/* Get a chain of descriptors from the used ring, if one is available. */ +struct vq_entry * +virtio_pull_chain(struct virtqueue *vq, uint32_t *len) +{ + struct vq_entry *head; + int slot; + int usedidx; + + mutex_enter(&vq->vq_used_lock); + + /* No used entries? Bye. */ + if (vq->vq_used_idx == vq->vq_used->idx) { + mutex_exit(&vq->vq_used_lock); + return (NULL); + } + + usedidx = vq->vq_used_idx; + vq->vq_used_idx++; + mutex_exit(&vq->vq_used_lock); + + usedidx %= vq->vq_num; + + /* Make sure we do the next step _after_ checking the idx. */ + membar_consumer(); + + slot = vq->vq_used->ring[usedidx].id; + *len = vq->vq_used->ring[usedidx].len; + + head = &vq->vq_entries[slot]; + + return (head); +} + +void +virtio_free_chain(struct vq_entry *qe) +{ + struct vq_entry *tmp; + struct virtqueue *vq = qe->qe_queue; + + ASSERT(qe); + + do { + ASSERT(qe->qe_queue == vq); + tmp = qe->qe_next; + vq_free_entry(vq, qe); + qe = tmp; + } while (tmp); +} + +void +virtio_ventry_stick(struct vq_entry *first, struct vq_entry *second) +{ + first->qe_next = second; +} + +static int +virtio_register_msi(struct virtio_softc *sc, + struct virtio_int_handler *config_handler, + struct virtio_int_handler vq_handlers[], + int intr_types) +{ + int count, actual; + int int_type; + int i; + int handler_count; + int ret; + + /* If both MSI and MSI-x are reported, prefer MSI-x. */ + int_type = DDI_INTR_TYPE_MSI; + if (intr_types & DDI_INTR_TYPE_MSIX) + int_type = DDI_INTR_TYPE_MSIX; + + /* Walk the handler table to get the number of handlers. */ + for (handler_count = 0; + vq_handlers && vq_handlers[handler_count].vh_func; + handler_count++) + ; + + /* +1 if there is a config change handler. */ + if (config_handler) + handler_count++; + + /* Number of MSIs supported by the device. */ + ret = ddi_intr_get_nintrs(sc->sc_dev, int_type, &count); + if (ret != DDI_SUCCESS) { + dev_err(sc->sc_dev, CE_WARN, "ddi_intr_get_nintrs failed"); + return (ret); + } + + /* + * Those who try to register more handlers then the device + * supports shall suffer. + */ + ASSERT(handler_count <= count); + + sc->sc_intr_htable = kmem_zalloc( + sizeof (ddi_intr_handle_t) * handler_count, KM_SLEEP); + + ret = ddi_intr_alloc(sc->sc_dev, sc->sc_intr_htable, int_type, 0, + handler_count, &actual, DDI_INTR_ALLOC_NORMAL); + if (ret != DDI_SUCCESS) { + dev_err(sc->sc_dev, CE_WARN, "Failed to allocate MSI: %d", ret); + goto out_msi_alloc; + } + + if (actual != handler_count) { + dev_err(sc->sc_dev, CE_WARN, + "Not enough MSI available: need %d, available %d", + handler_count, actual); + goto out_msi_available; + } + + sc->sc_intr_num = handler_count; + sc->sc_intr_config = B_FALSE; + if (config_handler) { + sc->sc_intr_config = B_TRUE; + } + + /* Assume they are all same priority */ + ret = ddi_intr_get_pri(sc->sc_intr_htable[0], &sc->sc_intr_prio); + if (ret != DDI_SUCCESS) { + dev_err(sc->sc_dev, CE_WARN, "ddi_intr_get_pri failed"); + goto out_msi_prio; + } + + /* Add the vq handlers */ + for (i = 0; vq_handlers[i].vh_func; i++) { + ret = ddi_intr_add_handler(sc->sc_intr_htable[i], + vq_handlers[i].vh_func, + sc, vq_handlers[i].vh_priv); + if (ret != DDI_SUCCESS) { + dev_err(sc->sc_dev, CE_WARN, + "ddi_intr_add_handler failed"); + /* Remove the handlers that succeeded. */ + while (--i >= 0) { + (void) ddi_intr_remove_handler( + sc->sc_intr_htable[i]); + } + goto out_add_handlers; + } + } + + /* Don't forget the config handler */ + if (config_handler) { + ret = ddi_intr_add_handler(sc->sc_intr_htable[i], + config_handler->vh_func, + sc, config_handler->vh_priv); + if (ret != DDI_SUCCESS) { + dev_err(sc->sc_dev, CE_WARN, + "ddi_intr_add_handler failed"); + /* Remove the handlers that succeeded. */ + while (--i >= 0) { + (void) ddi_intr_remove_handler( + sc->sc_intr_htable[i]); + } + goto out_add_handlers; + } + } + + /* We know we are using MSI, so set the config offset. */ + sc->sc_config_offset = VIRTIO_CONFIG_DEVICE_CONFIG_MSI; + + ret = ddi_intr_get_cap(sc->sc_intr_htable[0], + &sc->sc_intr_cap); + /* Just in case. */ + if (ret != DDI_SUCCESS) + sc->sc_intr_cap = 0; + +out_add_handlers: +out_msi_prio: +out_msi_available: + for (i = 0; i < actual; i++) + (void) ddi_intr_free(sc->sc_intr_htable[i]); +out_msi_alloc: + kmem_free(sc->sc_intr_htable, sizeof (ddi_intr_handle_t) * count); + + return (ret); +} + +struct virtio_handler_container { + int nhandlers; + struct virtio_int_handler config_handler; + struct virtio_int_handler vq_handlers[]; +}; + +uint_t +virtio_intx_dispatch(caddr_t arg1, caddr_t arg2) +{ + struct virtio_softc *sc = (void *)arg1; + struct virtio_handler_container *vhc = (void *)arg2; + uint8_t isr_status; + int i; + + isr_status = ddi_get8(sc->sc_ioh, (uint8_t *)(sc->sc_io_addr + + VIRTIO_CONFIG_ISR_STATUS)); + + if (!isr_status) + return (DDI_INTR_UNCLAIMED); + + if ((isr_status & VIRTIO_CONFIG_ISR_CONFIG_CHANGE) && + vhc->config_handler.vh_func) { + vhc->config_handler.vh_func((void *)sc, + vhc->config_handler.vh_priv); + } + + /* Notify all handlers */ + for (i = 0; i < vhc->nhandlers; i++) { + vhc->vq_handlers[i].vh_func((void *)sc, + vhc->vq_handlers[i].vh_priv); + } + + return (DDI_INTR_CLAIMED); +} + +/* + * config_handler and vq_handlers may be allocated on stack. + * Take precautions not to loose them. + */ +static int +virtio_register_intx(struct virtio_softc *sc, + struct virtio_int_handler *config_handler, + struct virtio_int_handler vq_handlers[]) +{ + int vq_handler_count; + int config_handler_count = 0; + int actual; + struct virtio_handler_container *vhc; + int ret = DDI_FAILURE; + + /* Walk the handler table to get the number of handlers. */ + for (vq_handler_count = 0; + vq_handlers && vq_handlers[vq_handler_count].vh_func; + vq_handler_count++) + ; + + if (config_handler) + config_handler_count = 1; + + vhc = kmem_zalloc(sizeof (struct virtio_handler_container) + + sizeof (struct virtio_int_handler) * vq_handler_count, + KM_SLEEP); + + vhc->nhandlers = vq_handler_count; + (void) memcpy(vhc->vq_handlers, vq_handlers, + sizeof (struct virtio_int_handler) * vq_handler_count); + + if (config_handler) { + (void) memcpy(&vhc->config_handler, config_handler, + sizeof (struct virtio_int_handler)); + } + + /* Just a single entry for a single interrupt. */ + sc->sc_intr_htable = kmem_zalloc(sizeof (ddi_intr_handle_t), KM_SLEEP); + + ret = ddi_intr_alloc(sc->sc_dev, sc->sc_intr_htable, + DDI_INTR_TYPE_FIXED, 0, 1, &actual, + DDI_INTR_ALLOC_NORMAL); + if (ret != DDI_SUCCESS) { + dev_err(sc->sc_dev, CE_WARN, + "Failed to allocate a fixed interrupt: %d", ret); + goto out_int_alloc; + } + + ASSERT(actual == 1); + sc->sc_intr_num = 1; + + ret = ddi_intr_get_pri(sc->sc_intr_htable[0], &sc->sc_intr_prio); + if (ret != DDI_SUCCESS) { + dev_err(sc->sc_dev, CE_WARN, "ddi_intr_get_pri failed"); + goto out_prio; + } + + ret = ddi_intr_add_handler(sc->sc_intr_htable[0], + virtio_intx_dispatch, sc, vhc); + if (ret != DDI_SUCCESS) { + dev_err(sc->sc_dev, CE_WARN, "ddi_intr_add_handler failed"); + goto out_add_handlers; + } + + /* We know we are not using MSI, so set the config offset. */ + sc->sc_config_offset = VIRTIO_CONFIG_DEVICE_CONFIG_NOMSI; + + return (DDI_SUCCESS); + +out_add_handlers: +out_prio: + (void) ddi_intr_free(sc->sc_intr_htable[0]); +out_int_alloc: + kmem_free(sc->sc_intr_htable, sizeof (ddi_intr_handle_t)); + kmem_free(vhc, sizeof (struct virtio_int_handler) * + (vq_handler_count + config_handler_count)); + return (ret); +} + +/* + * We find out if we support MSI during this, and the register layout + * depends on the MSI (doh). Don't acces the device specific bits in + * BAR 0 before calling it! + */ +int +virtio_register_ints(struct virtio_softc *sc, + struct virtio_int_handler *config_handler, + struct virtio_int_handler vq_handlers[]) +{ + int ret; + int intr_types; + + /* Determine which types of interrupts are supported */ + ret = ddi_intr_get_supported_types(sc->sc_dev, &intr_types); + if (ret != DDI_SUCCESS) { + dev_err(sc->sc_dev, CE_WARN, "Can't get supported int types"); + goto out_inttype; + } + + /* If we have msi, let's use them. */ + if (intr_types & (DDI_INTR_TYPE_MSIX | DDI_INTR_TYPE_MSI)) { + ret = virtio_register_msi(sc, config_handler, + vq_handlers, intr_types); + if (!ret) + return (0); + } + + /* Fall back to old-fashioned interrupts. */ + if (intr_types & DDI_INTR_TYPE_FIXED) { + dev_debug(sc->sc_dev, CE_WARN, + "Using legacy interrupts"); + + return (virtio_register_intx(sc, config_handler, vq_handlers)); + } + + dev_err(sc->sc_dev, CE_WARN, + "MSI failed and fixed interrupts not supported. Giving up."); + ret = DDI_FAILURE; + +out_inttype: + return (ret); +} + + +static int +virtio_enable_msi(struct virtio_softc *sc) +{ + int ret, i; + int vq_handler_count = sc->sc_intr_num; + + /* Number of handlers, not counting the counfig. */ + if (sc->sc_intr_config) + vq_handler_count--; + + /* Enable the iterrupts. Either the whole block, or one by one. */ + if (sc->sc_intr_cap & DDI_INTR_FLAG_BLOCK) { + ret = ddi_intr_block_enable(sc->sc_intr_htable, + sc->sc_intr_num); + if (ret != DDI_SUCCESS) { + dev_err(sc->sc_dev, CE_WARN, + "Failed to enable MSI, falling back to INTx"); + goto out_enable; + } + } else { + for (i = 0; i < sc->sc_intr_num; i++) { + ret = ddi_intr_enable(sc->sc_intr_htable[i]); + if (ret != DDI_SUCCESS) { + dev_err(sc->sc_dev, CE_WARN, + "Failed to enable MSI %d, " + "falling back to INTx", i); + + while (--i >= 0) { + (void) ddi_intr_disable( + sc->sc_intr_htable[i]); + } + goto out_enable; + } + } + } + + /* Bind the allocated MSI to the queues and config */ + for (i = 0; i < vq_handler_count; i++) { + int check; + ddi_put16(sc->sc_ioh, + /* LINTED E_BAD_PTR_CAST_ALIGN */ + (uint16_t *)(sc->sc_io_addr + + VIRTIO_CONFIG_QUEUE_SELECT), i); + + ddi_put16(sc->sc_ioh, + /* LINTED E_BAD_PTR_CAST_ALIGN */ + (uint16_t *)(sc->sc_io_addr + + VIRTIO_CONFIG_QUEUE_VECTOR), i); + + check = ddi_get16(sc->sc_ioh, + /* LINTED E_BAD_PTR_CAST_ALIGN */ + (uint16_t *)(sc->sc_io_addr + + VIRTIO_CONFIG_QUEUE_VECTOR)); + if (check != i) { + dev_err(sc->sc_dev, CE_WARN, "Failed to bind handler" + "for VQ %d, MSI %d. Check = %x", i, i, check); + ret = ENODEV; + goto out_bind; + } + } + + if (sc->sc_intr_config) { + int check; + ddi_put16(sc->sc_ioh, + /* LINTED E_BAD_PTR_CAST_ALIGN */ + (uint16_t *)(sc->sc_io_addr + + VIRTIO_CONFIG_CONFIG_VECTOR), i); + + check = ddi_get16(sc->sc_ioh, + /* LINTED E_BAD_PTR_CAST_ALIGN */ + (uint16_t *)(sc->sc_io_addr + + VIRTIO_CONFIG_CONFIG_VECTOR)); + if (check != i) { + dev_err(sc->sc_dev, CE_WARN, "Failed to bind handler " + "for Config updates, MSI %d", i); + ret = ENODEV; + goto out_bind; + } + } + + return (DDI_SUCCESS); + +out_bind: + /* Unbind the vqs */ + for (i = 0; i < vq_handler_count - 1; i++) { + ddi_put16(sc->sc_ioh, + /* LINTED E_BAD_PTR_CAST_ALIGN */ + (uint16_t *)(sc->sc_io_addr + + VIRTIO_CONFIG_QUEUE_SELECT), i); + + ddi_put16(sc->sc_ioh, + /* LINTED E_BAD_PTR_CAST_ALIGN */ + (uint16_t *)(sc->sc_io_addr + + VIRTIO_CONFIG_QUEUE_VECTOR), + VIRTIO_MSI_NO_VECTOR); + } + /* And the config */ + /* LINTED E_BAD_PTR_CAST_ALIGN */ + ddi_put16(sc->sc_ioh, (uint16_t *)(sc->sc_io_addr + + VIRTIO_CONFIG_CONFIG_VECTOR), VIRTIO_MSI_NO_VECTOR); + + ret = DDI_FAILURE; + +out_enable: + return (ret); +} + +static int virtio_enable_intx(struct virtio_softc *sc) +{ + int ret; + + ret = ddi_intr_enable(sc->sc_intr_htable[0]); + if (ret != DDI_SUCCESS) + dev_err(sc->sc_dev, CE_WARN, + "Failed to enable interrupt: %d", ret); + return (ret); +} + +/* + * We can't enable/disable individual handlers in the INTx case so do + * the whole bunch even in the msi case. + */ +int +virtio_enable_ints(struct virtio_softc *sc) +{ + + /* See if we are using MSI. */ + if (sc->sc_config_offset == VIRTIO_CONFIG_DEVICE_CONFIG_MSI) + return (virtio_enable_msi(sc)); + + ASSERT(sc->sc_config_offset == VIRTIO_CONFIG_DEVICE_CONFIG_NOMSI); + + return (virtio_enable_intx(sc)); +} + +void +virtio_release_ints(struct virtio_softc *sc) +{ + int i; + int ret; + + /* We were running with MSI, unbind them. */ + if (sc->sc_config_offset == VIRTIO_CONFIG_DEVICE_CONFIG_MSI) { + /* Unbind all vqs */ + for (i = 0; i < sc->sc_nvqs; i++) { + ddi_put16(sc->sc_ioh, + /* LINTED E_BAD_PTR_CAST_ALIGN */ + (uint16_t *)(sc->sc_io_addr + + VIRTIO_CONFIG_QUEUE_SELECT), i); + + ddi_put16(sc->sc_ioh, + /* LINTED E_BAD_PTR_CAST_ALIGN */ + (uint16_t *)(sc->sc_io_addr + + VIRTIO_CONFIG_QUEUE_VECTOR), + VIRTIO_MSI_NO_VECTOR); + } + /* And the config */ + /* LINTED E_BAD_PTR_CAST_ALIGN */ + ddi_put16(sc->sc_ioh, (uint16_t *)(sc->sc_io_addr + + VIRTIO_CONFIG_CONFIG_VECTOR), + VIRTIO_MSI_NO_VECTOR); + + } + + /* Disable the iterrupts. Either the whole block, or one by one. */ + if (sc->sc_intr_cap & DDI_INTR_FLAG_BLOCK) { + ret = ddi_intr_block_disable(sc->sc_intr_htable, + sc->sc_intr_num); + if (ret != DDI_SUCCESS) { + dev_err(sc->sc_dev, CE_WARN, + "Failed to disable MSIs, won't be able to" + "reuse next time"); + } + } else { + for (i = 0; i < sc->sc_intr_num; i++) { + ret = ddi_intr_disable(sc->sc_intr_htable[i]); + if (ret != DDI_SUCCESS) { + dev_err(sc->sc_dev, CE_WARN, + "Failed to disable interrupt %d, " + "won't be able to reuse", i); + + } + } + } + + + for (i = 0; i < sc->sc_intr_num; i++) { + (void) ddi_intr_remove_handler(sc->sc_intr_htable[i]); + } + + for (i = 0; i < sc->sc_intr_num; i++) + (void) ddi_intr_free(sc->sc_intr_htable[i]); + + kmem_free(sc->sc_intr_htable, + sizeof (ddi_intr_handle_t) * sc->sc_intr_num); + + + /* After disabling interrupts, the config offset is non-MSI. */ + sc->sc_config_offset = VIRTIO_CONFIG_DEVICE_CONFIG_NOMSI; +} + +/* + * Module linkage information for the kernel. + */ +static struct modlmisc modlmisc = { + &mod_miscops, /* Type of module */ + "VirtIO common library module", +}; + +static struct modlinkage modlinkage = { + MODREV_1, + { + (void *)&modlmisc, + NULL + } +}; + +int +_init(void) +{ + return (mod_install(&modlinkage)); +} + +int +_fini(void) +{ + return (mod_remove(&modlinkage)); +} + +int +_info(struct modinfo *modinfop) +{ + return (mod_info(&modlinkage, modinfop)); +} diff --git a/usr/src/uts/common/io/virtio/virtioreg.h b/usr/src/uts/common/io/virtio/virtioreg.h new file mode 100644 index 0000000000..8cfcd59a47 --- /dev/null +++ b/usr/src/uts/common/io/virtio/virtioreg.h @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2010 Minoura Makoto. + * Copyright (c) 2012 Nexenta Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Part of the file derived from `Virtio PCI Card Specification v0.8.6 DRAFT' + * Appendix A. + */ + +/* + * An interface for efficient virtio implementation. + * + * This header is BSD licensed so anyone can use the definitions + * to implement compatible drivers/servers. + * + * Copyright 2007, 2009, IBM Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * 3. Neither the name of IBM nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' ANDANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#ifndef __VIRTIOREG_H__ +#define __VIRTIOREG_H__ + +#include <sys/types.h> + +#define PCI_VENDOR_QUMRANET 0x1af4 +#define PCI_DEV_VIRTIO_MIN 0x1000 +#define PCI_DEV_VIRTIO_MAX 0x103f +#define VIRTIO_PCI_ABI_VERSION 0 + +/* Virtio product id (subsystem) */ +#define PCI_PRODUCT_VIRTIO_NETWORK 1 +#define PCI_PRODUCT_VIRTIO_BLOCK 2 +#define PCI_PRODUCT_VIRTIO_CONSOLE 3 +#define PCI_PRODUCT_VIRTIO_ENTROPY 4 +#define PCI_PRODUCT_VIRTIO_BALLOON 5 +#define PCI_PRODUCT_VIRTIO_9P 9 + +/* Virtio header */ +#define VIRTIO_CONFIG_DEVICE_FEATURES 0 /* 32bit */ +#define VIRTIO_CONFIG_GUEST_FEATURES 4 /* 32bit */ + +#define VIRTIO_F_NOTIFY_ON_EMPTY (1<<24) +#define VIRTIO_F_RING_INDIRECT_DESC (1<<28) +#define VIRTIO_F_BAD_FEATURE (1<<30) + +#define VIRTIO_CONFIG_QUEUE_ADDRESS 8 /* 32bit */ +#define VIRTIO_CONFIG_QUEUE_SIZE 12 /* 16bit */ +#define VIRTIO_CONFIG_QUEUE_SELECT 14 /* 16bit */ +#define VIRTIO_CONFIG_QUEUE_NOTIFY 16 /* 16bit */ +#define VIRTIO_CONFIG_DEVICE_STATUS 18 /* 8bit */ + +#define VIRTIO_CONFIG_DEVICE_STATUS_RESET 0 +#define VIRTIO_CONFIG_DEVICE_STATUS_ACK 1 +#define VIRTIO_CONFIG_DEVICE_STATUS_DRIVER 2 +#define VIRTIO_CONFIG_DEVICE_STATUS_DRIVER_OK 4 +#define VIRTIO_CONFIG_DEVICE_STATUS_FAILED 128 + +#define VIRTIO_CONFIG_ISR_STATUS 19 /* 8bit */ +#define VIRTIO_CONFIG_ISR_CONFIG_CHANGE 2 + +#define VIRTIO_CONFIG_CONFIG_VECTOR 20 /* 16bit, optional */ +#define VIRTIO_CONFIG_QUEUE_VECTOR 22 + +#define VIRTIO_CONFIG_DEVICE_CONFIG_NOMSI 20 +#define VIRTIO_CONFIG_DEVICE_CONFIG_MSI 24 + +#define VIRTIO_MSI_NO_VECTOR 0xffff + +/* Virtqueue */ +/* This marks a buffer as continuing via the next field. */ +#define VRING_DESC_F_NEXT 1 +/* + * This marks a buffer as write-only, from the devices's perspective. + * (otherwise read-only). + */ +#define VRING_DESC_F_WRITE 2 +/* This means the buffer contains a list of buffer descriptors. */ +#define VRING_DESC_F_INDIRECT 4 + +/* + * The Host uses this in used->flags to advise the Guest: don't kick me + * when you add a buffer. It's unreliable, so it's simply an + * optimization. Guest will still kick if it's out of buffers. + */ +#define VRING_USED_F_NO_NOTIFY 1 +/* + * The Guest uses this in avail->flags to advise the Host: don't + * interrupt me when you consume a buffer. It's unreliable, so it's + * simply an optimization. + */ +#define VRING_AVAIL_F_NO_INTERRUPT 1 + +/* + * Virtio ring descriptors: 16 bytes. + * These can chain together via "next". + */ +struct vring_desc { + /* Address (guest-physical). */ + uint64_t addr; + /* Length. */ + uint32_t len; + /* The flags as indicated above. */ + uint16_t flags; + /* We chain unused descriptors via this, too */ + uint16_t next; +} __attribute__((packed)); + +struct vring_avail { + uint16_t flags; + uint16_t idx; + uint16_t ring[]; +} __attribute__((packed)); + +/* u32 is used here for ids for padding reasons. */ +struct vring_used_elem { + /* Index of start of used descriptor chain. */ + uint32_t id; + /* Total length of the descriptor chain which was written to. */ + uint32_t len; +} __attribute__((packed)); + +struct vring_used { + uint16_t flags; + uint16_t idx; + struct vring_used_elem ring[]; +} __attribute__((packed)); + + +/* Got nothing to do with the system page size, just a confusing name. */ +#define VIRTIO_PAGE_SIZE (4096) + +#endif /* __VIRTIOREG_H__ */ diff --git a/usr/src/uts/common/io/virtio/virtiovar.h b/usr/src/uts/common/io/virtio/virtiovar.h new file mode 100644 index 0000000000..e1617feb5d --- /dev/null +++ b/usr/src/uts/common/io/virtio/virtiovar.h @@ -0,0 +1,209 @@ +/* + * Copyright (c) 2010 Minoura Makoto. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Part of the file derived from `Virtio PCI Card Specification v0.8.6 DRAFT' + * Appendix A. + */ + +/* + * An interface for efficient virtio implementation. + * + * This header is BSD licensed so anyone can use the definitions + * to implement compatible drivers/servers. + * + * Copyright 2007, 2009, IBM Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * 3. Neither the name of IBM nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' ANDANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. + */ + +#ifndef __VIRTIOVAR_H__ +#define __VIRTIOVAR_H__ + +#include <sys/types.h> +#include <sys/dditypes.h> +#include <sys/cmn_err.h> +#include <sys/list.h> + +#ifdef DEBUG +#define dev_debug(dip, fmt, arg...) \ + dev_err(dip, fmt, ##arg) +#else +#define dev_debug(dip, fmt, arg...) +#endif + +struct vq_entry { + list_node_t qe_list; + struct virtqueue *qe_queue; + uint16_t qe_index; /* index in vq_desc array */ + /* followings are used only when it is the `head' entry */ + struct vq_entry *qe_next; + struct vring_desc *qe_desc; + ddi_dma_cookie_t qe_indirect_dma_cookie; + ddi_dma_handle_t qe_indirect_dma_handle; + ddi_acc_handle_t qe_indirect_dma_acch; + struct vring_desc *qe_indirect_descs; + unsigned int qe_indirect_next; +}; + +struct virtqueue { + struct virtio_softc *vq_owner; + unsigned int vq_num; /* queue size (# of entries) */ + unsigned int vq_indirect_num; + int vq_index; /* queue number (0, 1, ...) */ + + /* vring pointers (KVA) */ + struct vring_desc *vq_descs; + struct vring_avail *vq_avail; + struct vring_used *vq_used; + + /* virtqueue allocation info */ + void *vq_vaddr; + int vq_availoffset; + int vq_usedoffset; + ddi_dma_cookie_t vq_dma_cookie; + ddi_dma_handle_t vq_dma_handle; + ddi_acc_handle_t vq_dma_acch; + + int vq_maxsegsize; + + /* free entry management */ + struct vq_entry *vq_entries; + list_t vq_freelist; + kmutex_t vq_freelist_lock; + int vq_used_entries; + + /* enqueue/dequeue status */ + uint16_t vq_avail_idx; + kmutex_t vq_avail_lock; + uint16_t vq_used_idx; + kmutex_t vq_used_lock; +}; + +struct virtio_softc { + dev_info_t *sc_dev; + + uint_t sc_intr_prio; + + ddi_acc_handle_t sc_ioh; + caddr_t sc_io_addr; + int sc_config_offset; + + uint32_t sc_features; + + int sc_nvqs; /* set by the user */ + + ddi_intr_handle_t *sc_intr_htable; + int sc_intr_num; + boolean_t sc_intr_config; + int sc_intr_cap; +}; + +struct virtio_int_handler { + ddi_intr_handler_t *vh_func; + void *vh_priv; +}; + +/* public interface */ +uint32_t virtio_negotiate_features(struct virtio_softc *, uint32_t); +size_t virtio_show_features(uint32_t features, char *buffer, size_t len); +boolean_t virtio_has_feature(struct virtio_softc *sc, uint32_t feature); +void virtio_set_status(struct virtio_softc *sc, unsigned int); +#define virtio_device_reset(sc) virtio_set_status((sc), 0) + +uint8_t virtio_read_device_config_1(struct virtio_softc *sc, + unsigned int index); +uint16_t virtio_read_device_config_2(struct virtio_softc *sc, + unsigned int index); +uint32_t virtio_read_device_config_4(struct virtio_softc *sc, + unsigned int index); +uint64_t virtio_read_device_config_8(struct virtio_softc *sc, + unsigned int index); +void virtio_write_device_config_1(struct virtio_softc *sc, + unsigned int index, uint8_t value); +void virtio_write_device_config_2(struct virtio_softc *sc, + unsigned int index, uint16_t value); +void virtio_write_device_config_4(struct virtio_softc *sc, + unsigned int index, uint32_t value); +void virtio_write_device_config_8(struct virtio_softc *sc, + unsigned int index, uint64_t value); + +struct virtqueue *virtio_alloc_vq(struct virtio_softc *sc, + unsigned int index, unsigned int size, + unsigned int indirect_num, const char *name); +void virtio_free_vq(struct virtqueue *); +void virtio_reset(struct virtio_softc *); +struct vq_entry *vq_alloc_entry(struct virtqueue *vq); +void vq_free_entry(struct virtqueue *vq, struct vq_entry *qe); +uint_t vq_num_used(struct virtqueue *vq); + +void virtio_stop_vq_intr(struct virtqueue *); +void virtio_start_vq_intr(struct virtqueue *); + +void virtio_ve_add_cookie(struct vq_entry *qe, ddi_dma_handle_t dma_handle, + ddi_dma_cookie_t dma_cookie, unsigned int ncookies, boolean_t write); +void virtio_ve_add_indirect_buf(struct vq_entry *qe, uint64_t paddr, + uint32_t len, boolean_t write); +void virtio_ve_set(struct vq_entry *qe, uint64_t paddr, uint32_t len, + boolean_t write); + +void virtio_push_chain(struct vq_entry *qe, boolean_t sync); +struct vq_entry *virtio_pull_chain(struct virtqueue *vq, uint32_t *len); +void virtio_free_chain(struct vq_entry *ve); +void virtio_sync_vq(struct virtqueue *vq); + +int virtio_register_ints(struct virtio_softc *sc, + struct virtio_int_handler *config_handler, + struct virtio_int_handler vq_handlers[]); +void virtio_release_ints(struct virtio_softc *sc); +int virtio_enable_ints(struct virtio_softc *sc); + +#endif /* __VIRTIOVAR_H__ */ diff --git a/usr/src/uts/common/nfs/nfs4.h b/usr/src/uts/common/nfs/nfs4.h index 829043bbe3..cf36c03d0a 100644 --- a/usr/src/uts/common/nfs/nfs4.h +++ b/usr/src/uts/common/nfs/nfs4.h @@ -22,6 +22,9 @@ * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. + */ #ifndef _NFS4_H #define _NFS4_H @@ -1307,7 +1310,7 @@ extern char *utf8_to_fn(utf8string *, uint_t *, char *); extern utf8string *str_to_utf8(char *, utf8string *); extern utf8string *utf8_copy(utf8string *, utf8string *); extern int utf8_compare(const utf8string *, const utf8string *); -extern int utf8_dir_verify(utf8string *); +extern nfsstat4 utf8_dir_verify(utf8string *); extern char *utf8_strchr(utf8string *, const char); extern int ln_ace4_cmp(nfsace4 *, nfsace4 *, int); extern int vs_aent_to_ace4(vsecattr_t *, vsecattr_t *, int, int); diff --git a/usr/src/uts/common/os/sunmdi.c b/usr/src/uts/common/os/sunmdi.c index a4ee88fef4..f174b4d4aa 100644 --- a/usr/src/uts/common/os/sunmdi.c +++ b/usr/src/uts/common/os/sunmdi.c @@ -23,8 +23,8 @@ */ /* - * Multipath driver interface (MDI) implementation; see mdi_impl.h for a more - * detailed discussion of the overall mpxio architecture. + * Multipath driver interface (MDI) implementation; see mdi_impldefs.h for a + * more detailed discussion of the overall mpxio architecture. * * Default locking order: * diff --git a/usr/src/uts/common/smbsrv/string.h b/usr/src/uts/common/smbsrv/string.h index ceeb8accde..14b9cac8b8 100644 --- a/usr/src/uts/common/smbsrv/string.h +++ b/usr/src/uts/common/smbsrv/string.h @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. */ #ifndef _SMBSRV_STRING_H @@ -123,8 +124,7 @@ int smb_isstrupr(const char *); int smb_isstrlwr(const char *); int smb_strcasecmp(const char *, const char *, size_t); -boolean_t smb_match(char *, char *); -boolean_t smb_match_ci(char *, char *); +boolean_t smb_match(const char *, const char *, boolean_t); size_t smb_mbstowcs(smb_wchar_t *, const char *, size_t); size_t smb_wcstombs(char *, const smb_wchar_t *, size_t); diff --git a/usr/src/uts/common/sys/elf.h b/usr/src/uts/common/sys/elf.h index 6d66401259..bc25aee9c4 100644 --- a/usr/src/uts/common/sys/elf.h +++ b/usr/src/uts/common/sys/elf.h @@ -19,6 +19,9 @@ * CDDL HEADER END */ /* + * Copyright 2012 DEY Storage Systems, Inc. All rights reserved. + */ +/* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -812,7 +815,8 @@ typedef Elf64_Word Elf64_Capchain; #define NT_PRPRIVINFO 19 /* priv_impl_info_t <sys/priv.h> */ #define NT_CONTENT 20 /* core_content_t <sys/corectl.h> */ #define NT_ZONENAME 21 /* string from getzonenamebyid(3C) */ -#define NT_NUM 21 +#define NT_FDINFO 22 /* open fd info */ +#define NT_NUM 22 #ifdef _KERNEL diff --git a/usr/src/uts/common/sys/ipmi.h b/usr/src/uts/common/sys/ipmi.h index 9dafac407d..94a53392de 100644 --- a/usr/src/uts/common/sys/ipmi.h +++ b/usr/src/uts/common/sys/ipmi.h @@ -42,8 +42,8 @@ extern "C" { #define IPMI_MAX_ADDR_SIZE 0x20 #define IPMI_MAX_RX 1024 -#define IPMI_BMC_SLAVE_ADDR 0x20 /* Linux Default slave address */ -#define IPMI_BMC_CHANNEL 0x0f /* Linux BMC channel */ +#define IPMI_BMC_SLAVE_ADDR 0x20 /* Default slave address */ +#define IPMI_BMC_CHANNEL 0x0f /* BMC channel */ #define IPMI_BMC_SMS_LUN 0x02 diff --git a/usr/src/uts/common/sys/procfs.h b/usr/src/uts/common/sys/procfs.h index 12a6925368..f592fd9dcf 100644 --- a/usr/src/uts/common/sys/procfs.h +++ b/usr/src/uts/common/sys/procfs.h @@ -23,12 +23,13 @@ * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2012 DEY Storage Systems, Inc. All rights reserved. + */ #ifndef _SYS_PROCFS_H #define _SYS_PROCFS_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif @@ -61,6 +62,8 @@ extern "C" { #include <sys/pset.h> #include <sys/procfs_isa.h> #include <sys/priv.h> +#include <sys/stat.h> +#include <sys/param.h> /* * System call interfaces for /proc. @@ -488,6 +491,38 @@ typedef struct prasmap { #define PG_HWMAPPED 0x04 /* page is present and mapped */ /* + * Open files. Only in core files (for now). Note that we'd like to use + * the stat or stat64 structure, but both of these structures are unfortunately + * not consistent between 32 and 64 bit modes. To keep our lives simpler, we + * just define our own structure with types that are not sensitive to this + * difference. Also, it turns out that pfiles omits a lot of info from the + * struct stat (e.g. times, device sizes, etc.) so we don't bother adding those + * here. + */ +typedef struct prfdinfo { + int pr_fd; + mode_t pr_mode; + + uid_t pr_uid; + gid_t pr_gid; + + major_t pr_major; /* think stat.st_dev */ + minor_t pr_minor; + + major_t pr_rmajor; /* think stat.st_rdev */ + minor_t pr_rminor; + + ino64_t pr_ino; + off64_t pr_offset; + off64_t pr_size; + + int pr_fileflags; /* fcntl(F_GETXFL), etc */ + int pr_fdflags; /* fcntl(F_GETFD), etc. */ + + char pr_path[MAXPATHLEN]; +} prfdinfo_t; + +/* * Header for /proc/<pid>/lstatus /proc/<pid>/lpsinfo /proc/<pid>/lusage */ typedef struct prheader { diff --git a/usr/src/uts/common/sys/utsname.h b/usr/src/uts/common/sys/utsname.h index 2b9cf0e33f..4a2aca442c 100644 --- a/usr/src/uts/common/sys/utsname.h +++ b/usr/src/uts/common/sys/utsname.h @@ -31,8 +31,6 @@ #ifndef _SYS_UTSNAME_H #define _SYS_UTSNAME_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/feature_tests.h> #ifdef __cplusplus @@ -67,13 +65,9 @@ extern struct utsname utsname; #if defined(__STDC__) -#if !defined(__lint) -static int uname(struct utsname *); -static int _uname(struct utsname *); -#else extern int uname(struct utsname *); extern int _uname(struct utsname *); -#endif + #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) extern int nuname(struct utsname *); #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */ @@ -81,13 +75,9 @@ extern int _nuname(struct utsname *); #else /* defined(__STDC__) */ -#if !defined(__lint) -static int uname(); -static int _uname(); -#else extern int uname(); extern int _uname(); -#endif + #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) extern int nuname(); #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */ @@ -95,30 +85,20 @@ extern int _nuname(); #endif /* defined(__STDC__) */ - -#if !defined(__lint) -static int -#if defined(__STDC__) -_uname(struct utsname *_buf) -#else -_uname(_buf) -struct utsname *_buf; -#endif -{ - return (_nuname(_buf)); -} - -static int -#if defined(__STDC__) -uname(struct utsname *_buf) +/* + * On i386 in SVID.2 uname() returns a utsname structure with 8 byte members, + * and nuname() returns the real struct utsname. In SVID.3 uname and nuname + * are equivalent. Anyone who includes this header gets the SVID.3 behaviour. + * The SVID.2 behaviour exists solely for compatibility, and is what is + * implemented by the libc uname/_uname entrypoints. + */ +#ifdef __PRAGMA_REDEFINE_EXTNAME +#pragma redefine_extname uname _nuname +#pragma redefine_extname _uname _nuname #else -uname(_buf) -struct utsname *_buf; +#define uname _nuname +#define _uname _nuname #endif -{ - return (_nuname(_buf)); -} -#endif /* !defined(__lint) */ #else /* defined(__i386) */ diff --git a/usr/src/uts/common/syscall/poll.c b/usr/src/uts/common/syscall/poll.c index 5e87d073e3..7f37529941 100644 --- a/usr/src/uts/common/syscall/poll.c +++ b/usr/src/uts/common/syscall/poll.c @@ -308,7 +308,7 @@ poll_common(pollfd_t *fds, nfds_t nfds, timespec_t *tsp, k_sigset_t *ksetp) deadline = 0; } else { /* They must wait at least a tick. */ - deadline = tsp->tv_sec * NANOSEC + tsp->tv_nsec; + deadline = ((hrtime_t)tsp->tv_sec * NANOSEC) + tsp->tv_nsec; deadline = MAX(deadline, nsec_per_tick); deadline += gethrtime(); } diff --git a/usr/src/uts/i86pc/acpidev/Makefile b/usr/src/uts/i86pc/acpidev/Makefile index b95e0d1cc2..ab9cbde6ee 100644 --- a/usr/src/uts/i86pc/acpidev/Makefile +++ b/usr/src/uts/i86pc/acpidev/Makefile @@ -60,6 +60,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # LDFLAGS += -dy -N misc/acpica +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits + # # Default build targets. # diff --git a/usr/src/uts/i86pc/acpippm/Makefile b/usr/src/uts/i86pc/acpippm/Makefile index 5844ddfca1..65a42fdfa8 100644 --- a/usr/src/uts/i86pc/acpippm/Makefile +++ b/usr/src/uts/i86pc/acpippm/Makefile @@ -63,6 +63,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-variable + # # Declare dependency on misc/acpica # diff --git a/usr/src/uts/i86pc/amd_iommu/Makefile b/usr/src/uts/i86pc/amd_iommu/Makefile index b9fb8e2f18..a90023cde9 100644 --- a/usr/src/uts/i86pc/amd_iommu/Makefile +++ b/usr/src/uts/i86pc/amd_iommu/Makefile @@ -56,6 +56,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # LDFLAGS += -dy -Nmisc/iommulib -Nmisc/acpica +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/i86pc/apix/Makefile b/usr/src/uts/i86pc/apix/Makefile index 5e67b3f03a..501e095b4d 100644 --- a/usr/src/uts/i86pc/apix/Makefile +++ b/usr/src/uts/i86pc/apix/Makefile @@ -62,6 +62,11 @@ $(NOT_RELEASE_BUILD)DEBUG_DEFS += $(DEBUG_FLGS) # LDFLAGS += -dy -N misc/acpica +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-empty-body + # # Default build targets. # diff --git a/usr/src/uts/i86pc/consconfig_dacf/Makefile b/usr/src/uts/i86pc/consconfig_dacf/Makefile index 3867201c6b..a3ab02542e 100644 --- a/usr/src/uts/i86pc/consconfig_dacf/Makefile +++ b/usr/src/uts/i86pc/consconfig_dacf/Makefile @@ -24,10 +24,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" -# -# This makefile drives the production of the consconfig_dacf module. -# + # # Path to the base of the uts directory tree (usually /usr/src/uts). # @@ -58,6 +55,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # LDFLAGS += -dy -Nmisc/usbser +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: def: $(DEF_DEPS) diff --git a/usr/src/uts/i86pc/cpr/Makefile b/usr/src/uts/i86pc/cpr/Makefile index 7e07865e48..c8c403adac 100644 --- a/usr/src/uts/i86pc/cpr/Makefile +++ b/usr/src/uts/i86pc/cpr/Makefile @@ -72,6 +72,11 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/i86pc/cpudrv/Makefile b/usr/src/uts/i86pc/cpudrv/Makefile index dedf1b907a..8a59334d72 100644 --- a/usr/src/uts/i86pc/cpudrv/Makefile +++ b/usr/src/uts/i86pc/cpudrv/Makefile @@ -55,6 +55,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Link to acpica for ACPI services # diff --git a/usr/src/uts/i86pc/dr/Makefile b/usr/src/uts/i86pc/dr/Makefile index 03aa5f615e..f29362ef14 100644 --- a/usr/src/uts/i86pc/dr/Makefile +++ b/usr/src/uts/i86pc/dr/Makefile @@ -68,6 +68,10 @@ ALL_BUILDS = $(ALL_BUILDS64) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-empty-body + # # module dependencies # diff --git a/usr/src/uts/i86pc/fipe/Makefile b/usr/src/uts/i86pc/fipe/Makefile index a1b9091970..ca933cf4f7 100644 --- a/usr/src/uts/i86pc/fipe/Makefile +++ b/usr/src/uts/i86pc/fipe/Makefile @@ -62,6 +62,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-type-limits + # # Dependency # diff --git a/usr/src/uts/i86pc/generic_cpu/Makefile b/usr/src/uts/i86pc/generic_cpu/Makefile index 6fca8a5f1f..787402f588 100644 --- a/usr/src/uts/i86pc/generic_cpu/Makefile +++ b/usr/src/uts/i86pc/generic_cpu/Makefile @@ -41,6 +41,9 @@ ROOTMODULE = $(ROOT_PSM_CPU_DIR)/$(MODULE) # include ../cpu/Makefile.cpu +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Our lint library has a different name from that of the module we build. # diff --git a/usr/src/uts/i86pc/gfx_private/Makefile b/usr/src/uts/i86pc/gfx_private/Makefile index e3b23a0f57..b8156af9e2 100644 --- a/usr/src/uts/i86pc/gfx_private/Makefile +++ b/usr/src/uts/i86pc/gfx_private/Makefile @@ -23,10 +23,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# -# This makefile drives the production of the graphics private -# interface kernel module. + # # i86pc platform dependent # @@ -74,6 +71,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/i86pc/i86hvm/hvm_cmdk/Makefile b/usr/src/uts/i86pc/i86hvm/hvm_cmdk/Makefile index a4b0995bed..523e48f440 100644 --- a/usr/src/uts/i86pc/i86hvm/hvm_cmdk/Makefile +++ b/usr/src/uts/i86pc/i86hvm/hvm_cmdk/Makefile @@ -72,6 +72,10 @@ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized # # Default build targets. diff --git a/usr/src/uts/i86pc/i86hvm/hvm_sd/Makefile b/usr/src/uts/i86pc/i86hvm/hvm_sd/Makefile index f6b3802cbd..681f4849ae 100644 --- a/usr/src/uts/i86pc/i86hvm/hvm_sd/Makefile +++ b/usr/src/uts/i86pc/i86hvm/hvm_sd/Makefile @@ -70,6 +70,12 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-value # # Default build targets. diff --git a/usr/src/uts/i86pc/i86hvm/pv_cmdk/Makefile b/usr/src/uts/i86pc/i86hvm/pv_cmdk/Makefile index 030564df78..203fd6a533 100644 --- a/usr/src/uts/i86pc/i86hvm/pv_cmdk/Makefile +++ b/usr/src/uts/i86pc/i86hvm/pv_cmdk/Makefile @@ -76,6 +76,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable + # # Default build targets. # diff --git a/usr/src/uts/i86pc/i86hvm/pv_sd/Makefile b/usr/src/uts/i86pc/i86hvm/pv_sd/Makefile index 9eab704747..25f01f00ef 100644 --- a/usr/src/uts/i86pc/i86hvm/pv_sd/Makefile +++ b/usr/src/uts/i86pc/i86hvm/pv_sd/Makefile @@ -73,6 +73,8 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-unused-variable + # # Default build targets. # diff --git a/usr/src/uts/i86pc/i86hvm/xdf/Makefile b/usr/src/uts/i86pc/i86hvm/xdf/Makefile index bef6a685f6..61c773f5b3 100644 --- a/usr/src/uts/i86pc/i86hvm/xdf/Makefile +++ b/usr/src/uts/i86pc/i86hvm/xdf/Makefile @@ -60,6 +60,10 @@ LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/i86pc/i86hvm/xpv/Makefile b/usr/src/uts/i86pc/i86hvm/xpv/Makefile index a1ff318e68..ed2453b9c5 100644 --- a/usr/src/uts/i86pc/i86hvm/xpv/Makefile +++ b/usr/src/uts/i86pc/i86hvm/xpv/Makefile @@ -24,7 +24,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the xpv # driver, which provides the necessary infrastructure for @@ -71,6 +71,8 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-unused-label + # # Default build targets. # diff --git a/usr/src/uts/i86pc/i86hvm/xpvd/Makefile b/usr/src/uts/i86pc/i86hvm/xpvd/Makefile index 283bd34e5e..38e6406a5b 100644 --- a/usr/src/uts/i86pc/i86hvm/xpvd/Makefile +++ b/usr/src/uts/i86pc/i86hvm/xpvd/Makefile @@ -23,7 +23,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the xpvd nexus driver # @@ -63,6 +63,8 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/i86pc/ioat/Makefile b/usr/src/uts/i86pc/ioat/Makefile index 2dcd6e898e..5fa80da055 100644 --- a/usr/src/uts/i86pc/ioat/Makefile +++ b/usr/src/uts/i86pc/ioat/Makefile @@ -24,7 +24,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the ioat driver kernel # module. @@ -58,6 +58,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Dependency # diff --git a/usr/src/uts/i86pc/isa/Makefile b/usr/src/uts/i86pc/isa/Makefile index dee628b0b4..73e7e3c617 100644 --- a/usr/src/uts/i86pc/isa/Makefile +++ b/usr/src/uts/i86pc/isa/Makefile @@ -105,6 +105,8 @@ $(OBJECTS) $(LINTS) := CPPFLAGS += -Dd37A_read_count=$(MODULE)_d37A_read_count # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-unused-variable + # # Default build targets. # diff --git a/usr/src/uts/i86pc/npe/Makefile b/usr/src/uts/i86pc/npe/Makefile index 4d28a86d31..93d7c4a2bc 100644 --- a/usr/src/uts/i86pc/npe/Makefile +++ b/usr/src/uts/i86pc/npe/Makefile @@ -78,6 +78,9 @@ LINTFLAGS += -D_MODULE_NAME="\"$(MODULE)\"" LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/i86pc/pci-ide/Makefile b/usr/src/uts/i86pc/pci-ide/Makefile index 5850e521a9..2a50977aac 100644 --- a/usr/src/uts/i86pc/pci-ide/Makefile +++ b/usr/src/uts/i86pc/pci-ide/Makefile @@ -25,7 +25,7 @@ # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the pci-ide "drv" # kernel module. @@ -67,6 +67,8 @@ DEBUG_DEFS += $(DEBUG_FLGS) INC_PATH += -I$(UTSBASE)/common/io/pci-ide +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/i86pc/pci/Makefile b/usr/src/uts/i86pc/pci/Makefile index 2b9cde0e77..5a4e6e891a 100644 --- a/usr/src/uts/i86pc/pci/Makefile +++ b/usr/src/uts/i86pc/pci/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the PCI nexus driver # @@ -75,6 +75,9 @@ LINTFLAGS += -D_MODULE_NAME="\"$(MODULE)\"" LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/i86pc/pcie/Makefile b/usr/src/uts/i86pc/pcie/Makefile index fa4154f928..475ed19ff7 100644 --- a/usr/src/uts/i86pc/pcie/Makefile +++ b/usr/src/uts/i86pc/pcie/Makefile @@ -63,6 +63,12 @@ ALL_TARGET = $(BINARY) LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function # safe + # # Default build targets. # diff --git a/usr/src/uts/i86pc/pcplusmp/Makefile b/usr/src/uts/i86pc/pcplusmp/Makefile index f0e108904d..c65a382e71 100644 --- a/usr/src/uts/i86pc/pcplusmp/Makefile +++ b/usr/src/uts/i86pc/pcplusmp/Makefile @@ -24,7 +24,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the pcplusmp "mach" # kernel module. @@ -77,6 +77,12 @@ LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-empty-body + # # Default build targets. # diff --git a/usr/src/uts/i86pc/ppm/Makefile b/usr/src/uts/i86pc/ppm/Makefile index 057272504e..b8ad45a623 100644 --- a/usr/src/uts/i86pc/ppm/Makefile +++ b/usr/src/uts/i86pc/ppm/Makefile @@ -24,7 +24,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the generic power managment # pseudo driver @@ -63,6 +63,11 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable + # # Link to acpica for ACPI services # diff --git a/usr/src/uts/i86pc/rootnex/Makefile b/usr/src/uts/i86pc/rootnex/Makefile index 2ef85546b3..63b027b90e 100644 --- a/usr/src/uts/i86pc/rootnex/Makefile +++ b/usr/src/uts/i86pc/rootnex/Makefile @@ -69,6 +69,11 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/i86pc/tzmon/Makefile b/usr/src/uts/i86pc/tzmon/Makefile index f11d39e502..4410c18c88 100644 --- a/usr/src/uts/i86pc/tzmon/Makefile +++ b/usr/src/uts/i86pc/tzmon/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" -# # This makefile drives the production of the tzmon # ThermalZone Monitor driver kernel module. @@ -72,6 +70,8 @@ LDFLAGS += -dy -N misc/acpica # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/i86pc/unix/Makefile b/usr/src/uts/i86pc/unix/Makefile index 94ca90ea8b..0a83e6c4cc 100644 --- a/usr/src/uts/i86pc/unix/Makefile +++ b/usr/src/uts/i86pc/unix/Makefile @@ -134,6 +134,17 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-empty-body +CERRWARN += -_gcc=-Wno-unused-value + # Ensure that lint sees 'struct cpu' containing a fully declared # embedded 'struct machcpu' # diff --git a/usr/src/uts/i86pc/xsvc/Makefile b/usr/src/uts/i86pc/xsvc/Makefile index 6dd8477ad5..cfa49328e6 100644 --- a/usr/src/uts/i86pc/xsvc/Makefile +++ b/usr/src/uts/i86pc/xsvc/Makefile @@ -24,7 +24,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the xsvc driver kernel # module. @@ -67,6 +67,8 @@ LDFLAGS += -dy MODSTUBS_DIR = $(OBJS_DIR) CLEANFILES += $(MODSTUBS_O) +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/i86xpv/consconfig_dacf/Makefile b/usr/src/uts/i86xpv/consconfig_dacf/Makefile index 3658eb4e81..5994e5a22b 100644 --- a/usr/src/uts/i86xpv/consconfig_dacf/Makefile +++ b/usr/src/uts/i86xpv/consconfig_dacf/Makefile @@ -23,11 +23,10 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the consconfig_dacf module. # -# # Path to the base of the uts directory tree (usually /usr/src/uts). # UTSBASE = ../.. @@ -57,6 +56,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # LDFLAGS += -dy -Nmisc/usbser +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: def: $(DEF_DEPS) diff --git a/usr/src/uts/i86xpv/generic_cpu/Makefile b/usr/src/uts/i86xpv/generic_cpu/Makefile index 7558bb0f83..d5503c572b 100644 --- a/usr/src/uts/i86xpv/generic_cpu/Makefile +++ b/usr/src/uts/i86xpv/generic_cpu/Makefile @@ -44,6 +44,10 @@ ROOTMODULE = $(ROOT_PSM_CPU_DIR)/$(MODULE) include $(UTSBASE)/i86xpv/Makefile.i86xpv include $(UTSBASE)/i86pc/cpu/Makefile.files +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable + # # Our lint library has a different name from that of the module we build. # diff --git a/usr/src/uts/i86xpv/gfx_private/Makefile b/usr/src/uts/i86xpv/gfx_private/Makefile index 8e428fe28c..7184d1091f 100644 --- a/usr/src/uts/i86xpv/gfx_private/Makefile +++ b/usr/src/uts/i86xpv/gfx_private/Makefile @@ -23,7 +23,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the graphics private # interface kernel module. @@ -67,6 +67,9 @@ LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/i86xpv/ioat/Makefile b/usr/src/uts/i86xpv/ioat/Makefile index 54354aedc7..b1c1f1553c 100644 --- a/usr/src/uts/i86xpv/ioat/Makefile +++ b/usr/src/uts/i86xpv/ioat/Makefile @@ -24,7 +24,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the ioat driver kernel # module. @@ -58,6 +58,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Dependency # diff --git a/usr/src/uts/i86xpv/isa/Makefile b/usr/src/uts/i86xpv/isa/Makefile index 07df8ec920..c6a37b99b4 100644 --- a/usr/src/uts/i86xpv/isa/Makefile +++ b/usr/src/uts/i86xpv/isa/Makefile @@ -99,6 +99,7 @@ $(OBJECTS) $(LINTS) := CPPFLAGS += -Dd37A_write_count=$(MODULE)_d37A_write_count $(OBJECTS) $(LINTS) := CPPFLAGS += -Dd37A_read_count=$(MODULE)_d37A_read_count LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-unused-variable # # Default build targets. diff --git a/usr/src/uts/i86xpv/npe/Makefile b/usr/src/uts/i86xpv/npe/Makefile index 2754f9246b..f460ef6d41 100644 --- a/usr/src/uts/i86xpv/npe/Makefile +++ b/usr/src/uts/i86xpv/npe/Makefile @@ -72,6 +72,9 @@ LINTFLAGS += -D_MODULE_NAME="\"$(MODULE)\"" LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/i86xpv/pci-ide/Makefile b/usr/src/uts/i86xpv/pci-ide/Makefile index 638fb16db1..449973b7a6 100644 --- a/usr/src/uts/i86xpv/pci-ide/Makefile +++ b/usr/src/uts/i86xpv/pci-ide/Makefile @@ -23,7 +23,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the pci-ide "drv" # kernel module. @@ -65,6 +65,8 @@ DEBUG_DEFS += $(DEBUG_FLGS) INC_PATH += -I$(UTSBASE)/common/io/pci-ide +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/i86xpv/pci/Makefile b/usr/src/uts/i86xpv/pci/Makefile index 63bc7fa339..a57bbefc42 100644 --- a/usr/src/uts/i86xpv/pci/Makefile +++ b/usr/src/uts/i86xpv/pci/Makefile @@ -23,7 +23,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the PCI nexus driver # @@ -70,6 +70,9 @@ LINTFLAGS += -D_MODULE_NAME="\"$(MODULE)\"" LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/i86xpv/privcmd/Makefile b/usr/src/uts/i86xpv/privcmd/Makefile index 738dc6f160..8c5ce59e10 100644 --- a/usr/src/uts/i86xpv/privcmd/Makefile +++ b/usr/src/uts/i86xpv/privcmd/Makefile @@ -23,7 +23,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the privcmd # driver kernel module. @@ -58,6 +58,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/i86xpv/rootnex/Makefile b/usr/src/uts/i86xpv/rootnex/Makefile index e9ee5b5d12..af3f6354f4 100644 --- a/usr/src/uts/i86xpv/rootnex/Makefile +++ b/usr/src/uts/i86xpv/rootnex/Makefile @@ -23,7 +23,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the rootnex driver # @@ -63,6 +63,10 @@ LDFLAGS += -dy LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/i86xpv/unix/Makefile b/usr/src/uts/i86xpv/unix/Makefile index 600b3db4d3..7969a8dd44 100644 --- a/usr/src/uts/i86xpv/unix/Makefile +++ b/usr/src/uts/i86xpv/unix/Makefile @@ -123,6 +123,17 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-empty-body + # Ensure that lint sees 'struct cpu' containing a fully declared # embedded 'struct machcpu' # diff --git a/usr/src/uts/i86xpv/xdb/Makefile b/usr/src/uts/i86xpv/xdb/Makefile index 0fa27ea974..bc5628fd5c 100644 --- a/usr/src/uts/i86xpv/xdb/Makefile +++ b/usr/src/uts/i86xpv/xdb/Makefile @@ -55,6 +55,7 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-switch # # Overrides diff --git a/usr/src/uts/i86xpv/xdf/Makefile b/usr/src/uts/i86xpv/xdf/Makefile index 686f4a732c..01a5aea021 100644 --- a/usr/src/uts/i86xpv/xdf/Makefile +++ b/usr/src/uts/i86xpv/xdf/Makefile @@ -25,7 +25,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # i86xpv architecture dependent # @@ -61,6 +61,9 @@ LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/i86xpv/xdt/Makefile b/usr/src/uts/i86xpv/xdt/Makefile index 276b3865ca..e3d3f987db 100644 --- a/usr/src/uts/i86xpv/xdt/Makefile +++ b/usr/src/uts/i86xpv/xdt/Makefile @@ -23,8 +23,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# UTSBASE = ../.. @@ -42,6 +40,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) LDFLAGS += -dy -Ndrv/dtrace +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: def: $(DEF_DEPS) diff --git a/usr/src/uts/i86xpv/xenbus/Makefile b/usr/src/uts/i86xpv/xenbus/Makefile index f71cba09b5..a20aa84a9d 100644 --- a/usr/src/uts/i86xpv/xenbus/Makefile +++ b/usr/src/uts/i86xpv/xenbus/Makefile @@ -25,7 +25,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the xenbus # xenstore driver kernel module. @@ -60,6 +60,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable + # # Default build targets. # diff --git a/usr/src/uts/i86xpv/xencons/Makefile b/usr/src/uts/i86xpv/xencons/Makefile index 2eccd15c42..9acb97f2f2 100644 --- a/usr/src/uts/i86xpv/xencons/Makefile +++ b/usr/src/uts/i86xpv/xencons/Makefile @@ -25,7 +25,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the xencons # console driver kernel module. @@ -63,6 +63,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable + # # Default build targets. # diff --git a/usr/src/uts/i86xpv/xnb/Makefile b/usr/src/uts/i86xpv/xnb/Makefile index 72649e053e..336b225836 100644 --- a/usr/src/uts/i86xpv/xnb/Makefile +++ b/usr/src/uts/i86xpv/xnb/Makefile @@ -76,6 +76,8 @@ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/i86xpv/xpv_psm/Makefile b/usr/src/uts/i86xpv/xpv_psm/Makefile index e1c6a1ed2a..009ccabac1 100644 --- a/usr/src/uts/i86xpv/xpv_psm/Makefile +++ b/usr/src/uts/i86xpv/xpv_psm/Makefile @@ -23,7 +23,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the xpv_psm mach # kernel module. @@ -73,6 +73,11 @@ LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-empty-body + # Default build targets. # .KEEP_STATE: diff --git a/usr/src/uts/i86xpv/xpvd/Makefile b/usr/src/uts/i86xpv/xpvd/Makefile index a1c616cd10..83359e9cfe 100644 --- a/usr/src/uts/i86xpv/xpvd/Makefile +++ b/usr/src/uts/i86xpv/xpvd/Makefile @@ -23,7 +23,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the xpvd nexus driver # @@ -58,6 +58,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/i86xpv/xpvtap/Makefile b/usr/src/uts/i86xpv/xpvtap/Makefile index e51310e6ba..80778dfe66 100644 --- a/usr/src/uts/i86xpv/xpvtap/Makefile +++ b/usr/src/uts/i86xpv/xpvtap/Makefile @@ -75,6 +75,8 @@ LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_CONSTANT_CONDITION +CERRWARN += -_gcc=-Wno-unused-label + # # Default build targets. # diff --git a/usr/src/uts/i86xpv/xsvc/Makefile b/usr/src/uts/i86xpv/xsvc/Makefile index 0e2a65492f..8414445dc1 100644 --- a/usr/src/uts/i86xpv/xsvc/Makefile +++ b/usr/src/uts/i86xpv/xsvc/Makefile @@ -23,7 +23,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the xsvc driver kernel # module. @@ -66,6 +66,8 @@ LDFLAGS += -dy MODSTUBS_DIR = $(OBJS_DIR) CLEANFILES += $(MODSTUBS_O) +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/FSS/Makefile b/usr/src/uts/intel/FSS/Makefile index cd4b018441..e5ccd5a9a0 100644 --- a/usr/src/uts/intel/FSS/Makefile +++ b/usr/src/uts/intel/FSS/Makefile @@ -24,7 +24,7 @@ # # uts/intel/FSS/Makefile # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the FSS scheduling class # kernel module. @@ -64,6 +64,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/Makefile.intel.shared b/usr/src/uts/intel/Makefile.intel.shared index bd0977e532..0b2d708840 100644 --- a/usr/src/uts/intel/Makefile.intel.shared +++ b/usr/src/uts/intel/Makefile.intel.shared @@ -1,4 +1,3 @@ -# # CDDL HEADER START # # The contents of this file are subject to the terms of the @@ -20,9 +19,8 @@ # # Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - -# Copyright 2011 Nexenta Systems, Inc. All rights reserved. # Copyright (c) 2012 Joyent, Inc. All rights reserved. +# Copyright (c) 2012 Nexenta Systems, Inc. All rights reserved. # # This makefile contains the common definitions for all intel @@ -411,6 +409,16 @@ DRV_KMODS += vr $(CLOSED_BUILD)CLOSED_DRV_KMODS += ixgb # +# Virtio drivers +# + +# Virtio core +DRV_KMODS += virtio + +# Virtio block driver +DRV_KMODS += vioblk + +# # DTrace and DTrace Providers # DRV_KMODS += dtrace diff --git a/usr/src/uts/intel/aac/Makefile b/usr/src/uts/intel/aac/Makefile index 6deee97aba..15e6b33d1a 100644 --- a/usr/src/uts/intel/aac/Makefile +++ b/usr/src/uts/intel/aac/Makefile @@ -23,7 +23,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the aac driver kernel module. # @@ -68,6 +68,12 @@ LDFLAGS += -dy -Nmisc/scsi # Overrides # +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/intel/acpica/Makefile b/usr/src/uts/intel/acpica/Makefile index fec299a870..c901c5d2ba 100644 --- a/usr/src/uts/intel/acpica/Makefile +++ b/usr/src/uts/intel/acpica/Makefile @@ -57,6 +57,10 @@ LINTFLAGS += -errhdr=%none LINTFLAGS += -erroff=%all LINTFLAGS += -errwarn=%none +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/aggr/Makefile b/usr/src/uts/intel/aggr/Makefile index 133dcdac8b..c1acf014c7 100644 --- a/usr/src/uts/intel/aggr/Makefile +++ b/usr/src/uts/intel/aggr/Makefile @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -65,6 +63,12 @@ LDFLAGS += -dy -Ndrv/dld -Nmisc/mac -Nmisc/dls LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable + # # Default build targets. # diff --git a/usr/src/uts/intel/agpgart/Makefile b/usr/src/uts/intel/agpgart/Makefile index 4925a216b2..e80b1db6cf 100644 --- a/usr/src/uts/intel/agpgart/Makefile +++ b/usr/src/uts/intel/agpgart/Makefile @@ -4,8 +4,7 @@ # # uts/intel/agpgart/Makefile # -# -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the framework of agp protocol # (agpgart) kernel module. @@ -36,6 +35,10 @@ ALL_TARGET = $(BINARY) $(SRC_CONFILE) LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # For now, disable these lint checks; maintainers should endeavor # to investigate and remove these for maximum lint coverage. diff --git a/usr/src/uts/intel/agptarget/Makefile b/usr/src/uts/intel/agptarget/Makefile index d8064ea72b..8cf479a368 100644 --- a/usr/src/uts/intel/agptarget/Makefile +++ b/usr/src/uts/intel/agptarget/Makefile @@ -31,6 +31,8 @@ LDFLAGS += -dy -Nmisc/busra # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/intel/ahci/Makefile b/usr/src/uts/intel/ahci/Makefile index 564ebabe2d..f5a003fab5 100644 --- a/usr/src/uts/intel/ahci/Makefile +++ b/usr/src/uts/intel/ahci/Makefile @@ -23,8 +23,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# # # This makefile drives the production of the @@ -73,6 +71,10 @@ DEBUG_DEFS += $(DEBUG_FLGS) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # # we depend on the sata module diff --git a/usr/src/uts/intel/amr/Makefile b/usr/src/uts/intel/amr/Makefile index 679408abfa..eecc02183b 100644 --- a/usr/src/uts/intel/amr/Makefile +++ b/usr/src/uts/intel/amr/Makefile @@ -45,6 +45,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses + # # Depends on scsi # diff --git a/usr/src/uts/intel/arcmsr/Makefile b/usr/src/uts/intel/arcmsr/Makefile index 8349da09a8..286162de07 100644 --- a/usr/src/uts/intel/arcmsr/Makefile +++ b/usr/src/uts/intel/arcmsr/Makefile @@ -41,6 +41,11 @@ CONF_SRCDIR = $(UTSBASE)/intel/io/scsi/adapters/arcmsr # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets. # @@ -52,6 +57,7 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # Note dependancy on misc/scsi. # LDFLAGS += -dy -N"misc/scsi" + # # Default build targets. # diff --git a/usr/src/uts/intel/arn/Makefile b/usr/src/uts/intel/arn/Makefile index 7bbf268098..ddc4e69dd2 100644 --- a/usr/src/uts/intel/arn/Makefile +++ b/usr/src/uts/intel/arn/Makefile @@ -61,6 +61,12 @@ LDFLAGS += -dy -Nmisc/mac -Nmisc/net80211 LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-empty-body + # # Default build targets. # diff --git a/usr/src/uts/intel/asy/Makefile b/usr/src/uts/intel/asy/Makefile index fa866ec236..fc51587b26 100644 --- a/usr/src/uts/intel/asy/Makefile +++ b/usr/src/uts/intel/asy/Makefile @@ -24,7 +24,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the asy `drv' # kernel module. @@ -70,6 +70,11 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable + # # Default build targets. # diff --git a/usr/src/uts/intel/ata/Makefile b/usr/src/uts/intel/ata/Makefile index ce2e3d5c81..c0c0584bf2 100644 --- a/usr/src/uts/intel/ata/Makefile +++ b/usr/src/uts/intel/ata/Makefile @@ -72,6 +72,9 @@ INC_PATH += -I$(UTSBASE)/intel/io/dktp/hba/ghd # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Depends on scsi # diff --git a/usr/src/uts/intel/atge/Makefile b/usr/src/uts/intel/atge/Makefile index eb39aa821b..dc5fb963d0 100644 --- a/usr/src/uts/intel/atge/Makefile +++ b/usr/src/uts/intel/atge/Makefile @@ -56,6 +56,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # Overrides # +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch + # # Driver depends on GLD # diff --git a/usr/src/uts/intel/ath/Makefile b/usr/src/uts/intel/ath/Makefile index 46c623233f..fbf5b7d6eb 100644 --- a/usr/src/uts/intel/ath/Makefile +++ b/usr/src/uts/intel/ath/Makefile @@ -62,6 +62,10 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # LDFLAGS += -dy -Nmisc/mac -Nmisc/net80211 +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-empty-body + # # Default build targets. # diff --git a/usr/src/uts/intel/atu/Makefile b/usr/src/uts/intel/atu/Makefile index d9c6021615..958ead1731 100644 --- a/usr/src/uts/intel/atu/Makefile +++ b/usr/src/uts/intel/atu/Makefile @@ -59,6 +59,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # LDFLAGS += -dy -Nmisc/mac -Nmisc/net80211 -Nmisc/usba +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/intel/audio/Makefile b/usr/src/uts/intel/audio/Makefile index e9c4ca1bc3..7a3ba33a11 100644 --- a/usr/src/uts/intel/audio/Makefile +++ b/usr/src/uts/intel/audio/Makefile @@ -46,6 +46,8 @@ CONF_SRCDIR = $(UTSBASE)/common/io/audio/impl # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/intel/audio1575/Makefile b/usr/src/uts/intel/audio1575/Makefile index f3d241376d..c23809dc8b 100644 --- a/usr/src/uts/intel/audio1575/Makefile +++ b/usr/src/uts/intel/audio1575/Makefile @@ -51,6 +51,8 @@ include $(UTSBASE)/intel/Makefile.intel # LDFLAGS += -dy -Ndrv/audio -Nmisc/ac97 +CERRWARN += -_gcc=-Wno-switch + # # Define targets # diff --git a/usr/src/uts/intel/audio810/Makefile b/usr/src/uts/intel/audio810/Makefile index a3d3df4247..487ccd3ce3 100644 --- a/usr/src/uts/intel/audio810/Makefile +++ b/usr/src/uts/intel/audio810/Makefile @@ -52,6 +52,8 @@ include $(UTSBASE)/intel/Makefile.intel # LDFLAGS += -dy -Ndrv/audio -Nmisc/ac97 +CERRWARN += -_gcc=-Wno-switch + # # Define targets # diff --git a/usr/src/uts/intel/audiocmi/Makefile b/usr/src/uts/intel/audiocmi/Makefile index b6afc59a3c..d173c0442e 100644 --- a/usr/src/uts/intel/audiocmi/Makefile +++ b/usr/src/uts/intel/audiocmi/Makefile @@ -54,6 +54,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LDFLAGS += -dy -Ndrv/audio +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/audiocmihd/Makefile b/usr/src/uts/intel/audiocmihd/Makefile index 7bbc917f72..fa3a3c43f6 100644 --- a/usr/src/uts/intel/audiocmihd/Makefile +++ b/usr/src/uts/intel/audiocmihd/Makefile @@ -56,6 +56,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LDFLAGS += -dy -Ndrv/audio -Nmisc/ac97 +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/audioemu10k/Makefile b/usr/src/uts/intel/audioemu10k/Makefile index be847cd106..ff855e75f4 100644 --- a/usr/src/uts/intel/audioemu10k/Makefile +++ b/usr/src/uts/intel/audioemu10k/Makefile @@ -60,6 +60,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LDFLAGS += -dy -Ndrv/audio -Nmisc/ac97 +CERRWARN += -_gcc=-Wno-uninitialized + $(OBJS_DIR)/%.o := CPPFLAGS += -I$(OBJS_DIR) $(OBJS_DIR)/%.ln := CPPFLAGS += -I$(OBJS_DIR) $(OBJS_DIR)/emu10k_gpr.h := ASM10KFLAGS = -v -0 -P gpr diff --git a/usr/src/uts/intel/audioens/Makefile b/usr/src/uts/intel/audioens/Makefile index 1fc59de8b1..8170620e89 100644 --- a/usr/src/uts/intel/audioens/Makefile +++ b/usr/src/uts/intel/audioens/Makefile @@ -54,6 +54,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LDFLAGS += -dy -Ndrv/audio -Nmisc/ac97 +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/audiohd/Makefile b/usr/src/uts/intel/audiohd/Makefile index 89a8444fe2..2ccf42e4f2 100644 --- a/usr/src/uts/intel/audiohd/Makefile +++ b/usr/src/uts/intel/audiohd/Makefile @@ -63,6 +63,10 @@ $(NOT_RELEASE_BUILD)DEBUG_DEFS += $(DEBUG_FLGS) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + LDFLAGS += -dy -Ndrv/audio # diff --git a/usr/src/uts/intel/audioixp/Makefile b/usr/src/uts/intel/audioixp/Makefile index 3c17853936..16db380a53 100644 --- a/usr/src/uts/intel/audioixp/Makefile +++ b/usr/src/uts/intel/audioixp/Makefile @@ -56,6 +56,8 @@ CFLAGS += $(CCVERBOSE) # LDFLAGS += -dy -Ndrv/audio -Nmisc/ac97 +CERRWARN += -_gcc=-Wno-unused-label + # # Define targets # diff --git a/usr/src/uts/intel/audiols/Makefile b/usr/src/uts/intel/audiols/Makefile index 027073402b..ffb2bf4e82 100644 --- a/usr/src/uts/intel/audiols/Makefile +++ b/usr/src/uts/intel/audiols/Makefile @@ -54,6 +54,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LDFLAGS += -dy -Ndrv/audio -Nmisc/ac97 +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/intel/audiop16x/Makefile b/usr/src/uts/intel/audiop16x/Makefile index 0b1b6638ba..e493e02fa5 100644 --- a/usr/src/uts/intel/audiop16x/Makefile +++ b/usr/src/uts/intel/audiop16x/Makefile @@ -54,6 +54,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LDFLAGS += -dy -Ndrv/audio -Nmisc/ac97 +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/audiopci/Makefile b/usr/src/uts/intel/audiopci/Makefile index 0d773f9659..f33f56c260 100644 --- a/usr/src/uts/intel/audiopci/Makefile +++ b/usr/src/uts/intel/audiopci/Makefile @@ -54,6 +54,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LDFLAGS += -dy -Ndrv/audio +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/audiosolo/Makefile b/usr/src/uts/intel/audiosolo/Makefile index 264964966d..d8eac43ea9 100644 --- a/usr/src/uts/intel/audiosolo/Makefile +++ b/usr/src/uts/intel/audiosolo/Makefile @@ -54,6 +54,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LDFLAGS += -dy -Ndrv/audio +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/audiots/Makefile b/usr/src/uts/intel/audiots/Makefile index 8aa04ae1ce..f571c8b8b6 100644 --- a/usr/src/uts/intel/audiots/Makefile +++ b/usr/src/uts/intel/audiots/Makefile @@ -55,6 +55,8 @@ CFLAGS += $(CCVERBOSE) # LDFLAGS += -dy -N misc/ac97 -N drv/audio +CERRWARN += -_gcc=-Wno-parentheses + # # Define targets # diff --git a/usr/src/uts/intel/autofs/Makefile b/usr/src/uts/intel/autofs/Makefile index 94c28816c9..13744bab48 100644 --- a/usr/src/uts/intel/autofs/Makefile +++ b/usr/src/uts/intel/autofs/Makefile @@ -71,6 +71,11 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/av1394/Makefile b/usr/src/uts/intel/av1394/Makefile index c3a6feb1cc..fc112dc4c4 100644 --- a/usr/src/uts/intel/av1394/Makefile +++ b/usr/src/uts/intel/av1394/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" -# # # Path to the base of the uts directory tree. @@ -75,6 +73,10 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits + # # depends on misc/s1394 LDFLAGS += -dy -Nmisc/s1394 diff --git a/usr/src/uts/intel/bfe/Makefile b/usr/src/uts/intel/bfe/Makefile index 58f58e5560..89b13ec0be 100644 --- a/usr/src/uts/intel/bfe/Makefile +++ b/usr/src/uts/intel/bfe/Makefile @@ -68,6 +68,9 @@ CPPFLAGS += $(VFLAGS) $(AFLAGS) $(DFLAGS) $(CFGFLAGS) $(CCVERBOSE) \ CFLAGS += $(CPPFLAGS) -xc99=%all +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Driver depends on MAC & IP # diff --git a/usr/src/uts/intel/bge/Makefile b/usr/src/uts/intel/bge/Makefile index 143f03720b..3d59fb4bf1 100644 --- a/usr/src/uts/intel/bge/Makefile +++ b/usr/src/uts/intel/bge/Makefile @@ -22,7 +22,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the Broadcom BCM57xx # Gigabit Ethernet (BGE) driver module in intel systems @@ -64,6 +64,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses # # Driver depends on MAC diff --git a/usr/src/uts/intel/blkdev/Makefile b/usr/src/uts/intel/blkdev/Makefile index a5607b8566..e74e516804 100644 --- a/usr/src/uts/intel/blkdev/Makefile +++ b/usr/src/uts/intel/blkdev/Makefile @@ -57,6 +57,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # LDFLAGS += -dy -Nmisc/cmlb +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/blowfish/Makefile b/usr/src/uts/intel/blowfish/Makefile index 4c9bf9e467..bc4746e129 100644 --- a/usr/src/uts/intel/blowfish/Makefile +++ b/usr/src/uts/intel/blowfish/Makefile @@ -22,7 +22,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the Blowfish KEF provider. # @@ -75,6 +75,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/bofi/Makefile b/usr/src/uts/intel/bofi/Makefile index 87cc4aa5ed..14a5fd7bc0 100644 --- a/usr/src/uts/intel/bofi/Makefile +++ b/usr/src/uts/intel/bofi/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the bofi driver # kernel module. @@ -66,7 +66,9 @@ MODSTUBS_DIR = $(OBJS_DIR) $(MODSTUBS_O) := AS_CPPFLAGS += -DBOFI_MODULE CLEANFILES += $(MODSTUBS_O) -CPPFLAGS += -I../../sun4 +CPPFLAGS += -I../../sun4 + +CERRWARN += -_gcc=-Wno-uninitialized # # For now, disable these lint checks; maintainers should endeavor diff --git a/usr/src/uts/intel/bpf/Makefile b/usr/src/uts/intel/bpf/Makefile index 410df18e54..b7136e61db 100644 --- a/usr/src/uts/intel/bpf/Makefile +++ b/usr/src/uts/intel/bpf/Makefile @@ -70,6 +70,9 @@ INC_PATH += -I$(UTSBASE)/common/io/bpf # LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/bridge/Makefile b/usr/src/uts/intel/bridge/Makefile index c06180ffb4..65b7f28ee8 100644 --- a/usr/src/uts/intel/bridge/Makefile +++ b/usr/src/uts/intel/bridge/Makefile @@ -57,6 +57,10 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses + # # Driver depends on MAC, DLS, and DLD # diff --git a/usr/src/uts/intel/bscbus/Makefile b/usr/src/uts/intel/bscbus/Makefile index 1e2944f362..ec4acf91b5 100644 --- a/usr/src/uts/intel/bscbus/Makefile +++ b/usr/src/uts/intel/bscbus/Makefile @@ -24,7 +24,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the bscbus driver # @@ -66,6 +66,8 @@ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-unused-value + # # Default build targets. # diff --git a/usr/src/uts/intel/bscv/Makefile b/usr/src/uts/intel/bscv/Makefile index f01bd4e914..d450f08475 100644 --- a/usr/src/uts/intel/bscv/Makefile +++ b/usr/src/uts/intel/bscv/Makefile @@ -24,7 +24,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the bscv driver # @@ -67,6 +67,9 @@ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-value + # # Default build targets. # diff --git a/usr/src/uts/intel/busra/Makefile b/usr/src/uts/intel/busra/Makefile index 36bfd57516..9bb7ea39ec 100644 --- a/usr/src/uts/intel/busra/Makefile +++ b/usr/src/uts/intel/busra/Makefile @@ -25,7 +25,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the busra # kernel module. @@ -51,6 +51,9 @@ ROOTMODULE = $(ROOT_MISC_DIR)/$(MODULE) # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/intel/c2audit/Makefile b/usr/src/uts/intel/c2audit/Makefile index 316e3a35ee..0afbc9383c 100644 --- a/usr/src/uts/intel/c2audit/Makefile +++ b/usr/src/uts/intel/c2audit/Makefile @@ -75,6 +75,10 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/cachefs/Makefile b/usr/src/uts/intel/cachefs/Makefile index b1254fe1df..cad7332144 100644 --- a/usr/src/uts/intel/cachefs/Makefile +++ b/usr/src/uts/intel/cachefs/Makefile @@ -73,6 +73,9 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/cardbus/Makefile b/usr/src/uts/intel/cardbus/Makefile index 656e86d123..4b5fa7e764 100755..100644 --- a/usr/src/uts/intel/cardbus/Makefile +++ b/usr/src/uts/intel/cardbus/Makefile @@ -24,7 +24,7 @@ # # uts/intel/cardbus/Makefile # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the cardbus kernel module. # @@ -82,6 +82,11 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable + # # Default build targets. # diff --git a/usr/src/uts/intel/chxge/Makefile b/usr/src/uts/intel/chxge/Makefile index 100d73f507..0d1a5010a1 100644 --- a/usr/src/uts/intel/chxge/Makefile +++ b/usr/src/uts/intel/chxge/Makefile @@ -22,7 +22,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the Chelsio N110 # 10G Ethernet (CH) driver module in x86 systems @@ -101,6 +101,11 @@ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses + # # # Default build targets. diff --git a/usr/src/uts/intel/cmdk/Makefile b/usr/src/uts/intel/cmdk/Makefile index bc5f1c5db7..05532fd7b2 100644 --- a/usr/src/uts/intel/cmdk/Makefile +++ b/usr/src/uts/intel/cmdk/Makefile @@ -66,6 +66,11 @@ LDFLAGS += -dy -Nmisc/dadk -Nmisc/strategy -Nmisc/cmlb # Larger than 1TB VTOC support CPPFLAGS += -D_EXTVTOC +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits + # # For now, disable these lint checks; maintainers should endeavor # to investigate and remove these for maximum lint coverage. diff --git a/usr/src/uts/intel/cmlb/Makefile b/usr/src/uts/intel/cmlb/Makefile index f320bcaaab..199d487524 100644 --- a/usr/src/uts/intel/cmlb/Makefile +++ b/usr/src/uts/intel/cmlb/Makefile @@ -76,6 +76,12 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/consms/Makefile b/usr/src/uts/intel/consms/Makefile index 46f4696638..d6aa3b8d95 100644 --- a/usr/src/uts/intel/consms/Makefile +++ b/usr/src/uts/intel/consms/Makefile @@ -23,7 +23,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the consms driver # @@ -63,6 +63,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/intel/core_pcbe/Makefile b/usr/src/uts/intel/core_pcbe/Makefile index e7a5546b03..7f2d1ad8e5 100644 --- a/usr/src/uts/intel/core_pcbe/Makefile +++ b/usr/src/uts/intel/core_pcbe/Makefile @@ -52,6 +52,9 @@ ROOTSOFTLINKS = $(SOFTLINKS:%=$(ROOT_PSM_PCBE_DIR)/%) # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable + # # Define targets. # diff --git a/usr/src/uts/intel/cryptmod/Makefile b/usr/src/uts/intel/cryptmod/Makefile index db37788934..4e9e2d5d41 100644 --- a/usr/src/uts/intel/cryptmod/Makefile +++ b/usr/src/uts/intel/cryptmod/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the streams crypto kernel # module. @@ -65,6 +65,8 @@ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/crypto/Makefile b/usr/src/uts/intel/crypto/Makefile index 084dbe270a..adbd33bbc4 100644 --- a/usr/src/uts/intel/crypto/Makefile +++ b/usr/src/uts/intel/crypto/Makefile @@ -56,6 +56,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOTLINK) $(ROOT_CONFFILE) LDFLAGS += -dy -Nmisc/kcf +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/cryptoadm/Makefile b/usr/src/uts/intel/cryptoadm/Makefile index c19830eec1..34917c1339 100644 --- a/usr/src/uts/intel/cryptoadm/Makefile +++ b/usr/src/uts/intel/cryptoadm/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the cryptoadm driver # kernel module. @@ -65,6 +65,9 @@ LDFLAGS += -dy -Nmisc/kcf # LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/ctf/Makefile b/usr/src/uts/intel/ctf/Makefile index d95308321a..207a5ff8ea 100644 --- a/usr/src/uts/intel/ctf/Makefile +++ b/usr/src/uts/intel/ctf/Makefile @@ -22,7 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" UTSBASE = ../.. @@ -49,6 +48,8 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: def: $(DEF_DEPS) diff --git a/usr/src/uts/intel/ctfs/Makefile b/usr/src/uts/intel/ctfs/Makefile index 233c2224ae..cbe7dd1c34 100644 --- a/usr/src/uts/intel/ctfs/Makefile +++ b/usr/src/uts/intel/ctfs/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the contract file system # kernel module. @@ -62,6 +62,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/dadk/Makefile b/usr/src/uts/intel/dadk/Makefile index 9b832952de..85c6ff48be 100644 --- a/usr/src/uts/intel/dadk/Makefile +++ b/usr/src/uts/intel/dadk/Makefile @@ -73,6 +73,8 @@ CPPFLAGS += -D_EXTVTOC # LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/daplt/Makefile b/usr/src/uts/intel/daplt/Makefile index 24c315bdee..edc6de73ab 100644 --- a/usr/src/uts/intel/daplt/Makefile +++ b/usr/src/uts/intel/daplt/Makefile @@ -71,6 +71,11 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/dca/Makefile b/usr/src/uts/intel/dca/Makefile index 92a48e42cd..1cb66084e3 100644 --- a/usr/src/uts/intel/dca/Makefile +++ b/usr/src/uts/intel/dca/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the DCA kCF provider. # @@ -71,6 +71,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable + # # Default build targets. # diff --git a/usr/src/uts/intel/dcam1394/Makefile b/usr/src/uts/intel/dcam1394/Makefile index 12ffe30fe3..c043878082 100644 --- a/usr/src/uts/intel/dcam1394/Makefile +++ b/usr/src/uts/intel/dcam1394/Makefile @@ -22,8 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -66,6 +64,9 @@ LDFLAGS += -dy -Nmisc/s1394 # LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # Default build targets. # .KEEP_STATE: diff --git a/usr/src/uts/intel/dcfs/Makefile b/usr/src/uts/intel/dcfs/Makefile index f6bd3f18c2..ab0738de9c 100644 --- a/usr/src/uts/intel/dcfs/Makefile +++ b/usr/src/uts/intel/dcfs/Makefile @@ -58,6 +58,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/dcopy/Makefile b/usr/src/uts/intel/dcopy/Makefile index e321465ec1..baa0c303b5 100644 --- a/usr/src/uts/intel/dcopy/Makefile +++ b/usr/src/uts/intel/dcopy/Makefile @@ -24,7 +24,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the dcopy # kernel module. @@ -50,6 +50,8 @@ ROOTMODULE = $(ROOT_MISC_DIR)/$(MODULE) # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-unused-label + # # Define targets # diff --git a/usr/src/uts/intel/des/Makefile b/usr/src/uts/intel/des/Makefile index 400e8c1736..e9512fabe6 100644 --- a/usr/src/uts/intel/des/Makefile +++ b/usr/src/uts/intel/des/Makefile @@ -24,7 +24,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the des crypto kernel module. # @@ -80,6 +80,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/dev/Makefile b/usr/src/uts/intel/dev/Makefile index 8347ffbde0..b5c7c1a9c8 100644 --- a/usr/src/uts/intel/dev/Makefile +++ b/usr/src/uts/intel/dev/Makefile @@ -63,6 +63,10 @@ LDFLAGS += -dy -Nfs/devfs -Nmisc/dls INC_PATH += -I$(UTSBASE)/common/fs/zfs INC_PATH += -I$(UTSBASE)/common/io/bpf +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/devfs/Makefile b/usr/src/uts/intel/devfs/Makefile index eeaddc7733..c2a5b33098 100644 --- a/usr/src/uts/intel/devfs/Makefile +++ b/usr/src/uts/intel/devfs/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # uts/intel/devfs/Makefile # This makefile drives the production of the devfs file system @@ -49,6 +49,8 @@ ROOTMODULE = $(ROOT_FS_DIR)/$(MODULE) # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-parentheses + # # Define targets # diff --git a/usr/src/uts/intel/devinfo/Makefile b/usr/src/uts/intel/devinfo/Makefile index 09fc90ea7b..f9dd3056dd 100644 --- a/usr/src/uts/intel/devinfo/Makefile +++ b/usr/src/uts/intel/devinfo/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the devinfo kernel # driver to support libdevinfo. @@ -60,6 +60,11 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) CPPFLAGS += -I$(SRC)/common +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-clobbered + # # Default build targets. # diff --git a/usr/src/uts/intel/dld/Makefile b/usr/src/uts/intel/dld/Makefile index e9dd181973..e0b736c8d2 100644 --- a/usr/src/uts/intel/dld/Makefile +++ b/usr/src/uts/intel/dld/Makefile @@ -67,6 +67,10 @@ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/dls/Makefile b/usr/src/uts/intel/dls/Makefile index c882f9629e..dfa1cd74ec 100644 --- a/usr/src/uts/intel/dls/Makefile +++ b/usr/src/uts/intel/dls/Makefile @@ -65,6 +65,8 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/dmfe/Makefile b/usr/src/uts/intel/dmfe/Makefile index 7d517a365b..1bef101854 100644 --- a/usr/src/uts/intel/dmfe/Makefile +++ b/usr/src/uts/intel/dmfe/Makefile @@ -56,6 +56,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized + # # extra link arguments # diff --git a/usr/src/uts/intel/dnet/Makefile b/usr/src/uts/intel/dnet/Makefile index 9fddc8d1de..e793392b1f 100644 --- a/usr/src/uts/intel/dnet/Makefile +++ b/usr/src/uts/intel/dnet/Makefile @@ -64,6 +64,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + LDFLAGS += -dy -N misc/mac # diff --git a/usr/src/uts/intel/doorfs/Makefile b/usr/src/uts/intel/doorfs/Makefile index e6e002c0eb..f0bfcbee8b 100644 --- a/usr/src/uts/intel/doorfs/Makefile +++ b/usr/src/uts/intel/doorfs/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the doorfs driver kernel module. # @@ -73,6 +73,9 @@ CLEANFILES += $(MODSTUBS_O) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/dprov/Makefile b/usr/src/uts/intel/dprov/Makefile index 67d042d208..4ecb5915ef 100644 --- a/usr/src/uts/intel/dprov/Makefile +++ b/usr/src/uts/intel/dprov/Makefile @@ -22,7 +22,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the dummy KEF provider. # @@ -84,6 +84,10 @@ LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label + # # Default build targets. # diff --git a/usr/src/uts/intel/drm/Makefile b/usr/src/uts/intel/drm/Makefile index 05221302e6..1e48127d53 100644 --- a/usr/src/uts/intel/drm/Makefile +++ b/usr/src/uts/intel/drm/Makefile @@ -23,7 +23,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the DRM (Direct Rendering # Manager) common misc module. @@ -52,6 +52,10 @@ LDFLAGS += -dy -Nmisc/agpmaster -Nmisc/gfx_private # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable + # # Define targets # diff --git a/usr/src/uts/intel/dscpmk/Makefile b/usr/src/uts/intel/dscpmk/Makefile index f56b5c69bf..5d5ed6d3b5 100644 --- a/usr/src/uts/intel/dscpmk/Makefile +++ b/usr/src/uts/intel/dscpmk/Makefile @@ -23,7 +23,6 @@ # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" # # This makefile creates the marker (ipp) module. # intel architecture dependent @@ -69,6 +68,8 @@ LDFLAGS += -dy -Ndrv/ip LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/dtrace/Makefile b/usr/src/uts/intel/dtrace/Makefile index 5cd153e387..ba914bcbaa 100644 --- a/usr/src/uts/intel/dtrace/Makefile +++ b/usr/src/uts/intel/dtrace/Makefile @@ -22,7 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" UTSBASE = ../.. @@ -46,6 +45,10 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized + ALL_TARGET = $(BINARY) $(SRC_CONFILE) LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) diff --git a/usr/src/uts/intel/e1000g/Makefile b/usr/src/uts/intel/e1000g/Makefile index 319f27bee7..503e3f91dc 100644 --- a/usr/src/uts/intel/e1000g/Makefile +++ b/usr/src/uts/intel/e1000g/Makefile @@ -58,6 +58,12 @@ CFLAGS_CPP_COMMENTS = -xCC CFLAGS += $(CFLAGS_CPP_COMMENTS) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable + # # Define targets # diff --git a/usr/src/uts/intel/ecc/Makefile b/usr/src/uts/intel/ecc/Makefile index e7be8e1fdb..9d3c1bce9e 100644 --- a/usr/src/uts/intel/ecc/Makefile +++ b/usr/src/uts/intel/ecc/Makefile @@ -69,6 +69,14 @@ CFLAGS += -DMP_API_COMPATIBLE -DNSS_ECC_MORE_THAN_SUITE_B LINTFLAGS += -I$(COM1_DIR) -I$(COM2_DIR) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-empty-body +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/ecpp/Makefile b/usr/src/uts/intel/ecpp/Makefile index 92ad2f9c9f..ad00fbee41 100644 --- a/usr/src/uts/intel/ecpp/Makefile +++ b/usr/src/uts/intel/ecpp/Makefile @@ -22,7 +22,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This Makefile drives the production of ecpp # kernel module. @@ -67,6 +67,10 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable + # # Default build targets. # diff --git a/usr/src/uts/intel/efe/Makefile b/usr/src/uts/intel/efe/Makefile index 602037b49b..687ffc28a0 100644 --- a/usr/src/uts/intel/efe/Makefile +++ b/usr/src/uts/intel/efe/Makefile @@ -40,6 +40,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -N misc/mac -N misc/mii +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/ehci/Makefile b/usr/src/uts/intel/ehci/Makefile index 4f12a13773..84340ab114 100644 --- a/usr/src/uts/intel/ehci/Makefile +++ b/usr/src/uts/intel/ehci/Makefile @@ -48,6 +48,9 @@ WLCMD_DIR = $(UTSBASE)/common/io/warlock # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch + # # depends on misc/usba # diff --git a/usr/src/uts/intel/eibnx/Makefile b/usr/src/uts/intel/eibnx/Makefile index 82a5119540..790d52d56e 100644 --- a/usr/src/uts/intel/eibnx/Makefile +++ b/usr/src/uts/intel/eibnx/Makefile @@ -77,6 +77,9 @@ LDFLAGS += -dy -Nmisc/ibcm -Nmisc/ibtl # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets # diff --git a/usr/src/uts/intel/elfexec/Makefile b/usr/src/uts/intel/elfexec/Makefile index 4840620966..9751e04ba7 100644 --- a/usr/src/uts/intel/elfexec/Makefile +++ b/usr/src/uts/intel/elfexec/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the elfexec exec kernel # module. @@ -69,6 +69,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/elxl/Makefile b/usr/src/uts/intel/elxl/Makefile index 304e34b84d..22f578c91d 100644 --- a/usr/src/uts/intel/elxl/Makefile +++ b/usr/src/uts/intel/elxl/Makefile @@ -60,6 +60,9 @@ LDFLAGS += -dy -N misc/mac -N misc/mii # Lint flag # +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # # Default build targets. diff --git a/usr/src/uts/intel/emlxs/Makefile b/usr/src/uts/intel/emlxs/Makefile index 637f65b402..46594b4d60 100644 --- a/usr/src/uts/intel/emlxs/Makefile +++ b/usr/src/uts/intel/emlxs/Makefile @@ -91,6 +91,10 @@ LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_INCONS_VAL_TYPE_DECL2 +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/emul64/Makefile b/usr/src/uts/intel/emul64/Makefile index 565c57a367..da916f1dbc 100644 --- a/usr/src/uts/intel/emul64/Makefile +++ b/usr/src/uts/intel/emul64/Makefile @@ -67,6 +67,9 @@ CFLAGS += $(CCVERBOSE) # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Depends on scsi # diff --git a/usr/src/uts/intel/eoib/Makefile b/usr/src/uts/intel/eoib/Makefile index 9518c711af..0be7ddc774 100644 --- a/usr/src/uts/intel/eoib/Makefile +++ b/usr/src/uts/intel/eoib/Makefile @@ -66,6 +66,9 @@ CPPFLAGS += -DEIB_DEBUG # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Depends on misc/ibtl # diff --git a/usr/src/uts/intel/fasttrap/Makefile b/usr/src/uts/intel/fasttrap/Makefile index d549f2e142..f464ee90a9 100644 --- a/usr/src/uts/intel/fasttrap/Makefile +++ b/usr/src/uts/intel/fasttrap/Makefile @@ -23,8 +23,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# UTSBASE = ../.. @@ -45,6 +43,8 @@ CFLAGS += $(CCVERBOSE) CPPFLAGS += -I$(SRC)/common LDFLAGS += -dy -Ndrv/dtrace +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: def: $(DEF_DEPS) diff --git a/usr/src/uts/intel/fcip/Makefile b/usr/src/uts/intel/fcip/Makefile index 76d66f6b4b..0af2d29b95 100644 --- a/usr/src/uts/intel/fcip/Makefile +++ b/usr/src/uts/intel/fcip/Makefile @@ -71,6 +71,9 @@ LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_INCONS_ARG_USED2 LINTTAGS += -erroff=E_INCONS_VAL_TYPE_USED2 +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits + # # Default build targets. # diff --git a/usr/src/uts/intel/fcoe/Makefile b/usr/src/uts/intel/fcoe/Makefile index d4f6f26f8a..ac697a75f9 100644 --- a/usr/src/uts/intel/fcoe/Makefile +++ b/usr/src/uts/intel/fcoe/Makefile @@ -58,6 +58,8 @@ MODSTUBS_DIR = $(OBJS_DIR) LDFLAGS += -dy -Nmisc/mac INC_PATH += -I$(UTSBASE)/common/io/fcoe +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/fcp/Makefile b/usr/src/uts/intel/fcp/Makefile index 1d1105587f..8bfcc253c4 100644 --- a/usr/src/uts/intel/fcp/Makefile +++ b/usr/src/uts/intel/fcp/Makefile @@ -65,6 +65,11 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/fcsm/Makefile b/usr/src/uts/intel/fcsm/Makefile index 525d1bffb9..c181fc205c 100644 --- a/usr/src/uts/intel/fcsm/Makefile +++ b/usr/src/uts/intel/fcsm/Makefile @@ -70,6 +70,9 @@ LDFLAGS += -dy -Nmisc/fctl # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/fct/Makefile b/usr/src/uts/intel/fct/Makefile index d2c3f861dc..3281db0d10 100644 --- a/usr/src/uts/intel/fct/Makefile +++ b/usr/src/uts/intel/fct/Makefile @@ -71,6 +71,10 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_IF_ELSE_ANNOTATION +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/fctl/Makefile b/usr/src/uts/intel/fctl/Makefile index b93c2b4449..e325f915e2 100644 --- a/usr/src/uts/intel/fctl/Makefile +++ b/usr/src/uts/intel/fctl/Makefile @@ -68,6 +68,8 @@ LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/fd/Makefile b/usr/src/uts/intel/fd/Makefile index 675cc9740a..31f7be3535 100644 --- a/usr/src/uts/intel/fd/Makefile +++ b/usr/src/uts/intel/fd/Makefile @@ -24,7 +24,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the floppy driver # @@ -70,6 +70,8 @@ LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/fdc/Makefile b/usr/src/uts/intel/fdc/Makefile index 2ea0866fa5..3169694b23 100644 --- a/usr/src/uts/intel/fdc/Makefile +++ b/usr/src/uts/intel/fdc/Makefile @@ -24,7 +24,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the floppy controller dirver # @@ -69,6 +69,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/fifofs/Makefile b/usr/src/uts/intel/fifofs/Makefile index 4bb66ef3b3..429e63213d 100644 --- a/usr/src/uts/intel/fifofs/Makefile +++ b/usr/src/uts/intel/fifofs/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the fifofs file system # kernel module. @@ -72,6 +72,8 @@ CLEANFILES += $(MODSTUBS_O) LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/flowacct/Makefile b/usr/src/uts/intel/flowacct/Makefile index 51c05d47c7..0b9f291825 100644 --- a/usr/src/uts/intel/flowacct/Makefile +++ b/usr/src/uts/intel/flowacct/Makefile @@ -23,7 +23,6 @@ # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" # # This makefile creates the flowacct accounting (ipp) module. # intel architecture dependent @@ -67,6 +66,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/fp/Makefile b/usr/src/uts/intel/fp/Makefile index f988f1d4ab..55f405d69f 100644 --- a/usr/src/uts/intel/fp/Makefile +++ b/usr/src/uts/intel/fp/Makefile @@ -76,6 +76,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-function + # # Default build targets. # diff --git a/usr/src/uts/intel/fssnap/Makefile b/usr/src/uts/intel/fssnap/Makefile index debe0b964a..8efa81730c 100644 --- a/usr/src/uts/intel/fssnap/Makefile +++ b/usr/src/uts/intel/fssnap/Makefile @@ -24,7 +24,6 @@ # # intel architecture dependent # -#ident "%Z%%M% %I% %E% SMI" # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -64,6 +63,8 @@ LDFLAGS += -dy -Nmisc/fssnap_if -Nfs/ufs # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/gen_drv/Makefile b/usr/src/uts/intel/gen_drv/Makefile index fb8a147a6a..7776a6d08b 100644 --- a/usr/src/uts/intel/gen_drv/Makefile +++ b/usr/src/uts/intel/gen_drv/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the gen_drv kernel # driver to testing hotplugging operations @@ -62,6 +62,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-unused-variable + # # Default build targets. # diff --git a/usr/src/uts/intel/genunix/Makefile b/usr/src/uts/intel/genunix/Makefile index ab0073268f..3c96c10d49 100644 --- a/usr/src/uts/intel/genunix/Makefile +++ b/usr/src/uts/intel/genunix/Makefile @@ -98,6 +98,17 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-empty-body + # # Ensure that lint sees 'struct cpu' containing a fully declared # embedded 'struct machcpu' diff --git a/usr/src/uts/intel/gld/Makefile b/usr/src/uts/intel/gld/Makefile index f240e4e60a..53869c40df 100644 --- a/usr/src/uts/intel/gld/Makefile +++ b/usr/src/uts/intel/gld/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the gld driver # kernel module. @@ -66,6 +66,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/hci1394/Makefile b/usr/src/uts/intel/hci1394/Makefile index bc855c96a1..324bfaad1e 100644 --- a/usr/src/uts/intel/hci1394/Makefile +++ b/usr/src/uts/intel/hci1394/Makefile @@ -24,7 +24,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the hci1394 OHCI HAL module. # @@ -83,6 +83,9 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/hermon/Makefile b/usr/src/uts/intel/hermon/Makefile index 3666b75b10..df654582e9 100644 --- a/usr/src/uts/intel/hermon/Makefile +++ b/usr/src/uts/intel/hermon/Makefile @@ -75,6 +75,12 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/hid/Makefile b/usr/src/uts/intel/hid/Makefile index 20376e28e0..98ab745af4 100644 --- a/usr/src/uts/intel/hid/Makefile +++ b/usr/src/uts/intel/hid/Makefile @@ -73,6 +73,8 @@ LDFLAGS += -dy -Nmisc/usba -Nmisc/hidparser -Ndacf/consconfig_dacf # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/hidparser/Makefile b/usr/src/uts/intel/hidparser/Makefile index 0cee159aa9..fa8db67f73 100644 --- a/usr/src/uts/intel/hidparser/Makefile +++ b/usr/src/uts/intel/hidparser/Makefile @@ -46,6 +46,8 @@ ROOTMODULE = $(ROOT_MISC_DIR)/$(MODULE) # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/intel/hme/Makefile b/usr/src/uts/intel/hme/Makefile index 1065312ea1..ab1f31df18 100644 --- a/usr/src/uts/intel/hme/Makefile +++ b/usr/src/uts/intel/hme/Makefile @@ -59,6 +59,10 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -Nmisc/mii -Nmisc/mac +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/hook/Makefile b/usr/src/uts/intel/hook/Makefile index 06d4593682..91d0bda783 100644 --- a/usr/src/uts/intel/hook/Makefile +++ b/usr/src/uts/intel/hook/Makefile @@ -24,7 +24,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the hook driver kernel module. # @@ -50,6 +50,8 @@ ROOTMODULE = $(ROOT_MISC_DIR)/$(MODULE) # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/intel/hpcsvc/Makefile b/usr/src/uts/intel/hpcsvc/Makefile index d6260ee0cb..9aae68f8f1 100644 --- a/usr/src/uts/intel/hpcsvc/Makefile +++ b/usr/src/uts/intel/hpcsvc/Makefile @@ -24,7 +24,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the hpcsvc "misc" # kernel module. @@ -63,6 +63,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) DEBUG_FLGS = DEBUG_DEFS += $(DEBUG_FLGS) +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/hsfs/Makefile b/usr/src/uts/intel/hsfs/Makefile index ea8c25f22e..09099a698c 100644 --- a/usr/src/uts/intel/hsfs/Makefile +++ b/usr/src/uts/intel/hsfs/Makefile @@ -73,6 +73,12 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/intel/hwahc/Makefile b/usr/src/uts/intel/hwahc/Makefile index 759803f3cf..60346ffd44 100644 --- a/usr/src/uts/intel/hwahc/Makefile +++ b/usr/src/uts/intel/hwahc/Makefile @@ -48,6 +48,9 @@ WLCMD_DIR = $(UTSBASE)/common/io/warlock # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch + # # Define targets # diff --git a/usr/src/uts/intel/hxge/Makefile b/usr/src/uts/intel/hxge/Makefile index cfae693201..3f2444702f 100644 --- a/usr/src/uts/intel/hxge/Makefile +++ b/usr/src/uts/intel/hxge/Makefile @@ -81,6 +81,12 @@ LINTFLAGS += -DSOLARIS LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_FALSE_LOGICAL_EXPR + +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Driver depends on mac & IP # diff --git a/usr/src/uts/intel/i8042/Makefile b/usr/src/uts/intel/i8042/Makefile index c4e4797b4f..0a67c8d5b0 100644 --- a/usr/src/uts/intel/i8042/Makefile +++ b/usr/src/uts/intel/i8042/Makefile @@ -19,11 +19,10 @@ # CDDL HEADER END # # -# uts/intel/i8042/%M% # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the i8042 nexus driver # @@ -63,6 +62,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-unused-function + # # Default build targets. # diff --git a/usr/src/uts/intel/i915/Makefile b/usr/src/uts/intel/i915/Makefile index 6182d34a9f..e0c2a3002b 100644 --- a/usr/src/uts/intel/i915/Makefile +++ b/usr/src/uts/intel/i915/Makefile @@ -23,7 +23,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # uts/intel/drm/Makefile # @@ -57,6 +57,8 @@ LDFLAGS += -dy -Nmisc/drm # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-unused-label + # # Re-define targets # diff --git a/usr/src/uts/intel/ib/Makefile b/usr/src/uts/intel/ib/Makefile index 5fddccd1cf..b66a6ca45a 100644 --- a/usr/src/uts/intel/ib/Makefile +++ b/usr/src/uts/intel/ib/Makefile @@ -22,9 +22,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# -# + # # This makefile drives the production of the ibnex driver # @@ -64,6 +62,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # Overrides. # +CERRWARN += -_gcc=-Wno-uninitialized + # # lint pass one enforcement # diff --git a/usr/src/uts/intel/ibcm/Makefile b/usr/src/uts/intel/ibcm/Makefile index 013cd7637d..a3e573b057 100644 --- a/usr/src/uts/intel/ibcm/Makefile +++ b/usr/src/uts/intel/ibcm/Makefile @@ -28,8 +28,6 @@ # module. SPARC architecture dependent # -#ident "%Z%%M% %I% %E% SMI" - # # Path to the base of the uts directory tree (usually /usr/src/uts). # @@ -67,6 +65,14 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-value + # # depends on misc/ibtl and misc/ibmf # diff --git a/usr/src/uts/intel/ibdm/Makefile b/usr/src/uts/intel/ibdm/Makefile index 30c329cd97..c957274d71 100644 --- a/usr/src/uts/intel/ibdm/Makefile +++ b/usr/src/uts/intel/ibdm/Makefile @@ -22,9 +22,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# -# + # This makefile drives the production of the ibdm kernel module. # # intel architecture dependent @@ -79,6 +77,8 @@ LDFLAGS += -dy -Nmisc/ibtl -Nmisc/ibmf LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/ibmf/Makefile b/usr/src/uts/intel/ibmf/Makefile index 39e0f50834..ddb162da36 100644 --- a/usr/src/uts/intel/ibmf/Makefile +++ b/usr/src/uts/intel/ibmf/Makefile @@ -22,8 +22,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# + # This makefile drives the production of the ibmf kernel module. # # intel architecture dependent @@ -76,6 +75,8 @@ CFLAGS += $(CCVERBOSE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/ibp/Makefile b/usr/src/uts/intel/ibp/Makefile index bf395ccc0e..7496199be8 100644 --- a/usr/src/uts/intel/ibp/Makefile +++ b/usr/src/uts/intel/ibp/Makefile @@ -61,6 +61,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/intel/ibtl/Makefile b/usr/src/uts/intel/ibtl/Makefile index eb58c5246e..26cbb7ee6d 100644 --- a/usr/src/uts/intel/ibtl/Makefile +++ b/usr/src/uts/intel/ibtl/Makefile @@ -22,7 +22,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the ibtl kernel module. # @@ -77,6 +77,12 @@ LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-value + # # Default build targets. # diff --git a/usr/src/uts/intel/idm/Makefile b/usr/src/uts/intel/idm/Makefile index 27ad59afaf..99f4bb5cc3 100644 --- a/usr/src/uts/intel/idm/Makefile +++ b/usr/src/uts/intel/idm/Makefile @@ -62,6 +62,10 @@ DEBUG_FLGS = DEBUG_DEFS += $(DEBUG_FLGS) LDFLAGS += -dy -Nfs/sockfs -Nmisc/ksocket +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # Include INC_PATH += -I$(SRC)/common/hdcrc diff --git a/usr/src/uts/intel/idmap/Makefile b/usr/src/uts/intel/idmap/Makefile index 157f5cbed0..89b7b448ba 100644 --- a/usr/src/uts/intel/idmap/Makefile +++ b/usr/src/uts/intel/idmap/Makefile @@ -60,6 +60,8 @@ LDFLAGS += -dy -N"sys/doorfs" -N"strmod/rpcmod" # LINTTAGS += -erroff=E_FUNC_VAR_UNUSED -erroff=E_CONSTANT_CONDITION +CERRWARN += -_gcc=-Wno-unused-variable + # # Define targets # diff --git a/usr/src/uts/intel/igb/Makefile b/usr/src/uts/intel/igb/Makefile index 461f653159..b14088fedc 100644 --- a/usr/src/uts/intel/igb/Makefile +++ b/usr/src/uts/intel/igb/Makefile @@ -49,6 +49,9 @@ CONF_SRCDIR = $(UTSBASE)/common/io/igb # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/intel/ii/Makefile b/usr/src/uts/intel/ii/Makefile index 2b6eb23bd2..484f12bad1 100644 --- a/usr/src/uts/intel/ii/Makefile +++ b/usr/src/uts/intel/ii/Makefile @@ -62,11 +62,14 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # # lint pass one enforcement # -CFLAGS += -v +CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -N"drv/nsctl" -N"drv/nskern" -N"misc/spuni" LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: def: $(DEF_DEPS) diff --git a/usr/src/uts/intel/inst_sync/Makefile b/usr/src/uts/intel/inst_sync/Makefile index 18a7b42702..4dfeee22e8 100644 --- a/usr/src/uts/intel/inst_sync/Makefile +++ b/usr/src/uts/intel/inst_sync/Makefile @@ -25,7 +25,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the inst_sync system call module. # @@ -57,6 +57,8 @@ ALL_TARGET = $(BINARY) LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/intel_nb5000/Makefile b/usr/src/uts/intel/intel_nb5000/Makefile index ed3f586289..ec9092d791 100644 --- a/usr/src/uts/intel/intel_nb5000/Makefile +++ b/usr/src/uts/intel/intel_nb5000/Makefile @@ -75,6 +75,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # LDFLAGS += -dy -N drv/smbios +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/intel_nhm/Makefile b/usr/src/uts/intel/intel_nhm/Makefile index 41b7e8f99b..cc21adac2a 100644 --- a/usr/src/uts/intel/intel_nhm/Makefile +++ b/usr/src/uts/intel/intel_nhm/Makefile @@ -70,8 +70,10 @@ ALL_TARGET = $(BINARY) $(SRC_CONFFILE) LINT_TARGET = $(LINT_MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) -CPPFLAGS += -I$(UTSBASE)/i86pc -LDFLAGS += -dy -N drv/smbios +CPPFLAGS += -I$(UTSBASE)/i86pc +LDFLAGS += -dy -N drv/smbios + +CERRWARN += -_gcc=-Wno-uninitialized # # Default build targets. diff --git a/usr/src/uts/intel/intpexec/Makefile b/usr/src/uts/intel/intpexec/Makefile index 9ba154e40a..c450443739 100644 --- a/usr/src/uts/intel/intpexec/Makefile +++ b/usr/src/uts/intel/intpexec/Makefile @@ -25,7 +25,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the intpexec (interpreter) # exec kernel module. @@ -51,6 +51,8 @@ ROOTMODULE = $(ROOT_EXEC_DIR)/$(MODULE) # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-parentheses + # # Define targets # diff --git a/usr/src/uts/intel/io/agpmaster/agpmaster.c b/usr/src/uts/intel/io/agpmaster/agpmaster.c index 9e71b3cf41..7a4de1ea04 100644 --- a/usr/src/uts/intel/io/agpmaster/agpmaster.c +++ b/usr/src/uts/intel/io/agpmaster/agpmaster.c @@ -639,7 +639,7 @@ detect_i8xx_device(agp_master_softc_t *master_softc) } /* - * If agp master is succssfully detected, 0 is returned. + * If agp master is successfully detected, 0 is returned. * Otherwise -1 is returned. */ static int diff --git a/usr/src/uts/intel/io/ipmi/THIRDPARTYLICENSE b/usr/src/uts/intel/io/ipmi/THIRDPARTYLICENSE new file mode 100644 index 0000000000..78c9a1985c --- /dev/null +++ b/usr/src/uts/intel/io/ipmi/THIRDPARTYLICENSE @@ -0,0 +1,23 @@ +Copyright (c) 2006 IronPort Systems Inc. <ambrisko@ironport.com> +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. 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. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. diff --git a/usr/src/uts/intel/io/ipmi/THIRDPARTYLICENSE.descrip b/usr/src/uts/intel/io/ipmi/THIRDPARTYLICENSE.descrip new file mode 100644 index 0000000000..eb678fe823 --- /dev/null +++ b/usr/src/uts/intel/io/ipmi/THIRDPARTYLICENSE.descrip @@ -0,0 +1 @@ +INTELLIGENT PLATFORM MANAGEMENT INTERFACE SUPPORT diff --git a/usr/src/uts/intel/io/ipmi/ipmi.c b/usr/src/uts/intel/io/ipmi/ipmi.c index 56829dfcad..7c59bc2fda 100644 --- a/usr/src/uts/intel/io/ipmi/ipmi.c +++ b/usr/src/uts/intel/io/ipmi/ipmi.c @@ -235,7 +235,8 @@ ipmi_startup(struct ipmi_softc *sc) req = ipmi_alloc_driver_request(IPMI_ADDR(IPMI_APP_REQUEST, 0), IPMI_CLEAR_FLAGS, 1, 0); - (void) ipmi_submit_driver_request(sc, req, 0); + if ((error = ipmi_submit_driver_request(sc, req, 0)) != 0) + cmn_err(CE_WARN, "Failed to clear IPMI flags: %d\n", error); /* Magic numbers */ if (req->ir_compcode == 0xc0) { @@ -251,7 +252,10 @@ ipmi_startup(struct ipmi_softc *sc) IPMI_GET_CHANNEL_INFO, 1, 0); req->ir_request[0] = (uchar_t)i; - (void) ipmi_submit_driver_request(sc, req, 0); + if (ipmi_submit_driver_request(sc, req, 0) != 0) { + ipmi_free_request(req); + break; + } if (req->ir_compcode != 0) { ipmi_free_request(req); @@ -265,7 +269,11 @@ ipmi_startup(struct ipmi_softc *sc) req = ipmi_alloc_driver_request(IPMI_ADDR(IPMI_APP_REQUEST, 0), IPMI_GET_WDOG, 0, 0); - (void) ipmi_submit_driver_request(sc, req, 0); + if ((error = ipmi_submit_driver_request(sc, req, 0)) != 0) { + cmn_err(CE_WARN, "Failed to check IPMI watchdog: %d\n", error); + ipmi_free_request(req); + return; + } if (req->ir_compcode == 0x00) { cmn_err(CE_CONT, "!watchdog supported"); diff --git a/usr/src/uts/intel/io/ipmi/ipmi_kcs.c b/usr/src/uts/intel/io/ipmi/ipmi_kcs.c index 480db14459..2cdeb5c0f7 100644 --- a/usr/src/uts/intel/io/ipmi/ipmi_kcs.c +++ b/usr/src/uts/intel/io/ipmi/ipmi_kcs.c @@ -31,6 +31,7 @@ */ #include <sys/param.h> +#include <sys/disp.h> #include <sys/systm.h> #include <sys/condvar.h> #include <sys/cmn_err.h> diff --git a/usr/src/uts/intel/io/ipmi/ipmi_main.c b/usr/src/uts/intel/io/ipmi/ipmi_main.c index 465cb338a6..9d1e2d0031 100644 --- a/usr/src/uts/intel/io/ipmi/ipmi_main.c +++ b/usr/src/uts/intel/io/ipmi/ipmi_main.c @@ -180,21 +180,22 @@ static int ipmi_close(dev_t dev, int flag, int otyp, cred_t *cred) { ipmi_device_t *dp; - struct ipmi_request *req; + struct ipmi_request *req, *next; if ((dp = lookup_ipmidev_by_dev(dev)) == NULL) return (ENODEV); IPMI_LOCK(sc); /* remove any pending requests */ -restart: - for (req = TAILQ_FIRST(&sc->ipmi_pending_requests); req != NULL; - req = TAILQ_NEXT(req, ir_link)) { + req = TAILQ_FIRST(&sc->ipmi_pending_requests); + while (req != NULL) { + next = TAILQ_NEXT(req, ir_link); + if (req->ir_owner == dp) { TAILQ_REMOVE(&sc->ipmi_pending_requests, req, ir_link); ipmi_free_request(req); - goto restart; } + req = next; } IPMI_UNLOCK(sc); diff --git a/usr/src/uts/intel/ip/Makefile b/usr/src/uts/intel/ip/Makefile index bfb91b74ec..18036a47a7 100644 --- a/usr/src/uts/intel/ip/Makefile +++ b/usr/src/uts/intel/ip/Makefile @@ -59,6 +59,15 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOTLINK) $(ROOT_CONFFILE) CINLINEFLAGS = -xinline=tcp_set_ws_value CFLAGS += $(CINLINEFLAGS) + +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits + # # To get the BPF header files included by ipnet.h # diff --git a/usr/src/uts/intel/ipc/Makefile b/usr/src/uts/intel/ipc/Makefile index b69605882e..8bf9b9a67c 100644 --- a/usr/src/uts/intel/ipc/Makefile +++ b/usr/src/uts/intel/ipc/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the ipc `user' kernel module. # @@ -63,6 +63,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/ipf/Makefile b/usr/src/uts/intel/ipf/Makefile index db27bf34f7..046a6c223d 100644 --- a/usr/src/uts/intel/ipf/Makefile +++ b/usr/src/uts/intel/ipf/Makefile @@ -72,6 +72,12 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-empty-body + # # Default build targets. # diff --git a/usr/src/uts/intel/ipgpc/Makefile b/usr/src/uts/intel/ipgpc/Makefile index a418edda17..5b005a0022 100644 --- a/usr/src/uts/intel/ipgpc/Makefile +++ b/usr/src/uts/intel/ipgpc/Makefile @@ -23,7 +23,6 @@ # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" # # This makefile drives the production of the IP generic packet classifier # ipp kernel module. @@ -71,6 +70,8 @@ LDFLAGS += -dy -Ndrv/ip LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/iprb/Makefile b/usr/src/uts/intel/iprb/Makefile index 285813a7ae..4b991a68e6 100644 --- a/usr/src/uts/intel/iprb/Makefile +++ b/usr/src/uts/intel/iprb/Makefile @@ -54,6 +54,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # Overrides # +CERRWARN += -_gcc=-Wno-switch + # # Driver depends on GLD # diff --git a/usr/src/uts/intel/ipsecah/Makefile b/usr/src/uts/intel/ipsecah/Makefile index c11fb6c902..90870c6a0a 100644 --- a/usr/src/uts/intel/ipsecah/Makefile +++ b/usr/src/uts/intel/ipsecah/Makefile @@ -23,7 +23,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the ipsecah driver # kernel module. @@ -73,6 +73,9 @@ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/ipsecesp/Makefile b/usr/src/uts/intel/ipsecesp/Makefile index 3c5c1d12b4..68cf590888 100644 --- a/usr/src/uts/intel/ipsecesp/Makefile +++ b/usr/src/uts/intel/ipsecesp/Makefile @@ -23,7 +23,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the ipsecesp driver # kernel module. @@ -72,6 +72,8 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/iptun/Makefile b/usr/src/uts/intel/iptun/Makefile index 650b4581d2..24fb7f9fe8 100644 --- a/usr/src/uts/intel/iptun/Makefile +++ b/usr/src/uts/intel/iptun/Makefile @@ -59,6 +59,10 @@ INC_PATH += -I$(UTSBASE)/common/io/bpf LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/ipw/Makefile b/usr/src/uts/intel/ipw/Makefile index a8799c172e..4363bc43c4 100755..100644 --- a/usr/src/uts/intel/ipw/Makefile +++ b/usr/src/uts/intel/ipw/Makefile @@ -23,8 +23,6 @@ # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" - # # This makefile drives the production of the ipw driver kernel module. # @@ -49,6 +47,11 @@ ROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE) # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # @@ -69,7 +72,7 @@ def: $(DEF_DEPS) all: $(ALL_DEPS) clean: $(CLEAN_DEPS) - + clobber: $(CLOBBER_DEPS) lint: $(LINT_DEPS) diff --git a/usr/src/uts/intel/iscsi/Makefile b/usr/src/uts/intel/iscsi/Makefile index d87315f0d1..ea010ebcc0 100644 --- a/usr/src/uts/intel/iscsi/Makefile +++ b/usr/src/uts/intel/iscsi/Makefile @@ -68,6 +68,12 @@ LDFLAGS += -N"misc/idm" LINTFLAGS += -a -erroff=E_BAD_PTR_CAST_ALIGN -erroff=E_PTRDIFF_OVERFLOW LINTFLAGS64 += -a -erroff=E_BAD_PTR_CAST_ALIGN -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/iscsit/Makefile b/usr/src/uts/intel/iscsit/Makefile index d7cfc24314..1d61a81d72 100644 --- a/usr/src/uts/intel/iscsit/Makefile +++ b/usr/src/uts/intel/iscsit/Makefile @@ -63,6 +63,10 @@ LDFLAGS += -dy -Ndrv/stmf -Nmisc/idm -Nfs/sockfs -Nmisc/md5 -Nmisc/ksocket C99MODE= -xc99=%all C99LMODE= -Xc99=%all +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label + # # Default build targets. # diff --git a/usr/src/uts/intel/iser/Makefile b/usr/src/uts/intel/iser/Makefile index b400678eaf..d3e7ffc8e2 100644 --- a/usr/src/uts/intel/iser/Makefile +++ b/usr/src/uts/intel/iser/Makefile @@ -43,6 +43,8 @@ CONF_SRCDIR = $(UTSBASE)/common/io/ib/clients/iser # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/intel/iwh/Makefile b/usr/src/uts/intel/iwh/Makefile index d1a389752b..89a2dde869 100644 --- a/usr/src/uts/intel/iwh/Makefile +++ b/usr/src/uts/intel/iwh/Makefile @@ -59,6 +59,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + CPPFLAGS += -I. -D_KERNEL LDFLAGS += -dy -Nmisc/mac -Nmisc/net80211 -Ndrv/random -Ndrv/ip diff --git a/usr/src/uts/intel/iwk/Makefile b/usr/src/uts/intel/iwk/Makefile index e3654b1bab..91668f9b3c 100644 --- a/usr/src/uts/intel/iwk/Makefile +++ b/usr/src/uts/intel/iwk/Makefile @@ -23,7 +23,6 @@ # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" # # This makefile drives the production of the iwk driver kernel module. # @@ -64,6 +63,9 @@ CPPFLAGS += -I. -D_KERNEL -DIWL=4965 LDFLAGS += -dy -Nmisc/mac -Nmisc/net80211 -Ndrv/random -Ndrv/ip +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/iwp/Makefile b/usr/src/uts/intel/iwp/Makefile index 3097e5fc74..c0c086d685 100644 --- a/usr/src/uts/intel/iwp/Makefile +++ b/usr/src/uts/intel/iwp/Makefile @@ -63,6 +63,9 @@ CPPFLAGS += -I. -D_KERNEL LDFLAGS += -dy -Nmisc/mac -Nmisc/net80211 -Ndrv/random -Ndrv/ip +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/ixgbe/Makefile b/usr/src/uts/intel/ixgbe/Makefile index c98f9a1f11..fe2b93e4d8 100644 --- a/usr/src/uts/intel/ixgbe/Makefile +++ b/usr/src/uts/intel/ixgbe/Makefile @@ -49,6 +49,10 @@ CONF_SRCDIR = $(UTSBASE)/common/io/ixgbe # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/intel/javaexec/Makefile b/usr/src/uts/intel/javaexec/Makefile index 90653b8f46..78d9436be5 100644 --- a/usr/src/uts/intel/javaexec/Makefile +++ b/usr/src/uts/intel/javaexec/Makefile @@ -25,7 +25,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the javaexec kernel module # @@ -50,6 +50,8 @@ ROOTMODULE = $(USR_EXEC_DIR)/$(MODULE) # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-parentheses + # # Define targets # diff --git a/usr/src/uts/intel/kaio/Makefile b/usr/src/uts/intel/kaio/Makefile index 43e16d5fe1..4e2c736c9d 100644 --- a/usr/src/uts/intel/kaio/Makefile +++ b/usr/src/uts/intel/kaio/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the kaio driver kernel module. # @@ -71,6 +71,10 @@ CLEANFILES += $(MODSTUBS_O) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/kbtrans/Makefile b/usr/src/uts/intel/kbtrans/Makefile index f71e77e406..f5d8214e6c 100644 --- a/usr/src/uts/intel/kbtrans/Makefile +++ b/usr/src/uts/intel/kbtrans/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the kbtrans kernel module. # @@ -63,6 +63,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-empty-body +CERRWARN += -_gcc=-Wno-unused-braces + .KEEP_STATE: def: $(DEF_DEPS) diff --git a/usr/src/uts/intel/kcf/Makefile b/usr/src/uts/intel/kcf/Makefile index 1dbb3cb17d..1e3354a29e 100644 --- a/usr/src/uts/intel/kcf/Makefile +++ b/usr/src/uts/intel/kcf/Makefile @@ -69,6 +69,11 @@ AS_CPPFLAGS += -I../../$(PLATFORM) LINTTAGS += -I$(COM_DIR) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label + # # Default build targets. # diff --git a/usr/src/uts/intel/keysock/Makefile b/usr/src/uts/intel/keysock/Makefile index 4960aeff07..99a1f7b1d8 100644 --- a/usr/src/uts/intel/keysock/Makefile +++ b/usr/src/uts/intel/keysock/Makefile @@ -23,7 +23,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the keysock driver # kernel module. @@ -73,6 +73,8 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-unused-variable + # # Default build targets. # diff --git a/usr/src/uts/intel/kgssapi/Makefile b/usr/src/uts/intel/kgssapi/Makefile index f9eed1a41e..d5c69eb049 100644 --- a/usr/src/uts/intel/kgssapi/Makefile +++ b/usr/src/uts/intel/kgssapi/Makefile @@ -67,6 +67,9 @@ LDFLAGS += -dy -N strmod/rpcmod -N misc/rpcsec -N misc/tlimod LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/kiconv_ko/Makefile b/usr/src/uts/intel/kiconv_ko/Makefile index bcdb0559a9..30429402db 100755..100644 --- a/usr/src/uts/intel/kiconv_ko/Makefile +++ b/usr/src/uts/intel/kiconv_ko/Makefile @@ -24,7 +24,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the kiconv_ko # kernel module. @@ -69,6 +69,8 @@ CFLAGS += $(CCVERBOSE) # LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/kmech_dummy/Makefile b/usr/src/uts/intel/kmech_dummy/Makefile index 417f32e2ad..fb687d3a56 100644 --- a/usr/src/uts/intel/kmech_dummy/Makefile +++ b/usr/src/uts/intel/kmech_dummy/Makefile @@ -48,6 +48,8 @@ ROOTMODULE = $(ROOT_KGSS_DIR)/$(MODULE) # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-parentheses + # # Define dependency on kgssapi # diff --git a/usr/src/uts/intel/kmech_krb5/Makefile b/usr/src/uts/intel/kmech_krb5/Makefile index b1b63e5914..1423cbc758 100644 --- a/usr/src/uts/intel/kmech_krb5/Makefile +++ b/usr/src/uts/intel/kmech_krb5/Makefile @@ -68,6 +68,11 @@ LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/kssl/Makefile b/usr/src/uts/intel/kssl/Makefile index 348e3138e4..27c4519f62 100644 --- a/usr/src/uts/intel/kssl/Makefile +++ b/usr/src/uts/intel/kssl/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the kernel SSL driver # kernel module. @@ -68,6 +68,8 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/ksslf/Makefile b/usr/src/uts/intel/ksslf/Makefile index 5f0f8e8b9f..569a6666bb 100644 --- a/usr/src/uts/intel/ksslf/Makefile +++ b/usr/src/uts/intel/ksslf/Makefile @@ -67,6 +67,9 @@ LDFLAGS += -dy -Nmisc/md5 -Nmisc/kcf -Ndrv/kssl -Nfs/sockfs LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/kstat/Makefile b/usr/src/uts/intel/kstat/Makefile index 33883b30ee..c0321693a0 100644 --- a/usr/src/uts/intel/kstat/Makefile +++ b/usr/src/uts/intel/kstat/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # kernel statistics driver makefile. # @@ -64,6 +64,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/ksyms/Makefile b/usr/src/uts/intel/ksyms/Makefile index 31907ddd4a..dbfbb529c3 100644 --- a/usr/src/uts/intel/ksyms/Makefile +++ b/usr/src/uts/intel/ksyms/Makefile @@ -25,7 +25,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # ksyms (kernel symbols) driver makefile. # @@ -51,6 +51,8 @@ CONF_SRCDIR = $(UTSBASE)/common/io # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-parentheses + # # Define targets # diff --git a/usr/src/uts/intel/ldterm/Makefile b/usr/src/uts/intel/ldterm/Makefile index fb7f009e30..9911d74a04 100644 --- a/usr/src/uts/intel/ldterm/Makefile +++ b/usr/src/uts/intel/ldterm/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the ldterm streams kernel # module. @@ -66,6 +66,9 @@ LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/llc1/Makefile b/usr/src/uts/intel/llc1/Makefile index e18db01cf3..cd5a74a1d7 100644 --- a/usr/src/uts/intel/llc1/Makefile +++ b/usr/src/uts/intel/llc1/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the Sound-Blaster driver # kernel module. @@ -66,6 +66,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/lofi/Makefile b/usr/src/uts/intel/lofi/Makefile index 36c9b44c27..deef4ab1b2 100644 --- a/usr/src/uts/intel/lofi/Makefile +++ b/usr/src/uts/intel/lofi/Makefile @@ -47,7 +47,9 @@ include $(UTSBASE)/intel/Makefile.intel # # Overrides. # -INC_PATH += -I$(SRC)/common/lzma +INC_PATH += -I$(SRC)/common/lzma + +CERRWARN += -_gcc=-Wno-uninitialized # # Define targets diff --git a/usr/src/uts/intel/lofs/Makefile b/usr/src/uts/intel/lofs/Makefile index fe77aea5d6..17cd97eeef 100644 --- a/usr/src/uts/intel/lofs/Makefile +++ b/usr/src/uts/intel/lofs/Makefile @@ -25,7 +25,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the lofs file system # kernel module. @@ -51,6 +51,8 @@ ROOTMODULE = $(ROOT_FS_DIR)/$(MODULE) # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-parentheses + # # Define targets # diff --git a/usr/src/uts/intel/mac/Makefile b/usr/src/uts/intel/mac/Makefile index 2fd9b15b79..8346daa30b 100644 --- a/usr/src/uts/intel/mac/Makefile +++ b/usr/src/uts/intel/mac/Makefile @@ -61,6 +61,13 @@ INC_PATH += -I$(UTSBASE)/common/io/bpf LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-variable + # # Default build targets. # diff --git a/usr/src/uts/intel/mac_wifi/Makefile b/usr/src/uts/intel/mac_wifi/Makefile index 29c6676219..11f22cfca7 100644 --- a/usr/src/uts/intel/mac_wifi/Makefile +++ b/usr/src/uts/intel/mac_wifi/Makefile @@ -44,6 +44,8 @@ ROOTMODULE = $(ROOT_MAC_DIR)/$(MODULE) # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-switch + # # Define targets # diff --git a/usr/src/uts/intel/mc-amd/Makefile b/usr/src/uts/intel/mc-amd/Makefile index 35554e9f08..e075b30b81 100644 --- a/usr/src/uts/intel/mc-amd/Makefile +++ b/usr/src/uts/intel/mc-amd/Makefile @@ -61,6 +61,9 @@ CPPFLAGS += -I$(SRC)/common/util CLEANFILES += $(MCAMD_OFF_H) CLOBBERFILES += $(MCAMD_OFF_H) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/md/Makefile b/usr/src/uts/intel/md/Makefile index 9c8fee7a19..271c12b6ee 100644 --- a/usr/src/uts/intel/md/Makefile +++ b/usr/src/uts/intel/md/Makefile @@ -63,6 +63,12 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses + # # Define targets # diff --git a/usr/src/uts/intel/md_hotspares/Makefile b/usr/src/uts/intel/md_hotspares/Makefile index 61aa35b74b..a0ae477130 100644 --- a/usr/src/uts/intel/md_hotspares/Makefile +++ b/usr/src/uts/intel/md_hotspares/Makefile @@ -48,6 +48,8 @@ ROOTMODULE = $(ROOT_MISC_DIR)/$(MODULE) # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/intel/md_mirror/Makefile b/usr/src/uts/intel/md_mirror/Makefile index a07d5b91f5..0015ca055d 100644 --- a/usr/src/uts/intel/md_mirror/Makefile +++ b/usr/src/uts/intel/md_mirror/Makefile @@ -70,6 +70,9 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/md_notify/Makefile b/usr/src/uts/intel/md_notify/Makefile index 6fb1f8f9af..04ad80b965 100644 --- a/usr/src/uts/intel/md_notify/Makefile +++ b/usr/src/uts/intel/md_notify/Makefile @@ -48,6 +48,8 @@ ROOTMODULE = $(ROOT_MISC_DIR)/$(MODULE) # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/intel/md_raid/Makefile b/usr/src/uts/intel/md_raid/Makefile index 2a52496d9a..7cbdee5d89 100644 --- a/usr/src/uts/intel/md_raid/Makefile +++ b/usr/src/uts/intel/md_raid/Makefile @@ -66,6 +66,9 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Depends on md # diff --git a/usr/src/uts/intel/md_sp/Makefile b/usr/src/uts/intel/md_sp/Makefile index cf349c711b..4dfbcd3747 100644 --- a/usr/src/uts/intel/md_sp/Makefile +++ b/usr/src/uts/intel/md_sp/Makefile @@ -63,6 +63,10 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Depends on md # diff --git a/usr/src/uts/intel/md_stripe/Makefile b/usr/src/uts/intel/md_stripe/Makefile index 6c018bf3af..b63e96c0d0 100644 --- a/usr/src/uts/intel/md_stripe/Makefile +++ b/usr/src/uts/intel/md_stripe/Makefile @@ -66,6 +66,10 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses + # # Depends on md # diff --git a/usr/src/uts/intel/md_trans/Makefile b/usr/src/uts/intel/md_trans/Makefile index 8a6aeaa636..83dd631aad 100644 --- a/usr/src/uts/intel/md_trans/Makefile +++ b/usr/src/uts/intel/md_trans/Makefile @@ -62,6 +62,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses + # # Depends on md & ufs # diff --git a/usr/src/uts/intel/mega_sas/Makefile b/usr/src/uts/intel/mega_sas/Makefile index 58bdda1eab..20e4cf8e5d 100644 --- a/usr/src/uts/intel/mega_sas/Makefile +++ b/usr/src/uts/intel/mega_sas/Makefile @@ -21,7 +21,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # uts/intel/mega_sas/Makefile # @@ -61,6 +61,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # LDFLAGS += -dy -Nmisc/scsi +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/mii/Makefile b/usr/src/uts/intel/mii/Makefile index 28ac502177..49071a070e 100644 --- a/usr/src/uts/intel/mii/Makefile +++ b/usr/src/uts/intel/mii/Makefile @@ -57,6 +57,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LDFLAGS += -dy -N misc/mac +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/mm/Makefile b/usr/src/uts/intel/mm/Makefile index 0428a4d2f3..90d8804d8a 100644 --- a/usr/src/uts/intel/mm/Makefile +++ b/usr/src/uts/intel/mm/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the mm driver # @@ -67,6 +67,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-clobbered + # # Default build targets. # diff --git a/usr/src/uts/intel/mntfs/Makefile b/usr/src/uts/intel/mntfs/Makefile index 18fd92d88d..8900c1586a 100644 --- a/usr/src/uts/intel/mntfs/Makefile +++ b/usr/src/uts/intel/mntfs/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the mntfs file system # kernel module. @@ -70,6 +70,8 @@ CLEANFILES += $(MODSTUBS_O) # LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/mouse8042/Makefile b/usr/src/uts/intel/mouse8042/Makefile index ccdad9a91f..c639b13221 100644 --- a/usr/src/uts/intel/mouse8042/Makefile +++ b/usr/src/uts/intel/mouse8042/Makefile @@ -19,11 +19,10 @@ # CDDL HEADER END # # -# uts/intel/mouse8042/%M% # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the mouse8042 driver # @@ -64,6 +63,9 @@ LDFLAGS += -dy -Ndacf/consconfig_dacf # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/intel/mpt_sas/Makefile b/usr/src/uts/intel/mpt_sas/Makefile index 8fecd3ba6d..ed09c9fa37 100644 --- a/usr/src/uts/intel/mpt_sas/Makefile +++ b/usr/src/uts/intel/mpt_sas/Makefile @@ -60,6 +60,11 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/intel/mr_sas/Makefile b/usr/src/uts/intel/mr_sas/Makefile index 121e19606b..a3dbbd5f89 100644 --- a/usr/src/uts/intel/mr_sas/Makefile +++ b/usr/src/uts/intel/mr_sas/Makefile @@ -59,6 +59,10 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # LDFLAGS += -dy -Nmisc/scsi +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/msgsys/Makefile b/usr/src/uts/intel/msgsys/Makefile index 1e07d84424..bdf25b708b 100644 --- a/usr/src/uts/intel/msgsys/Makefile +++ b/usr/src/uts/intel/msgsys/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the msgsys driver kernel module. # @@ -66,6 +66,9 @@ LDFLAGS += -dy -Nmisc/ipc # LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/mwl/Makefile b/usr/src/uts/intel/mwl/Makefile index c3e1368a40..2c268ad0b6 100644 --- a/usr/src/uts/intel/mwl/Makefile +++ b/usr/src/uts/intel/mwl/Makefile @@ -64,6 +64,9 @@ LDFLAGS += -dy -Nmisc/mac -Nmisc/net80211 # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-value + # # Default build targets. # diff --git a/usr/src/uts/intel/mxfe/Makefile b/usr/src/uts/intel/mxfe/Makefile index 847ec90c13..c2f6349dc7 100644 --- a/usr/src/uts/intel/mxfe/Makefile +++ b/usr/src/uts/intel/mxfe/Makefile @@ -22,7 +22,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the Macronix # Fast Ethernet (MXFE) driver module in intel systems @@ -57,6 +57,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # Overrides # +CERRWARN += -_gcc=-Wno-switch + # # Driver depends on GLDv3 # diff --git a/usr/src/uts/intel/namefs/Makefile b/usr/src/uts/intel/namefs/Makefile index c3de08d85d..362d2754e6 100644 --- a/usr/src/uts/intel/namefs/Makefile +++ b/usr/src/uts/intel/namefs/Makefile @@ -25,7 +25,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the namefs file system # kernel module. @@ -51,6 +51,8 @@ ROOTMODULE = $(ROOT_FS_DIR)/$(MODULE) # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-parentheses + # # Define targets # diff --git a/usr/src/uts/intel/net80211/Makefile b/usr/src/uts/intel/net80211/Makefile index 61dfa1a27c..a08ee52384 100644 --- a/usr/src/uts/intel/net80211/Makefile +++ b/usr/src/uts/intel/net80211/Makefile @@ -24,8 +24,6 @@ # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" - # # This file makes the atheros driver for an intel system # @@ -67,6 +65,10 @@ LDFLAGS += -dy -Nmisc/mac -Nmac/mac_wifi -Ndrv/ip # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/nfs/Makefile b/usr/src/uts/intel/nfs/Makefile index 28d6ba3a2b..e3524c9718 100644 --- a/usr/src/uts/intel/nfs/Makefile +++ b/usr/src/uts/intel/nfs/Makefile @@ -81,6 +81,15 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-empty-body + # # Default build targets. # diff --git a/usr/src/uts/intel/nfs_dlboot/Makefile b/usr/src/uts/intel/nfs_dlboot/Makefile index 8e2ee46422..fcd505e38e 100644 --- a/usr/src/uts/intel/nfs_dlboot/Makefile +++ b/usr/src/uts/intel/nfs_dlboot/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the dlboot_proto # kernel module. @@ -73,6 +73,8 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/nfssrv/Makefile b/usr/src/uts/intel/nfssrv/Makefile index a047ef4833..8cd5005557 100644 --- a/usr/src/uts/intel/nfssrv/Makefile +++ b/usr/src/uts/intel/nfssrv/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the nfs server-specific # kernel module. @@ -74,6 +74,14 @@ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/intel/nge/Makefile b/usr/src/uts/intel/nge/Makefile index 5f195226d4..d2be242a1c 100644 --- a/usr/src/uts/intel/nge/Makefile +++ b/usr/src/uts/intel/nge/Makefile @@ -71,6 +71,9 @@ LDFLAGS += -dy -N misc/mac # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/nsctl/Makefile b/usr/src/uts/intel/nsctl/Makefile index 7bcec5f439..e57c1eb168 100644 --- a/usr/src/uts/intel/nsctl/Makefile +++ b/usr/src/uts/intel/nsctl/Makefile @@ -63,11 +63,13 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # # lint pass one enforcement # -CFLAGS += -v +CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -N"drv/nskern" -N"drv/ncall" -N"misc/spuni" LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: def: $(DEF_DEPS) diff --git a/usr/src/uts/intel/ntxn/Makefile b/usr/src/uts/intel/ntxn/Makefile index cb62da5b2a..8843e8bfe5 100644 --- a/usr/src/uts/intel/ntxn/Makefile +++ b/usr/src/uts/intel/ntxn/Makefile @@ -69,6 +69,10 @@ LDFLAGS += -dy -N misc/mac -N drv/ip LINTFLAGS += $(NTXN_DFLAGS) $(NTXN_KFLAGS) LINTFLAGS += -DSOLARIS11 +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-type-limits + # # # Default build targets. diff --git a/usr/src/uts/intel/nv_sata/Makefile b/usr/src/uts/intel/nv_sata/Makefile index bbc19803e1..17f12c4fcd 100644 --- a/usr/src/uts/intel/nv_sata/Makefile +++ b/usr/src/uts/intel/nv_sata/Makefile @@ -76,6 +76,8 @@ LDFLAGS += -dy -N misc/sata # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/nxge/Makefile b/usr/src/uts/intel/nxge/Makefile index 9adb16dfa6..7346a0b84b 100644 --- a/usr/src/uts/intel/nxge/Makefile +++ b/usr/src/uts/intel/nxge/Makefile @@ -85,6 +85,13 @@ LINTFLAGS += -DSOLARIS LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_FALSE_LOGICAL_EXPR + +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits + # # Driver depends on mac & IP # diff --git a/usr/src/uts/intel/objfs/Makefile b/usr/src/uts/intel/objfs/Makefile index d30d24dddd..9c8a6e9bbd 100644 --- a/usr/src/uts/intel/objfs/Makefile +++ b/usr/src/uts/intel/objfs/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the object file system # kernel module. @@ -68,6 +68,10 @@ CFLAGS += $(CCVERBOSE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/oce/Makefile b/usr/src/uts/intel/oce/Makefile index 9094b439a1..5725f7676a 100644 --- a/usr/src/uts/intel/oce/Makefile +++ b/usr/src/uts/intel/oce/Makefile @@ -56,6 +56,11 @@ INC_PATH += -I$(UTSBASE)/common/sys/fibre-channel/fca/oce LDFLAGS += -dy -Nmisc/mac +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/ohci/Makefile b/usr/src/uts/intel/ohci/Makefile index 08ead62711..afd68d8540 100644 --- a/usr/src/uts/intel/ohci/Makefile +++ b/usr/src/uts/intel/ohci/Makefile @@ -67,6 +67,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/openeepr/Makefile b/usr/src/uts/intel/openeepr/Makefile index 7b36bdb529..7ab3ee4210 100644 --- a/usr/src/uts/intel/openeepr/Makefile +++ b/usr/src/uts/intel/openeepr/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the openeepr driver # @@ -66,6 +66,9 @@ LDFLAGS += -dy -Ndacf/consconfig_dacf # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/p123_pcbe/Makefile b/usr/src/uts/intel/p123_pcbe/Makefile index b4ee930a82..d591d52e62 100644 --- a/usr/src/uts/intel/p123_pcbe/Makefile +++ b/usr/src/uts/intel/p123_pcbe/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This Makefile builds the Pentium 1, 2, and 3 Performance Counter BackEnd (PCBE) # @@ -60,6 +60,9 @@ LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-unused-function + # # Default build targets. # diff --git a/usr/src/uts/intel/p4_pcbe/Makefile b/usr/src/uts/intel/p4_pcbe/Makefile index bacb694b41..42dc040eee 100644 --- a/usr/src/uts/intel/p4_pcbe/Makefile +++ b/usr/src/uts/intel/p4_pcbe/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This Makefile builds the Pentium 4 Performance Counter BackEnd (PCBE). # @@ -59,6 +59,8 @@ LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized # # Default build targets. diff --git a/usr/src/uts/intel/pcan/Makefile b/usr/src/uts/intel/pcan/Makefile index 9d4fccb38f..45f6946b66 100644 --- a/usr/src/uts/intel/pcan/Makefile +++ b/usr/src/uts/intel/pcan/Makefile @@ -23,7 +23,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the pcan driver kernel module. # @@ -66,13 +66,17 @@ INC_PATH += -I$(UTSBASE)/common/pcmcia # # lint pass one enforcement # -CFLAGS += -v +CFLAGS += $(CCVERBOSE) # # STREAMS API limitations force us to turn off these lint checks. # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-switch + # # dependency # diff --git a/usr/src/uts/intel/pcata/Makefile b/usr/src/uts/intel/pcata/Makefile index eff616b4b4..90a3bd0074 100644 --- a/usr/src/uts/intel/pcata/Makefile +++ b/usr/src/uts/intel/pcata/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the pcata driver kernel module. # @@ -71,6 +71,9 @@ INC_PATH += -I$(UTSBASE)/common/pcmcia LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/pcfs/Makefile b/usr/src/uts/intel/pcfs/Makefile index 5b9b2a2734..59d2650970 100644 --- a/usr/src/uts/intel/pcfs/Makefile +++ b/usr/src/uts/intel/pcfs/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the DOS file system # kernel module. @@ -62,6 +62,12 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-function + # # Define targets # diff --git a/usr/src/uts/intel/pci_autoconfig/Makefile b/usr/src/uts/intel/pci_autoconfig/Makefile index c4d91376bd..94fdc98af0 100644 --- a/usr/src/uts/intel/pci_autoconfig/Makefile +++ b/usr/src/uts/intel/pci_autoconfig/Makefile @@ -68,6 +68,8 @@ LDFLAGS += -dy -Nmisc/acpica -Nmisc/pcie LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/pcic/Makefile b/usr/src/uts/intel/pcic/Makefile index 4c917534ec..100973ecf1 100644 --- a/usr/src/uts/intel/pcic/Makefile +++ b/usr/src/uts/intel/pcic/Makefile @@ -24,7 +24,6 @@ # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" # # This makefile drives the PCIC style PCMCIA adapter # It is mostly a standard driver @@ -74,6 +73,11 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/pcicfg/Makefile b/usr/src/uts/intel/pcicfg/Makefile index 07a02666ae..90e0ba1970 100644 --- a/usr/src/uts/intel/pcicfg/Makefile +++ b/usr/src/uts/intel/pcicfg/Makefile @@ -77,6 +77,9 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/pcieb/Makefile b/usr/src/uts/intel/pcieb/Makefile index 9e8c2d681e..be0357f8b2 100644 --- a/usr/src/uts/intel/pcieb/Makefile +++ b/usr/src/uts/intel/pcieb/Makefile @@ -75,6 +75,8 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-unused-value + # # Default build targets. # diff --git a/usr/src/uts/intel/pckt/Makefile b/usr/src/uts/intel/pckt/Makefile index fc830eb515..ff735b6541 100644 --- a/usr/src/uts/intel/pckt/Makefile +++ b/usr/src/uts/intel/pckt/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the pckt streams kernel # module. @@ -65,6 +65,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/pcmcia/Makefile b/usr/src/uts/intel/pcmcia/Makefile index 096f3379ff..b50059c5ed 100644 --- a/usr/src/uts/intel/pcmcia/Makefile +++ b/usr/src/uts/intel/pcmcia/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This file makes the pcmcia nexus for an intel system # @@ -80,6 +80,9 @@ LDFLAGS += -dy -Nmisc/busra -Nmisc/pci_autoconfig LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/pcn/Makefile b/usr/src/uts/intel/pcn/Makefile index 5bfacf988d..ab40851635 100644 --- a/usr/src/uts/intel/pcn/Makefile +++ b/usr/src/uts/intel/pcn/Makefile @@ -56,6 +56,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # Overrides # +CERRWARN += -_gcc=-Wno-parentheses + # # Driver depends on GLD # diff --git a/usr/src/uts/intel/pcwl/Makefile b/usr/src/uts/intel/pcwl/Makefile index b22e5ba87c..ee5da418f8 100644 --- a/usr/src/uts/intel/pcwl/Makefile +++ b/usr/src/uts/intel/pcwl/Makefile @@ -23,7 +23,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the pcwl driver kernel module. # @@ -66,13 +66,18 @@ INC_PATH += -I$(UTSBASE)/common/pcmcia # # lint pass one enforcement # -CFLAGS += -v +CFLAGS += $(CCVERBOSE) # # STREAMS API limitations force us to turn off these lint checks. # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # dependency # diff --git a/usr/src/uts/intel/pipe/Makefile b/usr/src/uts/intel/pipe/Makefile index 98020a0cb0..a9b7f51cd1 100644 --- a/usr/src/uts/intel/pipe/Makefile +++ b/usr/src/uts/intel/pipe/Makefile @@ -49,6 +49,8 @@ ROOTMODULE = $(ROOT_SYS_DIR)/$(MODULE) # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-parentheses + # # Define targets # diff --git a/usr/src/uts/intel/pm/Makefile b/usr/src/uts/intel/pm/Makefile index 1d8dfe1baf..66acca85d2 100644 --- a/usr/src/uts/intel/pm/Makefile +++ b/usr/src/uts/intel/pm/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the pm driver # @@ -65,6 +65,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/pmcs/Makefile b/usr/src/uts/intel/pmcs/Makefile index ee52f64701..31500be02f 100644 --- a/usr/src/uts/intel/pmcs/Makefile +++ b/usr/src/uts/intel/pmcs/Makefile @@ -69,6 +69,12 @@ CPPFLAGS += $(PMCS_DRV_FLGS) \ -DPMCS_FIRMWARE_VERSION=${PMCS_FW_VERSION} \ -DPMCS_FIRMWARE_VERSION_STRING=\"${PMCS_FW_VERSION_STRING}\" +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. diff --git a/usr/src/uts/intel/poll/Makefile b/usr/src/uts/intel/poll/Makefile index 9c5763364b..fe16be6421 100644 --- a/usr/src/uts/intel/poll/Makefile +++ b/usr/src/uts/intel/poll/Makefile @@ -20,11 +20,10 @@ # CDDL HEADER END # # -# uts/intel/devpoll/Makefile # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the /dev/poll driver # @@ -50,6 +49,8 @@ CONF_SRCDIR = $(UTSBASE)/common/io # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/intel/portfs/Makefile b/usr/src/uts/intel/portfs/Makefile index 754a7b60b2..acd107022c 100644 --- a/usr/src/uts/intel/portfs/Makefile +++ b/usr/src/uts/intel/portfs/Makefile @@ -23,7 +23,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the portfs driver kernel module. # @@ -72,6 +72,9 @@ CLEANFILES += $(MODSTUBS_O) # LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/power/Makefile b/usr/src/uts/intel/power/Makefile index a61c18049a..363cf2407e 100644 --- a/usr/src/uts/intel/power/Makefile +++ b/usr/src/uts/intel/power/Makefile @@ -23,7 +23,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the power driver # @@ -77,6 +77,8 @@ LDFLAGS += -dy -N misc/acpica LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-unused-variable + # # Default build targets. # diff --git a/usr/src/uts/intel/pppt/Makefile b/usr/src/uts/intel/pppt/Makefile index 3731c52d24..78f8e8b7f7 100644 --- a/usr/src/uts/intel/pppt/Makefile +++ b/usr/src/uts/intel/pppt/Makefile @@ -63,6 +63,9 @@ LDFLAGS += -dy -Ndrv/stmf C99MODE= -xc99=%all C99LMODE= -Xc99=%all +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/procfs/Makefile b/usr/src/uts/intel/procfs/Makefile index 6f41847a7f..21057b40d8 100644 --- a/usr/src/uts/intel/procfs/Makefile +++ b/usr/src/uts/intel/procfs/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the procfs file system # kernel module. @@ -73,6 +73,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized # # Default build targets. # diff --git a/usr/src/uts/intel/pshot/Makefile b/usr/src/uts/intel/pshot/Makefile index c391db02ca..c1866a81db 100644 --- a/usr/src/uts/intel/pshot/Makefile +++ b/usr/src/uts/intel/pshot/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the pshot kernel # driver to testing hotplugging operations @@ -63,6 +63,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable + # # Default build targets. # diff --git a/usr/src/uts/intel/ptem/Makefile b/usr/src/uts/intel/ptem/Makefile index c5c0d5fa55..55cec27bcd 100644 --- a/usr/src/uts/intel/ptem/Makefile +++ b/usr/src/uts/intel/ptem/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the ptem streams kernel # module. @@ -65,6 +65,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/ptsl/Makefile b/usr/src/uts/intel/ptsl/Makefile index 49506c0ea8..62cc5bc04d 100644 --- a/usr/src/uts/intel/ptsl/Makefile +++ b/usr/src/uts/intel/ptsl/Makefile @@ -64,6 +64,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses + # # Depends on ptc # diff --git a/usr/src/uts/intel/qlc/Makefile b/usr/src/uts/intel/qlc/Makefile index 38d61ead83..4363c69dcd 100644 --- a/usr/src/uts/intel/qlc/Makefile +++ b/usr/src/uts/intel/qlc/Makefile @@ -78,6 +78,10 @@ FWIMAGES += 8100 FWMODULES = $(FWIMAGES:%=$(MODULE)_fw_%) FWMODULES_SRC = $(FWIMAGES:%=$(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_%.c) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/qlge/Makefile b/usr/src/uts/intel/qlge/Makefile index 82f64ac215..3883358dbf 100644 --- a/usr/src/uts/intel/qlge/Makefile +++ b/usr/src/uts/intel/qlge/Makefile @@ -64,6 +64,9 @@ LDFLAGS += -dy -Nmisc/mac -Ndrv/ip C99MODE= -xc99=%all C99LMODE= -Xc99=%all +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/qlt/Makefile b/usr/src/uts/intel/qlt/Makefile index 2b7ad9b3f1..cdbef29ee9 100644 --- a/usr/src/uts/intel/qlt/Makefile +++ b/usr/src/uts/intel/qlt/Makefile @@ -71,6 +71,8 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/rdc/Makefile b/usr/src/uts/intel/rdc/Makefile index 89b6f157bf..337ef0f14c 100644 --- a/usr/src/uts/intel/rdc/Makefile +++ b/usr/src/uts/intel/rdc/Makefile @@ -62,7 +62,7 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # # lint pass one enforcement # -CFLAGS += -v -D_SD_8K_BLKSIZE -D_SYSCALL32 +CFLAGS += $(CCVERBOSE) -D_SD_8K_BLKSIZE -D_SYSCALL32 LINT_DEFS += -D_SYSCALL32 LINTTAGS += -erroff=E_FUNC_RET_MAYBE_IGNORED2 LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN @@ -70,6 +70,12 @@ LINTTAGS += -erroff=E_INCONS_ARG_DECL2 LDFLAGS += -dy -N"drv/nsctl" -N"drv/nskern" -N"drv/ncall" -N"misc/spuni" \ -N"misc/rdcsrv" -N"strmod/rpcmod" +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + + .KEEP_STATE: def: $(DEF_DEPS) diff --git a/usr/src/uts/intel/rdcsrv/Makefile b/usr/src/uts/intel/rdcsrv/Makefile index c9571b27b5..852d4aa932 100644 --- a/usr/src/uts/intel/rdcsrv/Makefile +++ b/usr/src/uts/intel/rdcsrv/Makefile @@ -62,9 +62,12 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOTLINK) # # lint pass one enforcement # -CFLAGS += -v -D_SD_8K_BLKSIZE -D_SYSCALL32 -LINT_DEFS += -D_SD_8K_BLKSIZE -D_SYSCALL32 -LDFLAGS += -dy -N"strmod/rpcmod" -N"misc/rdcstub" +CFLAGS += $(CCVERBOSE) -D_SD_8K_BLKSIZE -D_SYSCALL32 +LINT_DEFS += -D_SD_8K_BLKSIZE -D_SYSCALL32 +LDFLAGS += -dy -N"strmod/rpcmod" -N"misc/rdcstub" + +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable .KEEP_STATE: diff --git a/usr/src/uts/intel/rds/Makefile b/usr/src/uts/intel/rds/Makefile index 19a2e14b93..c70ffa30ad 100644 --- a/usr/src/uts/intel/rds/Makefile +++ b/usr/src/uts/intel/rds/Makefile @@ -22,9 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# -# # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -45,6 +42,8 @@ CONF_SRCDIR = $(UTSBASE)/common/io/ib/clients/rds # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/intel/rdsib/Makefile b/usr/src/uts/intel/rdsib/Makefile index 6041335f01..72d81caa89 100644 --- a/usr/src/uts/intel/rdsib/Makefile +++ b/usr/src/uts/intel/rdsib/Makefile @@ -22,9 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# -# # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -45,6 +42,9 @@ CONF_SRCDIR = $(UTSBASE)/common/io/ib/clients/rds # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/intel/rdsv3/Makefile b/usr/src/uts/intel/rdsv3/Makefile index 26f3ec84b0..1250b9c42f 100644 --- a/usr/src/uts/intel/rdsv3/Makefile +++ b/usr/src/uts/intel/rdsv3/Makefile @@ -59,6 +59,12 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_FUNC_SET_NOT_USED +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Define targets # diff --git a/usr/src/uts/intel/rge/Makefile b/usr/src/uts/intel/rge/Makefile index 936e6ea9c6..aaa493f044 100644 --- a/usr/src/uts/intel/rge/Makefile +++ b/usr/src/uts/intel/rge/Makefile @@ -68,6 +68,9 @@ LDFLAGS += -dy -N misc/mac -N drv/ip # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/rlmod/Makefile b/usr/src/uts/intel/rlmod/Makefile index 13ca96649a..c517b8ea5d 100644 --- a/usr/src/uts/intel/rlmod/Makefile +++ b/usr/src/uts/intel/rlmod/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the rlmod streams kernel # module. @@ -65,6 +65,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/rpcib/Makefile b/usr/src/uts/intel/rpcib/Makefile index 8f49ea8804..f90003d045 100644 --- a/usr/src/uts/intel/rpcib/Makefile +++ b/usr/src/uts/intel/rpcib/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the kernel # rpcib module. @@ -73,6 +73,10 @@ LDFLAGS += -dy -Nmisc/ibtl -Nmisc/ibcm LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/rpcmod/Makefile b/usr/src/uts/intel/rpcmod/Makefile index 209859c2ff..ae92a0a983 100644 --- a/usr/src/uts/intel/rpcmod/Makefile +++ b/usr/src/uts/intel/rpcmod/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the rpcmod streams kernel # module. @@ -82,6 +82,13 @@ LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-function + # # Default build targets. # diff --git a/usr/src/uts/intel/rpcsec/Makefile b/usr/src/uts/intel/rpcsec/Makefile index fde53d6aed..3dd8a5e003 100644 --- a/usr/src/uts/intel/rpcsec/Makefile +++ b/usr/src/uts/intel/rpcsec/Makefile @@ -68,6 +68,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/rpcsec_gss/Makefile b/usr/src/uts/intel/rpcsec_gss/Makefile index 7f34da31c9..22ae1fbaf3 100644 --- a/usr/src/uts/intel/rpcsec_gss/Makefile +++ b/usr/src/uts/intel/rpcsec_gss/Makefile @@ -68,6 +68,8 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/rsa/Makefile b/usr/src/uts/intel/rsa/Makefile index 1915aa7d8a..e05d3e307d 100644 --- a/usr/src/uts/intel/rsa/Makefile +++ b/usr/src/uts/intel/rsa/Makefile @@ -74,6 +74,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/rsm/Makefile b/usr/src/uts/intel/rsm/Makefile index 745272fa83..26c3c45282 100644 --- a/usr/src/uts/intel/rsm/Makefile +++ b/usr/src/uts/intel/rsm/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the rsm kernel agent @@ -78,6 +78,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/rtls/Makefile b/usr/src/uts/intel/rtls/Makefile index b412976238..c688f5e940 100644 --- a/usr/src/uts/intel/rtls/Makefile +++ b/usr/src/uts/intel/rtls/Makefile @@ -56,6 +56,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # Overrides # +CERRWARN += -_gcc=-Wno-uninitialized + # # Driver depends on Mac # diff --git a/usr/src/uts/intel/rtw/Makefile b/usr/src/uts/intel/rtw/Makefile index 1cbf411330..2ca9ae5e1f 100644 --- a/usr/src/uts/intel/rtw/Makefile +++ b/usr/src/uts/intel/rtw/Makefile @@ -22,7 +22,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the realtek 8180 # wifi(rtw) driver module in intel systems @@ -58,6 +58,10 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # LDFLAGS += -dy -Nmisc/mac -Nmisc/net80211 +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/intel/rwn/Makefile b/usr/src/uts/intel/rwn/Makefile index 8be5784444..69c4e8127e 100644 --- a/usr/src/uts/intel/rwn/Makefile +++ b/usr/src/uts/intel/rwn/Makefile @@ -64,6 +64,10 @@ LDFLAGS += -dy -Nmisc/mac -Nmisc/net80211 # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-value + # # Default build targets. # diff --git a/usr/src/uts/intel/s1394/Makefile b/usr/src/uts/intel/s1394/Makefile index 3f938aa76f..0efc9bdc25 100644 --- a/usr/src/uts/intel/s1394/Makefile +++ b/usr/src/uts/intel/s1394/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the s1394 kernel module. # @@ -81,6 +81,11 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/sad/Makefile b/usr/src/uts/intel/sad/Makefile index 53c428846d..5220e4999c 100644 --- a/usr/src/uts/intel/sad/Makefile +++ b/usr/src/uts/intel/sad/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the sad driver # @@ -70,6 +70,9 @@ CLEANFILES += $(MODSTUBS_O) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/sata/Makefile b/usr/src/uts/intel/sata/Makefile index 74c89d5b9a..c9f86f8c11 100644 --- a/usr/src/uts/intel/sata/Makefile +++ b/usr/src/uts/intel/sata/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" -# # # uts/intel/io/sata/Makefile @@ -88,6 +86,13 @@ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-empty-body + # # Default build targets. # diff --git a/usr/src/uts/intel/sbp2/Makefile b/usr/src/uts/intel/sbp2/Makefile index 3df078a78e..58f728a1d1 100644 --- a/usr/src/uts/intel/sbp2/Makefile +++ b/usr/src/uts/intel/sbp2/Makefile @@ -24,8 +24,6 @@ # # uts/intel/sbp2/Makefile -#ident "%Z%%M% %I% %E% SMI" - # # This makefile drives the production of the sbp2 kernel module. # @@ -67,6 +65,8 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-unused-function + .KEEP_STATE: def: $(DEF_DEPS) diff --git a/usr/src/uts/intel/scsa1394/Makefile b/usr/src/uts/intel/scsa1394/Makefile index a69d4c2ed5..18555118ca 100644 --- a/usr/src/uts/intel/scsa1394/Makefile +++ b/usr/src/uts/intel/scsa1394/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" -# # # Path to the base of the uts directory tree. @@ -67,6 +65,9 @@ LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # Default build targets. # .KEEP_STATE: diff --git a/usr/src/uts/intel/scsa2usb/Makefile b/usr/src/uts/intel/scsa2usb/Makefile index f1673e6c2e..9da60a6d6a 100644 --- a/usr/src/uts/intel/scsa2usb/Makefile +++ b/usr/src/uts/intel/scsa2usb/Makefile @@ -75,6 +75,9 @@ LDFLAGS += -dy -Nmisc/usba -Nmisc/scsi # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/scsi/Makefile b/usr/src/uts/intel/scsi/Makefile index 7e1a99b44d..f4b8ec262c 100644 --- a/usr/src/uts/intel/scsi/Makefile +++ b/usr/src/uts/intel/scsi/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the scsi kernel module. # @@ -74,6 +74,10 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/scsi_vhci/Makefile b/usr/src/uts/intel/scsi_vhci/Makefile index 5d3b05021a..f18133d8dd 100644 --- a/usr/src/uts/intel/scsi_vhci/Makefile +++ b/usr/src/uts/intel/scsi_vhci/Makefile @@ -25,8 +25,6 @@ # # -#pragma ident "%Z%%M% %I% %E% SMI" -# # This makefile drives the production of SCSI vHCI Driver # intel architecture dependent # @@ -50,6 +48,10 @@ CONF_SRCDIR = $(UTSBASE)/common/io/scsi/adapters/scsi_vhci # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label + # # Define targets. # diff --git a/usr/src/uts/intel/sd/Makefile b/usr/src/uts/intel/sd/Makefile index 067893854f..bac6d94908 100644 --- a/usr/src/uts/intel/sd/Makefile +++ b/usr/src/uts/intel/sd/Makefile @@ -77,6 +77,13 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized + # # Depends on scsi and cmlb # diff --git a/usr/src/uts/intel/sdbc/Makefile b/usr/src/uts/intel/sdbc/Makefile index 902b09eb6c..bc506fab29 100644 --- a/usr/src/uts/intel/sdbc/Makefile +++ b/usr/src/uts/intel/sdbc/Makefile @@ -70,11 +70,15 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # # lint pass one enforcement # -CFLAGS += -v -D_SD_8K_BLKSIZE -D_SDBC_SINGLE_BRD +CFLAGS += $(CCVERBOSE) -D_SD_8K_BLKSIZE -D_SDBC_SINGLE_BRD LDFLAGS += -dy -N"drv/nsctl" -N"drv/ncall" -N"drv/nskern" -N"misc/spuni" LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label + .KEEP_STATE: def: $(DEF_DEPS) diff --git a/usr/src/uts/intel/semsys/Makefile b/usr/src/uts/intel/semsys/Makefile index 41699fd9fd..4691fd01dd 100644 --- a/usr/src/uts/intel/semsys/Makefile +++ b/usr/src/uts/intel/semsys/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the semsys driver kernel module. # @@ -69,6 +69,9 @@ LDFLAGS += -dy -Nmisc/ipc # LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/sfe/Makefile b/usr/src/uts/intel/sfe/Makefile index 2d158502d7..9f2ad1e63a 100644 --- a/usr/src/uts/intel/sfe/Makefile +++ b/usr/src/uts/intel/sfe/Makefile @@ -22,7 +22,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of NS/SiS # Fast Ethernet (SFE) driver module in intel systems @@ -73,6 +73,11 @@ CPPFLAGS += $(VFLAGS) $(AFLAGS) $(DFLAGS) $(CFGFLAGS) $(CCVERBOSE) \ CFLAGS += $(CPPFLAGS) -xc99=%all +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Driver depends on MAC & IP # diff --git a/usr/src/uts/intel/sgen/Makefile b/usr/src/uts/intel/sgen/Makefile index fa6da5607f..39e2c07e44 100644 --- a/usr/src/uts/intel/sgen/Makefile +++ b/usr/src/uts/intel/sgen/Makefile @@ -25,8 +25,6 @@ # # -#ident "%Z%%M% %I% %E% SMI" -# # This makefile drives the production of the sgen driver. # intel architecture dependent # @@ -70,6 +68,9 @@ LDFLAGS += -dy -N"misc/scsi" LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/sha2/Makefile b/usr/src/uts/intel/sha2/Makefile index 672813a87c..e8f0be7d51 100644 --- a/usr/src/uts/intel/sha2/Makefile +++ b/usr/src/uts/intel/sha2/Makefile @@ -71,6 +71,9 @@ LDFLAGS += -dy -Nmisc/kcf CFLAGS += -I$(COMDIR) LINTFLAGS += -I$(COMDIR) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/sharefs/Makefile b/usr/src/uts/intel/sharefs/Makefile index a829438cfe..8b15f71c0d 100644 --- a/usr/src/uts/intel/sharefs/Makefile +++ b/usr/src/uts/intel/sharefs/Makefile @@ -22,7 +22,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the sharetab file system # kernel module. @@ -60,6 +60,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/shbinexec/Makefile b/usr/src/uts/intel/shbinexec/Makefile index ab4f70ce62..729e4a88ab 100644 --- a/usr/src/uts/intel/shbinexec/Makefile +++ b/usr/src/uts/intel/shbinexec/Makefile @@ -48,6 +48,8 @@ ROOTMODULE = $(USR_EXEC_DIR)/$(MODULE) # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-parentheses + # # Define targets # diff --git a/usr/src/uts/intel/shmsys/Makefile b/usr/src/uts/intel/shmsys/Makefile index bb9e3290f0..0c4420703d 100644 --- a/usr/src/uts/intel/shmsys/Makefile +++ b/usr/src/uts/intel/shmsys/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the shmsys driver kernel module. # @@ -70,6 +70,8 @@ LDFLAGS += -dy -Nmisc/ipc LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/si3124/Makefile b/usr/src/uts/intel/si3124/Makefile index 67d2c55bbd..813a7b9011 100644 --- a/usr/src/uts/intel/si3124/Makefile +++ b/usr/src/uts/intel/si3124/Makefile @@ -67,6 +67,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) DEBUG_FLGS = DEBUG_DEFS += $(DEBUG_FLGS) +CERRWARN += -_gcc=-Wno-uninitialized + # # lint pass one enforcement # diff --git a/usr/src/uts/intel/simnet/Makefile b/usr/src/uts/intel/simnet/Makefile index f7e5eeff7c..c3f41026a3 100644 --- a/usr/src/uts/intel/simnet/Makefile +++ b/usr/src/uts/intel/simnet/Makefile @@ -54,6 +54,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -Ndrv/dld -Nmisc/mac -Nmisc/dls -Ndrv/random +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/intel/smbfs/Makefile b/usr/src/uts/intel/smbfs/Makefile index 65377ffa1e..49538576b6 100644 --- a/usr/src/uts/intel/smbfs/Makefile +++ b/usr/src/uts/intel/smbfs/Makefile @@ -68,6 +68,8 @@ LDFLAGS += -dy -Ndrv/nsmb # Until CR 4994570 is fixed... LINTTAGS += -erroff=E_BAD_FORMAT_ARG_TYPE2 +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized # The mb_put/md_get functions are intentionally used with and without # return value checks, so filter those out like LGREP.2 does. diff --git a/usr/src/uts/intel/smbsrv/Makefile b/usr/src/uts/intel/smbsrv/Makefile index 26ad642da1..7ebb6d4cbe 100644 --- a/usr/src/uts/intel/smbsrv/Makefile +++ b/usr/src/uts/intel/smbsrv/Makefile @@ -69,6 +69,10 @@ CLEANFILES += $(MODSTUBS_O) INC_PATH += -I$(SRC)/common +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/intel/sockfs/Makefile b/usr/src/uts/intel/sockfs/Makefile index 6db7ee368e..31ae52d1cc 100644 --- a/usr/src/uts/intel/sockfs/Makefile +++ b/usr/src/uts/intel/sockfs/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the sockfs file system # kernel module. @@ -86,6 +86,13 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/sockpfp/Makefile b/usr/src/uts/intel/sockpfp/Makefile index d39e40d0c2..ab2f16a0b3 100644 --- a/usr/src/uts/intel/sockpfp/Makefile +++ b/usr/src/uts/intel/sockpfp/Makefile @@ -68,6 +68,9 @@ INC_PATH += -I$(UTSBASE)/common/inet/sockmods -I$(UTSBASE)/common/io/bpf # LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label + # # Default build targets. # diff --git a/usr/src/uts/intel/socksctp/Makefile b/usr/src/uts/intel/socksctp/Makefile index fa316464ad..31efabc0d0 100644 --- a/usr/src/uts/intel/socksctp/Makefile +++ b/usr/src/uts/intel/socksctp/Makefile @@ -68,6 +68,9 @@ LDFLAGS += -dy -Nfs/sockfs -Ndrv/ip LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/socksdp/Makefile b/usr/src/uts/intel/socksdp/Makefile index 966b436fce..17cda95dce 100644 --- a/usr/src/uts/intel/socksdp/Makefile +++ b/usr/src/uts/intel/socksdp/Makefile @@ -58,6 +58,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + LDFLAGS += -dy -Nfs/sockfs -Ndrv/ip -Ndrv/sdpib # diff --git a/usr/src/uts/intel/softmac/Makefile b/usr/src/uts/intel/softmac/Makefile index 023cef81c7..347b1bdc7a 100644 --- a/usr/src/uts/intel/softmac/Makefile +++ b/usr/src/uts/intel/softmac/Makefile @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -64,6 +62,9 @@ LDFLAGS += -dy -Ndrv/dld -Nmisc/mac -Nmisc/strplumb -Nmisc/dls # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label + # # Default build targets. # diff --git a/usr/src/uts/intel/sol_ofs/Makefile b/usr/src/uts/intel/sol_ofs/Makefile index b73ef83964..e83b128b6e 100644 --- a/usr/src/uts/intel/sol_ofs/Makefile +++ b/usr/src/uts/intel/sol_ofs/Makefile @@ -61,6 +61,11 @@ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_CONST_TRUNCATED_BY_ASSIGN +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-unused-variable + # # Default build targets. # diff --git a/usr/src/uts/intel/sol_umad/Makefile b/usr/src/uts/intel/sol_umad/Makefile index 946b8e2cb8..2d76f118a1 100644 --- a/usr/src/uts/intel/sol_umad/Makefile +++ b/usr/src/uts/intel/sol_umad/Makefile @@ -42,6 +42,7 @@ LDFLAGS += -dy -Nmisc/sol_ofs -Nmisc/ibmf -Nmisc/ibtl # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-uninitialized # # Define targets diff --git a/usr/src/uts/intel/sol_uverbs/Makefile b/usr/src/uts/intel/sol_uverbs/Makefile index a89aac0448..0e913dd524 100644 --- a/usr/src/uts/intel/sol_uverbs/Makefile +++ b/usr/src/uts/intel/sol_uverbs/Makefile @@ -62,6 +62,10 @@ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_CONST_TRUNCATED_BY_ASSIGN +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-label + # # Default build targets. # diff --git a/usr/src/uts/intel/spdsock/Makefile b/usr/src/uts/intel/spdsock/Makefile index a64deaa4f8..8517e4882a 100644 --- a/usr/src/uts/intel/spdsock/Makefile +++ b/usr/src/uts/intel/spdsock/Makefile @@ -71,6 +71,8 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/specfs/Makefile b/usr/src/uts/intel/specfs/Makefile index 23a13db05e..8ff48afa63 100644 --- a/usr/src/uts/intel/specfs/Makefile +++ b/usr/src/uts/intel/specfs/Makefile @@ -24,7 +24,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the specfs file system # kernel module. @@ -72,6 +72,9 @@ LDFLAGS += -dy -Nfs/fifofs # LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/sppp/Makefile b/usr/src/uts/intel/sppp/Makefile index 1b51c278f3..eafe63dc5d 100644 --- a/usr/src/uts/intel/sppp/Makefile +++ b/usr/src/uts/intel/sppp/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the sppp STREAMS pseudo- # driver kernel module. @@ -76,6 +76,9 @@ INC_PATH += -I$(UTSBASE)/common/io/ppp/common LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/spppcomp/Makefile b/usr/src/uts/intel/spppcomp/Makefile index b97579b4aa..31476b0589 100644 --- a/usr/src/uts/intel/spppcomp/Makefile +++ b/usr/src/uts/intel/spppcomp/Makefile @@ -75,6 +75,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Depends on sppp # diff --git a/usr/src/uts/intel/sppptun/Makefile b/usr/src/uts/intel/sppptun/Makefile index 30d467f981..6bb25046bc 100644 --- a/usr/src/uts/intel/sppptun/Makefile +++ b/usr/src/uts/intel/sppptun/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the sppptun STREAMS pseudo- # driver kernel module. @@ -78,6 +78,8 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/srn/Makefile b/usr/src/uts/intel/srn/Makefile index 8146241688..37e7df0aec 100755..100644 --- a/usr/src/uts/intel/srn/Makefile +++ b/usr/src/uts/intel/srn/Makefile @@ -24,7 +24,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the srn driver # @@ -50,6 +50,8 @@ CONF_SRCDIR = $(UTSBASE)/common/io # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/intel/srpt/Makefile b/usr/src/uts/intel/srpt/Makefile index 57123dfc00..7c83e44453 100644 --- a/usr/src/uts/intel/srpt/Makefile +++ b/usr/src/uts/intel/srpt/Makefile @@ -63,6 +63,8 @@ LDFLAGS += -dy -Ndrv/stmf -Nmisc/ibtl -Nmisc/ibcm C99MODE= -xc99=%all C99LMODE= -Xc99=%all +CERRWARN += -_gcc=-Wno-unused-label + # # Default build targets. # diff --git a/usr/src/uts/intel/st/Makefile b/usr/src/uts/intel/st/Makefile index e772736d09..f629f4b70a 100644 --- a/usr/src/uts/intel/st/Makefile +++ b/usr/src/uts/intel/st/Makefile @@ -74,6 +74,10 @@ LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Depends on scsi # diff --git a/usr/src/uts/intel/stmf/Makefile b/usr/src/uts/intel/stmf/Makefile index 8dfdd42bc3..1e45739dbb 100644 --- a/usr/src/uts/intel/stmf/Makefile +++ b/usr/src/uts/intel/stmf/Makefile @@ -68,6 +68,10 @@ C99LMODE= -Xc99=%all LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-variable + # # Default build targets. # diff --git a/usr/src/uts/intel/stmf_sbd/Makefile b/usr/src/uts/intel/stmf_sbd/Makefile index 6958d90376..a57ccaf73d 100644 --- a/usr/src/uts/intel/stmf_sbd/Makefile +++ b/usr/src/uts/intel/stmf_sbd/Makefile @@ -69,6 +69,11 @@ C99LMODE= -Xc99=%all # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/strategy/Makefile b/usr/src/uts/intel/strategy/Makefile index e4e9d044d0..80a819601d 100644 --- a/usr/src/uts/intel/strategy/Makefile +++ b/usr/src/uts/intel/strategy/Makefile @@ -25,7 +25,7 @@ # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the strategy "misc" # kernel module. @@ -51,6 +51,8 @@ ROOTMODULE = $(ROOT_MISC_DIR)/$(MODULE) # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-parentheses + # # Define targets # diff --git a/usr/src/uts/intel/strplumb/Makefile b/usr/src/uts/intel/strplumb/Makefile index c7cccb236e..78dbdc7cdd 100644 --- a/usr/src/uts/intel/strplumb/Makefile +++ b/usr/src/uts/intel/strplumb/Makefile @@ -24,7 +24,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the strplumb # kernel module. @@ -66,6 +66,8 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/sv/Makefile b/usr/src/uts/intel/sv/Makefile index f63968e4e1..af3f10107e 100644 --- a/usr/src/uts/intel/sv/Makefile +++ b/usr/src/uts/intel/sv/Makefile @@ -62,9 +62,11 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # # lint pass one enforcement # -CFLAGS += -v +CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -N"drv/nsctl" -N"drv/nskern" -N"misc/spuni" +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: def: $(DEF_DEPS) diff --git a/usr/src/uts/intel/swrand/Makefile b/usr/src/uts/intel/swrand/Makefile index 2d98dddb34..e1abdc1536 100644 --- a/usr/src/uts/intel/swrand/Makefile +++ b/usr/src/uts/intel/swrand/Makefile @@ -74,6 +74,8 @@ LDFLAGS += -dy -Nmisc/kcf -Nmisc/sha1 LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-unused-function + # # Default build targets. # diff --git a/usr/src/uts/intel/tavor/Makefile b/usr/src/uts/intel/tavor/Makefile index a36b5d10ed..bf51bf8a59 100644 --- a/usr/src/uts/intel/tavor/Makefile +++ b/usr/src/uts/intel/tavor/Makefile @@ -84,6 +84,11 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits + # # Default build targets. # diff --git a/usr/src/uts/intel/telmod/Makefile b/usr/src/uts/intel/telmod/Makefile index c4f57353cf..731bf2beef 100644 --- a/usr/src/uts/intel/telmod/Makefile +++ b/usr/src/uts/intel/telmod/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the telmod streams kernel # module. @@ -65,6 +65,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/tem/Makefile b/usr/src/uts/intel/tem/Makefile index 9962a28f30..1d877e2259 100644 --- a/usr/src/uts/intel/tem/Makefile +++ b/usr/src/uts/intel/tem/Makefile @@ -65,6 +65,9 @@ LDFLAGS += -dy -Ndacf/consconfig_dacf # LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/tirdwr/Makefile b/usr/src/uts/intel/tirdwr/Makefile index 558b9c923b..55f9fc189f 100644 --- a/usr/src/uts/intel/tirdwr/Makefile +++ b/usr/src/uts/intel/tirdwr/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the tirdwr streams kernel # module. @@ -65,6 +65,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/tl/Makefile b/usr/src/uts/intel/tl/Makefile index 1123d1c3aa..83d7faeaad 100644 --- a/usr/src/uts/intel/tl/Makefile +++ b/usr/src/uts/intel/tl/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the tl driver # @@ -73,6 +73,10 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/tmpfs/Makefile b/usr/src/uts/intel/tmpfs/Makefile index 443501c56f..7d94dba6e8 100644 --- a/usr/src/uts/intel/tmpfs/Makefile +++ b/usr/src/uts/intel/tmpfs/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the tmpfs file system # kernel module. @@ -65,6 +65,10 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-value + # # Default build targets. # diff --git a/usr/src/uts/intel/tnf/Makefile b/usr/src/uts/intel/tnf/Makefile index 24aa0d8376..99ea51b39f 100644 --- a/usr/src/uts/intel/tnf/Makefile +++ b/usr/src/uts/intel/tnf/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # tnf (kernel trace driver) Makefile # @@ -66,6 +66,8 @@ LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized # # Default build targets. # diff --git a/usr/src/uts/intel/tphci/Makefile b/usr/src/uts/intel/tphci/Makefile index 32eb9cacbf..230f018d13 100644 --- a/usr/src/uts/intel/tphci/Makefile +++ b/usr/src/uts/intel/tphci/Makefile @@ -23,7 +23,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the tphci kernel # driver for testing MPxIO interfaces @@ -49,6 +49,8 @@ include $(UTSBASE)/intel/Makefile.intel CLOBBERFILES += $(MODULE) +CERRWARN += -_gcc=-Wno-parentheses + # # Define targets # diff --git a/usr/src/uts/intel/tpm/Makefile b/usr/src/uts/intel/tpm/Makefile index a970b4768e..c87048cceb 100644 --- a/usr/src/uts/intel/tpm/Makefile +++ b/usr/src/uts/intel/tpm/Makefile @@ -63,6 +63,8 @@ CPPFLAGS += -I$(ROOT)/usr/include # This is for /usr/include/tss/, which is not built in the ON consolidation CPPFLAGS += -I$(ADJUNCT_PROTO)/usr/include +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/trill/Makefile b/usr/src/uts/intel/trill/Makefile index b3c4999604..4ef89d3a1d 100644 --- a/usr/src/uts/intel/trill/Makefile +++ b/usr/src/uts/intel/trill/Makefile @@ -48,6 +48,8 @@ ROOTMODULE = $(ROOT_SOCK_DIR)/$(MODULE) # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/intel/tvhci/Makefile b/usr/src/uts/intel/tvhci/Makefile index 58e6324f89..543e9542d8 100644 --- a/usr/src/uts/intel/tvhci/Makefile +++ b/usr/src/uts/intel/tvhci/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the tvhci kernel # driver for testing MPxIO interfaces @@ -61,6 +61,7 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # Please do not carry these forward to new Makefiles. # LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-unused-function # # Default build targets. diff --git a/usr/src/uts/intel/udfs/Makefile b/usr/src/uts/intel/udfs/Makefile index 7f3baea29f..a1d5d5daaa 100644 --- a/usr/src/uts/intel/udfs/Makefile +++ b/usr/src/uts/intel/udfs/Makefile @@ -78,6 +78,11 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits + # # Default build targets. # diff --git a/usr/src/uts/intel/ufs/Makefile b/usr/src/uts/intel/ufs/Makefile index e968a7abf6..b7127a0e23 100644 --- a/usr/src/uts/intel/ufs/Makefile +++ b/usr/src/uts/intel/ufs/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the ufs file system # kernel module. @@ -77,6 +77,11 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-unused-label + # # Default build targets. # diff --git a/usr/src/uts/intel/ugen/Makefile b/usr/src/uts/intel/ugen/Makefile index de0ca3af98..32b475b6fd 100644 --- a/usr/src/uts/intel/ugen/Makefile +++ b/usr/src/uts/intel/ugen/Makefile @@ -49,6 +49,8 @@ WLCMD_DIR = $(UTSBASE)/common/io/warlock # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/intel/uhci/Makefile b/usr/src/uts/intel/uhci/Makefile index f966a4f3d5..7b61ccf155 100644 --- a/usr/src/uts/intel/uhci/Makefile +++ b/usr/src/uts/intel/uhci/Makefile @@ -74,6 +74,8 @@ LDFLAGS += -dy -Nmisc/usba # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/urtw/Makefile b/usr/src/uts/intel/urtw/Makefile index 5cf71c57da..a7b03b6bb3 100644 --- a/usr/src/uts/intel/urtw/Makefile +++ b/usr/src/uts/intel/urtw/Makefile @@ -59,6 +59,11 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # LDFLAGS += -dy -Nmisc/mac -Nmisc/net80211 -Nmisc/usba +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/usb_ac/Makefile b/usr/src/uts/intel/usb_ac/Makefile index a69a4cd371..072d676d98 100644 --- a/usr/src/uts/intel/usb_ac/Makefile +++ b/usr/src/uts/intel/usb_ac/Makefile @@ -64,6 +64,11 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) MODSTUBS_DIR = $(OBJS_DIR) CLEANFILES += $(MODSTUBS_O) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # depends on misc/usba # @@ -122,7 +127,6 @@ warlock: $(WARLOCK_OK) $(WARLOCK_OK): $(WARLOCK_OUT) warlock_ddi.files \ warlock_standalone warlock_usba.files warlock_with_usba $(TOUCH) $(WARLOCK_OK) - warlock_with_usba: $(WLCMD_DIR)/usb_ac_with_usba.wlcmd $(WARLOCK_OUT) \ warlock_ddi.files warlock_usba.files warlock_ohci.files \ diff --git a/usr/src/uts/intel/usb_ah/Makefile b/usr/src/uts/intel/usb_ah/Makefile index d0ce81be85..6a3e43f1cf 100644 --- a/usr/src/uts/intel/usb_ah/Makefile +++ b/usr/src/uts/intel/usb_ah/Makefile @@ -75,6 +75,8 @@ LDFLAGS += -dy -Nmisc/usba -Nmisc/hidparser -Ndrv/usb_ac # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/usb_as/Makefile b/usr/src/uts/intel/usb_as/Makefile index e48617d312..38542942d7 100644 --- a/usr/src/uts/intel/usb_as/Makefile +++ b/usr/src/uts/intel/usb_as/Makefile @@ -72,6 +72,8 @@ LDFLAGS += -dy -Nmisc/usba -Ndrv/usb_ac # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-unused-label + # # Default build targets. # diff --git a/usr/src/uts/intel/usba/Makefile b/usr/src/uts/intel/usba/Makefile index 49e9f66172..0b11d372fc 100644 --- a/usr/src/uts/intel/usba/Makefile +++ b/usr/src/uts/intel/usba/Makefile @@ -47,6 +47,13 @@ WARLOCK_OK = $(MODULE).ok # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-unused-variable + # # Define targets # diff --git a/usr/src/uts/intel/usbftdi/Makefile b/usr/src/uts/intel/usbftdi/Makefile index 4dfbef27bc..43a6aa9976 100644 --- a/usr/src/uts/intel/usbftdi/Makefile +++ b/usr/src/uts/intel/usbftdi/Makefile @@ -48,6 +48,8 @@ WLCMD_DIR = $(UTSBASE)/common/io/warlock # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-uninitialized + LDFLAGS += -dy -Nmisc/usba -Nmisc/usbser # diff --git a/usr/src/uts/intel/usbms/Makefile b/usr/src/uts/intel/usbms/Makefile index ca5a7c4105..2cf550f26c 100644 --- a/usr/src/uts/intel/usbms/Makefile +++ b/usr/src/uts/intel/usbms/Makefile @@ -70,6 +70,9 @@ LDFLAGS += -dy -Nmisc/usba -Nmisc/hidparser # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/usbsacm/Makefile b/usr/src/uts/intel/usbsacm/Makefile index 7044f3a013..390c663a59 100644 --- a/usr/src/uts/intel/usbsacm/Makefile +++ b/usr/src/uts/intel/usbsacm/Makefile @@ -49,6 +49,8 @@ include $(UTSBASE)/intel/Makefile.intel LDFLAGS += -dy -Nmisc/usba -Nmisc/usbser +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/intel/usbser/Makefile b/usr/src/uts/intel/usbser/Makefile index a4aa5057fe..888e472c71 100644 --- a/usr/src/uts/intel/usbser/Makefile +++ b/usr/src/uts/intel/usbser/Makefile @@ -68,6 +68,10 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label + .KEEP_STATE: all: $(ALL_DEPS) diff --git a/usr/src/uts/intel/usbsksp/Makefile b/usr/src/uts/intel/usbsksp/Makefile index a8141b4d45..9ac78dc7e0 100644 --- a/usr/src/uts/intel/usbsksp/Makefile +++ b/usr/src/uts/intel/usbsksp/Makefile @@ -83,6 +83,8 @@ install: $(INSTALL_DEPS) # include $(UTSBASE)/intel/Makefile.targ +CERRWARN += -_gcc=-Wno-uninitialized + # # Defines for local commands. # diff --git a/usr/src/uts/intel/usbsprl/Makefile b/usr/src/uts/intel/usbsprl/Makefile index 24cbdebf47..3b76265082 100644 --- a/usr/src/uts/intel/usbsprl/Makefile +++ b/usr/src/uts/intel/usbsprl/Makefile @@ -47,6 +47,8 @@ WLCMD_DIR = $(UTSBASE)/common/io/warlock # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-uninitialized + LDFLAGS += -dy -Nmisc/usba -Nmisc/usbser # diff --git a/usr/src/uts/intel/usbvc/Makefile b/usr/src/uts/intel/usbvc/Makefile index c3898620e8..66c96b9a5c 100644 --- a/usr/src/uts/intel/usbvc/Makefile +++ b/usr/src/uts/intel/usbvc/Makefile @@ -73,6 +73,8 @@ LDFLAGS += -dy -Nmisc/usba # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/usbwcm/Makefile b/usr/src/uts/intel/usbwcm/Makefile index 4a7df889fd..5202f40f6f 100644 --- a/usr/src/uts/intel/usbwcm/Makefile +++ b/usr/src/uts/intel/usbwcm/Makefile @@ -70,6 +70,9 @@ LDFLAGS += -dy -Nmisc/usba # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/uwba/Makefile b/usr/src/uts/intel/uwba/Makefile index d56a55a562..20fe0f1775 100644 --- a/usr/src/uts/intel/uwba/Makefile +++ b/usr/src/uts/intel/uwba/Makefile @@ -65,6 +65,9 @@ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/vgatext/Makefile b/usr/src/uts/intel/vgatext/Makefile index fbd4871509..3f15372b40 100644 --- a/usr/src/uts/intel/vgatext/Makefile +++ b/usr/src/uts/intel/vgatext/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the VGA text driver # @@ -66,6 +66,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable + # # Default build targets. # diff --git a/usr/src/uts/intel/vioblk/Makefile b/usr/src/uts/intel/vioblk/Makefile new file mode 100644 index 0000000000..5e5783fca6 --- /dev/null +++ b/usr/src/uts/intel/vioblk/Makefile @@ -0,0 +1,90 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# +# +# Copyright 2012 Nexenta Systems, Inc. All rights reserved. +# + +# +# Path to the base of the uts directory tree (usually /usr/src/uts). +# +UTSBASE = ../.. + +# +# Define the module and object file sets. +# +MODULE = vioblk +OBJECTS = $(VIOBLK_OBJS:%=$(OBJS_DIR)/%) +LINTS = $(VIOBLK_OBJS:%.o=$(LINTS_DIR)/%.ln) +ROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE) + +# +# Include common rules. +# +include $(UTSBASE)/intel/Makefile.intel + +# +# Define targets +# +ALL_TARGET = $(BINARY) +LINT_TARGET = $(MODULE).lint +INSTALL_TARGET = $(BINARY) $(ROOTMODULE) + +# +# Overrides +# + +INC_PATH += -I$(UTSBASE)/common/io/virtio + +# +# lint pass one enforcement +# +CFLAGS += $(CCVERBOSE) + +# +# Driver depends on virtio and blkdev +# +LDFLAGS += -dy -N misc/virtio -N drv/blkdev + +# +# Default build targets. +# +.KEEP_STATE: + +def: $(DEF_DEPS) + +all: $(ALL_DEPS) + +clean: $(CLEAN_DEPS) + +clobber: $(CLOBBER_DEPS) + +lint: $(LINT_DEPS) + +modlintlib: $(MODLINTLIB_DEPS) + +clean.lint: $(CLEAN_LINT_DEPS) + +install: $(INSTALL_DEPS) + +# +# Include common targets. +# +include $(UTSBASE)/intel/Makefile.targ diff --git a/usr/src/uts/intel/virtio/Makefile b/usr/src/uts/intel/virtio/Makefile new file mode 100644 index 0000000000..10418db2cc --- /dev/null +++ b/usr/src/uts/intel/virtio/Makefile @@ -0,0 +1,86 @@ +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright (c) 2012 Nexenta Systems, Inc. All rights reserved. +# + +# +# Path to the base of the uts directory tree (usually /usr/src/uts). +# +UTSBASE = ../.. + +# +# Define the module and object file sets. +# +MODULE = virtio +OBJECTS = $(VIRTIO_OBJS:%=$(OBJS_DIR)/%) +LINTS = $(VIRTIO_OBJS:%.o=$(LINTS_DIR)/%.ln) +ROOTMODULE = $(ROOT_MISC_DIR)/$(MODULE) + +# +# Include common rules. +# +include $(UTSBASE)/intel/Makefile.intel + +# +# Define targets +# +ALL_TARGET = $(BINARY) +LINT_TARGET = $(MODULE).lint +INSTALL_TARGET = $(BINARY) $(ROOTMODULE) + +# +# Overrides +# + +INC_PATH += -I$(UTSBASE)/common/io/virtio + +# +# lint pass one enforcement +# +CFLAGS += $(CCVERBOSE) + +# +# Default build targets. +# +.KEEP_STATE: + +def: $(DEF_DEPS) + +all: $(ALL_DEPS) + +clean: $(CLEAN_DEPS) + +clobber: $(CLOBBER_DEPS) + +lint: $(LINT_DEPS) + +modlintlib: $(MODLINTLIB_DEPS) + +clean.lint: $(CLEAN_LINT_DEPS) + +install: $(INSTALL_DEPS) + +# +# Include common targets. +# +include $(UTSBASE)/intel/Makefile.targ diff --git a/usr/src/uts/intel/vnic/Makefile b/usr/src/uts/intel/vnic/Makefile index 83a4c749c2..15ee8a885c 100644 --- a/usr/src/uts/intel/vnic/Makefile +++ b/usr/src/uts/intel/vnic/Makefile @@ -54,6 +54,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -Ndrv/dld -Nmisc/mac -Nmisc/dls +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/vr/Makefile b/usr/src/uts/intel/vr/Makefile index b51ed32639..85e97f4f6b 100644 --- a/usr/src/uts/intel/vr/Makefile +++ b/usr/src/uts/intel/vr/Makefile @@ -56,6 +56,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # Overrides # +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Driver depends on GLD # diff --git a/usr/src/uts/intel/vuid2ps2/Makefile b/usr/src/uts/intel/vuid2ps2/Makefile index dae1631816..207f0c1d45 100644 --- a/usr/src/uts/intel/vuid2ps2/Makefile +++ b/usr/src/uts/intel/vuid2ps2/Makefile @@ -24,7 +24,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the vuid2ps2 streams kernel # module. @@ -50,6 +50,9 @@ ROOTMODULE = $(ROOT_STRMOD_DIR)/$(MODULE) # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Define targets # diff --git a/usr/src/uts/intel/vuid3ps2/Makefile b/usr/src/uts/intel/vuid3ps2/Makefile index 5b26d76846..b6d28fc856 100644 --- a/usr/src/uts/intel/vuid3ps2/Makefile +++ b/usr/src/uts/intel/vuid3ps2/Makefile @@ -24,7 +24,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the vuid3ps2 streams kernel # module. @@ -50,6 +50,9 @@ ROOTMODULE = $(ROOT_STRMOD_DIR)/$(MODULE) # include $(UTSBASE)/intel/Makefile.intel +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Define targets # diff --git a/usr/src/uts/intel/vuidm3p/Makefile b/usr/src/uts/intel/vuidm3p/Makefile index aa80f9c2a3..2d068a6e05 100644 --- a/usr/src/uts/intel/vuidm3p/Makefile +++ b/usr/src/uts/intel/vuidm3p/Makefile @@ -24,7 +24,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the vuidm3p streams kernel # module. @@ -62,6 +62,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # ALL_DEFS += -DVUIDM3P +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/vuidm4p/Makefile b/usr/src/uts/intel/vuidm4p/Makefile index b6c38f89a3..0fe311ad2f 100644 --- a/usr/src/uts/intel/vuidm4p/Makefile +++ b/usr/src/uts/intel/vuidm4p/Makefile @@ -24,7 +24,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the vuidm4p streams kernel # module. @@ -62,6 +62,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # ALL_DEFS += -DVUIDM4P +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/vuidm5p/Makefile b/usr/src/uts/intel/vuidm5p/Makefile index d418e0bf47..f127056424 100644 --- a/usr/src/uts/intel/vuidm5p/Makefile +++ b/usr/src/uts/intel/vuidm5p/Makefile @@ -24,7 +24,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the vuidm5p streams kernel # module. @@ -59,6 +59,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) ALL_DEFS += -DVUIDM5P +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/wc/Makefile b/usr/src/uts/intel/wc/Makefile index b7461a4bed..29f823b998 100644 --- a/usr/src/uts/intel/wc/Makefile +++ b/usr/src/uts/intel/wc/Makefile @@ -64,6 +64,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # LDFLAGS += -dy -Nmisc/tem -Ndacf/consconfig_dacf +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/winlock/Makefile b/usr/src/uts/intel/winlock/Makefile index f94dd29c50..2d2e266e76 100644 --- a/usr/src/uts/intel/winlock/Makefile +++ b/usr/src/uts/intel/winlock/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of winlock kernel module. # @@ -64,6 +64,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/intel/wusb_df/Makefile b/usr/src/uts/intel/wusb_df/Makefile index 48cc88a4c6..0b76177028 100644 --- a/usr/src/uts/intel/wusb_df/Makefile +++ b/usr/src/uts/intel/wusb_df/Makefile @@ -73,6 +73,8 @@ LDFLAGS += -dy -Nmisc/usba # LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/xge/Makefile b/usr/src/uts/intel/xge/Makefile index 8541c1b052..b3836ba90f 100644 --- a/usr/src/uts/intel/xge/Makefile +++ b/usr/src/uts/intel/xge/Makefile @@ -106,6 +106,12 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-empty-body +CERRWARN += -_gcc=-Wno-uninitialized + # # # Default build targets. diff --git a/usr/src/uts/intel/yge/Makefile b/usr/src/uts/intel/yge/Makefile index 29adc839b2..49b2d4ca45 100644 --- a/usr/src/uts/intel/yge/Makefile +++ b/usr/src/uts/intel/yge/Makefile @@ -60,6 +60,8 @@ LDFLAGS += -dy -N misc/mac -N misc/mii # Lint flag # +CERRWARN += -_gcc=-Wno-unused-label + # # # Default build targets. diff --git a/usr/src/uts/intel/zfs/Makefile b/usr/src/uts/intel/zfs/Makefile index 669ce93ed3..f106577baa 100644 --- a/usr/src/uts/intel/zfs/Makefile +++ b/usr/src/uts/intel/zfs/Makefile @@ -79,6 +79,14 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/zfs/spa_boot.c b/usr/src/uts/intel/zfs/spa_boot.c index a6cdb81890..adbcffaef0 100644 --- a/usr/src/uts/intel/zfs/spa_boot.c +++ b/usr/src/uts/intel/zfs/spa_boot.c @@ -24,9 +24,16 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + #include <sys/zio.h> #include <sys/spa.h> #include <sys/sunddi.h> +#include <sys/x86_archext.h> + +extern int zfs_deadman_enabled; char * spa_get_bootprop(char *propname) @@ -44,3 +51,21 @@ spa_free_bootprop(char *value) { ddi_prop_free(value); } + +void +spa_arch_init(void) +{ + /* + * Configure the default settings for the zfs deadman unless + * overriden by /etc/system. + */ + if (zfs_deadman_enabled == -1) { + /* + * Disable the zfs deadman logic on VMware deployments. + */ + if (get_hwenv() == HW_VMWARE) + zfs_deadman_enabled = 0; + else + zfs_deadman_enabled = 1; + } +} diff --git a/usr/src/uts/intel/zut/Makefile b/usr/src/uts/intel/zut/Makefile index 544ab3cd53..7df92bc696 100644 --- a/usr/src/uts/intel/zut/Makefile +++ b/usr/src/uts/intel/zut/Makefile @@ -72,6 +72,9 @@ C99LMODE= -Xc99=%all # LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/intel/zyd/Makefile b/usr/src/uts/intel/zyd/Makefile index 7f32a47cd3..144dbad6b2 100644 --- a/usr/src/uts/intel/zyd/Makefile +++ b/usr/src/uts/intel/zyd/Makefile @@ -59,6 +59,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # LDFLAGS += -dy -Nmisc/mac -Nmisc/net80211 -Nmisc/usba +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/FSS/Makefile b/usr/src/uts/sparc/FSS/Makefile index e38a41a2f6..8bf1c25c85 100644 --- a/usr/src/uts/sparc/FSS/Makefile +++ b/usr/src/uts/sparc/FSS/Makefile @@ -24,7 +24,7 @@ # # uts/sparc/FSS/Makefile # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the FSS scheduling class # kernel module. @@ -69,6 +69,8 @@ CFLAGS += $(CCVERBOSE) # LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/Makefile.sparc.shared b/usr/src/uts/sparc/Makefile.sparc.shared index 5973079ae5..96f6960750 100644 --- a/usr/src/uts/sparc/Makefile.sparc.shared +++ b/usr/src/uts/sparc/Makefile.sparc.shared @@ -133,7 +133,7 @@ CFLAGS += $(INLINES) -D_ASM_INLINES CFLAGS += $(CCMODE) CFLAGS += $(SPACEFLAG) CFLAGS += $(CERRWARN) -CFLAGS += $(CTF_FLAGS) +CFLAGS += $(CTF_FLAGS_$(CLASS)) CFLAGS += $(C99MODE) CFLAGS += $(CCUNBOUND) CFLAGS += $(CCSTATICSYM) diff --git a/usr/src/uts/sparc/aac/Makefile b/usr/src/uts/sparc/aac/Makefile index b680e8434e..c5b5079f59 100644 --- a/usr/src/uts/sparc/aac/Makefile +++ b/usr/src/uts/sparc/aac/Makefile @@ -23,7 +23,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the aac driver kernel module. # @@ -73,6 +73,12 @@ LDFLAGS += -dy -Nmisc/scsi # Overrides # +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/sparc/aggr/Makefile b/usr/src/uts/sparc/aggr/Makefile index 1cb0111950..d9ec754f15 100644 --- a/usr/src/uts/sparc/aggr/Makefile +++ b/usr/src/uts/sparc/aggr/Makefile @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -65,6 +63,12 @@ LDFLAGS += -dy -Ndrv/dld -Nmisc/mac -Nmisc/dls LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable + # # Default build targets. # diff --git a/usr/src/uts/sparc/ahci/Makefile b/usr/src/uts/sparc/ahci/Makefile index bec4a695ed..a80a11100e 100644 --- a/usr/src/uts/sparc/ahci/Makefile +++ b/usr/src/uts/sparc/ahci/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" -# # # uts/sparc/ahci/Makefile @@ -74,6 +72,10 @@ DEBUG_DEFS += $(DEBUG_FLGS) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/aoutexec/Makefile b/usr/src/uts/sparc/aoutexec/Makefile index cf30dcf77b..4c050e4ead 100644 --- a/usr/src/uts/sparc/aoutexec/Makefile +++ b/usr/src/uts/sparc/aoutexec/Makefile @@ -60,6 +60,7 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses # # Define dependency on elfexec diff --git a/usr/src/uts/sparc/audio/Makefile b/usr/src/uts/sparc/audio/Makefile index 2bb577fac6..fde8cd522b 100644 --- a/usr/src/uts/sparc/audio/Makefile +++ b/usr/src/uts/sparc/audio/Makefile @@ -46,6 +46,8 @@ CONF_SRCDIR = $(UTSBASE)/common/io/audio/impl # include $(UTSBASE)/sparc/Makefile.sparc +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/sparc/audio1575/Makefile b/usr/src/uts/sparc/audio1575/Makefile index 9c9ba7565c..acc5d00f68 100644 --- a/usr/src/uts/sparc/audio1575/Makefile +++ b/usr/src/uts/sparc/audio1575/Makefile @@ -55,6 +55,8 @@ CFLAGS += $(CCVERBOSE) # LDFLAGS += -dy -Ndrv/audio -Nmisc/ac97 +CERRWARN += -_gcc=-Wno-switch + # # Define targets # diff --git a/usr/src/uts/sparc/audiocs/Makefile b/usr/src/uts/sparc/audiocs/Makefile index 9c68518b19..72b36a15d1 100644 --- a/usr/src/uts/sparc/audiocs/Makefile +++ b/usr/src/uts/sparc/audiocs/Makefile @@ -57,6 +57,7 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # Overrides # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized # # Depends on misc/audiosup diff --git a/usr/src/uts/sparc/audioens/Makefile b/usr/src/uts/sparc/audioens/Makefile index debea255c5..aa4088266c 100644 --- a/usr/src/uts/sparc/audioens/Makefile +++ b/usr/src/uts/sparc/audioens/Makefile @@ -54,6 +54,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LDFLAGS += -dy -Ndrv/audio -Nmisc/ac97 +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/audiols/Makefile b/usr/src/uts/sparc/audiols/Makefile index d7b560e556..fc43d0a255 100644 --- a/usr/src/uts/sparc/audiols/Makefile +++ b/usr/src/uts/sparc/audiols/Makefile @@ -54,6 +54,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LDFLAGS += -dy -Ndrv/audio -Nmisc/ac97 +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/sparc/audiop16x/Makefile b/usr/src/uts/sparc/audiop16x/Makefile index d820998f54..b11c93d68d 100644 --- a/usr/src/uts/sparc/audiop16x/Makefile +++ b/usr/src/uts/sparc/audiop16x/Makefile @@ -54,6 +54,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LDFLAGS += -dy -Ndrv/audio -Nmisc/ac97 +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/audiopci/Makefile b/usr/src/uts/sparc/audiopci/Makefile index 9c54179b58..d660a24994 100644 --- a/usr/src/uts/sparc/audiopci/Makefile +++ b/usr/src/uts/sparc/audiopci/Makefile @@ -54,6 +54,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LDFLAGS += -dy -Ndrv/audio +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/audiots/Makefile b/usr/src/uts/sparc/audiots/Makefile index 07249a48c3..c830c5bfb9 100644 --- a/usr/src/uts/sparc/audiots/Makefile +++ b/usr/src/uts/sparc/audiots/Makefile @@ -55,6 +55,8 @@ CFLAGS += $(CCVERBOSE) # LDFLAGS += -dy -N misc/ac97 -N drv/audio +CERRWARN += -_gcc=-Wno-parentheses + # # Define targets # diff --git a/usr/src/uts/sparc/autofs/Makefile b/usr/src/uts/sparc/autofs/Makefile index 1c3ad1c0fa..3c76d18c96 100644 --- a/usr/src/uts/sparc/autofs/Makefile +++ b/usr/src/uts/sparc/autofs/Makefile @@ -75,6 +75,11 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/av1394/Makefile b/usr/src/uts/sparc/av1394/Makefile index 934f64c8b5..3b610a5ea4 100644 --- a/usr/src/uts/sparc/av1394/Makefile +++ b/usr/src/uts/sparc/av1394/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" -# # # Path to the base of the uts directory tree. @@ -80,6 +78,10 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits + # # depends on misc/s1394 LDFLAGS += -dy -Nmisc/s1394 diff --git a/usr/src/uts/sparc/bge/Makefile b/usr/src/uts/sparc/bge/Makefile index 7de383291b..df29b5b014 100644 --- a/usr/src/uts/sparc/bge/Makefile +++ b/usr/src/uts/sparc/bge/Makefile @@ -18,11 +18,12 @@ # # CDDL HEADER END # + # # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the Broadcom BCM57xx # Gigabit Ethernet (BGE) driver module in sparc systems @@ -76,6 +77,10 @@ LDFLAGS += -dy -N misc/mac # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/blkdev/Makefile b/usr/src/uts/sparc/blkdev/Makefile index 6839dcb917..6e6b785207 100644 --- a/usr/src/uts/sparc/blkdev/Makefile +++ b/usr/src/uts/sparc/blkdev/Makefile @@ -57,6 +57,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # LDFLAGS += -dy -Nmisc/cmlb +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/blowfish/Makefile b/usr/src/uts/sparc/blowfish/Makefile index a34fa78564..b7dfdc8fe6 100644 --- a/usr/src/uts/sparc/blowfish/Makefile +++ b/usr/src/uts/sparc/blowfish/Makefile @@ -22,8 +22,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# + # This makefile drives the production of the blowfish KEF provider. # # sparc implementation architecture dependent @@ -79,6 +78,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/bofi/Makefile b/usr/src/uts/sparc/bofi/Makefile index 9fc6405076..e133686cb0 100644 --- a/usr/src/uts/sparc/bofi/Makefile +++ b/usr/src/uts/sparc/bofi/Makefile @@ -18,11 +18,12 @@ # # CDDL HEADER END # + # # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the bofi driver # kernel module. @@ -82,6 +83,8 @@ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/bpf/Makefile b/usr/src/uts/sparc/bpf/Makefile index cf1e481312..7fa0e7d76c 100644 --- a/usr/src/uts/sparc/bpf/Makefile +++ b/usr/src/uts/sparc/bpf/Makefile @@ -70,6 +70,9 @@ INC_PATH += -I$(UTSBASE)/common/io/bpf # LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/bridge/Makefile b/usr/src/uts/sparc/bridge/Makefile index 0693e8861c..0d233275d9 100644 --- a/usr/src/uts/sparc/bridge/Makefile +++ b/usr/src/uts/sparc/bridge/Makefile @@ -57,6 +57,10 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses + # # Driver depends on MAC, DLS, and DLD # diff --git a/usr/src/uts/sparc/busra/Makefile b/usr/src/uts/sparc/busra/Makefile index 8a9b920571..6c7373a899 100644 --- a/usr/src/uts/sparc/busra/Makefile +++ b/usr/src/uts/sparc/busra/Makefile @@ -24,7 +24,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the busra # kernel module. @@ -50,6 +50,9 @@ ROOTMODULE = $(ROOT_MISC_DIR)/$(MODULE) # include $(UTSBASE)/sparc/Makefile.sparc +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/sparc/c2audit/Makefile b/usr/src/uts/sparc/c2audit/Makefile index 4b75b4db88..90af18b7be 100644 --- a/usr/src/uts/sparc/c2audit/Makefile +++ b/usr/src/uts/sparc/c2audit/Makefile @@ -75,6 +75,10 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/cachefs/Makefile b/usr/src/uts/sparc/cachefs/Makefile index f584865505..730d536ca2 100644 --- a/usr/src/uts/sparc/cachefs/Makefile +++ b/usr/src/uts/sparc/cachefs/Makefile @@ -77,6 +77,9 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/cardbus/Makefile b/usr/src/uts/sparc/cardbus/Makefile index ecabc41c3d..39b54137e8 100644 --- a/usr/src/uts/sparc/cardbus/Makefile +++ b/usr/src/uts/sparc/cardbus/Makefile @@ -24,7 +24,7 @@ # # uts/sparc/cardbus/Makefile # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the cardbus kernel module. # @@ -78,6 +78,11 @@ CPPFLAGS += -DHOTPLUG # dependency LDFLAGS += -dy -Nmisc/busra -Nmisc/pcmcia -Nmisc/hpcsvc +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable + # # For now, disable these lint checks; maintainers should endeavor # to investigate and remove these for maximum lint coverage. diff --git a/usr/src/uts/sparc/chxge/Makefile b/usr/src/uts/sparc/chxge/Makefile index 817736b6e9..90c194aa9f 100644 --- a/usr/src/uts/sparc/chxge/Makefile +++ b/usr/src/uts/sparc/chxge/Makefile @@ -22,7 +22,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the Chelsio N110 # 10G Ethernet (CH) driver module in x86 systems @@ -101,6 +101,11 @@ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses + # # # Default build targets. diff --git a/usr/src/uts/sparc/cmlb/Makefile b/usr/src/uts/sparc/cmlb/Makefile index 0403901985..b21cbbfdcb 100644 --- a/usr/src/uts/sparc/cmlb/Makefile +++ b/usr/src/uts/sparc/cmlb/Makefile @@ -75,6 +75,12 @@ LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/consconfig_dacf/Makefile b/usr/src/uts/sparc/consconfig_dacf/Makefile index eddf23c6cd..2170a45137 100644 --- a/usr/src/uts/sparc/consconfig_dacf/Makefile +++ b/usr/src/uts/sparc/consconfig_dacf/Makefile @@ -24,7 +24,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -62,6 +61,7 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # Please do not carry these forward to new Makefiles. # LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-parentheses .KEEP_STATE: diff --git a/usr/src/uts/sparc/consms/Makefile b/usr/src/uts/sparc/consms/Makefile index 766ae41a8e..f10d86e5b0 100644 --- a/usr/src/uts/sparc/consms/Makefile +++ b/usr/src/uts/sparc/consms/Makefile @@ -23,7 +23,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the consms driver # @@ -68,6 +68,8 @@ CFLAGS += $(CCVERBOSE) # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/sparc/cryptmod/Makefile b/usr/src/uts/sparc/cryptmod/Makefile index 21a3b0e180..ad24856510 100644 --- a/usr/src/uts/sparc/cryptmod/Makefile +++ b/usr/src/uts/sparc/cryptmod/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the streams crypto kernel # module. @@ -70,6 +70,8 @@ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/crypto/Makefile b/usr/src/uts/sparc/crypto/Makefile index 81df885335..786ff74b65 100644 --- a/usr/src/uts/sparc/crypto/Makefile +++ b/usr/src/uts/sparc/crypto/Makefile @@ -61,6 +61,8 @@ CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -Nmisc/kcf +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/cryptoadm/Makefile b/usr/src/uts/sparc/cryptoadm/Makefile index d744436fe0..f992ce2af8 100644 --- a/usr/src/uts/sparc/cryptoadm/Makefile +++ b/usr/src/uts/sparc/cryptoadm/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the cryptoadm driver # kernel module. @@ -70,6 +70,9 @@ LDFLAGS += -dy -Nmisc/kcf # LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/ctf/Makefile b/usr/src/uts/sparc/ctf/Makefile index 511d622450..bb40cd9d28 100644 --- a/usr/src/uts/sparc/ctf/Makefile +++ b/usr/src/uts/sparc/ctf/Makefile @@ -22,7 +22,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" UTSBASE = ../.. @@ -49,6 +48,8 @@ LDFLAGS += $(BREDUCE) -M$(UTSBASE)/common/ctf/mapfile -dy LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: def: $(DEF_DEPS) diff --git a/usr/src/uts/sparc/ctfs/Makefile b/usr/src/uts/sparc/ctfs/Makefile index 2f1d31df1e..3f8ddeee8b 100644 --- a/usr/src/uts/sparc/ctfs/Makefile +++ b/usr/src/uts/sparc/ctfs/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the contract file system # kernel module. @@ -67,6 +67,8 @@ CFLAGS += $(CCVERBOSE) # LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/dad/Makefile b/usr/src/uts/sparc/dad/Makefile index 94cff6a0e5..bccba311ff 100644 --- a/usr/src/uts/sparc/dad/Makefile +++ b/usr/src/uts/sparc/dad/Makefile @@ -18,13 +18,12 @@ # # CDDL HEADER END # -# -#ident "%Z%%M% %I% %E% SMI" + # # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# uts/sparc/dad/Makefile + # # This makefile drives the production of the dad driver kernel module. # @@ -77,6 +76,14 @@ LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-type-limits + # # Default build targets. # diff --git a/usr/src/uts/sparc/daplt/Makefile b/usr/src/uts/sparc/daplt/Makefile index 5fe9e5a0d3..ba5e0800a0 100644 --- a/usr/src/uts/sparc/daplt/Makefile +++ b/usr/src/uts/sparc/daplt/Makefile @@ -80,6 +80,11 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/dca/Makefile b/usr/src/uts/sparc/dca/Makefile index 70b655e4e4..bea36330f6 100644 --- a/usr/src/uts/sparc/dca/Makefile +++ b/usr/src/uts/sparc/dca/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the DCA kCF provider. # @@ -74,6 +74,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable + # # Default build targets. # diff --git a/usr/src/uts/sparc/dcam1394/Makefile b/usr/src/uts/sparc/dcam1394/Makefile index 5cd4807169..6f8d4dce91 100644 --- a/usr/src/uts/sparc/dcam1394/Makefile +++ b/usr/src/uts/sparc/dcam1394/Makefile @@ -23,8 +23,6 @@ # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# # # Path to the base of the uts directory tree. @@ -67,6 +65,9 @@ CFLAGS += $(CCVERBOSE) # depends on misc/s1394 LDFLAGS += -dy -Nmisc/s1394 +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # Default build targets. # .KEEP_STATE: diff --git a/usr/src/uts/sparc/dcfs/Makefile b/usr/src/uts/sparc/dcfs/Makefile index ca4be87faf..0b6ef711dc 100644 --- a/usr/src/uts/sparc/dcfs/Makefile +++ b/usr/src/uts/sparc/dcfs/Makefile @@ -23,7 +23,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the dcfs file system # kernel module. @@ -61,6 +61,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/des/Makefile b/usr/src/uts/sparc/des/Makefile index 4d23520c3f..90bc58b943 100644 --- a/usr/src/uts/sparc/des/Makefile +++ b/usr/src/uts/sparc/des/Makefile @@ -24,7 +24,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the des crypto kernel module. # @@ -82,6 +82,9 @@ LDFLAGS += -dy -Nmisc/kcf CFLAGS += $(CCVERBOSE) -I$(COM_DIR) LINTFLAGS += -I$(COM_DIR) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # For now, disable these lint checks; maintainers should endeavor # to investigate and remove these for maximum lint coverage. diff --git a/usr/src/uts/sparc/dev/Makefile b/usr/src/uts/sparc/dev/Makefile index 164e9486b2..1469b37763 100644 --- a/usr/src/uts/sparc/dev/Makefile +++ b/usr/src/uts/sparc/dev/Makefile @@ -64,6 +64,10 @@ LDFLAGS += -dy -Nfs/devfs -Nmisc/dls INC_PATH += -I$(UTSBASE)/common/fs/zfs INC_PATH += -I$(UTSBASE)/common/io/bpf +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/devfs/Makefile b/usr/src/uts/sparc/devfs/Makefile index 4ec32b042b..c80af73300 100644 --- a/usr/src/uts/sparc/devfs/Makefile +++ b/usr/src/uts/sparc/devfs/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # uts/sparc/devfs/Makefile # This makefile drives the production of the Cache file system @@ -49,6 +49,8 @@ ROOTMODULE = $(ROOT_FS_DIR)/$(MODULE) # include $(UTSBASE)/sparc/Makefile.sparc +CERRWARN += -_gcc=-Wno-parentheses + # # Define targets # diff --git a/usr/src/uts/sparc/devinfo/Makefile b/usr/src/uts/sparc/devinfo/Makefile index 6a060aea41..9afc28426f 100644 --- a/usr/src/uts/sparc/devinfo/Makefile +++ b/usr/src/uts/sparc/devinfo/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the devinfo kernel # driver to support libdevinfo. @@ -65,6 +65,11 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) CFLAGS += $(CCVERBOSE) CPPFLAGS += -I$(SRC)/common +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-clobbered + # # Default build targets. # diff --git a/usr/src/uts/sparc/dld/Makefile b/usr/src/uts/sparc/dld/Makefile index 15ffe8a8eb..b4b1c63377 100644 --- a/usr/src/uts/sparc/dld/Makefile +++ b/usr/src/uts/sparc/dld/Makefile @@ -69,6 +69,10 @@ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/dls/Makefile b/usr/src/uts/sparc/dls/Makefile index 81dd25d8e3..a7c278e543 100644 --- a/usr/src/uts/sparc/dls/Makefile +++ b/usr/src/uts/sparc/dls/Makefile @@ -67,6 +67,8 @@ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/dmfe/Makefile b/usr/src/uts/sparc/dmfe/Makefile index 4712b9738b..7d3b4a6957 100644 --- a/usr/src/uts/sparc/dmfe/Makefile +++ b/usr/src/uts/sparc/dmfe/Makefile @@ -56,6 +56,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized + # # extra link arguments # diff --git a/usr/src/uts/sparc/doorfs/Makefile b/usr/src/uts/sparc/doorfs/Makefile index f6c621ff44..ebdfcb24fd 100644 --- a/usr/src/uts/sparc/doorfs/Makefile +++ b/usr/src/uts/sparc/doorfs/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the semsys driver kernel module. # @@ -75,6 +75,9 @@ CFLAGS += $(CCVERBOSE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/dprov/Makefile b/usr/src/uts/sparc/dprov/Makefile index 6dbd368567..330fd4da81 100644 --- a/usr/src/uts/sparc/dprov/Makefile +++ b/usr/src/uts/sparc/dprov/Makefile @@ -22,7 +22,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the dummy KEF provider. # @@ -86,6 +86,10 @@ LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label + # # Default build targets. # diff --git a/usr/src/uts/sparc/dscpmk/Makefile b/usr/src/uts/sparc/dscpmk/Makefile index 0385535b0b..f9c67ebd48 100644 --- a/usr/src/uts/sparc/dscpmk/Makefile +++ b/usr/src/uts/sparc/dscpmk/Makefile @@ -23,7 +23,6 @@ # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" # # This makefile creates the marker (ipp) module. # sparc architecture dependent @@ -73,6 +72,8 @@ LDFLAGS += -dy -Ndrv/ip LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/dtrace/Makefile b/usr/src/uts/sparc/dtrace/Makefile index bd500cd36c..3a2d5341b1 100644 --- a/usr/src/uts/sparc/dtrace/Makefile +++ b/usr/src/uts/sparc/dtrace/Makefile @@ -22,7 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" UTSBASE = ../.. @@ -40,6 +39,10 @@ include $(UTSBASE)/sparc/Makefile.sparc # DSF_DIR = $(UTSBASE)/$(PLATFORM)/genassym +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized + ALL_TARGET = $(BINARY) $(SRC_CONFILE) LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) diff --git a/usr/src/uts/sparc/e1000g/Makefile b/usr/src/uts/sparc/e1000g/Makefile index a0845ff847..66681a746b 100644 --- a/usr/src/uts/sparc/e1000g/Makefile +++ b/usr/src/uts/sparc/e1000g/Makefile @@ -56,6 +56,12 @@ ALL_TARGET = $(BINARY) $(SRC_CONFFILE) LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable + # # Override defaults # diff --git a/usr/src/uts/sparc/ecc/Makefile b/usr/src/uts/sparc/ecc/Makefile index 06ac288821..86170b2387 100644 --- a/usr/src/uts/sparc/ecc/Makefile +++ b/usr/src/uts/sparc/ecc/Makefile @@ -70,6 +70,14 @@ CFLAGS += $(CCVERBOSE) -I$(COM1_DIR) -I$(COM2_DIR) CFLAGS += -DMP_API_COMPATIBLE -DNSS_ECC_MORE_THAN_SUITE_B LINTFLAGS += -I$(COM1_DIR) -I$(COM2_DIR) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-empty-body +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/ecpp/Makefile b/usr/src/uts/sparc/ecpp/Makefile index a2c95548b5..be88954984 100644 --- a/usr/src/uts/sparc/ecpp/Makefile +++ b/usr/src/uts/sparc/ecpp/Makefile @@ -23,7 +23,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This Makefile drives the production of ecpp # kernel module. @@ -67,6 +67,10 @@ CFLAGS += $(CCVERBOSE) # Turn this on once compiler understands v9 in it's backend #INLINES += $(UTSBASE)/sun/io/ecpp.il +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable + # # For now, disable these lint checks; maintainers should endeavor # to investigate and remove these for maximum lint coverage. diff --git a/usr/src/uts/sparc/efe/Makefile b/usr/src/uts/sparc/efe/Makefile index c26d8c875e..e0342d5ace 100644 --- a/usr/src/uts/sparc/efe/Makefile +++ b/usr/src/uts/sparc/efe/Makefile @@ -40,6 +40,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -N misc/mac -N misc/mii +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/ehci/Makefile b/usr/src/uts/sparc/ehci/Makefile index 7d5c813e24..33d39ca0cb 100644 --- a/usr/src/uts/sparc/ehci/Makefile +++ b/usr/src/uts/sparc/ehci/Makefile @@ -55,7 +55,9 @@ include $(UTSBASE)/sparc/Makefile.sparc # # lint pass one enforcement # -CFLAGS += $(CCVERBOSE) +CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch # # depends on misc/usba diff --git a/usr/src/uts/sparc/eibnx/Makefile b/usr/src/uts/sparc/eibnx/Makefile index 0d3d3f8675..c3264d57cb 100644 --- a/usr/src/uts/sparc/eibnx/Makefile +++ b/usr/src/uts/sparc/eibnx/Makefile @@ -83,6 +83,9 @@ LDFLAGS += -dy -Nmisc/ibcm -Nmisc/ibtl # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets # diff --git a/usr/src/uts/sparc/elfexec/Makefile b/usr/src/uts/sparc/elfexec/Makefile index d0880e974c..cfe4e5e8e0 100644 --- a/usr/src/uts/sparc/elfexec/Makefile +++ b/usr/src/uts/sparc/elfexec/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the elfexec exec kernel # module. @@ -73,6 +73,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/emlxs/Makefile b/usr/src/uts/sparc/emlxs/Makefile index 351d9f934d..bf4e73799d 100644 --- a/usr/src/uts/sparc/emlxs/Makefile +++ b/usr/src/uts/sparc/emlxs/Makefile @@ -87,6 +87,10 @@ LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_INCONS_VAL_TYPE_DECL2 +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/emul64/Makefile b/usr/src/uts/sparc/emul64/Makefile index cea352e91c..337d3e9d95 100644 --- a/usr/src/uts/sparc/emul64/Makefile +++ b/usr/src/uts/sparc/emul64/Makefile @@ -65,6 +65,9 @@ CFLAGS += $(CCVERBOSE) # LDFLAGS += -dy -N misc/scsi +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # For now, disable these lint checks; maintainers should endeavor # to investigate and remove these for maximum lint coverage. diff --git a/usr/src/uts/sparc/eoib/Makefile b/usr/src/uts/sparc/eoib/Makefile index 1d1ee7f1ed..93dacb1a88 100644 --- a/usr/src/uts/sparc/eoib/Makefile +++ b/usr/src/uts/sparc/eoib/Makefile @@ -72,6 +72,9 @@ CPPFLAGS += -DEIB_DEBUG # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Depends on misc/ibtl # diff --git a/usr/src/uts/sparc/eri/Makefile b/usr/src/uts/sparc/eri/Makefile index 9587befd42..d0976890d7 100644 --- a/usr/src/uts/sparc/eri/Makefile +++ b/usr/src/uts/sparc/eri/Makefile @@ -18,14 +18,13 @@ # # CDDL HEADER END # -# -# uts/sparc/eri/Makefile -# -#ident "%Z%%M% %I% %E% SMI" + # # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # + +# # This makefile drives the production of the eri driver # kernel module. # @@ -66,6 +65,8 @@ CLEANLINTFILES += $(LINT32_FILES) # Overrides. # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label LDFLAGS += -dy -N misc/mac -N drv/ip # diff --git a/usr/src/uts/sparc/fas/Makefile b/usr/src/uts/sparc/fas/Makefile index 06b5cc8e38..8af59c8f2e 100644 --- a/usr/src/uts/sparc/fas/Makefile +++ b/usr/src/uts/sparc/fas/Makefile @@ -76,6 +76,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/fasttrap/Makefile b/usr/src/uts/sparc/fasttrap/Makefile index aa76c45a77..a6fc8659cf 100644 --- a/usr/src/uts/sparc/fasttrap/Makefile +++ b/usr/src/uts/sparc/fasttrap/Makefile @@ -23,8 +23,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# UTSBASE = ../.. @@ -45,6 +43,8 @@ CFLAGS += $(CCVERBOSE) CPPFLAGS += -I$(SRC)/common LDFLAGS += -dy -Ndrv/dtrace +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: def: $(DEF_DEPS) diff --git a/usr/src/uts/sparc/fbt/Makefile b/usr/src/uts/sparc/fbt/Makefile index 941f1ec977..1b2b5dcf75 100644 --- a/usr/src/uts/sparc/fbt/Makefile +++ b/usr/src/uts/sparc/fbt/Makefile @@ -22,7 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" UTSBASE = ../.. @@ -50,6 +49,10 @@ LDFLAGS += -dy -Ndrv/dtrace -Nmisc/ctf LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: def: $(DEF_DEPS) diff --git a/usr/src/uts/sparc/fcip/Makefile b/usr/src/uts/sparc/fcip/Makefile index ebda0210fc..af515c5d35 100644 --- a/usr/src/uts/sparc/fcip/Makefile +++ b/usr/src/uts/sparc/fcip/Makefile @@ -71,6 +71,9 @@ LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_INCONS_ARG_USED2 LINTTAGS += -erroff=E_INCONS_VAL_TYPE_USED2 +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits + # # Default build targets. # diff --git a/usr/src/uts/sparc/fcoe/Makefile b/usr/src/uts/sparc/fcoe/Makefile index 4394f0f368..58215fc027 100644 --- a/usr/src/uts/sparc/fcoe/Makefile +++ b/usr/src/uts/sparc/fcoe/Makefile @@ -58,6 +58,8 @@ MODSTUBS_DIR = $(OBJS_DIR) LDFLAGS += -dy -Nmisc/mac INC_PATH += -I$(UTSBASE)/common/io/fcoe +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/fcp/Makefile b/usr/src/uts/sparc/fcp/Makefile index b11bda8839..00ba41c328 100644 --- a/usr/src/uts/sparc/fcp/Makefile +++ b/usr/src/uts/sparc/fcp/Makefile @@ -65,6 +65,11 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/fcpci/Makefile b/usr/src/uts/sparc/fcpci/Makefile index d491489be4..ab429cd13c 100644 --- a/usr/src/uts/sparc/fcpci/Makefile +++ b/usr/src/uts/sparc/fcpci/Makefile @@ -86,6 +86,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/fcsm/Makefile b/usr/src/uts/sparc/fcsm/Makefile index 1bb8c9c7ab..ce564e5eff 100644 --- a/usr/src/uts/sparc/fcsm/Makefile +++ b/usr/src/uts/sparc/fcsm/Makefile @@ -67,6 +67,9 @@ LDFLAGS += -dy -Nmisc/fctl # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/fct/Makefile b/usr/src/uts/sparc/fct/Makefile index d2c3f861dc..3281db0d10 100644 --- a/usr/src/uts/sparc/fct/Makefile +++ b/usr/src/uts/sparc/fct/Makefile @@ -71,6 +71,10 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_IF_ELSE_ANNOTATION +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/fctl/Makefile b/usr/src/uts/sparc/fctl/Makefile index fa8573764b..080e6afeb8 100644 --- a/usr/src/uts/sparc/fctl/Makefile +++ b/usr/src/uts/sparc/fctl/Makefile @@ -69,6 +69,8 @@ LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/fifofs/Makefile b/usr/src/uts/sparc/fifofs/Makefile index b36248db56..a12c89e2b0 100644 --- a/usr/src/uts/sparc/fifofs/Makefile +++ b/usr/src/uts/sparc/fifofs/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the fifofs file system # kernel module. @@ -72,6 +72,8 @@ CFLAGS += $(CCVERBOSE) LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/flowacct/Makefile b/usr/src/uts/sparc/flowacct/Makefile index 9d2b144007..40e80edef4 100644 --- a/usr/src/uts/sparc/flowacct/Makefile +++ b/usr/src/uts/sparc/flowacct/Makefile @@ -23,7 +23,6 @@ # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" # # This makefile creates the flowacct accounting (ipp) module. # sparc architecture dependent @@ -72,6 +71,8 @@ LDFLAGS += -dy -Ndrv/ip -Ndrv/tcp # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/fp/Makefile b/usr/src/uts/sparc/fp/Makefile index 34d7c25654..f1791f247e 100644 --- a/usr/src/uts/sparc/fp/Makefile +++ b/usr/src/uts/sparc/fp/Makefile @@ -72,6 +72,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-function + # # Default build targets. # diff --git a/usr/src/uts/sparc/fssnap/Makefile b/usr/src/uts/sparc/fssnap/Makefile index dc5f6bd54d..5d0eb504ae 100644 --- a/usr/src/uts/sparc/fssnap/Makefile +++ b/usr/src/uts/sparc/fssnap/Makefile @@ -22,7 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" # # sparc architecture dependent @@ -67,6 +66,8 @@ LDFLAGS += -dy -Nmisc/fssnap_if -Nfs/ufs # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/gen_drv/Makefile b/usr/src/uts/sparc/gen_drv/Makefile index 74ddca6ad4..a4a8448844 100644 --- a/usr/src/uts/sparc/gen_drv/Makefile +++ b/usr/src/uts/sparc/gen_drv/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the gen_drv kernel # driver to testing hotplugging operations @@ -68,6 +68,8 @@ CFLAGS += $(CCVERBOSE) # LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-unused-variable + # # Default build targets. # diff --git a/usr/src/uts/sparc/gld/Makefile b/usr/src/uts/sparc/gld/Makefile index 85340490b4..e4323878f1 100644 --- a/usr/src/uts/sparc/gld/Makefile +++ b/usr/src/uts/sparc/gld/Makefile @@ -19,7 +19,7 @@ # CDDL HEADER END # # -#ident "%Z%%M% %I% %E% SMI" + # # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. @@ -70,6 +70,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/hci1394/Makefile b/usr/src/uts/sparc/hci1394/Makefile index 83ab4805ff..068edbf679 100644 --- a/usr/src/uts/sparc/hci1394/Makefile +++ b/usr/src/uts/sparc/hci1394/Makefile @@ -24,7 +24,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the hci1394 OHCI HAL module. # @@ -88,6 +88,9 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/hermon/Makefile b/usr/src/uts/sparc/hermon/Makefile index 28fe738dab..0b302b9953 100644 --- a/usr/src/uts/sparc/hermon/Makefile +++ b/usr/src/uts/sparc/hermon/Makefile @@ -75,6 +75,12 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/hid/Makefile b/usr/src/uts/sparc/hid/Makefile index e1a1ecfd7b..5a855d5800 100644 --- a/usr/src/uts/sparc/hid/Makefile +++ b/usr/src/uts/sparc/hid/Makefile @@ -68,6 +68,8 @@ ALL_TARGET = $(BINARY) LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) +CERRWARN += -_gcc=-Wno-parentheses + # # For now, disable these lint checks; maintainers should endeavor # to investigate and remove these for maximum lint coverage. diff --git a/usr/src/uts/sparc/hidparser/Makefile b/usr/src/uts/sparc/hidparser/Makefile index a6f9d0a72f..1b6f99ef6e 100644 --- a/usr/src/uts/sparc/hidparser/Makefile +++ b/usr/src/uts/sparc/hidparser/Makefile @@ -43,6 +43,7 @@ OBJECTS = $(HIDPARSER_OBJS:%=$(OBJS_DIR)/%) LINTS = $(HIDPARSER_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_MISC_DIR)/$(MODULE) + # # Include common rules. # @@ -51,7 +52,8 @@ include $(UTSBASE)/sparc/Makefile.sparc # # lint pass one enforcement # -CFLAGS += $(CCVERBOSE) +CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized # # depends on misc/usba diff --git a/usr/src/uts/sparc/hme/Makefile b/usr/src/uts/sparc/hme/Makefile index 196d125161..b22c9eb8be 100644 --- a/usr/src/uts/sparc/hme/Makefile +++ b/usr/src/uts/sparc/hme/Makefile @@ -59,6 +59,10 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -Nmisc/mii -Nmisc/mac +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/hook/Makefile b/usr/src/uts/sparc/hook/Makefile index 75d1cf4d5b..7f8a8a0f5e 100644 --- a/usr/src/uts/sparc/hook/Makefile +++ b/usr/src/uts/sparc/hook/Makefile @@ -24,7 +24,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the hook driver kernel module. # @@ -49,6 +49,8 @@ ROOTMODULE = $(ROOT_MISC_DIR)/$(MODULE) # include $(UTSBASE)/sparc/Makefile.sparc +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/sparc/hpcsvc/Makefile b/usr/src/uts/sparc/hpcsvc/Makefile index ef5f0f8e5c..74edaabac0 100644 --- a/usr/src/uts/sparc/hpcsvc/Makefile +++ b/usr/src/uts/sparc/hpcsvc/Makefile @@ -24,7 +24,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the hpcsvc "misc" # kernel module. @@ -63,6 +63,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) DEBUG_FLGS = DEBUG_DEFS += $(DEBUG_FLGS) +CERRWARN += -_gcc=-Wno-uninitialized + # # lint pass one enforcement # diff --git a/usr/src/uts/sparc/hsfs/Makefile b/usr/src/uts/sparc/hsfs/Makefile index 7b3d8c6e79..7a042ec007 100644 --- a/usr/src/uts/sparc/hsfs/Makefile +++ b/usr/src/uts/sparc/hsfs/Makefile @@ -77,6 +77,12 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/sparc/hwahc/Makefile b/usr/src/uts/sparc/hwahc/Makefile index abe78b3e70..d6f810d2a4 100644 --- a/usr/src/uts/sparc/hwahc/Makefile +++ b/usr/src/uts/sparc/hwahc/Makefile @@ -53,6 +53,8 @@ include $(UTSBASE)/sparc/Makefile.sparc # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch # # depends on misc/usba diff --git a/usr/src/uts/sparc/hxge/Makefile b/usr/src/uts/sparc/hxge/Makefile index a04957a00f..e8064bf9a7 100644 --- a/usr/src/uts/sparc/hxge/Makefile +++ b/usr/src/uts/sparc/hxge/Makefile @@ -87,6 +87,12 @@ LINTFLAGS += -DSOLARIS LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_FALSE_LOGICAL_EXPR + +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Driver depends on mac & IP # diff --git a/usr/src/uts/sparc/i8042/Makefile b/usr/src/uts/sparc/i8042/Makefile index cf3b2394b9..a08c71cac1 100644 --- a/usr/src/uts/sparc/i8042/Makefile +++ b/usr/src/uts/sparc/i8042/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the i8042 nexus driver # @@ -62,6 +62,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-unused-function + # # Default build targets. # diff --git a/usr/src/uts/sparc/ib/Makefile b/usr/src/uts/sparc/ib/Makefile index 94ed6db924..7702adf1a5 100644 --- a/usr/src/uts/sparc/ib/Makefile +++ b/usr/src/uts/sparc/ib/Makefile @@ -22,7 +22,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # # @@ -66,6 +66,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) ALL_BUILDS = $(ALL_BUILDSONLY64) DEF_BUILDS = $(DEF_BUILDSONLY64) +CERRWARN += -_gcc=-Wno-uninitialized + # # lint pass one enforcement # diff --git a/usr/src/uts/sparc/ibcm/Makefile b/usr/src/uts/sparc/ibcm/Makefile index 62e2fb4a3a..c4f9bd7924 100644 --- a/usr/src/uts/sparc/ibcm/Makefile +++ b/usr/src/uts/sparc/ibcm/Makefile @@ -28,8 +28,6 @@ # module. SPARC architecture dependent # -# ident "%Z%%M% %I% %E% SMI" - # # Path to the base of the uts directory tree (usually /usr/src/uts). # @@ -69,6 +67,14 @@ DEF_BUILDS = $(DEF_BUILDSONLY64) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-value + # # depends on misc/ibtl and misc/ibmf # diff --git a/usr/src/uts/sparc/ibdm/Makefile b/usr/src/uts/sparc/ibdm/Makefile index 2aac7bad3f..a749558c65 100644 --- a/usr/src/uts/sparc/ibdm/Makefile +++ b/usr/src/uts/sparc/ibdm/Makefile @@ -22,7 +22,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # # This makefile drives the production of the ibdm kernel module. @@ -80,6 +80,8 @@ LDFLAGS += -dy -Nmisc/ibtl -Nmisc/ibmf # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/ibmf/Makefile b/usr/src/uts/sparc/ibmf/Makefile index 584806d0be..b3c8dc854e 100644 --- a/usr/src/uts/sparc/ibmf/Makefile +++ b/usr/src/uts/sparc/ibmf/Makefile @@ -22,7 +22,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the ibmf kernel module. # @@ -79,6 +79,8 @@ CFLAGS += $(CCVERBOSE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/ibp/Makefile b/usr/src/uts/sparc/ibp/Makefile index a3b20977a8..908fd36b5d 100644 --- a/usr/src/uts/sparc/ibp/Makefile +++ b/usr/src/uts/sparc/ibp/Makefile @@ -73,6 +73,9 @@ CFLAGS += $(CCVERBOSE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/sparc/ibtl/Makefile b/usr/src/uts/sparc/ibtl/Makefile index 7057fe475e..d096ba4aae 100644 --- a/usr/src/uts/sparc/ibtl/Makefile +++ b/usr/src/uts/sparc/ibtl/Makefile @@ -22,7 +22,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the ibtl kernel module. # @@ -78,6 +78,12 @@ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-value + # # Default build targets. # diff --git a/usr/src/uts/sparc/idm/Makefile b/usr/src/uts/sparc/idm/Makefile index 4953d5a112..ee54f9ca87 100644 --- a/usr/src/uts/sparc/idm/Makefile +++ b/usr/src/uts/sparc/idm/Makefile @@ -60,6 +60,10 @@ DEBUG_FLGS = DEBUG_DEFS += $(DEBUG_FLGS) LDFLAGS += -dy -Nfs/sockfs -Nmisc/ksocket +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # Include INC_PATH += -I$(SRC)/common/hdcrc diff --git a/usr/src/uts/sparc/idmap/Makefile b/usr/src/uts/sparc/idmap/Makefile index d201370ec2..a832800e41 100644 --- a/usr/src/uts/sparc/idmap/Makefile +++ b/usr/src/uts/sparc/idmap/Makefile @@ -60,6 +60,8 @@ LDFLAGS += -dy -N"sys/doorfs" -N"strmod/rpcmod" # LINTTAGS += -erroff=E_FUNC_VAR_UNUSED -erroff=E_CONSTANT_CONDITION +CERRWARN += -_gcc=-Wno-unused-variable + # # Define targets # diff --git a/usr/src/uts/sparc/igb/Makefile b/usr/src/uts/sparc/igb/Makefile index 3a721ac204..ae55dfc864 100644 --- a/usr/src/uts/sparc/igb/Makefile +++ b/usr/src/uts/sparc/igb/Makefile @@ -49,6 +49,9 @@ CONF_SRCDIR = $(UTSBASE)/common/io/igb # include $(UTSBASE)/sparc/Makefile.sparc +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/sparc/ii/Makefile b/usr/src/uts/sparc/ii/Makefile index a74651f50c..e4f936866f 100644 --- a/usr/src/uts/sparc/ii/Makefile +++ b/usr/src/uts/sparc/ii/Makefile @@ -62,11 +62,14 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # # lint pass one enforcement # -CFLAGS += -v +CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -N"drv/nsctl" -N"drv/nskern" -N"misc/spuni" LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: def: $(DEF_DEPS) diff --git a/usr/src/uts/sparc/inst_sync/Makefile b/usr/src/uts/sparc/inst_sync/Makefile index 11b99f9a14..a400fc61a2 100644 --- a/usr/src/uts/sparc/inst_sync/Makefile +++ b/usr/src/uts/sparc/inst_sync/Makefile @@ -24,7 +24,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the inst_sync system call module. # @@ -56,6 +56,8 @@ ALL_TARGET = $(BINARY) LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) +CERRWARN += -_gcc=-Wno-parentheses + # # Overrides. # diff --git a/usr/src/uts/sparc/intpexec/Makefile b/usr/src/uts/sparc/intpexec/Makefile index 266b2403ae..6de8290733 100644 --- a/usr/src/uts/sparc/intpexec/Makefile +++ b/usr/src/uts/sparc/intpexec/Makefile @@ -20,11 +20,10 @@ # CDDL HEADER END # # -# uts/sparc/intpexec/Makefile # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the intpexec (interpreter) # exec kernel module. @@ -61,6 +60,7 @@ include $(UTSBASE)/sparc/Makefile.sparc # Overrides. # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses # # Default build targets. diff --git a/usr/src/uts/sparc/ip/Makefile b/usr/src/uts/sparc/ip/Makefile index 143d4cce6b..e63fa44000 100644 --- a/usr/src/uts/sparc/ip/Makefile +++ b/usr/src/uts/sparc/ip/Makefile @@ -77,6 +77,14 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits + # # Depends on md5 and swrand (for SCTP). SCTP needs to depend on # swrand as it needs random numbers early on during boot before diff --git a/usr/src/uts/sparc/ipc/Makefile b/usr/src/uts/sparc/ipc/Makefile index 972ba0f9a2..2298bb7c42 100644 --- a/usr/src/uts/sparc/ipc/Makefile +++ b/usr/src/uts/sparc/ipc/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the ipc `user' kernel module. # @@ -67,6 +67,9 @@ CFLAGS += $(CCVERBOSE) # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/ipf/Makefile b/usr/src/uts/sparc/ipf/Makefile index 1270d808af..5ed794ece5 100644 --- a/usr/src/uts/sparc/ipf/Makefile +++ b/usr/src/uts/sparc/ipf/Makefile @@ -77,6 +77,12 @@ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-empty-body + # # Default build targets. # diff --git a/usr/src/uts/sparc/ipgpc/Makefile b/usr/src/uts/sparc/ipgpc/Makefile index 6d3f44922a..0e36efe1dc 100644 --- a/usr/src/uts/sparc/ipgpc/Makefile +++ b/usr/src/uts/sparc/ipgpc/Makefile @@ -23,7 +23,6 @@ # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" # # This makefile drives the production of the IP generic packet classifier # misc kernel module. @@ -68,6 +67,8 @@ CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -Ndrv/ip +CERRWARN += -_gcc=-Wno-uninitialized + # # For now, disable these lint checks; maintainers should endeavor # to investigate and remove these for maximum lint coverage. diff --git a/usr/src/uts/sparc/ipsecah/Makefile b/usr/src/uts/sparc/ipsecah/Makefile index 356b7ecdec..506645d988 100644 --- a/usr/src/uts/sparc/ipsecah/Makefile +++ b/usr/src/uts/sparc/ipsecah/Makefile @@ -22,7 +22,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the ipsecah driver # kernel module. @@ -77,6 +77,9 @@ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/ipsecesp/Makefile b/usr/src/uts/sparc/ipsecesp/Makefile index 8080db7fde..fa3fc8f4d5 100644 --- a/usr/src/uts/sparc/ipsecesp/Makefile +++ b/usr/src/uts/sparc/ipsecesp/Makefile @@ -22,7 +22,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the ipsecesp driver # kernel module. @@ -76,6 +76,8 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/iptun/Makefile b/usr/src/uts/sparc/iptun/Makefile index b48da88006..fc09008ab2 100644 --- a/usr/src/uts/sparc/iptun/Makefile +++ b/usr/src/uts/sparc/iptun/Makefile @@ -59,6 +59,10 @@ INC_PATH += -I$(UTSBASE)/common/io/bpf LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/iscsi/Makefile b/usr/src/uts/sparc/iscsi/Makefile index e821788377..56e8b185f2 100644 --- a/usr/src/uts/sparc/iscsi/Makefile +++ b/usr/src/uts/sparc/iscsi/Makefile @@ -68,6 +68,12 @@ LDFLAGS += -N"misc/idm" LINTFLAGS += -a -erroff=E_BAD_PTR_CAST_ALIGN -erroff=E_PTRDIFF_OVERFLOW LINTFLAGS64 += -a -erroff=E_BAD_PTR_CAST_ALIGN -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/iscsit/Makefile b/usr/src/uts/sparc/iscsit/Makefile index d7cfc24314..1d61a81d72 100644 --- a/usr/src/uts/sparc/iscsit/Makefile +++ b/usr/src/uts/sparc/iscsit/Makefile @@ -63,6 +63,10 @@ LDFLAGS += -dy -Ndrv/stmf -Nmisc/idm -Nfs/sockfs -Nmisc/md5 -Nmisc/ksocket C99MODE= -xc99=%all C99LMODE= -Xc99=%all +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label + # # Default build targets. # diff --git a/usr/src/uts/sparc/iser/Makefile b/usr/src/uts/sparc/iser/Makefile index c5fb26361c..bf5dd8e069 100644 --- a/usr/src/uts/sparc/iser/Makefile +++ b/usr/src/uts/sparc/iser/Makefile @@ -43,6 +43,8 @@ CONF_SRCDIR = $(UTSBASE)/common/io/ib/clients/iser # include $(UTSBASE)/sparc/Makefile.sparc +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/sparc/ixgbe/Makefile b/usr/src/uts/sparc/ixgbe/Makefile index 7d258b2088..c04e56561d 100644 --- a/usr/src/uts/sparc/ixgbe/Makefile +++ b/usr/src/uts/sparc/ixgbe/Makefile @@ -49,6 +49,10 @@ CONF_SRCDIR = $(UTSBASE)/common/io/ixgbe # include $(UTSBASE)/sparc/Makefile.sparc +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/sparc/javaexec/Makefile b/usr/src/uts/sparc/javaexec/Makefile index 056173e99d..7b25a52726 100644 --- a/usr/src/uts/sparc/javaexec/Makefile +++ b/usr/src/uts/sparc/javaexec/Makefile @@ -26,7 +26,7 @@ # Use is subject to license terms. # All right reserved. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the javaexec kernel module # @@ -51,6 +51,8 @@ ROOTMODULE = $(USR_EXEC_DIR)/$(MODULE) # include $(UTSBASE)/sparc/Makefile.sparc +CERRWARN += -_gcc=-Wno-parentheses + # # Define targets # diff --git a/usr/src/uts/sparc/kaio/Makefile b/usr/src/uts/sparc/kaio/Makefile index c13ac92c06..9713927ed1 100644 --- a/usr/src/uts/sparc/kaio/Makefile +++ b/usr/src/uts/sparc/kaio/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the kaio driver kernel module. # @@ -75,6 +75,10 @@ CFLAGS += $(CCVERBOSE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/kb8042/Makefile b/usr/src/uts/sparc/kb8042/Makefile index f65cfddce9..517bfd446d 100644 --- a/usr/src/uts/sparc/kb8042/Makefile +++ b/usr/src/uts/sparc/kb8042/Makefile @@ -24,7 +24,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" # # This makefile drives the production of the kb8042 # kernel module. @@ -65,6 +64,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/kbtrans/Makefile b/usr/src/uts/sparc/kbtrans/Makefile index 105de853bd..0669817680 100644 --- a/usr/src/uts/sparc/kbtrans/Makefile +++ b/usr/src/uts/sparc/kbtrans/Makefile @@ -21,10 +21,11 @@ # # uts/sparc/kbtrans/Makefile +# # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the kbtrans misc module. # @@ -69,6 +70,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-empty-body +CERRWARN += -_gcc=-Wno-unused-braces + .KEEP_STATE: def: $(DEF_DEPS) diff --git a/usr/src/uts/sparc/kcf/Makefile b/usr/src/uts/sparc/kcf/Makefile index eec896e679..22d39a7c0e 100644 --- a/usr/src/uts/sparc/kcf/Makefile +++ b/usr/src/uts/sparc/kcf/Makefile @@ -65,6 +65,11 @@ CFLAGS += $(CCVERBOSE) -I$(COM_DIR) LINTTAGS += -I$(COM_DIR) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label + # # Default build targets. # diff --git a/usr/src/uts/sparc/keysock/Makefile b/usr/src/uts/sparc/keysock/Makefile index b52878a227..f73ad4e981 100644 --- a/usr/src/uts/sparc/keysock/Makefile +++ b/usr/src/uts/sparc/keysock/Makefile @@ -23,7 +23,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the keysock driver # kernel module. @@ -78,6 +78,8 @@ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-unused-variable + # # Default build targets. # diff --git a/usr/src/uts/sparc/kgssapi/Makefile b/usr/src/uts/sparc/kgssapi/Makefile index ed0eed4bfb..c33564a338 100644 --- a/usr/src/uts/sparc/kgssapi/Makefile +++ b/usr/src/uts/sparc/kgssapi/Makefile @@ -70,6 +70,9 @@ LDFLAGS += -dy -N strmod/rpcmod -N misc/rpcsec -N misc/tlimod LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/kiconv_ko/Makefile b/usr/src/uts/sparc/kiconv_ko/Makefile index aebbba6b9c..066b2398ba 100755..100644 --- a/usr/src/uts/sparc/kiconv_ko/Makefile +++ b/usr/src/uts/sparc/kiconv_ko/Makefile @@ -24,7 +24,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the kiconv_ko # kernel module. @@ -69,6 +69,8 @@ CFLAGS += $(CCVERBOSE) # LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/kmech_dummy/Makefile b/usr/src/uts/sparc/kmech_dummy/Makefile index 5741b4445d..f8ea726961 100644 --- a/usr/src/uts/sparc/kmech_dummy/Makefile +++ b/usr/src/uts/sparc/kmech_dummy/Makefile @@ -46,6 +46,8 @@ ROOTMODULE = $(ROOT_KGSS_DIR)/$(MODULE) # include $(UTSBASE)/sparc/Makefile.sparc +CERRWARN += -_gcc=-Wno-parentheses + # # Define targets # diff --git a/usr/src/uts/sparc/kmech_krb5/Makefile b/usr/src/uts/sparc/kmech_krb5/Makefile index ffaa3f2a94..0bf4c49d1c 100644 --- a/usr/src/uts/sparc/kmech_krb5/Makefile +++ b/usr/src/uts/sparc/kmech_krb5/Makefile @@ -64,6 +64,11 @@ CFLAGS += $(CCVERBOSE) # LDFLAGS += -dy -N misc/kgssapi -N crypto/md5 +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # For now, disable these lint checks; maintainers should endeavor # to investigate and remove these for maximum lint coverage. diff --git a/usr/src/uts/sparc/kssl/Makefile b/usr/src/uts/sparc/kssl/Makefile index 9746df1319..ba7750705b 100644 --- a/usr/src/uts/sparc/kssl/Makefile +++ b/usr/src/uts/sparc/kssl/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the kernel SSL driver # kernel module. @@ -73,6 +73,8 @@ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/ksslf/Makefile b/usr/src/uts/sparc/ksslf/Makefile index d0711a3b49..17d6816547 100644 --- a/usr/src/uts/sparc/ksslf/Makefile +++ b/usr/src/uts/sparc/ksslf/Makefile @@ -67,6 +67,9 @@ LDFLAGS += -dy -Nmisc/md5 -Nmisc/kcf -Ndrv/kssl -Nfs/sockfs LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/kstat/Makefile b/usr/src/uts/sparc/kstat/Makefile index 75f3fc9124..09d0f64722 100644 --- a/usr/src/uts/sparc/kstat/Makefile +++ b/usr/src/uts/sparc/kstat/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # kernel statistics driver makefile. # @@ -68,6 +68,8 @@ CFLAGS += $(CCVERBOSE) # LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/ksyms/Makefile b/usr/src/uts/sparc/ksyms/Makefile index 319853d91c..34ba77de3f 100644 --- a/usr/src/uts/sparc/ksyms/Makefile +++ b/usr/src/uts/sparc/ksyms/Makefile @@ -24,7 +24,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # ksyms (kernel symbols) driver makefile. # @@ -50,6 +50,8 @@ CONF_SRCDIR = $(UTSBASE)/common/io # include $(UTSBASE)/sparc/Makefile.sparc +CERRWARN += -_gcc=-Wno-parentheses + # # Define targets # diff --git a/usr/src/uts/sparc/ldterm/Makefile b/usr/src/uts/sparc/ldterm/Makefile index a58d978c4a..a76cdad21e 100644 --- a/usr/src/uts/sparc/ldterm/Makefile +++ b/usr/src/uts/sparc/ldterm/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the ldterm streams kernel # module. @@ -70,6 +70,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/llc1/Makefile b/usr/src/uts/sparc/llc1/Makefile index e5e45d69e2..f2d79adf02 100644 --- a/usr/src/uts/sparc/llc1/Makefile +++ b/usr/src/uts/sparc/llc1/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" -# # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -65,6 +63,8 @@ CFLAGS += $(CCVERBOSE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/lofi/Makefile b/usr/src/uts/sparc/lofi/Makefile index 1e1802f603..9a98791817 100644 --- a/usr/src/uts/sparc/lofi/Makefile +++ b/usr/src/uts/sparc/lofi/Makefile @@ -56,6 +56,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized + INC_PATH += -I$(SRC)/common/lzma # diff --git a/usr/src/uts/sparc/lofs/Makefile b/usr/src/uts/sparc/lofs/Makefile index 16730c97b4..ec0a876cb1 100644 --- a/usr/src/uts/sparc/lofs/Makefile +++ b/usr/src/uts/sparc/lofs/Makefile @@ -24,7 +24,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the lofs file system # kernel module. @@ -50,6 +50,8 @@ ROOTMODULE = $(ROOT_FS_DIR)/$(MODULE) # include $(UTSBASE)/sparc/Makefile.sparc +CERRWARN += -_gcc=-Wno-parentheses + # # Define targets # diff --git a/usr/src/uts/sparc/mac/Makefile b/usr/src/uts/sparc/mac/Makefile index 6c013b94d3..5a2fd6834c 100644 --- a/usr/src/uts/sparc/mac/Makefile +++ b/usr/src/uts/sparc/mac/Makefile @@ -65,6 +65,13 @@ INC_PATH += -I$(UTSBASE)/common/io/bpf LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-variable + # # Default build targets. # diff --git a/usr/src/uts/sparc/mac_wifi/Makefile b/usr/src/uts/sparc/mac_wifi/Makefile index 47c178ca61..66dcd3ac3f 100644 --- a/usr/src/uts/sparc/mac_wifi/Makefile +++ b/usr/src/uts/sparc/mac_wifi/Makefile @@ -44,6 +44,8 @@ ROOTMODULE = $(ROOT_MAC_DIR)/$(MODULE) # include $(UTSBASE)/sparc/Makefile.sparc +CERRWARN += -_gcc=-Wno-switch + # # Define targets # diff --git a/usr/src/uts/sparc/md/Makefile b/usr/src/uts/sparc/md/Makefile index e5e32074e1..9dcd315e9f 100644 --- a/usr/src/uts/sparc/md/Makefile +++ b/usr/src/uts/sparc/md/Makefile @@ -19,7 +19,6 @@ # CDDL HEADER END # # -# uts/sparc/md/Makefile # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # Copyright (c) 2011 Bayard G. Bell. All rights reserved. @@ -63,6 +62,12 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses + # # Define dependency on rpcmod # diff --git a/usr/src/uts/sparc/md_hotspares/Makefile b/usr/src/uts/sparc/md_hotspares/Makefile index 1f607f4e6a..80cddd6b0d 100644 --- a/usr/src/uts/sparc/md_hotspares/Makefile +++ b/usr/src/uts/sparc/md_hotspares/Makefile @@ -48,6 +48,8 @@ ROOTMODULE = $(ROOT_MISC_DIR)/$(MODULE) # include $(UTSBASE)/sparc/Makefile.sparc +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/sparc/md_mirror/Makefile b/usr/src/uts/sparc/md_mirror/Makefile index 57cc631696..5a52355219 100644 --- a/usr/src/uts/sparc/md_mirror/Makefile +++ b/usr/src/uts/sparc/md_mirror/Makefile @@ -76,6 +76,9 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/md_notify/Makefile b/usr/src/uts/sparc/md_notify/Makefile index 3d58c5da0b..19730bb4f6 100644 --- a/usr/src/uts/sparc/md_notify/Makefile +++ b/usr/src/uts/sparc/md_notify/Makefile @@ -48,6 +48,8 @@ ROOTMODULE = $(ROOT_MISC_DIR)/$(MODULE) # include $(UTSBASE)/sparc/Makefile.sparc +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/sparc/md_raid/Makefile b/usr/src/uts/sparc/md_raid/Makefile index 246808fe0b..1cf5aba4c9 100644 --- a/usr/src/uts/sparc/md_raid/Makefile +++ b/usr/src/uts/sparc/md_raid/Makefile @@ -64,6 +64,9 @@ CFLAGS += $(CCVERBOSE) # LDFLAGS += -dy -N drv/md +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # For now, disable these lint checks; maintainers should endeavor # to investigate and remove these for maximum lint coverage. diff --git a/usr/src/uts/sparc/md_sp/Makefile b/usr/src/uts/sparc/md_sp/Makefile index 4e3a8bef82..251a6b08a0 100644 --- a/usr/src/uts/sparc/md_sp/Makefile +++ b/usr/src/uts/sparc/md_sp/Makefile @@ -59,6 +59,10 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # LDFLAGS += -dy -N drv/md +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # For now, disable these lint checks; maintainers should endeavor # to investigate and remove these for maximum lint coverage. diff --git a/usr/src/uts/sparc/md_stripe/Makefile b/usr/src/uts/sparc/md_stripe/Makefile index b5ceaf8aa2..88f1968440 100644 --- a/usr/src/uts/sparc/md_stripe/Makefile +++ b/usr/src/uts/sparc/md_stripe/Makefile @@ -64,6 +64,10 @@ CFLAGS += $(CCVERBOSE) # LDFLAGS += -dy -N drv/md +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses + # # For now, disable these lint checks; maintainers should endeavor # to investigate and remove these for maximum lint coverage. diff --git a/usr/src/uts/sparc/md_trans/Makefile b/usr/src/uts/sparc/md_trans/Makefile index 4f42b3cc68..77f5aaf6a7 100644 --- a/usr/src/uts/sparc/md_trans/Makefile +++ b/usr/src/uts/sparc/md_trans/Makefile @@ -64,6 +64,9 @@ CFLAGS += $(CCVERBOSE) # LDFLAGS += -dy -N drv/md -N fs/ufs +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses + # # For now, disable these lint checks; maintainers should endeavor # to investigate and remove these for maximum lint coverage. diff --git a/usr/src/uts/sparc/mii/Makefile b/usr/src/uts/sparc/mii/Makefile index b1e80d5bd6..620f0e1a9d 100644 --- a/usr/src/uts/sparc/mii/Makefile +++ b/usr/src/uts/sparc/mii/Makefile @@ -57,6 +57,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LDFLAGS += -dy -N misc/mac +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/mm/Makefile b/usr/src/uts/sparc/mm/Makefile index 71de828cc9..9382e2d30e 100644 --- a/usr/src/uts/sparc/mm/Makefile +++ b/usr/src/uts/sparc/mm/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the mm driver # @@ -68,6 +68,9 @@ CFLAGS += $(CCVERBOSE) # LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-clobbered + # # Default build targets. # diff --git a/usr/src/uts/sparc/mntfs/Makefile b/usr/src/uts/sparc/mntfs/Makefile index 40dfe779a6..5dec303245 100644 --- a/usr/src/uts/sparc/mntfs/Makefile +++ b/usr/src/uts/sparc/mntfs/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the mntfs file system # kernel module. @@ -71,6 +71,8 @@ CFLAGS += $(CCVERBOSE) # LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/mouse8042/Makefile b/usr/src/uts/sparc/mouse8042/Makefile index 9eca695c82..be8ec6689c 100644 --- a/usr/src/uts/sparc/mouse8042/Makefile +++ b/usr/src/uts/sparc/mouse8042/Makefile @@ -19,11 +19,10 @@ # CDDL HEADER END # # -# uts/sparc/mouse8042/%M% # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the mouse8042 driver # @@ -63,6 +62,9 @@ LDFLAGS += -dy -Ndacf/consconfig_dacf # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/sparc/mpt_sas/Makefile b/usr/src/uts/sparc/mpt_sas/Makefile index e3c4fc1816..9ffd7722d9 100644 --- a/usr/src/uts/sparc/mpt_sas/Makefile +++ b/usr/src/uts/sparc/mpt_sas/Makefile @@ -65,6 +65,11 @@ include $(UTSBASE)/sparc/Makefile.sparc # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/sparc/mr_sas/Makefile b/usr/src/uts/sparc/mr_sas/Makefile index 574302c773..7a38c8cc50 100644 --- a/usr/src/uts/sparc/mr_sas/Makefile +++ b/usr/src/uts/sparc/mr_sas/Makefile @@ -59,6 +59,10 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Turn on doubleword alignment for 64 bit registers # diff --git a/usr/src/uts/sparc/msgsys/Makefile b/usr/src/uts/sparc/msgsys/Makefile index 72ce8110c3..d0f1e78532 100644 --- a/usr/src/uts/sparc/msgsys/Makefile +++ b/usr/src/uts/sparc/msgsys/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the msgsys driver kernel module. # @@ -67,6 +67,9 @@ LDFLAGS += -dy -Nmisc/ipc # LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/mxfe/Makefile b/usr/src/uts/sparc/mxfe/Makefile index c6f05ab84e..17c7174a5c 100644 --- a/usr/src/uts/sparc/mxfe/Makefile +++ b/usr/src/uts/sparc/mxfe/Makefile @@ -22,7 +22,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the Macronix # Fast Ethernet (MXFE) driver module in sparc systems @@ -57,6 +57,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # Overrides # +CERRWARN += -_gcc=-Wno-switch + # # Driver depends on GLDv3 # diff --git a/usr/src/uts/sparc/namefs/Makefile b/usr/src/uts/sparc/namefs/Makefile index c02682db07..5a00eac980 100644 --- a/usr/src/uts/sparc/namefs/Makefile +++ b/usr/src/uts/sparc/namefs/Makefile @@ -24,7 +24,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the namefs file system # kernel module. @@ -50,6 +50,8 @@ ROOTMODULE = $(ROOT_FS_DIR)/$(MODULE) # include $(UTSBASE)/sparc/Makefile.sparc +CERRWARN += -_gcc=-Wno-parentheses + # # Define targets # diff --git a/usr/src/uts/sparc/nfs/Makefile b/usr/src/uts/sparc/nfs/Makefile index 59443a2fdf..e29e28133c 100644 --- a/usr/src/uts/sparc/nfs/Makefile +++ b/usr/src/uts/sparc/nfs/Makefile @@ -82,6 +82,15 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-empty-body + # # Default build targets. # diff --git a/usr/src/uts/sparc/nfs_dlboot/Makefile b/usr/src/uts/sparc/nfs_dlboot/Makefile index 6fc7b2d1e0..27e68a8180 100644 --- a/usr/src/uts/sparc/nfs_dlboot/Makefile +++ b/usr/src/uts/sparc/nfs_dlboot/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the dlboot_proto # kernel module. @@ -73,6 +73,8 @@ LDFLAGS += -dy -Nmisc/strplumb -Nstrmod/rpcmod LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/nfssrv/Makefile b/usr/src/uts/sparc/nfssrv/Makefile index 9a887e58bc..f71c2f10d8 100644 --- a/usr/src/uts/sparc/nfssrv/Makefile +++ b/usr/src/uts/sparc/nfssrv/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the server-side nfs file system # kernel module. @@ -74,6 +74,14 @@ LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/sparc/nsctl/Makefile b/usr/src/uts/sparc/nsctl/Makefile index 116a30c844..2875093f8e 100644 --- a/usr/src/uts/sparc/nsctl/Makefile +++ b/usr/src/uts/sparc/nsctl/Makefile @@ -63,11 +63,13 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # # lint pass one enforcement # -CFLAGS += -v +CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -N"drv/nskern" -N"drv/ncall" -N"misc/spuni" LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: def: $(DEF_DEPS) diff --git a/usr/src/uts/sparc/nv_sata/Makefile b/usr/src/uts/sparc/nv_sata/Makefile index c3d8cfc42f..04791ed8c7 100644 --- a/usr/src/uts/sparc/nv_sata/Makefile +++ b/usr/src/uts/sparc/nv_sata/Makefile @@ -22,7 +22,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -87,6 +87,8 @@ clean.lint: $(CLEAN_LINT_DEPS) install: $(INSTALL_DEPS) +CERRWARN += -_gcc=-Wno-uninitialized + # # Include common targets. # diff --git a/usr/src/uts/sparc/objfs/Makefile b/usr/src/uts/sparc/objfs/Makefile index 4b61d94641..f166f4ee54 100644 --- a/usr/src/uts/sparc/objfs/Makefile +++ b/usr/src/uts/sparc/objfs/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the object file system # kernel module. @@ -68,6 +68,10 @@ CFLAGS += $(CCVERBOSE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/oce/Makefile b/usr/src/uts/sparc/oce/Makefile index bb1fbfdc4a..fe3521b2f9 100644 --- a/usr/src/uts/sparc/oce/Makefile +++ b/usr/src/uts/sparc/oce/Makefile @@ -56,6 +56,11 @@ INC_PATH += -I$(UTSBASE)/common/sys/fibre-channel/fca/oce LDFLAGS += -dy -Nmisc/mac +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/ohci/Makefile b/usr/src/uts/sparc/ohci/Makefile index e733033453..a1afa2fa4e 100644 --- a/usr/src/uts/sparc/ohci/Makefile +++ b/usr/src/uts/sparc/ohci/Makefile @@ -69,6 +69,8 @@ ALL_TARGET = $(BINARY) $(SRC_CONFFILE) LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) +CERRWARN += -_gcc=-Wno-uninitialized + # # For now, disable these lint checks; maintainers should endeavor # to investigate and remove these for maximum lint coverage. diff --git a/usr/src/uts/sparc/openeepr/Makefile b/usr/src/uts/sparc/openeepr/Makefile index e03786d94d..8019dccfab 100644 --- a/usr/src/uts/sparc/openeepr/Makefile +++ b/usr/src/uts/sparc/openeepr/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the openeepr driver # @@ -65,6 +65,9 @@ CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -Ndacf/consconfig_dacf +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # For now, disable these lint checks; maintainers should endeavor # to investigate and remove these for maximum lint coverage. diff --git a/usr/src/uts/sparc/pcan/Makefile b/usr/src/uts/sparc/pcan/Makefile index 306089a12a..7b9f5a7d97 100644 --- a/usr/src/uts/sparc/pcan/Makefile +++ b/usr/src/uts/sparc/pcan/Makefile @@ -23,7 +23,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the pcan driver kernel module. # @@ -72,6 +72,10 @@ CFLAGS += -v LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-switch + # # dependency # diff --git a/usr/src/uts/sparc/pcata/Makefile b/usr/src/uts/sparc/pcata/Makefile index 8f40c457b9..cf45d848c5 100644 --- a/usr/src/uts/sparc/pcata/Makefile +++ b/usr/src/uts/sparc/pcata/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the pcata driver kernel module. # @@ -74,6 +74,9 @@ CFLAGS += $(CCVERBOSE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/pcfs/Makefile b/usr/src/uts/sparc/pcfs/Makefile index f2b1988b4d..3140a6d539 100644 --- a/usr/src/uts/sparc/pcfs/Makefile +++ b/usr/src/uts/sparc/pcfs/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the DOS file system # kernel module. @@ -61,6 +61,12 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-function + # # For now, disable these lint checks; maintainers should endeavor # to investigate and remove these for maximum lint coverage. diff --git a/usr/src/uts/sparc/pci_pci/Makefile b/usr/src/uts/sparc/pci_pci/Makefile index 37b8c63006..b9fd029289 100644 --- a/usr/src/uts/sparc/pci_pci/Makefile +++ b/usr/src/uts/sparc/pci_pci/Makefile @@ -78,6 +78,10 @@ CFLAGS += -dalign # LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-value + # # Dependency # diff --git a/usr/src/uts/sparc/pcic/Makefile b/usr/src/uts/sparc/pcic/Makefile index 3400a15204..be073df333 100644 --- a/usr/src/uts/sparc/pcic/Makefile +++ b/usr/src/uts/sparc/pcic/Makefile @@ -24,7 +24,6 @@ # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" # # This makefile drives the production of the PCIC driver kernel module. # @@ -78,6 +77,11 @@ CPPFLAGS += -DCARDBUS -DHOTPLUG # dependency LDFLAGS += -dy -Nmisc/busra -Nmisc/pcmcia -Nmisc/cardbus +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized + # # For now, disable these lint checks; maintainers should endeavor # to investigate and remove these for maximum lint coverage. diff --git a/usr/src/uts/sparc/pcicfg/Makefile b/usr/src/uts/sparc/pcicfg/Makefile index daa77d4c7e..5cda1ade8e 100644 --- a/usr/src/uts/sparc/pcicfg/Makefile +++ b/usr/src/uts/sparc/pcicfg/Makefile @@ -86,6 +86,11 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/pcieb/Makefile b/usr/src/uts/sparc/pcieb/Makefile index 7e01f6386d..9e2785998d 100644 --- a/usr/src/uts/sparc/pcieb/Makefile +++ b/usr/src/uts/sparc/pcieb/Makefile @@ -84,6 +84,9 @@ LDFLAGS += -dy -Nmisc/pcie LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-unused-variable + # # Default build targets. # diff --git a/usr/src/uts/sparc/pcieb_bcm/Makefile b/usr/src/uts/sparc/pcieb_bcm/Makefile index a9a3f0927d..f1e7efe3a6 100644 --- a/usr/src/uts/sparc/pcieb_bcm/Makefile +++ b/usr/src/uts/sparc/pcieb_bcm/Makefile @@ -85,6 +85,10 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-type-limits + # # Default build targets. # diff --git a/usr/src/uts/sparc/pckt/Makefile b/usr/src/uts/sparc/pckt/Makefile index a3c96e2e72..707f3571bb 100644 --- a/usr/src/uts/sparc/pckt/Makefile +++ b/usr/src/uts/sparc/pckt/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the pckt streams kernel # module. @@ -69,6 +69,8 @@ CFLAGS += $(CCVERBOSE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/pcmcia/Makefile b/usr/src/uts/sparc/pcmcia/Makefile index 4bf982e27d..2efecbe522 100644 --- a/usr/src/uts/sparc/pcmcia/Makefile +++ b/usr/src/uts/sparc/pcmcia/Makefile @@ -28,7 +28,7 @@ # # sparc architecture dependent # -#ident "%Z%%M% %I% %E% SMI" + # # Path to the base of the uts directory tree (usually /usr/src/uts). # @@ -83,6 +83,9 @@ LDFLAGS += -dy -Nmisc/busra LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/pcwl/Makefile b/usr/src/uts/sparc/pcwl/Makefile index 4575c0920d..2206f3c9c4 100644 --- a/usr/src/uts/sparc/pcwl/Makefile +++ b/usr/src/uts/sparc/pcwl/Makefile @@ -23,7 +23,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the pcwl driver kernel module. # @@ -64,13 +64,18 @@ INC_PATH += -I$(UTSBASE)/common/pcmcia # # lint pass one enforcement # -CFLAGS += -v +CFLAGS += $(CCVERBOSE) # # STREAMS API limitations force us to turn off these lint checks. # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # dependency # diff --git a/usr/src/uts/sparc/pipe/Makefile b/usr/src/uts/sparc/pipe/Makefile index 9db83bf5e7..ab513f2ba4 100644 --- a/usr/src/uts/sparc/pipe/Makefile +++ b/usr/src/uts/sparc/pipe/Makefile @@ -48,6 +48,8 @@ ROOTMODULE = $(ROOT_SYS_DIR)/$(MODULE) # include $(UTSBASE)/sparc/Makefile.sparc +CERRWARN += -_gcc=-Wno-parentheses + # # Define targets # diff --git a/usr/src/uts/sparc/pm/Makefile b/usr/src/uts/sparc/pm/Makefile index d713048385..da6092c328 100644 --- a/usr/src/uts/sparc/pm/Makefile +++ b/usr/src/uts/sparc/pm/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the pm (power manager) driver # kernel module. @@ -70,6 +70,9 @@ CFLAGS += $(CCVERBOSE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/pmcs/Makefile b/usr/src/uts/sparc/pmcs/Makefile index 90c8662127..4a963ee1f6 100644 --- a/usr/src/uts/sparc/pmcs/Makefile +++ b/usr/src/uts/sparc/pmcs/Makefile @@ -69,6 +69,12 @@ CPPFLAGS += $(PMCS_DRV_FLGS) \ -DPMCS_FIRMWARE_VERSION=${PMCS_FW_VERSION} \ -DPMCS_FIRMWARE_VERSION_STRING=\"${PMCS_FW_VERSION_STRING}\" +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. diff --git a/usr/src/uts/sparc/poll/Makefile b/usr/src/uts/sparc/poll/Makefile index 9345f60833..f49278c1c5 100644 --- a/usr/src/uts/sparc/poll/Makefile +++ b/usr/src/uts/sparc/poll/Makefile @@ -23,7 +23,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -54,7 +53,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # # lint pass one enforcement # -CFLAGS += $(CCVERBOSE) +CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized # # Default build targets. diff --git a/usr/src/uts/sparc/portfs/Makefile b/usr/src/uts/sparc/portfs/Makefile index b08d2828e5..3f2465e7ed 100644 --- a/usr/src/uts/sparc/portfs/Makefile +++ b/usr/src/uts/sparc/portfs/Makefile @@ -23,7 +23,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the port kernel module. # @@ -74,6 +74,9 @@ CFLAGS += $(CCVERBOSE) # LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/pppt/Makefile b/usr/src/uts/sparc/pppt/Makefile index 3731c52d24..78f8e8b7f7 100644 --- a/usr/src/uts/sparc/pppt/Makefile +++ b/usr/src/uts/sparc/pppt/Makefile @@ -63,6 +63,9 @@ LDFLAGS += -dy -Ndrv/stmf C99MODE= -xc99=%all C99LMODE= -Xc99=%all +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/procfs/Makefile b/usr/src/uts/sparc/procfs/Makefile index 2ff91a547e..6c4ec3fb7c 100644 --- a/usr/src/uts/sparc/procfs/Makefile +++ b/usr/src/uts/sparc/procfs/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the procfs file system # kernel module. @@ -73,6 +73,10 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/pshot/Makefile b/usr/src/uts/sparc/pshot/Makefile index dbe2c43748..e0fc89d2d8 100644 --- a/usr/src/uts/sparc/pshot/Makefile +++ b/usr/src/uts/sparc/pshot/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the pshot kernel # driver to testing hotplugging operations @@ -69,6 +69,9 @@ CFLAGS += $(CCVERBOSE) # LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable + # # Default build targets. # diff --git a/usr/src/uts/sparc/ptem/Makefile b/usr/src/uts/sparc/ptem/Makefile index ec6ec93b9c..202a3250a9 100644 --- a/usr/src/uts/sparc/ptem/Makefile +++ b/usr/src/uts/sparc/ptem/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the ptem streams kernel # module. @@ -69,6 +69,9 @@ CFLAGS += $(CCVERBOSE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/ptsl/Makefile b/usr/src/uts/sparc/ptsl/Makefile index 7ee339ee9b..e1587285d7 100644 --- a/usr/src/uts/sparc/ptsl/Makefile +++ b/usr/src/uts/sparc/ptsl/Makefile @@ -65,6 +65,8 @@ CFLAGS += $(CCVERBOSE) # LDFLAGS += -dy -N drv/ptc +CERRWARN += -_gcc=-Wno-parentheses + # # For now, disable these lint checks; maintainers should endeavor # to investigate and remove these for maximum lint coverage. diff --git a/usr/src/uts/sparc/qlc/Makefile b/usr/src/uts/sparc/qlc/Makefile index 456e9a84f9..c4482bb21f 100644 --- a/usr/src/uts/sparc/qlc/Makefile +++ b/usr/src/uts/sparc/qlc/Makefile @@ -78,6 +78,10 @@ FWIMAGES += 8100 FWMODULES = $(FWIMAGES:%=$(MODULE)_fw_%) FWMODULES_SRC = $(FWIMAGES:%=$(SRC)/uts/common/io/fibre-channel/fca/qlc/ql_fw_%.c) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/qlge/Makefile b/usr/src/uts/sparc/qlge/Makefile index 82f64ac215..3883358dbf 100644 --- a/usr/src/uts/sparc/qlge/Makefile +++ b/usr/src/uts/sparc/qlge/Makefile @@ -64,6 +64,9 @@ LDFLAGS += -dy -Nmisc/mac -Ndrv/ip C99MODE= -xc99=%all C99LMODE= -Xc99=%all +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/qlt/Makefile b/usr/src/uts/sparc/qlt/Makefile index e1aedb7b01..171ba3631d 100644 --- a/usr/src/uts/sparc/qlt/Makefile +++ b/usr/src/uts/sparc/qlt/Makefile @@ -71,6 +71,8 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/rdc/Makefile b/usr/src/uts/sparc/rdc/Makefile index dc20fcd5a8..193cc187a4 100644 --- a/usr/src/uts/sparc/rdc/Makefile +++ b/usr/src/uts/sparc/rdc/Makefile @@ -58,16 +58,21 @@ include $(UTSBASE)/common/avs/Makefile.com ALL_TARGET = $(BINARY) $(SRC_CONFILE) LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) - + # # lint pass one enforcement # -CFLAGS += -v -D_SD_8K_BLKSIZE -D_SYSCALL32 -LINT_DEFS += -D_SYSCALL32 -LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN -LINTTAGS += -erroff=E_INCONS_ARG_DECL2 -LDFLAGS += -dy -N"drv/nsctl" -N"drv/nskern" -N"drv/ncall" -N"misc/spuni" \ - -N"misc/rdcsrv" -N"strmod/rpcmod" +CFLAGS += $(CCVERBOSE) -D_SD_8K_BLKSIZE -D_SYSCALL32 +LINT_DEFS += -D_SYSCALL32 +LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +LINTTAGS += -erroff=E_INCONS_ARG_DECL2 +LDFLAGS += -dy -N"drv/nsctl" -N"drv/nskern" -N"drv/ncall" -N"misc/spuni" +LDFLAGS += -N"misc/rdcsrv" -N"strmod/rpcmod" + +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/uts/sparc/rdcsrv/Makefile b/usr/src/uts/sparc/rdcsrv/Makefile index 9d479e9ff5..94dfeaeace 100644 --- a/usr/src/uts/sparc/rdcsrv/Makefile +++ b/usr/src/uts/sparc/rdcsrv/Makefile @@ -62,10 +62,13 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOTLINK) # # lint pass one enforcement # -CFLAGS += -v -D_SD_8K_BLKSIZE -D_SYSCALL32 +CFLAGS += $(CCVERBOSE) -D_SD_8K_BLKSIZE -D_SYSCALL32 LINT_DEFS += -D_SD_8K_BLKSIZE -D_SYSCALL32 LDFLAGS += -dy -N"strmod/rpcmod" -N"misc/rdcstub" +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable + .KEEP_STATE: def: $(DEF_DEPS) diff --git a/usr/src/uts/sparc/rds/Makefile b/usr/src/uts/sparc/rds/Makefile index aa3202bf1b..8a19251b1d 100755..100644 --- a/usr/src/uts/sparc/rds/Makefile +++ b/usr/src/uts/sparc/rds/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the rds driver # kernel module. @@ -61,6 +61,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized + LDFLAGS += -dy -Nfs/sockfs -Ndrv/ip # diff --git a/usr/src/uts/sparc/rdsib/Makefile b/usr/src/uts/sparc/rdsib/Makefile index ee14ea9c1d..9a71c4cc92 100755..100644 --- a/usr/src/uts/sparc/rdsib/Makefile +++ b/usr/src/uts/sparc/rdsib/Makefile @@ -22,7 +22,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the rds driver # kernel module. @@ -61,6 +61,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + LDFLAGS += -dy -Ndrv/rds -Nmisc/ibtl -Nmisc/ibcm -Ndrv/ip # diff --git a/usr/src/uts/sparc/rdsv3/Makefile b/usr/src/uts/sparc/rdsv3/Makefile index 959610d555..53627981c0 100644 --- a/usr/src/uts/sparc/rdsv3/Makefile +++ b/usr/src/uts/sparc/rdsv3/Makefile @@ -61,6 +61,12 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Disable these lint checks since some errors suppressed here are # in the OFED code, but we'd like to keep it as is as much as possible. diff --git a/usr/src/uts/sparc/rge/Makefile b/usr/src/uts/sparc/rge/Makefile index f62bfc425a..56ebef3144 100755..100644 --- a/usr/src/uts/sparc/rge/Makefile +++ b/usr/src/uts/sparc/rge/Makefile @@ -22,7 +22,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the Realtek # Gigabit Ethernet (RGE) driver module in sparc systems @@ -68,6 +68,9 @@ CFLAGS += -dalign # LDFLAGS += -dy -N misc/mac -N drv/ip +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # For now, disable these lint checks; maintainers should endeavor # to investigate and remove these for maximum lint coverage. diff --git a/usr/src/uts/sparc/rlmod/Makefile b/usr/src/uts/sparc/rlmod/Makefile index 663fecfe37..b9f6254a5e 100644 --- a/usr/src/uts/sparc/rlmod/Makefile +++ b/usr/src/uts/sparc/rlmod/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the rlmod streams kernel # module. @@ -69,6 +69,9 @@ CFLAGS += $(CCVERBOSE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/rpcib/Makefile b/usr/src/uts/sparc/rpcib/Makefile index 18618bb905..82f1206b40 100644 --- a/usr/src/uts/sparc/rpcib/Makefile +++ b/usr/src/uts/sparc/rpcib/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the kernel # rpcib module. @@ -73,6 +73,10 @@ LDFLAGS += -dy -Nmisc/ibtl -Nmisc/ibcm LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/rpcmod/Makefile b/usr/src/uts/sparc/rpcmod/Makefile index 71126904da..dad440934b 100644 --- a/usr/src/uts/sparc/rpcmod/Makefile +++ b/usr/src/uts/sparc/rpcmod/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the rpcmod streams kernel # module. @@ -86,6 +86,13 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-function + # # Default build targets. # diff --git a/usr/src/uts/sparc/rpcsec/Makefile b/usr/src/uts/sparc/rpcsec/Makefile index 9b5bd81913..87f385f29d 100644 --- a/usr/src/uts/sparc/rpcsec/Makefile +++ b/usr/src/uts/sparc/rpcsec/Makefile @@ -70,6 +70,9 @@ LDFLAGS += -dy -N strmod/rpcmod -N misc/tlimod LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/rpcsec_gss/Makefile b/usr/src/uts/sparc/rpcsec_gss/Makefile index 7bc39e9739..c75c8e548e 100644 --- a/usr/src/uts/sparc/rpcsec_gss/Makefile +++ b/usr/src/uts/sparc/rpcsec_gss/Makefile @@ -72,6 +72,8 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/rsa/Makefile b/usr/src/uts/sparc/rsa/Makefile index 6a14020bb6..88a8cb52bd 100644 --- a/usr/src/uts/sparc/rsa/Makefile +++ b/usr/src/uts/sparc/rsa/Makefile @@ -81,6 +81,9 @@ LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/rsm/Makefile b/usr/src/uts/sparc/rsm/Makefile index df709263ae..6d830fa2b1 100644 --- a/usr/src/uts/sparc/rsm/Makefile +++ b/usr/src/uts/sparc/rsm/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the rsm kernel agent @@ -83,6 +83,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/rtls/Makefile b/usr/src/uts/sparc/rtls/Makefile index cda125df9e..d19674b6ed 100644 --- a/usr/src/uts/sparc/rtls/Makefile +++ b/usr/src/uts/sparc/rtls/Makefile @@ -56,6 +56,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # Overrides # +CERRWARN += -_gcc=-Wno-uninitialized + # # Driver depends on Mac # diff --git a/usr/src/uts/sparc/s1394/Makefile b/usr/src/uts/sparc/s1394/Makefile index 3d4afdc5b4..5ac3270bd3 100644 --- a/usr/src/uts/sparc/s1394/Makefile +++ b/usr/src/uts/sparc/s1394/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the s1394 kernel module. # @@ -85,6 +85,11 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/sad/Makefile b/usr/src/uts/sparc/sad/Makefile index 6a7119c989..92d7bedcdc 100644 --- a/usr/src/uts/sparc/sad/Makefile +++ b/usr/src/uts/sparc/sad/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the sad driver # @@ -71,6 +71,9 @@ CFLAGS += $(CCVERBOSE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/sata/Makefile b/usr/src/uts/sparc/sata/Makefile index f0a1fc5a8e..7e805ca2f0 100644 --- a/usr/src/uts/sparc/sata/Makefile +++ b/usr/src/uts/sparc/sata/Makefile @@ -23,8 +23,6 @@ # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# # # uts/sparc/sata/Makefile @@ -96,6 +94,13 @@ clean.lint: $(CLEAN_LINT_DEPS) install: $(INSTALL_DEPS) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-empty-body + # # Include common targets. # diff --git a/usr/src/uts/sparc/sbp2/Makefile b/usr/src/uts/sparc/sbp2/Makefile index 68ed5635e3..05e8615c99 100644 --- a/usr/src/uts/sparc/sbp2/Makefile +++ b/usr/src/uts/sparc/sbp2/Makefile @@ -24,8 +24,6 @@ # # uts/sparc/sbp2/Makefile -#ident "%Z%%M% %I% %E% SMI" - # # This makefile drives the production of the sbp2 kernel module. # @@ -78,6 +76,8 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-unused-function + .KEEP_STATE: def: $(DEF_DEPS) diff --git a/usr/src/uts/sparc/scsa1394/Makefile b/usr/src/uts/sparc/scsa1394/Makefile index 3f4f777054..1c60c4c4da 100644 --- a/usr/src/uts/sparc/scsa1394/Makefile +++ b/usr/src/uts/sparc/scsa1394/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" -# # # Path to the base of the uts directory tree. @@ -82,6 +80,9 @@ LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV # LDFLAGS += -dy -Nmisc/scsi -Nmisc/s1394 -Nmisc/sbp2 +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # Default build targets. # .KEEP_STATE: diff --git a/usr/src/uts/sparc/scsa2usb/Makefile b/usr/src/uts/sparc/scsa2usb/Makefile index ac55a7de42..a939a5042b 100644 --- a/usr/src/uts/sparc/scsa2usb/Makefile +++ b/usr/src/uts/sparc/scsa2usb/Makefile @@ -67,6 +67,9 @@ ALL_TARGET = $(BINARY) $(SRC_CONFILE) LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # For now, disable these lint checks; maintainers should endeavor # to investigate and remove these for maximum lint coverage. diff --git a/usr/src/uts/sparc/scsi/Makefile b/usr/src/uts/sparc/scsi/Makefile index 33a80bb448..f90607602f 100644 --- a/usr/src/uts/sparc/scsi/Makefile +++ b/usr/src/uts/sparc/scsi/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the scsi kernel module. # @@ -72,6 +72,10 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/scsi_vhci/Makefile b/usr/src/uts/sparc/scsi_vhci/Makefile index 519438040b..9213f4ff57 100644 --- a/usr/src/uts/sparc/scsi_vhci/Makefile +++ b/usr/src/uts/sparc/scsi_vhci/Makefile @@ -25,8 +25,6 @@ # # -#pragma ident "%Z%%M% %I% %E% SMI" -# # This makefile drives the production of SCSI vHCI Driver # sparc architecture dependent # @@ -50,6 +48,10 @@ CONF_SRCDIR = $(UTSBASE)/common/io/scsi/adapters/scsi_vhci # include $(UTSBASE)/sparc/Makefile.sparc +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label + # # Define targets. # diff --git a/usr/src/uts/sparc/sd/Makefile b/usr/src/uts/sparc/sd/Makefile index b7d788d5d3..18e6ac8f28 100644 --- a/usr/src/uts/sparc/sd/Makefile +++ b/usr/src/uts/sparc/sd/Makefile @@ -79,6 +79,13 @@ LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/sdbc/Makefile b/usr/src/uts/sparc/sdbc/Makefile index bf1c0459d0..110556f12b 100644 --- a/usr/src/uts/sparc/sdbc/Makefile +++ b/usr/src/uts/sparc/sdbc/Makefile @@ -70,11 +70,15 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # # lint pass one enforcement # -CFLAGS += -v -D_SD_8K_BLKSIZE -D_SDBC_SINGLE_BRD +CFLAGS += $(CCVERBOSE) -D_SD_8K_BLKSIZE -D_SDBC_SINGLE_BRD LDFLAGS += -dy -N"drv/nsctl" -N"drv/ncall" -N"drv/nskern" -N"misc/spuni" LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label + .KEEP_STATE: def: $(DEF_DEPS) diff --git a/usr/src/uts/sparc/sdt/Makefile b/usr/src/uts/sparc/sdt/Makefile index d2ed56ddea..7100325717 100644 --- a/usr/src/uts/sparc/sdt/Makefile +++ b/usr/src/uts/sparc/sdt/Makefile @@ -22,7 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" UTSBASE = ../.. @@ -49,6 +48,8 @@ LDFLAGS += -dy -Ndrv/dtrace -Nmisc/ctf # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses + .KEEP_STATE: def: $(DEF_DEPS) diff --git a/usr/src/uts/sparc/semsys/Makefile b/usr/src/uts/sparc/semsys/Makefile index 2e9527ac2e..d7ffa310bd 100644 --- a/usr/src/uts/sparc/semsys/Makefile +++ b/usr/src/uts/sparc/semsys/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the semsys driver kernel module. # @@ -70,6 +70,9 @@ LDFLAGS += -dy -Nmisc/ipc # LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/sfe/Makefile b/usr/src/uts/sparc/sfe/Makefile index bde91dc0aa..c01fa6ade3 100644 --- a/usr/src/uts/sparc/sfe/Makefile +++ b/usr/src/uts/sparc/sfe/Makefile @@ -22,7 +22,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of NS/SiS # Fast Ethernet (SFE) driver module in sparc systems @@ -73,6 +73,11 @@ CPPFLAGS += $(VFLAGS) $(AFLAGS) $(DFLAGS) $(CFGFLAGS) $(CCVERBOSE) \ CFLAGS += $(CPPFLAGS) -xc99=%all +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Driver depends on MAC & IP # diff --git a/usr/src/uts/sparc/sgen/Makefile b/usr/src/uts/sparc/sgen/Makefile index 2e39800f92..723344d539 100644 --- a/usr/src/uts/sparc/sgen/Makefile +++ b/usr/src/uts/sparc/sgen/Makefile @@ -25,8 +25,6 @@ # # -#ident "%Z%%M% %I% %E% SMI" -# # This makefile drives the production of the sgen driver. # sparc architecture dependent # @@ -75,6 +73,9 @@ CFLAGS += $(CCVERBOSE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/sha2/Makefile b/usr/src/uts/sparc/sha2/Makefile index 920a368dda..e9d255252d 100644 --- a/usr/src/uts/sparc/sha2/Makefile +++ b/usr/src/uts/sparc/sha2/Makefile @@ -71,6 +71,9 @@ LDFLAGS += -dy -Nmisc/kcf CFLAGS += $(CCVERBOSE) -I$(COM_DIR) LINTFLAGS += -I$(COM_DIR) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/sharefs/Makefile b/usr/src/uts/sparc/sharefs/Makefile index 57fef2470a..f212780a6d 100644 --- a/usr/src/uts/sparc/sharefs/Makefile +++ b/usr/src/uts/sparc/sharefs/Makefile @@ -22,7 +22,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the sharetab file system # kernel module. @@ -60,6 +60,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/shbinexec/Makefile b/usr/src/uts/sparc/shbinexec/Makefile index a8a7bad5b2..a37c5c2294 100644 --- a/usr/src/uts/sparc/shbinexec/Makefile +++ b/usr/src/uts/sparc/shbinexec/Makefile @@ -48,6 +48,8 @@ ROOTMODULE = $(USR_EXEC_DIR)/$(MODULE) # include $(UTSBASE)/sparc/Makefile.sparc +CERRWARN += -_gcc=-Wno-parentheses + # # Define targets # diff --git a/usr/src/uts/sparc/shmsys/Makefile b/usr/src/uts/sparc/shmsys/Makefile index 1ba33f54dc..be041263ec 100644 --- a/usr/src/uts/sparc/shmsys/Makefile +++ b/usr/src/uts/sparc/shmsys/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the shmsys driver kernel module. # @@ -71,6 +71,8 @@ LDFLAGS += -dy -Nmisc/ipc LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/si3124/Makefile b/usr/src/uts/sparc/si3124/Makefile index 0c777e59ab..482a4b1781 100644 --- a/usr/src/uts/sparc/si3124/Makefile +++ b/usr/src/uts/sparc/si3124/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" -# # # uts/sparc/si3124/Makefile @@ -69,6 +67,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) DEBUG_FLGS = DEBUG_DEFS += $(DEBUG_FLGS) +CERRWARN += -_gcc=-Wno-uninitialized + # # lint pass one enforcement # diff --git a/usr/src/uts/sparc/simnet/Makefile b/usr/src/uts/sparc/simnet/Makefile index e9f16e0d95..f58942d867 100644 --- a/usr/src/uts/sparc/simnet/Makefile +++ b/usr/src/uts/sparc/simnet/Makefile @@ -54,6 +54,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -Ndrv/dld -Nmisc/mac -Nmisc/dls -Ndrv/random +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/sparc/smbfs/Makefile b/usr/src/uts/sparc/smbfs/Makefile index 26be8f8780..88ad9dd4ef 100644 --- a/usr/src/uts/sparc/smbfs/Makefile +++ b/usr/src/uts/sparc/smbfs/Makefile @@ -68,6 +68,8 @@ LDFLAGS += -dy -Ndrv/nsmb # Until CR 4994570 is fixed... LINTTAGS += -erroff=E_BAD_FORMAT_ARG_TYPE2 +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized # The mb_put/md_get functions are intentionally used with and without # return value checks, so filter those out like LGREP.2 does. diff --git a/usr/src/uts/sparc/smbsrv/Makefile b/usr/src/uts/sparc/smbsrv/Makefile index 17a187f480..5d3a78bf44 100644 --- a/usr/src/uts/sparc/smbsrv/Makefile +++ b/usr/src/uts/sparc/smbsrv/Makefile @@ -68,6 +68,10 @@ CLEANFILES += $(MODSTUBS_O) INC_PATH += -I$(SRC)/common +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/sparc/socal/Makefile b/usr/src/uts/sparc/socal/Makefile index 1acedb78d2..fa38e547c5 100644 --- a/usr/src/uts/sparc/socal/Makefile +++ b/usr/src/uts/sparc/socal/Makefile @@ -24,8 +24,6 @@ # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" - # # This makefile drives the production of the socal driver kernel # module, which is used for the Photon/FC-AL product @@ -75,6 +73,8 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/sockfs/Makefile b/usr/src/uts/sparc/sockfs/Makefile index 2d0241ca77..1b9600ab01 100644 --- a/usr/src/uts/sparc/sockfs/Makefile +++ b/usr/src/uts/sparc/sockfs/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the sockfs file system # kernel module. @@ -87,6 +87,13 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/sockpfp/Makefile b/usr/src/uts/sparc/sockpfp/Makefile index 612575651a..007eea8053 100644 --- a/usr/src/uts/sparc/sockpfp/Makefile +++ b/usr/src/uts/sparc/sockpfp/Makefile @@ -69,6 +69,9 @@ INC_PATH += -I$(UTSBASE)/common/inet/sockmods -I$(UTSBASE)/common/io/bpf LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label + # # Default build targets. # diff --git a/usr/src/uts/sparc/socksctp/Makefile b/usr/src/uts/sparc/socksctp/Makefile index 5acab4cfb1..066cfd9982 100644 --- a/usr/src/uts/sparc/socksctp/Makefile +++ b/usr/src/uts/sparc/socksctp/Makefile @@ -69,6 +69,9 @@ LDFLAGS += -dy -Nfs/sockfs -Ndrv/ip LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/socksdp/Makefile b/usr/src/uts/sparc/socksdp/Makefile index aa6fa4e21d..0b2ca3d837 100644 --- a/usr/src/uts/sparc/socksdp/Makefile +++ b/usr/src/uts/sparc/socksdp/Makefile @@ -59,6 +59,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + LDFLAGS += -dy -Nfs/sockfs -Ndrv/ip -Ndrv/sdpib # diff --git a/usr/src/uts/sparc/softmac/Makefile b/usr/src/uts/sparc/softmac/Makefile index 89c2abe5bc..23a54a8098 100644 --- a/usr/src/uts/sparc/softmac/Makefile +++ b/usr/src/uts/sparc/softmac/Makefile @@ -22,8 +22,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" -# # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -64,6 +62,9 @@ LDFLAGS += -dy -Ndrv/dld -Nmisc/mac -Nmisc/strplumb -Nmisc/dls # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label + # # Default build targets. # diff --git a/usr/src/uts/sparc/sol_ofs/Makefile b/usr/src/uts/sparc/sol_ofs/Makefile index 5af956dd10..5f8ebb6a6e 100644 --- a/usr/src/uts/sparc/sol_ofs/Makefile +++ b/usr/src/uts/sparc/sol_ofs/Makefile @@ -61,6 +61,11 @@ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_CONST_TRUNCATED_BY_ASSIGN +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-unused-variable + # # Default build targets. # diff --git a/usr/src/uts/sparc/sol_umad/Makefile b/usr/src/uts/sparc/sol_umad/Makefile index ff9a8dc097..e1774a2943 100644 --- a/usr/src/uts/sparc/sol_umad/Makefile +++ b/usr/src/uts/sparc/sol_umad/Makefile @@ -37,6 +37,7 @@ LINTS = $(SOL_UMAD_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE) CONF_SRCDIR = $(UTSBASE)/common/io/ib/clients/of/sol_umad LDFLAGS += -dy -Nmisc/sol_ofs -Nmisc/ibmf -Nmisc/ibtl + # # Include common rules. # @@ -55,6 +56,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # INCLUDE_PATH += -I$(UTSBASE)/common/sys/ib/clients/of/sol_umad +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/sol_uverbs/Makefile b/usr/src/uts/sparc/sol_uverbs/Makefile index 1c62c94483..ed3626eb42 100644 --- a/usr/src/uts/sparc/sol_uverbs/Makefile +++ b/usr/src/uts/sparc/sol_uverbs/Makefile @@ -62,6 +62,10 @@ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_CONST_TRUNCATED_BY_ASSIGN +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-label + # # Default build targets. # diff --git a/usr/src/uts/sparc/spdsock/Makefile b/usr/src/uts/sparc/spdsock/Makefile index 09b6508f70..85adf6a5d3 100644 --- a/usr/src/uts/sparc/spdsock/Makefile +++ b/usr/src/uts/sparc/spdsock/Makefile @@ -79,6 +79,8 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/specfs/Makefile b/usr/src/uts/sparc/specfs/Makefile index d19a549d3f..bcb97f9b53 100644 --- a/usr/src/uts/sparc/specfs/Makefile +++ b/usr/src/uts/sparc/specfs/Makefile @@ -23,7 +23,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the specfs file system # kernel module. @@ -65,6 +65,9 @@ CLEANFILES += $(MODSTUBS_O) CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -Nfs/fifofs +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/sppp/Makefile b/usr/src/uts/sparc/sppp/Makefile index 1a81eda62d..287dd71ea5 100644 --- a/usr/src/uts/sparc/sppp/Makefile +++ b/usr/src/uts/sparc/sppp/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the sppp STREAMS pseudo- # driver kernel module. @@ -77,6 +77,9 @@ CFLAGS += $(CCVERBOSE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/spppcomp/Makefile b/usr/src/uts/sparc/spppcomp/Makefile index 9955b7f5a8..b1da4d5dda 100644 --- a/usr/src/uts/sparc/spppcomp/Makefile +++ b/usr/src/uts/sparc/spppcomp/Makefile @@ -74,6 +74,9 @@ LDFLAGS += -dy -N drv/sppp CLEANLINTFILES += $(LINT64_FILES) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # For now, disable these lint checks; maintainers should endeavor # to investigate and remove these for maximum lint coverage. diff --git a/usr/src/uts/sparc/sppptun/Makefile b/usr/src/uts/sparc/sppptun/Makefile index 8335915f1b..488d6cf6b0 100644 --- a/usr/src/uts/sparc/sppptun/Makefile +++ b/usr/src/uts/sparc/sppptun/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the sppptun STREAMS pseudo- # driver kernel module. @@ -81,6 +81,8 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/srpt/Makefile b/usr/src/uts/sparc/srpt/Makefile index 57123dfc00..7c83e44453 100644 --- a/usr/src/uts/sparc/srpt/Makefile +++ b/usr/src/uts/sparc/srpt/Makefile @@ -63,6 +63,8 @@ LDFLAGS += -dy -Ndrv/stmf -Nmisc/ibtl -Nmisc/ibcm C99MODE= -xc99=%all C99LMODE= -Xc99=%all +CERRWARN += -_gcc=-Wno-unused-label + # # Default build targets. # diff --git a/usr/src/uts/sparc/ssd/Makefile b/usr/src/uts/sparc/ssd/Makefile index 524f11220e..d73bd3a5b3 100644 --- a/usr/src/uts/sparc/ssd/Makefile +++ b/usr/src/uts/sparc/ssd/Makefile @@ -78,6 +78,12 @@ LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits + # # Depends on scsi and cmlb # fcp included for fibre support diff --git a/usr/src/uts/sparc/st/Makefile b/usr/src/uts/sparc/st/Makefile index 1b5bc60dfa..fd24778fce 100644 --- a/usr/src/uts/sparc/st/Makefile +++ b/usr/src/uts/sparc/st/Makefile @@ -77,6 +77,10 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/stmf/Makefile b/usr/src/uts/sparc/stmf/Makefile index 8dfdd42bc3..1e45739dbb 100644 --- a/usr/src/uts/sparc/stmf/Makefile +++ b/usr/src/uts/sparc/stmf/Makefile @@ -68,6 +68,10 @@ C99LMODE= -Xc99=%all LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-variable + # # Default build targets. # diff --git a/usr/src/uts/sparc/stmf_sbd/Makefile b/usr/src/uts/sparc/stmf_sbd/Makefile index 6958d90376..a57ccaf73d 100644 --- a/usr/src/uts/sparc/stmf_sbd/Makefile +++ b/usr/src/uts/sparc/stmf_sbd/Makefile @@ -69,6 +69,11 @@ C99LMODE= -Xc99=%all # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/strplumb/Makefile b/usr/src/uts/sparc/strplumb/Makefile index 34f5182cb6..27f3fa9677 100644 --- a/usr/src/uts/sparc/strplumb/Makefile +++ b/usr/src/uts/sparc/strplumb/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the strplumb # kernel module. @@ -70,6 +70,8 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/sv/Makefile b/usr/src/uts/sparc/sv/Makefile index 9499f5d5d9..9f68438d65 100644 --- a/usr/src/uts/sparc/sv/Makefile +++ b/usr/src/uts/sparc/sv/Makefile @@ -62,9 +62,11 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # # lint pass one enforcement # -CFLAGS += -v +CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -N"drv/nsctl" -N"drv/nskern" -N"misc/spuni" +CERRWARN += -_gcc=-Wno-uninitialized + .KEEP_STATE: def: $(DEF_DEPS) diff --git a/usr/src/uts/sparc/swapgeneric/Makefile b/usr/src/uts/sparc/swapgeneric/Makefile index 2c7ceb7fbf..7f107a95d9 100644 --- a/usr/src/uts/sparc/swapgeneric/Makefile +++ b/usr/src/uts/sparc/swapgeneric/Makefile @@ -24,7 +24,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" # # This makefile drives the production of the swapgeneric `user' # kernel module. @@ -65,6 +64,8 @@ $(MODSTUBS_O) := AS_CPPFLAGS += -DSWAPGENERIC_MODULE CLEANFILES += $(MODSTUBS_O) CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/swrand/Makefile b/usr/src/uts/sparc/swrand/Makefile index 9f81e3ae39..5ec8395245 100644 --- a/usr/src/uts/sparc/swrand/Makefile +++ b/usr/src/uts/sparc/swrand/Makefile @@ -73,6 +73,8 @@ LDFLAGS += -dy -Nmisc/kcf -Nmisc/sha1 LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-unused-function + # # Default build targets. # diff --git a/usr/src/uts/sparc/tavor/Makefile b/usr/src/uts/sparc/tavor/Makefile index b6792eea83..8f03fa6db4 100644 --- a/usr/src/uts/sparc/tavor/Makefile +++ b/usr/src/uts/sparc/tavor/Makefile @@ -85,6 +85,11 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits + # # Default build targets. # diff --git a/usr/src/uts/sparc/telmod/Makefile b/usr/src/uts/sparc/telmod/Makefile index b1e62bbd06..7015a89727 100644 --- a/usr/src/uts/sparc/telmod/Makefile +++ b/usr/src/uts/sparc/telmod/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the telmod streams kernel # module. @@ -69,6 +69,8 @@ CFLAGS += $(CCVERBOSE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/tem/Makefile b/usr/src/uts/sparc/tem/Makefile index cd6a9c6d34..0a825020d6 100644 --- a/usr/src/uts/sparc/tem/Makefile +++ b/usr/src/uts/sparc/tem/Makefile @@ -70,6 +70,9 @@ LDFLAGS += -dy -Ndacf/consconfig_dacf # LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/tirdwr/Makefile b/usr/src/uts/sparc/tirdwr/Makefile index 5a34f304fe..c9140dccd1 100644 --- a/usr/src/uts/sparc/tirdwr/Makefile +++ b/usr/src/uts/sparc/tirdwr/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the tirdwr streams kernel # module. @@ -69,6 +69,8 @@ CFLAGS += $(CCVERBOSE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/tl/Makefile b/usr/src/uts/sparc/tl/Makefile index 1208778391..b63d5cb165 100644 --- a/usr/src/uts/sparc/tl/Makefile +++ b/usr/src/uts/sparc/tl/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the tl driver # @@ -77,6 +77,10 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/tmpfs/Makefile b/usr/src/uts/sparc/tmpfs/Makefile index ace4084d74..7a74a3d693 100644 --- a/usr/src/uts/sparc/tmpfs/Makefile +++ b/usr/src/uts/sparc/tmpfs/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the tmpfs file system # kernel module. @@ -69,6 +69,10 @@ CFLAGS += $(CCVERBOSE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-value + # # Default build targets. # diff --git a/usr/src/uts/sparc/tnf/Makefile b/usr/src/uts/sparc/tnf/Makefile index b43accfe26..5c4f539671 100644 --- a/usr/src/uts/sparc/tnf/Makefile +++ b/usr/src/uts/sparc/tnf/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # tnf (kernel trace driver) Makefile # @@ -70,6 +70,9 @@ CFLAGS += $(CCVERBOSE) LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/tphci/Makefile b/usr/src/uts/sparc/tphci/Makefile index 2b705ff7a1..c5e21e16d0 100644 --- a/usr/src/uts/sparc/tphci/Makefile +++ b/usr/src/uts/sparc/tphci/Makefile @@ -28,8 +28,6 @@ # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" - # # This makefile drives the production of a pHCI test driver # for testing the MPxIO framework. @@ -48,7 +46,6 @@ OBJECTS = $(TPHCI_OBJS:%=$(OBJS_DIR)/%) LINTS = $(TPHCI_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(USR_DRV_DIR)/$(MODULE) - # # Include common rules. # @@ -65,6 +62,7 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # Overrides # CFLAGS += $(CCVERBOSE) -dalign +CERRWARN += -_gcc=-Wno-parentheses # # Default build targets. diff --git a/usr/src/uts/sparc/trill/Makefile b/usr/src/uts/sparc/trill/Makefile index 5181ee76a7..11e1f1202e 100644 --- a/usr/src/uts/sparc/trill/Makefile +++ b/usr/src/uts/sparc/trill/Makefile @@ -48,6 +48,8 @@ ROOTMODULE = $(ROOT_SOCK_DIR)/$(MODULE) # include $(UTSBASE)/sparc/Makefile.sparc +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/sparc/ttymux/Makefile b/usr/src/uts/sparc/ttymux/Makefile index 3007c9802b..e798f51c21 100644 --- a/usr/src/uts/sparc/ttymux/Makefile +++ b/usr/src/uts/sparc/ttymux/Makefile @@ -18,11 +18,12 @@ # # CDDL HEADER END # + # # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the ttymux driver # kernel module. @@ -85,6 +86,10 @@ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits + # # Default build targets. # diff --git a/usr/src/uts/sparc/tvhci/Makefile b/usr/src/uts/sparc/tvhci/Makefile index c1d7bf40ec..e487290629 100644 --- a/usr/src/uts/sparc/tvhci/Makefile +++ b/usr/src/uts/sparc/tvhci/Makefile @@ -27,8 +27,6 @@ # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" - # # This makefile drives the production of a vHCI test driver # for testing MPxIO framework @@ -71,6 +69,7 @@ CFLAGS += $(CCVERBOSE) -dalign # Please do not carry these forward to new Makefiles. # LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-unused-function # # Default build targets. diff --git a/usr/src/uts/sparc/udfs/Makefile b/usr/src/uts/sparc/udfs/Makefile index 8dec1e2f68..93b7278ee3 100644 --- a/usr/src/uts/sparc/udfs/Makefile +++ b/usr/src/uts/sparc/udfs/Makefile @@ -79,6 +79,11 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits + # # Default build targets. # diff --git a/usr/src/uts/sparc/ufs/Makefile b/usr/src/uts/sparc/ufs/Makefile index cb512ba571..d49a878102 100644 --- a/usr/src/uts/sparc/ufs/Makefile +++ b/usr/src/uts/sparc/ufs/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the ufs file system # kernel module. @@ -77,6 +77,11 @@ CLEANFILES += $(MODSTUBS_O) CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -Nfs/specfs -Nmisc/fssnap_if +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-unused-label + # # Default build targets. # diff --git a/usr/src/uts/sparc/ugen/Makefile b/usr/src/uts/sparc/ugen/Makefile index 9d9e2b6564..cd88eac467 100644 --- a/usr/src/uts/sparc/ugen/Makefile +++ b/usr/src/uts/sparc/ugen/Makefile @@ -55,6 +55,7 @@ include $(UTSBASE)/sparc/Makefile.sparc # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized # # depends on misc/usba diff --git a/usr/src/uts/sparc/uhci/Makefile b/usr/src/uts/sparc/uhci/Makefile index f051c12e7c..ebc994f8cb 100644 --- a/usr/src/uts/sparc/uhci/Makefile +++ b/usr/src/uts/sparc/uhci/Makefile @@ -69,6 +69,8 @@ ALL_TARGET = $(BINARY) $(SRC_CONFFILE) LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) +CERRWARN += -_gcc=-Wno-uninitialized + # # For now, disable these lint checks; maintainers should endeavor # to investigate and remove these for maximum lint coverage. diff --git a/usr/src/uts/sparc/usb_ac/Makefile b/usr/src/uts/sparc/usb_ac/Makefile index 14560e1740..e1088a3ace 100644 --- a/usr/src/uts/sparc/usb_ac/Makefile +++ b/usr/src/uts/sparc/usb_ac/Makefile @@ -64,6 +64,11 @@ ALL_TARGET = $(BINARY) $(SRC_CONFILE) LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # For now, disable these lint checks; maintainers should endeavor # to investigate and remove these for maximum lint coverage. diff --git a/usr/src/uts/sparc/usb_ah/Makefile b/usr/src/uts/sparc/usb_ah/Makefile index bd65518c1f..ac5e14c875 100644 --- a/usr/src/uts/sparc/usb_ah/Makefile +++ b/usr/src/uts/sparc/usb_ah/Makefile @@ -67,6 +67,8 @@ ALL_TARGET = $(BINARY) LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) +CERRWARN += -_gcc=-Wno-uninitialized + # # For now, disable these lint checks; maintainers should endeavor # to investigate and remove these for maximum lint coverage. diff --git a/usr/src/uts/sparc/usb_as/Makefile b/usr/src/uts/sparc/usb_as/Makefile index 06a86518f9..870534bd2c 100644 --- a/usr/src/uts/sparc/usb_as/Makefile +++ b/usr/src/uts/sparc/usb_as/Makefile @@ -65,6 +65,8 @@ ALL_TARGET = $(BINARY) LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) +CERRWARN += -_gcc=-Wno-unused-label + # # For now, disable these lint checks; maintainers should endeavor # to investigate and remove these for maximum lint coverage. diff --git a/usr/src/uts/sparc/usba/Makefile b/usr/src/uts/sparc/usba/Makefile index 37b0eb52a1..044e1a3067 100644 --- a/usr/src/uts/sparc/usba/Makefile +++ b/usr/src/uts/sparc/usba/Makefile @@ -53,6 +53,13 @@ include $(UTSBASE)/sparc/Makefile.sparc # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-unused-variable + # # Define targets # diff --git a/usr/src/uts/sparc/usbftdi/Makefile b/usr/src/uts/sparc/usbftdi/Makefile index 025cfef7f1..b120699874 100644 --- a/usr/src/uts/sparc/usbftdi/Makefile +++ b/usr/src/uts/sparc/usbftdi/Makefile @@ -48,6 +48,8 @@ WLCMD_DIR = $(UTSBASE)/common/io/warlock # include $(UTSBASE)/sparc/Makefile.sparc +CERRWARN += -_gcc=-Wno-uninitialized + LDFLAGS += -dy -Nmisc/usba -Nmisc/usbser # diff --git a/usr/src/uts/sparc/usbms/Makefile b/usr/src/uts/sparc/usbms/Makefile index 2c908b4981..9223ef56a9 100644 --- a/usr/src/uts/sparc/usbms/Makefile +++ b/usr/src/uts/sparc/usbms/Makefile @@ -65,6 +65,9 @@ ALL_TARGET = $(BINARY) LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # For now, disable these lint checks; maintainers should endeavor # to investigate and remove these for maximum lint coverage. diff --git a/usr/src/uts/sparc/usbsacm/Makefile b/usr/src/uts/sparc/usbsacm/Makefile index 4d70941ca6..9c569539ce 100644 --- a/usr/src/uts/sparc/usbsacm/Makefile +++ b/usr/src/uts/sparc/usbsacm/Makefile @@ -55,6 +55,8 @@ CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -Nmisc/usba -Nmisc/usbser +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/sparc/usbser/Makefile b/usr/src/uts/sparc/usbser/Makefile index 0a5588752e..bb60d82cea 100644 --- a/usr/src/uts/sparc/usbser/Makefile +++ b/usr/src/uts/sparc/usbser/Makefile @@ -73,6 +73,10 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-label + .KEEP_STATE: all: $(ALL_DEPS) diff --git a/usr/src/uts/sparc/usbsksp/Makefile b/usr/src/uts/sparc/usbsksp/Makefile index 16987d8e66..cc0932b37d 100644 --- a/usr/src/uts/sparc/usbsksp/Makefile +++ b/usr/src/uts/sparc/usbsksp/Makefile @@ -89,6 +89,8 @@ install: $(INSTALL_DEPS) # include $(UTSBASE)/sparc/Makefile.targ +CERRWARN += -_gcc=-Wno-uninitialized + # # Defines for local commands. # diff --git a/usr/src/uts/sparc/usbsprl/Makefile b/usr/src/uts/sparc/usbsprl/Makefile index 2911e5ff6e..6d15b200dd 100644 --- a/usr/src/uts/sparc/usbsprl/Makefile +++ b/usr/src/uts/sparc/usbsprl/Makefile @@ -53,6 +53,8 @@ include $(UTSBASE)/sparc/Makefile.sparc # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized + LDFLAGS += -dy -Nmisc/usba -Nmisc/usbser # diff --git a/usr/src/uts/sparc/usbvc/Makefile b/usr/src/uts/sparc/usbvc/Makefile index e68cb46a4c..dc6a2bade5 100644 --- a/usr/src/uts/sparc/usbvc/Makefile +++ b/usr/src/uts/sparc/usbvc/Makefile @@ -68,6 +68,8 @@ ALL_TARGET = $(BINARY) LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) +CERRWARN += -_gcc=-Wno-uninitialized + # # Disable this because it is necessary for this driver # and it is surely safe diff --git a/usr/src/uts/sparc/usbwcm/Makefile b/usr/src/uts/sparc/usbwcm/Makefile index 48594f4ecd..9549f2bdc3 100644 --- a/usr/src/uts/sparc/usbwcm/Makefile +++ b/usr/src/uts/sparc/usbwcm/Makefile @@ -65,6 +65,9 @@ ALL_TARGET = $(BINARY) LINT_TARGET = $(MODULE).lint INSTALL_TARGET = $(BINARY) $(ROOTMODULE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # For now, disable these lint checks; maintainers should endeavor # to investigate and remove these for maximum lint coverage. diff --git a/usr/src/uts/sparc/uwba/Makefile b/usr/src/uts/sparc/uwba/Makefile index 8b00ffe383..46b7434db3 100644 --- a/usr/src/uts/sparc/uwba/Makefile +++ b/usr/src/uts/sparc/uwba/Makefile @@ -70,6 +70,9 @@ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/vnic/Makefile b/usr/src/uts/sparc/vnic/Makefile index 41052c901d..9be92ea9bc 100644 --- a/usr/src/uts/sparc/vnic/Makefile +++ b/usr/src/uts/sparc/vnic/Makefile @@ -54,6 +54,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -Ndrv/dld -Nmisc/mac -Nmisc/dls +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/vr/Makefile b/usr/src/uts/sparc/vr/Makefile index 3399d9f1a8..5679a7d12b 100644 --- a/usr/src/uts/sparc/vr/Makefile +++ b/usr/src/uts/sparc/vr/Makefile @@ -57,6 +57,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # Overrides # +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Driver depends on GLD # diff --git a/usr/src/uts/sparc/vuid3ps2/Makefile b/usr/src/uts/sparc/vuid3ps2/Makefile index de4020187a..7c2dd06c67 100644 --- a/usr/src/uts/sparc/vuid3ps2/Makefile +++ b/usr/src/uts/sparc/vuid3ps2/Makefile @@ -24,7 +24,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the vuid3ps2 streams kernel # module. @@ -48,6 +48,9 @@ ROOTMODULE = $(ROOT_STRMOD_DIR)/$(MODULE) # include $(UTSBASE)/sparc/Makefile.sparc +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Define targets # diff --git a/usr/src/uts/sparc/wc/Makefile b/usr/src/uts/sparc/wc/Makefile index 37a0e94a97..86d8563330 100644 --- a/usr/src/uts/sparc/wc/Makefile +++ b/usr/src/uts/sparc/wc/Makefile @@ -64,6 +64,8 @@ MODSTUBS_DIR = $(OBJS_DIR) $(MODSTUBS_O) := AS_CPPFLAGS += -DWC_MODULE CLEANFILES += $(MODSTUBS_O) +CERRWARN += -_gcc=-Wno-uninitialized + # # lint pass one enforcement # diff --git a/usr/src/uts/sparc/winlock/Makefile b/usr/src/uts/sparc/winlock/Makefile index a23a929d79..10ee83f9eb 100644 --- a/usr/src/uts/sparc/winlock/Makefile +++ b/usr/src/uts/sparc/winlock/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of winlock kernel module. # @@ -69,6 +69,8 @@ CFLAGS += $(CCVERBOSE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sparc/wusb_df/Makefile b/usr/src/uts/sparc/wusb_df/Makefile index 08cf439f62..da4c27e4aa 100644 --- a/usr/src/uts/sparc/wusb_df/Makefile +++ b/usr/src/uts/sparc/wusb_df/Makefile @@ -74,6 +74,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/xge/Makefile b/usr/src/uts/sparc/xge/Makefile index f30c4612e3..d9d3ce531c 100644 --- a/usr/src/uts/sparc/xge/Makefile +++ b/usr/src/uts/sparc/xge/Makefile @@ -106,6 +106,12 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-empty-body +CERRWARN += -_gcc=-Wno-uninitialized + # # # Default build targets. diff --git a/usr/src/uts/sparc/yge/Makefile b/usr/src/uts/sparc/yge/Makefile index db22acb6a9..8b376f704b 100644 --- a/usr/src/uts/sparc/yge/Makefile +++ b/usr/src/uts/sparc/yge/Makefile @@ -60,6 +60,8 @@ LDFLAGS += -dy -N misc/mac -N misc/mii # Lint flag # +CERRWARN += -_gcc=-Wno-unused-label + # # # Default build targets. diff --git a/usr/src/uts/sparc/zfs/Makefile b/usr/src/uts/sparc/zfs/Makefile index 94d83b28ea..018a9aaac2 100644 --- a/usr/src/uts/sparc/zfs/Makefile +++ b/usr/src/uts/sparc/zfs/Makefile @@ -83,6 +83,14 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sparc/zfs/spa_boot.c b/usr/src/uts/sparc/zfs/spa_boot.c index 6f5f652f15..71a8b9ed51 100644 --- a/usr/src/uts/sparc/zfs/spa_boot.c +++ b/usr/src/uts/sparc/zfs/spa_boot.c @@ -24,10 +24,16 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + #include <sys/zio.h> #include <sys/spa.h> #include <sys/bootconf.h> +extern int zfs_deadman_enabled; + char * spa_get_bootprop(char *propname) { @@ -52,3 +58,13 @@ spa_free_bootprop(char *propname) { kmem_free(propname, strlen(propname) + 1); } + +void +spa_arch_init(void) +{ + /* + * The deadman is disabled by default on sparc. + */ + if (zfs_deadman_enabled == -1) + zfs_deadman_enabled = 0; +} diff --git a/usr/src/uts/sparc/zut/Makefile b/usr/src/uts/sparc/zut/Makefile index 544ab3cd53..7df92bc696 100644 --- a/usr/src/uts/sparc/zut/Makefile +++ b/usr/src/uts/sparc/zut/Makefile @@ -72,6 +72,9 @@ C99LMODE= -Xc99=%all # LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sun4u/Makefile.sun4u.shared b/usr/src/uts/sun4u/Makefile.sun4u.shared index ad79ac45d4..62101c9927 100644 --- a/usr/src/uts/sun4u/Makefile.sun4u.shared +++ b/usr/src/uts/sun4u/Makefile.sun4u.shared @@ -205,7 +205,7 @@ CFLAGS += $(INLINES) -D_ASM_INLINES CFLAGS += $(CCMODE) CFLAGS += $(SPACEFLAG) CFLAGS += $(CERRWARN) -CFLAGS += $(CTF_FLAGS) +CFLAGS += $(CTF_FLAGS_$(CLASS)) CFLAGS += $(C99MODE) CFLAGS += $(CCUNBOUND) CFLAGS += $(CCNOAUTOINLINE) diff --git a/usr/src/uts/sun4u/arcfour/Makefile b/usr/src/uts/sun4u/arcfour/Makefile index d0bdcf1258..4eca278804 100644 --- a/usr/src/uts/sun4u/arcfour/Makefile +++ b/usr/src/uts/sun4u/arcfour/Makefile @@ -64,6 +64,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) CFLAGS += $(CCVERBOSE) -I$(COM_DIR) LINTFLAGS += -I$(COM_DIR) +CERRWARN += -_gcc=-Wno-parentheses + # # Turn on doubleword alignment for 64 bit registers # diff --git a/usr/src/uts/sun4u/bignum/Makefile b/usr/src/uts/sun4u/bignum/Makefile index 68bec2efe5..407a7bc3f0 100644 --- a/usr/src/uts/sun4u/bignum/Makefile +++ b/usr/src/uts/sun4u/bignum/Makefile @@ -63,6 +63,7 @@ LDFLAGS += -dy -Nmisc/kcf CFLAGS += $(CCVERBOSE) -I$(CRYPTODIR) -I$(COM1_DIR) CFLAGS += -DUMUL64 -DUSE_FLOATING_POINT LINTFLAGS += -I$(CRYPTODIR) -I$(COM1_DIR) +CERRWARN += -_gcc=-Wno-unused-function # # Default build targets. diff --git a/usr/src/uts/sun4u/blade/bscv/Makefile b/usr/src/uts/sun4u/blade/bscv/Makefile index 6c95f9e137..ca20d5a1e8 100644 --- a/usr/src/uts/sun4u/blade/bscv/Makefile +++ b/usr/src/uts/sun4u/blade/bscv/Makefile @@ -22,7 +22,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the sun4u "bscv" driver module. # @@ -66,6 +66,7 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized # # Default build targets. diff --git a/usr/src/uts/sun4u/bootdev/Makefile b/usr/src/uts/sun4u/bootdev/Makefile index a4be2fff1f..c430b580b2 100644 --- a/usr/src/uts/sun4u/bootdev/Makefile +++ b/usr/src/uts/sun4u/bootdev/Makefile @@ -23,7 +23,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" # # This makefile drives the production of the bootdev misc kernel @@ -67,6 +66,8 @@ CFLAGS += $(CCVERBOSE) # LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sun4u/cheetah/Makefile b/usr/src/uts/sun4u/cheetah/Makefile index eab8f9aa2d..974ea75d75 100644 --- a/usr/src/uts/sun4u/cheetah/Makefile +++ b/usr/src/uts/sun4u/cheetah/Makefile @@ -123,3 +123,7 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-clobbered diff --git a/usr/src/uts/sun4u/cheetahplus/Makefile b/usr/src/uts/sun4u/cheetahplus/Makefile index c828a05938..7d68335ee4 100644 --- a/usr/src/uts/sun4u/cheetahplus/Makefile +++ b/usr/src/uts/sun4u/cheetahplus/Makefile @@ -129,3 +129,8 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-clobbered diff --git a/usr/src/uts/sun4u/cherrystone/platmod/Makefile b/usr/src/uts/sun4u/cherrystone/platmod/Makefile index 6f84821528..0ed52a75dd 100644 --- a/usr/src/uts/sun4u/cherrystone/platmod/Makefile +++ b/usr/src/uts/sun4u/cherrystone/platmod/Makefile @@ -23,8 +23,6 @@ # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# # # This makefile drives the production of the sun4u lneck platform module. @@ -73,6 +71,7 @@ $(NOT_RELEASE_BUILD)DEF_BUILDS = debug64 # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-function # # Default build targets. diff --git a/usr/src/uts/sun4u/chicago/fpc/Makefile b/usr/src/uts/sun4u/chicago/fpc/Makefile index 0173e7af37..bc5c45d7ed 100644 --- a/usr/src/uts/sun4u/chicago/fpc/Makefile +++ b/usr/src/uts/sun4u/chicago/fpc/Makefile @@ -103,6 +103,8 @@ CFLAGS += -dalign # LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-unused-variable + # # Default build targets. # diff --git a/usr/src/uts/sun4u/chicago/platmod/Makefile b/usr/src/uts/sun4u/chicago/platmod/Makefile index c4188efaf8..4d151c7075 100644 --- a/usr/src/uts/sun4u/chicago/platmod/Makefile +++ b/usr/src/uts/sun4u/chicago/platmod/Makefile @@ -23,8 +23,6 @@ # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# # # This makefile drives the production of the sun4u chicago platform module. @@ -69,6 +67,7 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-variable # # Default build targets. diff --git a/usr/src/uts/sun4u/cpr/Makefile b/usr/src/uts/sun4u/cpr/Makefile index 89f17571e7..5d5b047b47 100644 --- a/usr/src/uts/sun4u/cpr/Makefile +++ b/usr/src/uts/sun4u/cpr/Makefile @@ -89,6 +89,12 @@ LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits + # # Default build targets. # diff --git a/usr/src/uts/sun4u/daktari/hpc3130/Makefile b/usr/src/uts/sun4u/daktari/hpc3130/Makefile index 6cb51f0a59..abd8689d12 100644 --- a/usr/src/uts/sun4u/daktari/hpc3130/Makefile +++ b/usr/src/uts/sun4u/daktari/hpc3130/Makefile @@ -24,7 +24,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the hpc3130 driver # for the Texas Instruments hot-plug controller. @@ -67,6 +67,7 @@ CLEANLINTFILES += $(LINT32_FILES) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-char-subscripts # # Turn on doubleword alignment for 64 bit registers diff --git a/usr/src/uts/sun4u/daktari/platmod/Makefile b/usr/src/uts/sun4u/daktari/platmod/Makefile index 764f701dd2..32a7654012 100644 --- a/usr/src/uts/sun4u/daktari/platmod/Makefile +++ b/usr/src/uts/sun4u/daktari/platmod/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" -# # # This makefile drives the production of the sun4u daktari platmod module @@ -74,6 +72,7 @@ CLEANLINTFILES += $(LINT32_FILES) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-function # # Default build targets. diff --git a/usr/src/uts/sun4u/db21554/Makefile b/usr/src/uts/sun4u/db21554/Makefile index 54e59b3716..860ed675f7 100644 --- a/usr/src/uts/sun4u/db21554/Makefile +++ b/usr/src/uts/sun4u/db21554/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the Intel 21554 drawbridge # nexus driver kernel module @@ -86,6 +86,10 @@ LDFLAGS += -dy -Nmisc/pcihp # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits + # Default build targets. # .KEEP_STATE: diff --git a/usr/src/uts/sun4u/des/Makefile b/usr/src/uts/sun4u/des/Makefile index 62d0157e57..50ce1ffb01 100644 --- a/usr/src/uts/sun4u/des/Makefile +++ b/usr/src/uts/sun4u/des/Makefile @@ -24,7 +24,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the des kernel module. # @@ -90,6 +90,9 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sun4u/ebus/Makefile b/usr/src/uts/sun4u/ebus/Makefile index f6d10c58b6..aa391f1ccd 100644 --- a/usr/src/uts/sun4u/ebus/Makefile +++ b/usr/src/uts/sun4u/ebus/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the ebus driver kernel module # @@ -75,6 +75,9 @@ CFLAGS += -dalign # LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sun4u/excalibur/xcalppm/Makefile b/usr/src/uts/sun4u/excalibur/xcalppm/Makefile index 4c3e661c7e..76c4b45f68 100644 --- a/usr/src/uts/sun4u/excalibur/xcalppm/Makefile +++ b/usr/src/uts/sun4u/excalibur/xcalppm/Makefile @@ -24,7 +24,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the platform power # management driver in the sun4u excalibur system. @@ -64,6 +64,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch # # Turn on doubleword alignment for 64 bit registers diff --git a/usr/src/uts/sun4u/fd/Makefile b/usr/src/uts/sun4u/fd/Makefile index cf023057d9..9d7036feb7 100644 --- a/usr/src/uts/sun4u/fd/Makefile +++ b/usr/src/uts/sun4u/fd/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the fd driver kernel module. # @@ -83,6 +83,10 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-char-subscripts + # # Default build targets. # diff --git a/usr/src/uts/sun4u/genunix/Makefile b/usr/src/uts/sun4u/genunix/Makefile index 1a77e4c916..0f6a33b52d 100644 --- a/usr/src/uts/sun4u/genunix/Makefile +++ b/usr/src/uts/sun4u/genunix/Makefile @@ -110,6 +110,17 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-empty-body + # # Ensure that lint sees 'struct cpu' containing a fully declared # embedded 'struct machcpu' diff --git a/usr/src/uts/sun4u/gpio_87317/Makefile b/usr/src/uts/sun4u/gpio_87317/Makefile index 203dc22cd0..86374e2b13 100644 --- a/usr/src/uts/sun4u/gpio_87317/Makefile +++ b/usr/src/uts/sun4u/gpio_87317/Makefile @@ -24,7 +24,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of gpio_87317 driver # @@ -59,7 +59,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # # lint pass one enforcement # -CFLAGS += $(CCVERBOSE) +CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses # # Default build targets. diff --git a/usr/src/uts/sun4u/gptwo_cpu/Makefile b/usr/src/uts/sun4u/gptwo_cpu/Makefile index 06bb109a42..d1a6c1c16e 100644 --- a/usr/src/uts/sun4u/gptwo_cpu/Makefile +++ b/usr/src/uts/sun4u/gptwo_cpu/Makefile @@ -18,12 +18,12 @@ # # CDDL HEADER END # + # -# uts/sun4u/gptwo_cpu/Makefile # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the cpu portion of # of the Safari Configurator. @@ -88,6 +88,9 @@ LDFLAGS += -dy -Nmisc/gptwocfg # LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-function + # # Default build targets. # diff --git a/usr/src/uts/sun4u/hummingbird/Makefile b/usr/src/uts/sun4u/hummingbird/Makefile index 836d9192e0..d6eca49e54 100644 --- a/usr/src/uts/sun4u/hummingbird/Makefile +++ b/usr/src/uts/sun4u/hummingbird/Makefile @@ -120,3 +120,5 @@ include $(UTSBASE)/sun4u/Makefile.targ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_BAD_FORMAT_STR2 + +CERRWARN += -_gcc=-Wno-uninitialized diff --git a/usr/src/uts/sun4u/isadma/Makefile b/usr/src/uts/sun4u/isadma/Makefile index 2956a854ed..6e92243d9a 100644 --- a/usr/src/uts/sun4u/isadma/Makefile +++ b/usr/src/uts/sun4u/isadma/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the isadma driver kernel module # @@ -74,6 +74,8 @@ CPPFLAGS += -I$(UTSBASE)/sun4u LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/sun4u/jalapeno/Makefile b/usr/src/uts/sun4u/jalapeno/Makefile index fdd2a22502..a3c45ab0c6 100644 --- a/usr/src/uts/sun4u/jalapeno/Makefile +++ b/usr/src/uts/sun4u/jalapeno/Makefile @@ -128,3 +128,7 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-clobbered diff --git a/usr/src/uts/sun4u/javelin/envctrltwo/Makefile b/usr/src/uts/sun4u/javelin/envctrltwo/Makefile index c9989dc8fd..11efab8ed6 100644 --- a/usr/src/uts/sun4u/javelin/envctrltwo/Makefile +++ b/usr/src/uts/sun4u/javelin/envctrltwo/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the envctrltwo driver kernel # module in the sun4u javelin systems. @@ -58,6 +58,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized # # Turn on doubleword alignment for 64 bit registers diff --git a/usr/src/uts/sun4u/kb/Makefile b/usr/src/uts/sun4u/kb/Makefile index 1784e6390c..c037619041 100644 --- a/usr/src/uts/sun4u/kb/Makefile +++ b/usr/src/uts/sun4u/kb/Makefile @@ -18,12 +18,12 @@ # # CDDL HEADER END # + # -# uts/sun4u/kb/Makefile # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the kb streams kernel # module. @@ -77,6 +77,8 @@ CFLAGS += $(CCVERBOSE) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sun4u/lw8/ntwdt/Makefile b/usr/src/uts/sun4u/lw8/ntwdt/Makefile index 36d5107c71..004558ea7a 100644 --- a/usr/src/uts/sun4u/lw8/ntwdt/Makefile +++ b/usr/src/uts/sun4u/lw8/ntwdt/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makes the "ntwdt" driver module, which # provides for an application-level watchdog @@ -66,6 +66,7 @@ CLEANLINTFILES += $(LINT32_FILES) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized LDFLAGS += -dy -Ndrv/sgsbbc diff --git a/usr/src/uts/sun4u/lw8/platmod/Makefile b/usr/src/uts/sun4u/lw8/platmod/Makefile index df89591cf1..3fd0e01760 100644 --- a/usr/src/uts/sun4u/lw8/platmod/Makefile +++ b/usr/src/uts/sun4u/lw8/platmod/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" -# # # This makefile drives the production of the sun4u lw8 platform module. @@ -76,6 +74,8 @@ CLEANLINTFILES += $(LINT32_FILES) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized # # Default build targets. diff --git a/usr/src/uts/sun4u/lw8/sgenv/Makefile b/usr/src/uts/sun4u/lw8/sgenv/Makefile index 66f488a6b1..e35528e081 100644 --- a/usr/src/uts/sun4u/lw8/sgenv/Makefile +++ b/usr/src/uts/sun4u/lw8/sgenv/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the lw8 # sgenv (environmentals) kernel module. @@ -68,6 +68,8 @@ CLEANLINTFILES += $(LINT32_FILES) CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -Ndrv/sgsbbc +CERRWARN += -_gcc=-Wno-type-limits + # # Default build targets. # diff --git a/usr/src/uts/sun4u/max1617/Makefile b/usr/src/uts/sun4u/max1617/Makefile index c3ed52a724..fa8367fd6b 100644 --- a/usr/src/uts/sun4u/max1617/Makefile +++ b/usr/src/uts/sun4u/max1617/Makefile @@ -19,8 +19,7 @@ # # CDDL HEADER END # -# -#ident "%Z%%M% %I% %E% SMI" + # # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. @@ -47,7 +46,9 @@ include $(UTSBASE)/sun4u/Makefile.sun4u # # lint pass one enforcement # -CFLAGS += $(CCVERBOSE) +CFLAGS += $(CCVERBOSE) + +CERRWARN += -_gcc=-Wno-unused-label LDFLAGS += -dy -N misc/i2c_svc diff --git a/usr/src/uts/sun4u/mc-us3/Makefile b/usr/src/uts/sun4u/mc-us3/Makefile index 1e0b81b6fc..02f46fc300 100644 --- a/usr/src/uts/sun4u/mc-us3/Makefile +++ b/usr/src/uts/sun4u/mc-us3/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # #This makefile drives the production of the mc-us3 driver kernel #module. @@ -71,6 +71,8 @@ CFLAGS += -dalign # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses + # #Default build targets. # diff --git a/usr/src/uts/sun4u/mc-us3i/Makefile b/usr/src/uts/sun4u/mc-us3i/Makefile index 456c4c80ae..3a233a7361 100644 --- a/usr/src/uts/sun4u/mc-us3i/Makefile +++ b/usr/src/uts/sun4u/mc-us3i/Makefile @@ -19,12 +19,12 @@ # # CDDL HEADER END # + # -# uts/sun4u/mc-us3i/Makefile # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the mc-us3i driver kernel # module. @@ -61,6 +61,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized # # Turn on doubleword alignment for 64 bit registers diff --git a/usr/src/uts/sun4u/mem_cache/Makefile b/usr/src/uts/sun4u/mem_cache/Makefile index 123c3f968a..d71809bf31 100644 --- a/usr/src/uts/sun4u/mem_cache/Makefile +++ b/usr/src/uts/sun4u/mem_cache/Makefile @@ -18,10 +18,12 @@ # # CDDL HEADER END # + +# # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the mem_cache driver # @@ -60,6 +62,7 @@ DSF_DIR = $(UTSBASE)/$(PLATFORM)/mem_cache/genassym # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses ASFLAGS += -DCHEETAH_PLUS AS_INC_PATH += -I$(DSF_DIR)/$(OBJS_DIR) diff --git a/usr/src/uts/sun4u/montecarlo/acebus/Makefile b/usr/src/uts/sun4u/montecarlo/acebus/Makefile index d62a6ee9ec..90d0438d14 100644 --- a/usr/src/uts/sun4u/montecarlo/acebus/Makefile +++ b/usr/src/uts/sun4u/montecarlo/acebus/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the acebus driver kernel module # for the Alarm Card. @@ -60,6 +60,7 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) -DNORDICA_CP1500 -DACEBUS_HOTPLUG +CERRWARN += -_gcc=-Wno-switch # # Turn on doubleword alignment for 64 bit registers diff --git a/usr/src/uts/sun4u/montecarlo/pcf8574_nct/Makefile b/usr/src/uts/sun4u/montecarlo/pcf8574_nct/Makefile index 0c30d29d28..7d0d5667c8 100644 --- a/usr/src/uts/sun4u/montecarlo/pcf8574_nct/Makefile +++ b/usr/src/uts/sun4u/montecarlo/pcf8574_nct/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the pcf8574 driver kernel module # @@ -58,6 +58,7 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) -DNORDICA_CP1500 +CERRWARN += -_gcc=-Wno-uninitialized # # Turn on doubleword alignment for 64 bit registers diff --git a/usr/src/uts/sun4u/montecarlo/scsb/Makefile b/usr/src/uts/sun4u/montecarlo/scsb/Makefile index 0561a8efc6..3076c9dbb6 100644 --- a/usr/src/uts/sun4u/montecarlo/scsb/Makefile +++ b/usr/src/uts/sun4u/montecarlo/scsb/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the scsb driver kernel module # @@ -60,6 +60,11 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) -DNORDICA_CP1500 +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized # # Turn on doubleword alignment for 64 bit registers diff --git a/usr/src/uts/sun4u/mpxu/tsalarm/Makefile b/usr/src/uts/sun4u/mpxu/tsalarm/Makefile index cca3c7d8d2..db9ad320f0 100644 --- a/usr/src/uts/sun4u/mpxu/tsalarm/Makefile +++ b/usr/src/uts/sun4u/mpxu/tsalarm/Makefile @@ -23,7 +23,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # Path to the base of the uts directory tree (usually /usr/src/uts). # @@ -66,6 +66,7 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses # # Turn on doubleword alignment for 64 bit registers diff --git a/usr/src/uts/sun4u/nxge/Makefile b/usr/src/uts/sun4u/nxge/Makefile index b16c145e25..b6ff905531 100644 --- a/usr/src/uts/sun4u/nxge/Makefile +++ b/usr/src/uts/sun4u/nxge/Makefile @@ -18,17 +18,17 @@ # # CDDL HEADER END # -# uts/sun4u/nxge/Makefile + # # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the Sun # 10G/1G Ethernet leaf driver kernel module. # + # # Path to the base of the uts directory tree (usually /usr/src/uts). # @@ -87,6 +87,13 @@ LINTFLAGS += -DSOLARIS # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW + +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits + # # Driver depends on mac & IP # diff --git a/usr/src/uts/sun4u/opl/dr/Makefile b/usr/src/uts/sun4u/opl/dr/Makefile index 31d5a8388a..81edee1e96 100644 --- a/usr/src/uts/sun4u/opl/dr/Makefile +++ b/usr/src/uts/sun4u/opl/dr/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the dr driver module. # @@ -59,6 +59,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses # # module dependencies diff --git a/usr/src/uts/sun4u/opl/drmach/Makefile b/usr/src/uts/sun4u/opl/drmach/Makefile index 804c421146..e96c6defc4 100644 --- a/usr/src/uts/sun4u/opl/drmach/Makefile +++ b/usr/src/uts/sun4u/opl/drmach/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the drmach loadable module. # @@ -63,6 +63,9 @@ CLEANFILES += $(DRMACH_OFFSETS_H) $(DRMACH_OFFSETS_OUT) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized # # module dependencies diff --git a/usr/src/uts/sun4u/opl/mc-opl/Makefile b/usr/src/uts/sun4u/opl/mc-opl/Makefile index 9ac4f46f10..7fd191f904 100644 --- a/usr/src/uts/sun4u/opl/mc-opl/Makefile +++ b/usr/src/uts/sun4u/opl/mc-opl/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the mc-opl driver kernel # module. @@ -61,6 +61,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) -I../sys +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits # # Turn on doubleword alignment for 64 bit registers diff --git a/usr/src/uts/sun4u/opl/olympus_c/Makefile b/usr/src/uts/sun4u/opl/olympus_c/Makefile index ba566c0d57..764bad7594 100644 --- a/usr/src/uts/sun4u/opl/olympus_c/Makefile +++ b/usr/src/uts/sun4u/opl/olympus_c/Makefile @@ -75,6 +75,7 @@ CLEANLINTFILES += $(LINT32_FILES) # OLYMPUS_C_DEFS += -DOLYMPUS_C CFLAGS += $(CCVERBOSE) $(OLYMPUS_C_DEFS) +CERRWARN += -_gcc=-Wno-uninitialized CPPFLAGS += -DCPU_MODULE -DOLYMPUS_C AS_CPPFLAGS += -DCPU_MODULE -DOLYMPUS_C diff --git a/usr/src/uts/sun4u/opl/oplmsu/Makefile b/usr/src/uts/sun4u/opl/oplmsu/Makefile index 851e374f41..8506680c14 100644 --- a/usr/src/uts/sun4u/opl/oplmsu/Makefile +++ b/usr/src/uts/sun4u/opl/oplmsu/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the oplmsu driver # loadable module. @@ -61,6 +61,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) CFLAGS += $(CCVERBOSE) -I../sys LDFLAGS += -dy -Ndrv/su +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sun4u/opl/oplpanel/Makefile b/usr/src/uts/sun4u/opl/oplpanel/Makefile index 5d2f757b40..aa264cdb3b 100644 --- a/usr/src/uts/sun4u/opl/oplpanel/Makefile +++ b/usr/src/uts/sun4u/opl/oplpanel/Makefile @@ -21,7 +21,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the oplpanel driver # loadable module. @@ -59,6 +59,7 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) -I../sys +CERRWARN += -_gcc=-Wno-unused-function # # Default build targets. diff --git a/usr/src/uts/sun4u/opl/pcicmu/Makefile b/usr/src/uts/sun4u/opl/pcicmu/Makefile index f610c04f77..00b9a4213f 100644 --- a/usr/src/uts/sun4u/opl/pcicmu/Makefile +++ b/usr/src/uts/sun4u/opl/pcicmu/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the pcicmu driver kernel module # @@ -60,6 +60,10 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) -I../sys +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-label # # Turn on doubleword alignment for 64 bit registers diff --git a/usr/src/uts/sun4u/opl/unix/Makefile b/usr/src/uts/sun4u/opl/unix/Makefile index f5285d1bd2..916c2f8fe5 100644 --- a/usr/src/uts/sun4u/opl/unix/Makefile +++ b/usr/src/uts/sun4u/opl/unix/Makefile @@ -22,7 +22,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of unix (and unix.o). # @@ -114,6 +114,18 @@ CLEANLINTFILES += $(LINT_LIB) # CFLAGS += $(CCVERBOSE) -dalign +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-empty-body +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/sun4u/opl_cfg/Makefile b/usr/src/uts/sun4u/opl_cfg/Makefile index 35bc368ed5..ae72d82246 100644 --- a/usr/src/uts/sun4u/opl_cfg/Makefile +++ b/usr/src/uts/sun4u/opl_cfg/Makefile @@ -18,13 +18,13 @@ # # CDDL HEADER END # + # -# uts/sun4u/opl_cfg/Makefile # # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the opl_cfg Jupiter Bus # Configurator @@ -83,6 +83,8 @@ CFLAGS += -dalign # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sun4u/opl_pcbe/Makefile b/usr/src/uts/sun4u/opl_pcbe/Makefile index 3e4a45260d..d47304b06b 100644 --- a/usr/src/uts/sun4u/opl_pcbe/Makefile +++ b/usr/src/uts/sun4u/opl_pcbe/Makefile @@ -22,7 +22,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # uts/sun4u/opl_pcbe/Makefile # @@ -66,6 +66,8 @@ CFLAGS += $(CCVERBOSE) LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-type-limits + # # Default build targets. # diff --git a/usr/src/uts/sun4u/pca9556/Makefile b/usr/src/uts/sun4u/pca9556/Makefile index 0ff092bc61..89fe7e08ba 100644 --- a/usr/src/uts/sun4u/pca9556/Makefile +++ b/usr/src/uts/sun4u/pca9556/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # This makefile drives the pca9556 build. # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -56,6 +56,8 @@ LDFLAGS += -dy -N misc/i2c_svc # LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/sun4u/pcie/Makefile b/usr/src/uts/sun4u/pcie/Makefile index ba42c6770a..d10cf86c92 100644 --- a/usr/src/uts/sun4u/pcie/Makefile +++ b/usr/src/uts/sun4u/pcie/Makefile @@ -63,6 +63,11 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # LDFLAGS += -dy -Nmisc/busra +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits + # # Default build targets. # diff --git a/usr/src/uts/sun4u/pcipsy/Makefile b/usr/src/uts/sun4u/pcipsy/Makefile index be05d27de8..0db91a93d1 100644 --- a/usr/src/uts/sun4u/pcipsy/Makefile +++ b/usr/src/uts/sun4u/pcipsy/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the pci driver kernel module # @@ -76,6 +76,10 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-function + # # Default build targets. # diff --git a/usr/src/uts/sun4u/pcisch/Makefile b/usr/src/uts/sun4u/pcisch/Makefile index 862e63e574..d246548ee9 100644 --- a/usr/src/uts/sun4u/pcisch/Makefile +++ b/usr/src/uts/sun4u/pcisch/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the pci driver kernel module # @@ -76,6 +76,11 @@ LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_STATIC_UNUSED +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-value + # # Default build targets. # diff --git a/usr/src/uts/sun4u/pic16f747/Makefile b/usr/src/uts/sun4u/pic16f747/Makefile index 1842b3e79d..530a5790a8 100644 --- a/usr/src/uts/sun4u/pic16f747/Makefile +++ b/usr/src/uts/sun4u/pic16f747/Makefile @@ -24,10 +24,6 @@ # Use is subject to license terms. # -# -#ident "%Z%%M% %I% %E% SMI" -# - # This makefile drives the pic16f747 build. # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -57,7 +53,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # # lint pass one enforcement # -CFLAGS += $(CCVERBOSE) +CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses # # Default build targets. diff --git a/usr/src/uts/sun4u/pmubus/Makefile b/usr/src/uts/sun4u/pmubus/Makefile index d7e87189ce..89c6d07fe3 100644 --- a/usr/src/uts/sun4u/pmubus/Makefile +++ b/usr/src/uts/sun4u/pmubus/Makefile @@ -24,7 +24,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" # # This makefile drives the production of the pmubus driver kernel module @@ -77,6 +76,9 @@ CPPFLAGS += -I$(UTSBASE)/sun4u # LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sun4u/ppm/Makefile b/usr/src/uts/sun4u/ppm/Makefile index c91f55391f..e13a4da1a8 100644 --- a/usr/src/uts/sun4u/ppm/Makefile +++ b/usr/src/uts/sun4u/ppm/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the power managment # module for the Tomatillo ASIC @@ -74,6 +74,10 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Turn on doubleword alignment for 64 bit registers # diff --git a/usr/src/uts/sun4u/px/Makefile b/usr/src/uts/sun4u/px/Makefile index c14d4a2f29..0e4a0ad309 100644 --- a/usr/src/uts/sun4u/px/Makefile +++ b/usr/src/uts/sun4u/px/Makefile @@ -82,6 +82,13 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-label + # # Dependency # diff --git a/usr/src/uts/sun4u/rmclomv/Makefile b/usr/src/uts/sun4u/rmclomv/Makefile index 01171c55b5..9d77985ad2 100644 --- a/usr/src/uts/sun4u/rmclomv/Makefile +++ b/usr/src/uts/sun4u/rmclomv/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the rmclomv driver kernel # module in the sun4u systems @@ -74,6 +74,8 @@ CFLAGS += -dalign LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sun4u/rootnex/Makefile b/usr/src/uts/sun4u/rootnex/Makefile index 0efe6b6ed3..3c31ff2e8f 100644 --- a/usr/src/uts/sun4u/rootnex/Makefile +++ b/usr/src/uts/sun4u/rootnex/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the rootnex driver # @@ -77,6 +77,11 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sun4u/sbbc/Makefile b/usr/src/uts/sun4u/sbbc/Makefile index 9ef2316b7c..fab5fa1d4b 100644 --- a/usr/src/uts/sun4u/sbbc/Makefile +++ b/usr/src/uts/sun4u/sbbc/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the sbbc driver kernel module # @@ -76,6 +76,8 @@ CFLAGS += -dalign LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/sun4u/sbd/Makefile b/usr/src/uts/sun4u/sbd/Makefile index 411ef645c0..bab52e56bb 100644 --- a/usr/src/uts/sun4u/sbd/Makefile +++ b/usr/src/uts/sun4u/sbd/Makefile @@ -23,7 +23,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the sbd driver module. # @@ -60,6 +60,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label # # Default build targets. diff --git a/usr/src/uts/sun4u/sbus/Makefile b/usr/src/uts/sun4u/sbus/Makefile index 25efe4e672..8fee184761 100644 --- a/usr/src/uts/sun4u/sbus/Makefile +++ b/usr/src/uts/sun4u/sbus/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the SBus driver kernel module, # the iommu nexus, and the obio nexus (which really is sbus on sun5). @@ -78,6 +78,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sun4u/sbusmem/Makefile b/usr/src/uts/sun4u/sbusmem/Makefile index 49d3970650..6fe27c961c 100644 --- a/usr/src/uts/sun4u/sbusmem/Makefile +++ b/usr/src/uts/sun4u/sbusmem/Makefile @@ -24,7 +24,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the sbusmem driver kernel module. # @@ -60,7 +60,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # # lint pass one enforcement # -CFLAGS += $(CCVERBOSE) +CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-variable # # Default build targets. diff --git a/usr/src/uts/sun4u/seeprom/Makefile b/usr/src/uts/sun4u/seeprom/Makefile index 29a523fb45..df05378e64 100644 --- a/usr/src/uts/sun4u/seeprom/Makefile +++ b/usr/src/uts/sun4u/seeprom/Makefile @@ -18,8 +18,7 @@ # # CDDL HEADER END # -# -#ident "%Z%%M% %I% %E% SMI" + # # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. @@ -58,6 +57,8 @@ LDFLAGS += -dy -N misc/i2c_svc # LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED +CERRWARN += -_gcc=-Wno-uninitialized + # # Define targets # diff --git a/usr/src/uts/sun4u/serengeti/cheetah/Makefile b/usr/src/uts/sun4u/serengeti/cheetah/Makefile index 27a8c3e7c1..48e8935947 100644 --- a/usr/src/uts/sun4u/serengeti/cheetah/Makefile +++ b/usr/src/uts/sun4u/serengeti/cheetah/Makefile @@ -77,6 +77,11 @@ CLEANLINTFILES += $(LINT32_FILES) CFLAGS += $(CCVERBOSE) -DCHEETAH ASFLAGS += -DCHEETAH +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-clobbered + # # cpu-module-specific flags # diff --git a/usr/src/uts/sun4u/serengeti/cheetahplus/Makefile b/usr/src/uts/sun4u/serengeti/cheetahplus/Makefile index da06097e3e..aa9be6d905 100644 --- a/usr/src/uts/sun4u/serengeti/cheetahplus/Makefile +++ b/usr/src/uts/sun4u/serengeti/cheetahplus/Makefile @@ -80,6 +80,12 @@ CFLAGS += $(CCVERBOSE) -DCHEETAH -DCHEETAH_PLUS -DCPU_IMP_L1_CACHE_PARITY \ ASFLAGS += -DCHEETAH -DCHEETAH_PLUS -DCPU_IMP_L1_CACHE_PARITY \ -DCPU_IMP_ECACHE_ASSOC -DCPU_IMP_DUAL_PAGESIZE -DCPU_IMP_AFSR_EXT +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-clobbered + # # cpu-module-specific flags # diff --git a/usr/src/uts/sun4u/serengeti/platmod/Makefile b/usr/src/uts/sun4u/serengeti/platmod/Makefile index 895376edcb..d4187406bb 100644 --- a/usr/src/uts/sun4u/serengeti/platmod/Makefile +++ b/usr/src/uts/sun4u/serengeti/platmod/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" -# # # This makefile drives the production of the sun4u serengeti platform @@ -77,6 +75,8 @@ CLEANLINTFILES += $(LINT32_FILES) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized # # Default build targets. diff --git a/usr/src/uts/sun4u/serengeti/sbdp/Makefile b/usr/src/uts/sun4u/serengeti/sbdp/Makefile index 196110b742..c1a49ef2ef 100644 --- a/usr/src/uts/sun4u/serengeti/sbdp/Makefile +++ b/usr/src/uts/sun4u/serengeti/sbdp/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the sbdp driver kernel module. # @@ -69,6 +69,11 @@ MACHINE_DEFS += -DCHEETAH_PLUS CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -Ndrv/sgsbbc +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable + # # Turn on doubleword alignment for 64 bit registers # diff --git a/usr/src/uts/sun4u/serengeti/sgcn/Makefile b/usr/src/uts/sun4u/serengeti/sgcn/Makefile index 579fa5be2d..ae115fae1f 100644 --- a/usr/src/uts/sun4u/serengeti/sgcn/Makefile +++ b/usr/src/uts/sun4u/serengeti/sgcn/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the "sgcn" driver module. # @@ -68,6 +68,9 @@ CLEANLINTFILES += $(LINT32_FILES) CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -Ndrv/sgsbbc +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sun4u/serengeti/sghsc/Makefile b/usr/src/uts/sun4u/serengeti/sghsc/Makefile index a0410766f2..684a7ec7ec 100644 --- a/usr/src/uts/sun4u/serengeti/sghsc/Makefile +++ b/usr/src/uts/sun4u/serengeti/sghsc/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the sghsc driver # kernel module. @@ -68,6 +68,8 @@ CLEANLINTFILES += $(LINT32_FILES) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized # # Turn on doubleword alignment for 64 bit registers diff --git a/usr/src/uts/sun4u/serengeti/sgsbbc/Makefile b/usr/src/uts/sun4u/serengeti/sgsbbc/Makefile index 700ef8843f..70abd98d29 100644 --- a/usr/src/uts/sun4u/serengeti/sgsbbc/Makefile +++ b/usr/src/uts/sun4u/serengeti/sgsbbc/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the serengeti sbbc # kernel module. @@ -69,6 +69,11 @@ CLEANLINTFILES += $(LINT32_FILES) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized # # Default build targets. diff --git a/usr/src/uts/sun4u/serengeti/ssm/Makefile b/usr/src/uts/sun4u/serengeti/ssm/Makefile index 9665219169..863d4c9669 100644 --- a/usr/src/uts/sun4u/serengeti/ssm/Makefile +++ b/usr/src/uts/sun4u/serengeti/ssm/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the sram driver kernel module. # @@ -68,6 +68,8 @@ CLEANLINTFILES += $(LINT32_FILES) CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -Ndrv/sgsbbc +CERRWARN += -_gcc=-Wno-type-limits + # # Turn on doubleword alignment for 64 bit registers # diff --git a/usr/src/uts/sun4u/serengeti/unix/Makefile b/usr/src/uts/sun4u/serengeti/unix/Makefile index e57033ffeb..7e17ce6332 100644 --- a/usr/src/uts/sun4u/serengeti/unix/Makefile +++ b/usr/src/uts/sun4u/serengeti/unix/Makefile @@ -23,8 +23,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# # # This makefile drives the production of unix (and unix.o). @@ -115,6 +113,18 @@ CLEANLINTFILES += $(LINT_LIB) # CFLAGS += $(CCVERBOSE) -dalign +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-empty-body +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/sun4u/serrano/Makefile b/usr/src/uts/sun4u/serrano/Makefile index acd6b33fb3..89be816d89 100644 --- a/usr/src/uts/sun4u/serrano/Makefile +++ b/usr/src/uts/sun4u/serrano/Makefile @@ -128,3 +128,7 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-clobbered diff --git a/usr/src/uts/sun4u/sf/Makefile b/usr/src/uts/sun4u/sf/Makefile index 0fa186b7fa..23c34d8bb9 100644 --- a/usr/src/uts/sun4u/sf/Makefile +++ b/usr/src/uts/sun4u/sf/Makefile @@ -76,6 +76,10 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sun4u/sha1/Makefile b/usr/src/uts/sun4u/sha1/Makefile index 5c920ed06f..4c78018602 100644 --- a/usr/src/uts/sun4u/sha1/Makefile +++ b/usr/src/uts/sun4u/sha1/Makefile @@ -67,6 +67,8 @@ CFLAGS += $(CCVERBOSE) -I$(COM_DIR) CFLAGS += -DVIS_SHA1 LINTFLAGS += -I$(COM_DIR) +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sun4u/simba/Makefile b/usr/src/uts/sun4u/simba/Makefile index 6502dee116..42031404d8 100644 --- a/usr/src/uts/sun4u/simba/Makefile +++ b/usr/src/uts/sun4u/simba/Makefile @@ -24,7 +24,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the pci driver kernel module # @@ -62,7 +62,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # # lint pass one enforcement # -CFLAGS += $(CCVERBOSE) +CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-switch # # Turn on doubleword alignment for 64 bit registers diff --git a/usr/src/uts/sun4u/spitfire/Makefile b/usr/src/uts/sun4u/spitfire/Makefile index 799f79e7bc..b586ea1002 100644 --- a/usr/src/uts/sun4u/spitfire/Makefile +++ b/usr/src/uts/sun4u/spitfire/Makefile @@ -86,6 +86,8 @@ LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_BAD_FORMAT_STR2 +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sun4u/starcat/cheetah/Makefile b/usr/src/uts/sun4u/starcat/cheetah/Makefile index 0588e4d986..1cc9fbd598 100644 --- a/usr/src/uts/sun4u/starcat/cheetah/Makefile +++ b/usr/src/uts/sun4u/starcat/cheetah/Makefile @@ -75,6 +75,11 @@ CLEANLINTFILES += $(LINT32_FILES) # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-clobbered + # # cpu-module-specific flags # diff --git a/usr/src/uts/sun4u/starcat/cheetahplus/Makefile b/usr/src/uts/sun4u/starcat/cheetahplus/Makefile index d058c8858b..4137226115 100644 --- a/usr/src/uts/sun4u/starcat/cheetahplus/Makefile +++ b/usr/src/uts/sun4u/starcat/cheetahplus/Makefile @@ -79,6 +79,12 @@ CFLAGS += $(CCVERBOSE) -DCHEETAH -DCHEETAH_PLUS -DCPU_IMP_L1_CACHE_PARITY \ ASFLAGS += -DCHEETAH -DCHEETAH_PLUS -DCPU_IMP_L1_CACHE_PARITY \ -DCPU_IMP_ECACHE_ASSOC -DCPU_IMP_DUAL_PAGESIZE -DCPU_IMP_AFSR_EXT +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-clobbered + # # cpu-module-specific flags # diff --git a/usr/src/uts/sun4u/starcat/dman/Makefile b/usr/src/uts/sun4u/starcat/dman/Makefile index 729d38747b..8978ae20bf 100644 --- a/usr/src/uts/sun4u/starcat/dman/Makefile +++ b/usr/src/uts/sun4u/starcat/dman/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the pruction of the Management Network # @@ -60,6 +60,11 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) CFLAGS += $(CCVERBOSE) LDFLAGS += -dy -Ndrv/ip -Ndrv/eri -Ndrv/iosram -Nmisc/mboxsc +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-type-limits + # # Default build targets. # diff --git a/usr/src/uts/sun4u/starcat/dr/Makefile b/usr/src/uts/sun4u/starcat/dr/Makefile index 459ced7aea..3a7409fc70 100644 --- a/usr/src/uts/sun4u/starcat/dr/Makefile +++ b/usr/src/uts/sun4u/starcat/dr/Makefile @@ -23,7 +23,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the dr driver module. # @@ -60,6 +60,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) -I../sys +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized # # module dependencies diff --git a/usr/src/uts/sun4u/starcat/drmach/Makefile b/usr/src/uts/sun4u/starcat/drmach/Makefile index 8bca56721f..2cc0ef1aa9 100644 --- a/usr/src/uts/sun4u/starcat/drmach/Makefile +++ b/usr/src/uts/sun4u/starcat/drmach/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the drmach loadable module. # @@ -60,6 +60,10 @@ MACHINE_DEFS += -DCHEETAH_PLUS # lint pass one enforcement # CFLAGS += $(CCVERBOSE) -I../sys -I$(UTSBASE)/sun4u/starcat/sys +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits # # module dependencies diff --git a/usr/src/uts/sun4u/starcat/fcgp2/Makefile b/usr/src/uts/sun4u/starcat/fcgp2/Makefile index 2860fb7a2b..83e576953e 100644 --- a/usr/src/uts/sun4u/starcat/fcgp2/Makefile +++ b/usr/src/uts/sun4u/starcat/fcgp2/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the fcgp2 # miscellaneous module. @@ -60,6 +60,7 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized # # module dependencies diff --git a/usr/src/uts/sun4u/starcat/iosram/Makefile b/usr/src/uts/sun4u/starcat/iosram/Makefile index a2768515bd..7337535f08 100644 --- a/usr/src/uts/sun4u/starcat/iosram/Makefile +++ b/usr/src/uts/sun4u/starcat/iosram/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the iosram driver module. # @@ -59,6 +59,7 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized # # module dependencies diff --git a/usr/src/uts/sun4u/starcat/platmod/Makefile b/usr/src/uts/sun4u/starcat/platmod/Makefile index 09d22b8627..39272993dd 100644 --- a/usr/src/uts/sun4u/starcat/platmod/Makefile +++ b/usr/src/uts/sun4u/starcat/platmod/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" -# # # This makefile drives the production of the sun4u starcat platform @@ -68,6 +66,7 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-variable # # Default build targets. diff --git a/usr/src/uts/sun4u/starcat/sc_gptwocfg/Makefile b/usr/src/uts/sun4u/starcat/sc_gptwocfg/Makefile index 0b1551ce31..f43cf2136a 100644 --- a/usr/src/uts/sun4u/starcat/sc_gptwocfg/Makefile +++ b/usr/src/uts/sun4u/starcat/sc_gptwocfg/Makefile @@ -23,7 +23,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the sc_gptwocfg # miscellaneous module. @@ -60,6 +60,7 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) -I../sys -I$(UTSBASE)/sun4u/starcat/sys +CERRWARN += -_gcc=-Wno-uninitialized # # module dependencies diff --git a/usr/src/uts/sun4u/starcat/scosmb/Makefile b/usr/src/uts/sun4u/starcat/scosmb/Makefile index 7f043a5d83..56fb23fa46 100644 --- a/usr/src/uts/sun4u/starcat/scosmb/Makefile +++ b/usr/src/uts/sun4u/starcat/scosmb/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#pragma ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the scosmb miscellaneous module. # @@ -59,6 +59,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized # # module dependencies diff --git a/usr/src/uts/sun4u/starcat/unix/Makefile b/usr/src/uts/sun4u/starcat/unix/Makefile index 2d9e683d9e..7881e5b2c4 100644 --- a/usr/src/uts/sun4u/starcat/unix/Makefile +++ b/usr/src/uts/sun4u/starcat/unix/Makefile @@ -113,6 +113,18 @@ CLEANLINTFILES += $(LINT_LIB) # CFLAGS += $(CCVERBOSE) -dalign +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-empty-body +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/sun4u/starfire/cvc/Makefile b/usr/src/uts/sun4u/starfire/cvc/Makefile index a310f9bc6d..f450a72f3b 100644 --- a/usr/src/uts/sun4u/starfire/cvc/Makefile +++ b/usr/src/uts/sun4u/starfire/cvc/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -# ident "%Z%%M% %I% %E% SMI" -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -60,6 +58,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized # # Default build targets. diff --git a/usr/src/uts/sun4u/starfire/idn/Makefile b/usr/src/uts/sun4u/starfire/idn/Makefile index 8e9296ffa5..3d7de4962e 100644 --- a/usr/src/uts/sun4u/starfire/idn/Makefile +++ b/usr/src/uts/sun4u/starfire/idn/Makefile @@ -23,7 +23,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the idn driver module. # @@ -63,6 +63,10 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) -DIPV6 +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits # # Default build targets. diff --git a/usr/src/uts/sun4u/starfire/ngdr/Makefile b/usr/src/uts/sun4u/starfire/ngdr/Makefile index 3deee7ded0..7d68bff634 100644 --- a/usr/src/uts/sun4u/starfire/ngdr/Makefile +++ b/usr/src/uts/sun4u/starfire/ngdr/Makefile @@ -23,7 +23,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the ngdr driver module. # @@ -60,6 +60,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized # # module dependencies diff --git a/usr/src/uts/sun4u/starfire/ngdrmach/Makefile b/usr/src/uts/sun4u/starfire/ngdrmach/Makefile index 8ad6a1b342..181e6cf8a6 100644 --- a/usr/src/uts/sun4u/starfire/ngdrmach/Makefile +++ b/usr/src/uts/sun4u/starfire/ngdrmach/Makefile @@ -58,6 +58,7 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized # # Define dependency on cvc diff --git a/usr/src/uts/sun4u/starfire/pcipsy/Makefile b/usr/src/uts/sun4u/starfire/pcipsy/Makefile index 5bdcbe25fe..97bb94d9a6 100644 --- a/usr/src/uts/sun4u/starfire/pcipsy/Makefile +++ b/usr/src/uts/sun4u/starfire/pcipsy/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -# ident "%Z%%M% %I% %E% SMI" -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -61,6 +59,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-function # # Turn on doubleword alignment for 64 bit registers diff --git a/usr/src/uts/sun4u/starfire/rootnex/Makefile b/usr/src/uts/sun4u/starfire/rootnex/Makefile index 46bf067f49..191a61016c 100644 --- a/usr/src/uts/sun4u/starfire/rootnex/Makefile +++ b/usr/src/uts/sun4u/starfire/rootnex/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -# ident "%Z%%M% %I% %E% SMI" -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -67,6 +65,10 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch # # Default build targets. diff --git a/usr/src/uts/sun4u/starfire/sbus/Makefile b/usr/src/uts/sun4u/starfire/sbus/Makefile index dddbc0b45d..03c6d28bf4 100644 --- a/usr/src/uts/sun4u/starfire/sbus/Makefile +++ b/usr/src/uts/sun4u/starfire/sbus/Makefile @@ -20,8 +20,6 @@ # CDDL HEADER END # # -# ident "%Z%%M% %I% %E% SMI" -# # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # @@ -65,6 +63,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized # # Turn on doubleword alignment for 64 bit registers diff --git a/usr/src/uts/sun4u/starfire/spitfire/Makefile b/usr/src/uts/sun4u/starfire/spitfire/Makefile index 0dae0c68c3..9db750b1cd 100644 --- a/usr/src/uts/sun4u/starfire/spitfire/Makefile +++ b/usr/src/uts/sun4u/starfire/spitfire/Makefile @@ -67,6 +67,7 @@ INSTALL_TARGET = def $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized CPPFLAGS += -DCPU_MODULE -DSPITFIRE AS_CPPFLAGS += -DCPU_MODULE -DSPITFIRE diff --git a/usr/src/uts/sun4u/starfire/unix/Makefile b/usr/src/uts/sun4u/starfire/unix/Makefile index 03e8ae5afc..e474a9fe90 100644 --- a/usr/src/uts/sun4u/starfire/unix/Makefile +++ b/usr/src/uts/sun4u/starfire/unix/Makefile @@ -106,6 +106,18 @@ CLEANLINTFILES += $(LINT_LIB) # CFLAGS += $(CCVERBOSE) -dalign +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-empty-body +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/sun4u/su/Makefile b/usr/src/uts/sun4u/su/Makefile index 1e3943e44e..25dc6f0f8f 100644 --- a/usr/src/uts/sun4u/su/Makefile +++ b/usr/src/uts/sun4u/su/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the sun4u "su" driver module. # @@ -69,6 +69,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sun4u/sunfire/ac/Makefile b/usr/src/uts/sun4u/sunfire/ac/Makefile index ca2e2cb4d6..f73e528bab 100644 --- a/usr/src/uts/sun4u/sunfire/ac/Makefile +++ b/usr/src/uts/sun4u/sunfire/ac/Makefile @@ -58,6 +58,7 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized # # Turn on doubleword alignment for 64 bit registers diff --git a/usr/src/uts/sun4u/sunfire/sysctrl/Makefile b/usr/src/uts/sun4u/sunfire/sysctrl/Makefile index e89213b440..c17f77d6a2 100644 --- a/usr/src/uts/sun4u/sunfire/sysctrl/Makefile +++ b/usr/src/uts/sun4u/sunfire/sysctrl/Makefile @@ -59,6 +59,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized # # Turn on doubleword alignment for 64 bit registers diff --git a/usr/src/uts/sun4u/tazmo/envctrl/Makefile b/usr/src/uts/sun4u/tazmo/envctrl/Makefile index 3343de2a6c..3562da1dca 100644 --- a/usr/src/uts/sun4u/tazmo/envctrl/Makefile +++ b/usr/src/uts/sun4u/tazmo/envctrl/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the envctrl driver kernel # module. @@ -60,6 +60,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits # # Turn on doubleword alignment for 64 bit registers diff --git a/usr/src/uts/sun4u/tod/Makefile b/usr/src/uts/sun4u/tod/Makefile index 9a1f00696c..ad7e1028ad 100644 --- a/usr/src/uts/sun4u/tod/Makefile +++ b/usr/src/uts/sun4u/tod/Makefile @@ -24,7 +24,7 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of tod driver # @@ -60,7 +60,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # # lint pass one enforcement # -CFLAGS += $(CCVERBOSE) +CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses # # Default build targets. diff --git a/usr/src/uts/sun4u/todds1287/Makefile b/usr/src/uts/sun4u/todds1287/Makefile index cdc4984e1d..9ffd0c2526 100644 --- a/usr/src/uts/sun4u/todds1287/Makefile +++ b/usr/src/uts/sun4u/todds1287/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of todds1287 kernel module. # @@ -67,6 +67,8 @@ CFLAGS += $(CCVERBOSE) # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sun4u/unix/Makefile b/usr/src/uts/sun4u/unix/Makefile index 7e99518eb5..8ff31a51ff 100644 --- a/usr/src/uts/sun4u/unix/Makefile +++ b/usr/src/uts/sun4u/unix/Makefile @@ -120,6 +120,18 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-empty-body +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/sun4u/upa64s/Makefile b/usr/src/uts/sun4u/upa64s/Makefile index 4899a386f7..48c7021920 100644 --- a/usr/src/uts/sun4u/upa64s/Makefile +++ b/usr/src/uts/sun4u/upa64s/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # sun4u implementation architecture dependent # @@ -66,6 +66,10 @@ CFLAGS += $(CCVERBOSE) # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sun4u/us/Makefile b/usr/src/uts/sun4u/us/Makefile index c3456b360b..5b28ca8b2a 100644 --- a/usr/src/uts/sun4u/us/Makefile +++ b/usr/src/uts/sun4u/us/Makefile @@ -24,7 +24,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of us (UltraSPARC) driver # kernel module. @@ -75,6 +75,9 @@ CFLAGS += -dalign LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sun4u/us234_pcbe/Makefile b/usr/src/uts/sun4u/us234_pcbe/Makefile index 295ca7c733..f6c68c324e 100644 --- a/usr/src/uts/sun4u/us234_pcbe/Makefile +++ b/usr/src/uts/sun4u/us234_pcbe/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This Makefile builds the UltraSPARC 2 - 4 Performance Counter BackEnd (PCBE). # @@ -59,6 +59,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOTLINK) LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-type-limits + # # Default build targets. # diff --git a/usr/src/uts/sun4u/vis/Makefile b/usr/src/uts/sun4u/vis/Makefile index 1777c820d4..530f21d1d9 100644 --- a/usr/src/uts/sun4u/vis/Makefile +++ b/usr/src/uts/sun4u/vis/Makefile @@ -24,7 +24,6 @@ # Copyright 2004 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" # # This makefile drives the production of the vis kernel module # @@ -61,6 +60,7 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/uts/sun4u/zs/Makefile b/usr/src/uts/sun4u/zs/Makefile index 092f3585d7..927f12d442 100644 --- a/usr/src/uts/sun4u/zs/Makefile +++ b/usr/src/uts/sun4u/zs/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the sun4u "zs" driver module. # @@ -77,6 +77,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sun4u/zsh/Makefile b/usr/src/uts/sun4u/zsh/Makefile index d48b7080ba..dfefb38063 100644 --- a/usr/src/uts/sun4u/zsh/Makefile +++ b/usr/src/uts/sun4u/zsh/Makefile @@ -74,6 +74,8 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sun4u/zuluvm/Makefile b/usr/src/uts/sun4u/zuluvm/Makefile index 2349802f61..719558aa46 100644 --- a/usr/src/uts/sun4u/zuluvm/Makefile +++ b/usr/src/uts/sun4u/zuluvm/Makefile @@ -22,7 +22,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" # # This makefile drives the production of the zulunvm # mics module @@ -88,6 +87,8 @@ LINTFLAGS += -I$(OBJS_DIR) LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sun4v/Makefile.sun4v.shared b/usr/src/uts/sun4v/Makefile.sun4v.shared index 7bf359290f..23c4a9cff5 100644 --- a/usr/src/uts/sun4v/Makefile.sun4v.shared +++ b/usr/src/uts/sun4v/Makefile.sun4v.shared @@ -179,7 +179,7 @@ CFLAGS += $(INLINES) -D_ASM_INLINES CFLAGS += $(CCMODE) CFLAGS += $(SPACEFLAG) CFLAGS += $(CERRWARN) -CFLAGS += $(CTF_FLAGS) +CFLAGS += $(CTF_FLAGS_$(CLASS)) CFLAGS += $(C99MODE) CFLAGS += $(CCUNBOUND) CFLAGS += $(CCNOAUTOINLINE) diff --git a/usr/src/uts/sun4v/bge/Makefile b/usr/src/uts/sun4v/bge/Makefile index c7231362c2..956f668e69 100644 --- a/usr/src/uts/sun4v/bge/Makefile +++ b/usr/src/uts/sun4v/bge/Makefile @@ -22,7 +22,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the Broadcom BCM5704 # Gigabit Ethernet (BGE) driver module in sun4v systems @@ -76,6 +76,10 @@ LDFLAGS += -dy -N misc/mac -N drv/ip # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sun4v/bootdev/Makefile b/usr/src/uts/sun4v/bootdev/Makefile index 46b8f746a7..684f732418 100644 --- a/usr/src/uts/sun4v/bootdev/Makefile +++ b/usr/src/uts/sun4v/bootdev/Makefile @@ -23,7 +23,6 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" # # This makefile drives the production of the bootdev misc kernel @@ -67,6 +66,8 @@ CFLAGS += $(CCVERBOSE) # LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sun4v/dr_io/Makefile b/usr/src/uts/sun4v/dr_io/Makefile index 37ecb9fc06..1de9932500 100644 --- a/usr/src/uts/sun4v/dr_io/Makefile +++ b/usr/src/uts/sun4v/dr_io/Makefile @@ -23,8 +23,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# + # # Path to the base of the uts directory tree (usually /usr/src/uts). @@ -55,6 +54,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized # # Turn on doubleword alignment for 64 bit registers diff --git a/usr/src/uts/sun4v/dr_mem/Makefile b/usr/src/uts/sun4v/dr_mem/Makefile index ea1d25dd0d..f55ea3ef6b 100644 --- a/usr/src/uts/sun4v/dr_mem/Makefile +++ b/usr/src/uts/sun4v/dr_mem/Makefile @@ -53,6 +53,7 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses # # Turn on doubleword alignment for 64 bit registers diff --git a/usr/src/uts/sun4v/ds/Makefile b/usr/src/uts/sun4v/ds/Makefile index 6422bf776a..64e873f53a 100644 --- a/usr/src/uts/sun4v/ds/Makefile +++ b/usr/src/uts/sun4v/ds/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the ds kernel module. # @@ -77,6 +77,8 @@ LDFLAGS += -dy -Nmisc/ldc # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sun4v/ds_pri/Makefile b/usr/src/uts/sun4v/ds_pri/Makefile index 869167c557..d67e8da7d0 100644 --- a/usr/src/uts/sun4v/ds_pri/Makefile +++ b/usr/src/uts/sun4v/ds_pri/Makefile @@ -22,7 +22,7 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the pseudo device # to access the sun4v PRI @@ -66,7 +66,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # # lint pass one enforcement # -CFLAGS += -v +CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized # # Module Dependencies diff --git a/usr/src/uts/sun4v/ebus/Makefile b/usr/src/uts/sun4v/ebus/Makefile index 6e43899a85..6ad462ca17 100644 --- a/usr/src/uts/sun4v/ebus/Makefile +++ b/usr/src/uts/sun4v/ebus/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the ebus driver kernel module # @@ -75,6 +75,9 @@ CFLAGS += -dalign # LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sun4v/fpc/Makefile b/usr/src/uts/sun4v/fpc/Makefile index 6575834682..904ebf0859 100644 --- a/usr/src/uts/sun4v/fpc/Makefile +++ b/usr/src/uts/sun4v/fpc/Makefile @@ -21,7 +21,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # uts/sun4v/fpc/Makefile # @@ -67,6 +67,7 @@ INC_PATH += -I$(UTSBASE)/sun4v/io/fpc # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-variable # # Turn on doubleword alignment for 64 bit registers diff --git a/usr/src/uts/sun4v/generic/Makefile b/usr/src/uts/sun4v/generic/Makefile index 1da2371622..53b1f453d9 100644 --- a/usr/src/uts/sun4v/generic/Makefile +++ b/usr/src/uts/sun4v/generic/Makefile @@ -69,6 +69,7 @@ INSTALL_TARGET = def $(BINARY) $(ROOTMODULE) $(ROOTSOFTLINKS) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses # # cpu-module-specific flags diff --git a/usr/src/uts/sun4v/genunix/Makefile b/usr/src/uts/sun4v/genunix/Makefile index 28d4f2aeeb..e0c060c402 100644 --- a/usr/src/uts/sun4v/genunix/Makefile +++ b/usr/src/uts/sun4v/genunix/Makefile @@ -118,6 +118,18 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-empty-body + + # Ensure that lint sees 'struct cpu' containing a fully declared # embedded 'struct machcpu'. # diff --git a/usr/src/uts/sun4v/ldc/Makefile b/usr/src/uts/sun4v/ldc/Makefile index 1fa2983eaf..0175bd7b56 100644 --- a/usr/src/uts/sun4v/ldc/Makefile +++ b/usr/src/uts/sun4v/ldc/Makefile @@ -23,7 +23,7 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # uts/sun4v/ldc/Makefile # @@ -78,6 +78,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-parentheses + # # Default build targets. # diff --git a/usr/src/uts/sun4v/mdesc/Makefile b/usr/src/uts/sun4v/mdesc/Makefile index fbc7714ff6..b7b49a01ad 100644 --- a/usr/src/uts/sun4v/mdesc/Makefile +++ b/usr/src/uts/sun4v/mdesc/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the pseudo device # to access the sun4v machine description. @@ -67,6 +67,7 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-function # # For now, disable these lint checks; maintainers should endeavor diff --git a/usr/src/uts/sun4v/n2piupc/Makefile b/usr/src/uts/sun4v/n2piupc/Makefile index 08d2695574..c4cd3e1b44 100644 --- a/usr/src/uts/sun4v/n2piupc/Makefile +++ b/usr/src/uts/sun4v/n2piupc/Makefile @@ -21,7 +21,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # uts/sun4v/n2piupc/Makefile # @@ -66,6 +66,7 @@ INC_PATH += -I$(UTSBASE)/sun4v/io/n2piupc # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-unused-label # # Turn on doubleword alignment for 64 bit registers, and pass in module name diff --git a/usr/src/uts/sun4v/n2rng/Makefile b/usr/src/uts/sun4v/n2rng/Makefile index f5c3c7d52d..b88975168f 100644 --- a/usr/src/uts/sun4v/n2rng/Makefile +++ b/usr/src/uts/sun4v/n2rng/Makefile @@ -66,8 +66,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) $(ROOT_CONFFILE) # # lint pass one enforcement # -CFLAGS += -v -DN2 -I$(COM_DIR) +CFLAGS += $(CCVERBOSE) -DN2 -I$(COM_DIR) LINTFLAGS += -DN2 -I$(COM_DIR) +CERRWARN += -_gcc=-Wno-uninitialized # # module dependencies diff --git a/usr/src/uts/sun4v/niagara/Makefile b/usr/src/uts/sun4v/niagara/Makefile index 91fe9a91a6..d802e9bf64 100644 --- a/usr/src/uts/sun4v/niagara/Makefile +++ b/usr/src/uts/sun4v/niagara/Makefile @@ -23,8 +23,6 @@ # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# # # This makefile drives the production of the UltraSPARC-H20 cpu module. @@ -69,6 +67,7 @@ INSTALL_TARGET = def $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) -DNIAGARA_IMPL +CERRWARN += -_gcc=-Wno-parentheses # # cpu-module-specific flags diff --git a/usr/src/uts/sun4v/niagara_pcbe/Makefile b/usr/src/uts/sun4v/niagara_pcbe/Makefile index 1b0740d1c7..ddc87ef3a8 100644 --- a/usr/src/uts/sun4v/niagara_pcbe/Makefile +++ b/usr/src/uts/sun4v/niagara_pcbe/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This Makefile builds the UltraSPARC-T1 Performance Counter BackEnd (PCBE). # @@ -58,6 +58,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-type-limits + # # Default build targets. # diff --git a/usr/src/uts/sun4v/niumx/Makefile b/usr/src/uts/sun4v/niumx/Makefile index fcb74811ec..756934f278 100644 --- a/usr/src/uts/sun4v/niumx/Makefile +++ b/usr/src/uts/sun4v/niumx/Makefile @@ -63,6 +63,8 @@ INC_PATH += -I$(UTSBASE)/sun4v/io/niumx # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized # # Turn on doubleword alignment for 64 bit registers diff --git a/usr/src/uts/sun4v/nxge/Makefile b/usr/src/uts/sun4v/nxge/Makefile index b7766cb96b..6d29a43007 100644 --- a/usr/src/uts/sun4v/nxge/Makefile +++ b/usr/src/uts/sun4v/nxge/Makefile @@ -24,7 +24,6 @@ # Use is subject to license terms. # # -# ident "%Z%%M% %I% %E% SMI" # # This makefile drives the production of the N2 NIU # 10G and SUN 10G/1G Ethernet leaf driver kernel module. @@ -112,6 +111,13 @@ LINTFLAGS += -DNIU_LP_WORKAROUND # LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW + +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-type-limits + # # Driver depends on mac & IP # diff --git a/usr/src/uts/sun4v/ontario/tsalarm/Makefile b/usr/src/uts/sun4v/ontario/tsalarm/Makefile index b30fd39397..7e8111d281 100644 --- a/usr/src/uts/sun4v/ontario/tsalarm/Makefile +++ b/usr/src/uts/sun4v/ontario/tsalarm/Makefile @@ -22,7 +22,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # Path to the base of the uts directory tree (usually /usr/src/uts). # @@ -85,6 +85,9 @@ LDFLAGS += -dy LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sun4v/pcie/Makefile b/usr/src/uts/sun4v/pcie/Makefile index 5b51172fd5..56b54dc602 100644 --- a/usr/src/uts/sun4v/pcie/Makefile +++ b/usr/src/uts/sun4v/pcie/Makefile @@ -63,6 +63,11 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # LDFLAGS += -dy -Nmisc/busra +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits + # # Default build targets. # diff --git a/usr/src/uts/sun4v/platsvc/Makefile b/usr/src/uts/sun4v/platsvc/Makefile index 52017c9a20..b66ad32420 100644 --- a/usr/src/uts/sun4v/platsvc/Makefile +++ b/usr/src/uts/sun4v/platsvc/Makefile @@ -56,6 +56,7 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized # # Turn on doubleword alignment for 64 bit registers diff --git a/usr/src/uts/sun4v/px/Makefile b/usr/src/uts/sun4v/px/Makefile index 30b67978db..839ed8709e 100644 --- a/usr/src/uts/sun4v/px/Makefile +++ b/usr/src/uts/sun4v/px/Makefile @@ -85,6 +85,14 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-label + # Dependency # LDFLAGS += -dy -Nmisc/pcie diff --git a/usr/src/uts/sun4v/qcn/Makefile b/usr/src/uts/sun4v/qcn/Makefile index 5545676079..3369e146a5 100644 --- a/usr/src/uts/sun4v/qcn/Makefile +++ b/usr/src/uts/sun4v/qcn/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the qcn driver kernel module. # @@ -66,6 +66,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function # # For now, disable these lint checks; maintainers should endeavor diff --git a/usr/src/uts/sun4v/rootnex/Makefile b/usr/src/uts/sun4v/rootnex/Makefile index 8ad68ff2e5..bf26875fc0 100644 --- a/usr/src/uts/sun4v/rootnex/Makefile +++ b/usr/src/uts/sun4v/rootnex/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the rootnex driver # @@ -66,7 +66,11 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # # lint pass one enforcement # -CFLAGS += $(CCVERBOSE) +CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-switch +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized # # For now, disable these lint checks; maintainers should endeavor diff --git a/usr/src/uts/sun4v/su/Makefile b/usr/src/uts/sun4v/su/Makefile index 5f61749b32..52719a7dab 100644 --- a/usr/src/uts/sun4v/su/Makefile +++ b/usr/src/uts/sun4v/su/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the sun4v "su" driver module. # @@ -69,6 +69,9 @@ LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sun4v/unix/Makefile b/usr/src/uts/sun4v/unix/Makefile index 6b3c685636..216a236f0f 100644 --- a/usr/src/uts/sun4v/unix/Makefile +++ b/usr/src/uts/sun4v/unix/Makefile @@ -23,8 +23,6 @@ # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" -# # # This makefile drives the production of /unix (and unix.o). @@ -121,6 +119,18 @@ LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-char-subscripts +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-empty-body +CERRWARN += -_gcc=-Wno-unused-value +CERRWARN += -_gcc=-Wno-switch + # # Default build targets. # diff --git a/usr/src/uts/sun4v/vcc/Makefile b/usr/src/uts/sun4v/vcc/Makefile index 30d5dc0b22..8100d00ebf 100644 --- a/usr/src/uts/sun4v/vcc/Makefile +++ b/usr/src/uts/sun4v/vcc/Makefile @@ -25,7 +25,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -# ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the vcc driver kernel module. # @@ -68,6 +68,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-uninitialized # # compiler failes with not reached statements diff --git a/usr/src/uts/sun4v/vdc/Makefile b/usr/src/uts/sun4v/vdc/Makefile index fc304909c5..da180435e0 100644 --- a/usr/src/uts/sun4v/vdc/Makefile +++ b/usr/src/uts/sun4v/vdc/Makefile @@ -65,6 +65,9 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) CFLAGS += $(CCVERBOSE) CFLAGS += -D_EXTVTOC +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + LDFLAGS += -dy -Nmisc/ldc -Nmisc/platsvc -Nmisc/scsi # diff --git a/usr/src/uts/sun4v/vds/Makefile b/usr/src/uts/sun4v/vds/Makefile index 83b1487289..80e5028a06 100644 --- a/usr/src/uts/sun4v/vds/Makefile +++ b/usr/src/uts/sun4v/vds/Makefile @@ -65,6 +65,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) CFLAGS += $(CCVERBOSE) CFLAGS += -D_EXTVTOC +CERRWARN += -_gcc=-Wno-uninitialized + # # module dependencies # diff --git a/usr/src/uts/sun4v/vis/Makefile b/usr/src/uts/sun4v/vis/Makefile index 029631a4c8..f7f1f09cb7 100644 --- a/usr/src/uts/sun4v/vis/Makefile +++ b/usr/src/uts/sun4v/vis/Makefile @@ -24,7 +24,7 @@ # Copyright 2005 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # This makefile drives the production of the vis kernel module # @@ -61,6 +61,7 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # lint pass one enforcement # CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-uninitialized .KEEP_STATE: diff --git a/usr/src/uts/sun4v/vlds/Makefile b/usr/src/uts/sun4v/vlds/Makefile index 6c10e8c9ea..7ef22bfc35 100644 --- a/usr/src/uts/sun4v/vlds/Makefile +++ b/usr/src/uts/sun4v/vlds/Makefile @@ -64,7 +64,8 @@ INSTALL_TARGET = $(BINARY) $(ROOTMODULE) # # lint pass one enforcement # -CFLAGS += -v +CFLAGS += $(CCVERBOSE) +CERRWARN += -_gcc=-Wno-parentheses # # Module Dependencies diff --git a/usr/src/uts/sun4v/vnet/Makefile b/usr/src/uts/sun4v/vnet/Makefile index 76cecf903a..a24d4790b6 100644 --- a/usr/src/uts/sun4v/vnet/Makefile +++ b/usr/src/uts/sun4v/vnet/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # uts/sun4v/vnet/Makefile # @@ -86,6 +86,14 @@ LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-uninitialized + # # Default build targets. # diff --git a/usr/src/uts/sun4v/vsw/Makefile b/usr/src/uts/sun4v/vsw/Makefile index cce4cf6c1e..6e093ce7f0 100644 --- a/usr/src/uts/sun4v/vsw/Makefile +++ b/usr/src/uts/sun4v/vsw/Makefile @@ -23,7 +23,7 @@ # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # -#ident "%Z%%M% %I% %E% SMI" + # # uts/sun4v/vsw/Makefile # @@ -96,6 +96,13 @@ LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV LINTTAGS += -erroff=E_STATIC_UNUSED LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON +CERRWARN += -_gcc=-Wno-type-limits +CERRWARN += -_gcc=-Wno-clobbered +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-label + # # Default build targets. # |