Print this page
10077 usr/src/uts/ Makefile changes for smatch
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/intel/genunix/Makefile
+++ new/usr/src/uts/intel/genunix/Makefile
1 1 #
2 2 # CDDL HEADER START
3 3 #
4 4 # The contents of this file are subject to the terms of the
5 5 # Common Development and Distribution License (the "License").
6 6 # You may not use this file except in compliance with the License.
7 7 #
8 8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 # or http://www.opensolaris.org/os/licensing.
10 10 # See the License for the specific language governing permissions
11 11 # and limitations under the License.
12 12 #
13 13 # When distributing Covered Code, include this CDDL HEADER in each
14 14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 # If applicable, add the following below this CDDL HEADER, with the
↓ open down ↓ |
15 lines elided |
↑ open up ↑ |
16 16 # fields enclosed by brackets "[]" replaced with your own identifying
17 17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 18 #
19 19 # CDDL HEADER END
20 20 #
21 21
22 22 #
23 23 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 24 # Use is subject to license terms.
25 25 #
26 +# Copyright (c) 2018, Joyent, Inc.
26 27
27 28 #
28 29 # This makefile drives the production of the generic
29 30 # unix kernel module.
30 31 #
31 32 # x86 implementation architecture dependent
32 33 #
33 34
34 35 #
35 36 # Path to the base of the uts directory tree (usually /usr/src/uts).
36 37 #
37 38 UTSBASE = ../..
38 39
39 40 #
40 41 # Define the module and object file sets.
41 42 #
42 43 MODULE = genunix
43 44 GENUNIX = $(OBJS_DIR)/$(MODULE)
44 45
45 46 OBJECTS = $(GENUNIX_OBJS:%=$(OBJS_DIR)/%) \
46 47 $(NOT_YET_KMODS:%=$(OBJS_DIR)/%)
47 48
48 49 LINTS = $(GENUNIX_OBJS:%.o=$(LINTS_DIR)/%.ln) \
49 50 $(NOT_YET_KMODS:%.o=$(LINTS_DIR)/%.ln)
50 51
51 52 ROOTMODULE = $(ROOT_KERN_DIR)/$(MODULE)
52 53
53 54 LIBGEN = $(OBJS_DIR)/libgenunix.so
54 55 LIBSTUBS = $(GENSTUBS_OBJS:%=$(OBJS_DIR)/%)
55 56
56 57 #
57 58 # Include common rules.
58 59 #
59 60 include $(UTSBASE)/intel/Makefile.intel
60 61
61 62 #
62 63 # Define targets
63 64 #
64 65 ALL_TARGET = $(LIBGEN) $(GENUNIX)
65 66 LINT_TARGET = $(MODULE).lint
66 67 INSTALL_TARGET = $(LIBGEN) $(GENUNIX) $(ROOTMODULE)
67 68
68 69 #
69 70 # Overrides
70 71 #
71 72 CLOBBERFILES += $(GENUNIX)
72 73 CLEANFILES += $(LIBSTUBS) $(LIBGEN)
73 74 BINARY =
74 75
75 76 #
76 77 # Non-patch genunix builds merge a version of the ip module called ipctf. This
77 78 # is to ensure that the common network-related types are included in genunix and
78 79 # can thus be uniquified out of other modules. We don't want to do this for
79 80 # patch builds, since we can't guarantee that ip and genunix will be in the same
80 81 # patch.
81 82 #
82 83 IPCTF_TARGET = $(IPCTF)
83 84 $(PATCH_BUILD)IPCTF_TARGET =
84 85
85 86 CPPFLAGS += -I$(SRC)/common
86 87 CPPFLAGS += -I$(SRC)/uts/common/fs/zfs
87 88
88 89 CPPFLAGS += -I$(UTSBASE)/i86pc
89 90
90 91 #
91 92 # For now, disable these lint checks; maintainers should endeavor
92 93 # to investigate and remove these for maximum lint coverage.
93 94 # Please do not carry these forward to new Makefiles.
94 95 #
95 96 LINTTAGS += -erroff=E_SUSPICIOUS_COMPARISON
96 97 LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN
97 98 LINTTAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
98 99 LINTTAGS += -erroff=E_STATIC_UNUSED
99 100 LINTTAGS += -erroff=E_PTRDIFF_OVERFLOW
100 101 LINTTAGS += -erroff=E_ASSIGN_NARROW_CONV
101 102
102 103 CERRWARN += -_gcc=-Wno-unused-label
↓ open down ↓ |
67 lines elided |
↑ open up ↑ |
103 104 CERRWARN += -_gcc=-Wno-unused-variable
104 105 CERRWARN += -_gcc=-Wno-unused-value
105 106 CERRWARN += -_gcc=-Wno-unused-function
106 107 CERRWARN += -_gcc=-Wno-parentheses
107 108 CERRWARN += -_gcc=-Wno-switch
108 109 CERRWARN += -_gcc=-Wno-type-limits
109 110 CERRWARN += -_gcc=-Wno-uninitialized
110 111 CERRWARN += -_gcc=-Wno-clobbered
111 112 CERRWARN += -_gcc=-Wno-empty-body
112 113
114 +# false positives
115 +SMOFF += index_overflow
116 +$(OBJS_DIR)/seg_vn.o := SMOFF += deref_check
117 +$(OBJS_DIR)/ddi_intr_irm.o := SMOFF += deref_check
118 +
119 +# need work still
120 +SMOFF += signed,indenting,all_func_returns
121 +$(OBJS_DIR)/clock_highres.o := SMOFF += signed_integer_overflow_check
122 +$(OBJS_DIR)/evchannels.o := SMOFF += allocating_enough_data
123 +$(OBJS_DIR)/klpd.o := SMOFF += cast_assign
124 +$(OBJS_DIR)/lookup.o := SMOFF += strcpy_overflow
125 +$(OBJS_DIR)/process.o := SMOFF += or_vs_and
126 +$(OBJS_DIR)/sunpci.o := SMOFF += deref_check
127 +$(OBJS_DIR)/timers.o := SMOFF += signed_integer_overflow_check
128 +
129 +# definitely wrong
130 +$(OBJS_DIR)/acl_common.o := SMOFF += or_vs_and
131 +
113 132 #
114 133 # Ensure that lint sees 'struct cpu' containing a fully declared
115 134 # embedded 'struct machcpu'
116 135 #
117 136 LINTFLAGS += -D_MACHDEP -I../../i86pc
118 137
119 138 #
120 139 # Default build targets.
121 140 #
122 141 .KEEP_STATE:
123 142
124 143 def: $(DEF_DEPS)
125 144
126 145 all: $(ALL_DEPS)
127 146
128 147 clean: $(CLEAN_DEPS)
129 148
130 149 clobber: $(CLOBBER_DEPS)
131 150
132 151 lint: $(LINT_DEPS)
133 152
134 153 modlintlib: $(MODLINTLIB_DEPS)
135 154
136 155 clean.lint: $(CLEAN_LINT_DEPS)
137 156
138 157 install: $(INSTALL_DEPS)
139 158
140 159 $(LIBGEN): $(GENUNIX) $(LIBSTUBS)
141 160 $(BUILD.SO) $(GENUNIX) $(LIBSTUBS)
142 161
143 162 $(IPCTF_TARGET) ipctf_target: FRC
144 163 @cd $(IPDRV_DIR); pwd; $(MAKE) ipctf.$(OBJS_DIR)
145 164 @pwd
146 165
147 166 $(GENUNIX): $(IPCTF_TARGET) $(OBJECTS)
148 167 $(LD) -r $(LDFLAGS) -o $@ $(OBJECTS)
149 168 $(CTFMERGE_GENUNIX_MERGE)
150 169 $(POST_PROCESS)
151 170
152 171 #
153 172 # Include common targets.
154 173 #
155 174 include $(UTSBASE)/intel/Makefile.targ
156 175
157 176 #
158 177 # Software workarounds for hardware "features".
159 178 #
160 179 include $(UTSBASE)/i86pc/Makefile.workarounds
161 180
162 181 ALL_DEFS += $(WORKAROUND_DEFS)
163 182
164 183 #
165 184 # Override.
166 185 #
167 186 $(MODULE).lint := GEN_LINT_LIB =
↓ open down ↓ |
45 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX