Print this page
10816 ctf_dwarf_convert_type() relies on un-initialized id
10817 ctfconvert -i option is mis-handled
10818 Improve ctfconvert error messages
10819 ctfconvert should handle empty dies
10820 ctfconvert -i never converts
10821 bad free in ctf_dwarf_init_die
10815 shouldn't build gcore.c as part of kmdb
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/mdb/Makefile.module
+++ new/usr/src/cmd/mdb/Makefile.module
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 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 23 # Use is subject to license terms.
24 24 #
25 25 # Copyright (c) 2013 by Delphix. All rights reserved.
26 -# Copyright (c) 2018, Joyent, Inc.
27 26 # Copyright (c) 2019 Carlos Neira <cneirabustos@gmail.com>
28 27 # Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
28 +# Copyright (c) 2019, Joyent, Inc.
29 29 #
30 30
31 31 .KEEP_STATE:
32 32 .SUFFIXES:
33 33
34 34 include $(SRC)/cmd/mdb/Makefile.tools
35 35
36 36 #
37 37 # Make sure we're getting a consistent execution environment for the
38 38 # embedded scripts.
39 39 #
40 40 SHELL= /usr/bin/ksh93
41 41
42 42 $(KMOD_SOURCES_DIFFERENT)KMODSRCS = $(MODSRCS)
43 43 $(KMOD_SOURCES_DIFFERENT)KMODASMSRCS = $(MODASMSRCS)
44 44
45 45 MODOBJS = $(MODSRCS:%.c=dmod/%.o) $(MODASMSRCS:%.s=dmod/%.o)
46 46 KMODOBJS = $(KMODSRCS:%.c=kmod/%.o) $(KMODASMSRCS:%.s=kmod/%.o)
47 47
48 48 MODNAME_cmd = if [ -n "$(MODULE_NAME)" ]; then print $(MODULE_NAME); else print $(MODULE)| sed -e 's:\.so$$::'; fi
49 49 MODNAME = $(MODNAME_cmd:sh)
50 50 KMODULE = $(MODNAME)
51 51
52 52 MODFILE = dmod/$(MODULE)
53 53 KMODFILE = kmod/$(KMODULE)
54 54
55 55 #
56 56 # The mess below is designed to pick the right set of objects to build and/or
57 57 # lint. We have three flavors:
58 58 #
59 59 # 1. proc and raw modules. Only $(MODOBJS) are built.
60 60 # 2. kvm modules for systems without kmdb. Only $(MODOBJS) are built.
61 61 # 3. kvm modules for systems with kmdb. $(MODOBJS) and $(KMODOBJS) are built.
62 62 #
63 63 # Complicating matters, we'd like to make the distinction between 2 and 3 before
64 64 # this Makefile is loaded. By default, we'll assume that all kvm modules should
65 65 # be built for kmdb. If, however, the user sets $(MODULE_BUILD_TYPE) to `mdb',
66 66 # the kmdb variant of the module won't be built.
67 67 #
68 68
69 69 # Which flavors are to be built?
70 70 TARGETS_kvm_type_ = both # Build both if $(MODULE_BUILD_TYPE) is unset
71 71 TARGETS_kvm_type_kmdb = both
72 72 TARGETS_kvm_type_mdb = mdb
73 73 TARGETS_kvm_type = $(TARGETS_kvm_type_$(MODULE_BUILD_TYPE))
74 74
75 75 # What should we build?
76 76 TARGETS_kvm_kmdb = $(KMODFILE)
77 77 TARGETS_kvm_mdb = $(MODFILE)
78 78 TARGETS_kvm_both = $(TARGETS_kvm_mdb) $(TARGETS_kvm_kmdb)
79 79 TARGETS_kvm = $(TARGETS_kvm_$(TARGETS_kvm_type))
80 80 TARGETS_proc = $(MODFILE)
81 81 TARGETS_raw = $(MODFILE)
82 82 TARGETS = $(TARGETS_$(MDBTGT))
83 83
84 84 # Where should we install that which we've built?
85 85 ROOTTGTS_kvm_type = $(TARGETS_kvm_type) # overridden by mdb_ks
86 86 ROOTTGTS_kvm_kmdb = $(ROOTKMOD)/$(KMODULE)
87 87 ROOTTGTS_kvm_mdb = $(ROOTMOD)/$(MODULE)
88 88 ROOTTGTS_kvm_both = $(ROOTTGTS_kvm_mdb) $(ROOTTGTS_kvm_kmdb)
89 89 ROOTTGTS_kvm = $(ROOTTGTS_kvm_$(ROOTTGTS_kvm_type))
90 90 ROOTTGTS_proc = $(ROOTMOD)/$(MODULE)
91 91 ROOTTGTS_raw = $(ROOTMOD)/$(MODULE)
92 92 ROOTTGTS = $(ROOTTGTS_$(MDBTGT))
93 93
94 94 # What should we lint?
95 95 KLINTOBJS = $(KMODOBJS:%.o=%.ln)
96 96 LINTOBJS = $(MODOBJS:%.o=%.ln)
97 97
98 98 LINTFILES_kvm_type = $(TARGETS_kvm_type)
99 99 LINTFILES_kvm_both = $(KLINTOBJS) $(LINTOBJS)
100 100 LINTFILES_kvm_mdb = $(LINTOBJS)
101 101 LINTFILES_kvm = $(LINTFILES_kvm_$(LINTFILES_kvm_type))
102 102 LINTFILES_proc = $(LINTOBJS)
103 103 LINTFILES_raw = $(LINTOBJS)
104 104 LINTFILES = $(LINTFILES_$(MDBTGT))
105 105
106 106 #
107 107 # Python specific flags. To try and make life easier for folks how are
108 108 # building with an LFS python, we attempt to use -isystem when it's
109 109 # available.
110 110 #
111 111 PYCPPFLAGS = -_gcc=-isystem -_gcc=$(ADJUNCT_PROTO)/usr/include/python$(PYTHON_VERSION)
112 112 PYCPPFLAGS += -_cc=-I$(ADJUNCT_PROTO)/usr/include/python$(PYTHON_VERSION)
113 113 PYLNFLAGS = -I$(ADJUNCT_PROTO)/usr/include/python$(PYTHON_VERSION)
114 114
115 115 kvm_TGTFLAGS = -D_KERNEL
116 116 proc_TGTFLAGS = -D_USER
117 117
118 118 CSTD = $(CSTD_GNU99)
119 119
120 120 CFLAGS += $(CCVERBOSE)
121 121 CFLAGS64 += $(CCVERBOSE)
122 122 CPPFLAGS += $($(MDBTGT)_TGTFLAGS) -I../../../common
123 123 LDFLAGS += $(ZTEXT)
124 124 LDFLAGS64 += $(ZTEXT)
125 125 ASFLAGS += -P
126 126 AS_CPPFLAGS += -D_ASM
127 127
128 128 SMOFF += all_func_returns,index_overflow
129 129
130 130 # Module type-specific compiler flags
131 131 $(MODOBJS) := CFLAGS += $(C_BIGPICFLAGS) $(XREGSFLAG)
132 132 $(MODOBJS) := CFLAGS64 += $(C_BIGPICFLAGS) $(XREGSFLAG)
133 133 $(KMODOBJS) $(KLINTOBJS) := CPPFLAGS += -D_KMDB
134 134 $(KMODOBJS) := V9CODESIZE = $(CCABS32)
135 135 $(KMODOBJS) := DTS_ERRNO =
136 136
137 137 # Modules aren't allowed to export symbols
138 138 MAPFILE = $(SRC)/cmd/mdb/common/modules/conf/mapfile
139 139
140 140 # Modules typically make external references. To provide for -zdefs use
141 141 # and clean ldd(1) processing, explicitly define all external references.
142 142 MAPFILE-EXT = $(SRC)/cmd/mdb/common/modules/conf/mapfile-extern
143 143
144 144 #
145 145 # kmdb is a kernel module, so we'll use the kernel's build flags.
146 146 $(KMODOBJS) := CFLAGS64 += $(STAND_FLAGS_64)
147 147
148 148 #
149 149 # Override this to pull source files from another directory
150 150 #
151 151 MODSRCS_DIR = ../../../common/modules/genunix
152 152
153 153 all: $$(TARGETS)
154 154
155 155 install: all $$(ROOTTGTS)
156 156
157 157 dmods: install
158 158
159 159 clean.lint:
160 160 $(RM) $(LINTFILES) $(MODSRCS:.c=.ln)
161 161
162 162 clean:
163 163 $(RM) $(MODOBJS) $(KMODOBJS) $(CLEANFILES)
164 164
165 165 clobber: clean clean.lint
166 166 $(RM) $(MODFILE) $(KMODFILE) $(CLOBBERFILES)
167 167
168 168 lint: $$(LINTFILES)
169 169
170 170 .NO_PARALLEL:
171 171 .PARALLEL: $(MODOBJS) $(KMODOBJS) mdb_tgt kmdb_tgt dmod kmod \
172 172 $(TARGETS) $(LINTFILES)
173 173
174 174 $(MODFILE): dmod .WAIT $(MODOBJS) $$(MAPFILE-EXT)
175 175 $(LINK.c) $(ZDEFS) $(ZIGNORE) $(MAPFILE-EXT:%=-M%) $(GSHARED) \
176 176 $(MODOBJS) -o $@ $(LDLIBS) -lc -lproc
177 177 $(CTFMERGE) -L VERSION -o $@ $(MODOBJS)
178 178 $(POST_PROCESS_SO)
179 179
180 180 #
181 181 # kmdb dmods must *not* stray from the module API. To ensure that they don't,
182 182 # we try to link them, at build time, against an object that exports the symbols
183 183 # that they can legally use. The link test object is, however, only built when
184 184 # kmdb itself is built. Requiring module developers to build kmdb first would
185 185 # be painful, so by default, module-level builds don't do the link test (the
186 186 # $(POUND_SIGN) assignment below takes care of that). Builds of the entire
187 187 # tree can, however, guarantee the construction of kmdb first, and as such can
188 188 # override the setting of $(KMDB_LINKTEST_ENABLE). This override causes the
189 189 # link test to be run.
190 190 #
191 191 # Developers wanting to force a link test for a single module can use the
192 192 # `linktest' target from within a module directory.
193 193 #
194 194 LINKTESTOBJ = $(KMDBDIR)/kmdb_modlinktest.o
195 195
196 196 KMDB_LINKTEST = \
197 197 $(LD) $(ZDEFS) -dy -r -o $@.linktest $(KMODOBJS) \
198 198 $(STANDOBJS) $(LINKTESTOBJ) && \
199 199 $(RM) $@.linktest
200 200
201 201 KMDB_LINKTEST_ENABLE=$(POUND_SIGN)
202 202 $(KMDB_LINKTEST_ENABLE)KMDB_LINKTEST_CMD = $(KMDB_LINKTEST)
203 203
204 204 #
205 205 # Ensure that dmods don't use floating point
206 206 #
207 207 KMDB_FPTEST_CMD = $(KMDB_FPTEST)
208 208
209 209 $(KMODFILE): kmod .WAIT $(KMODOBJS) $(MAPFILE)
210 210 $(LD) -dy -r $(MAPFILE:%=-M%) -Nmisc/kmdbmod -o $@ $(KMODOBJS) \
211 211 $(STANDOBJS)
212 212 $(KMDB_LINKTEST_CMD)
213 213 $(KMDB_FPTEST_CMD)
214 214 $(CTFMERGE) -f -L VERSION -o $@ $(KMODOBJS)
215 215 $(POST_PROCESS)
216 216 $(SETDYNFLAG) -f DF_1_NOKSYMS $@
217 217
218 218 linktest: linktest_check .WAIT kmod .WAIT $(KMODOBJS)
219 219 $(KMDB_LINKTEST)
220 220
221 221 linktest_check:
222 222 @if [ "$(MDBTGT)" != "kvm" ] ; then \
223 223 echo "ERROR: linktest is not supported non-kvm/disasm dmods" \
224 224 >&2 ; \
225 225 exit 1 ; \
226 226 fi
↓ open down ↓ |
188 lines elided |
↑ open up ↑ |
227 227
228 228 #
229 229 # Dynamic rules for object construction
230 230 #
231 231 dmod/%.o kmod/%.o: %.c
232 232 $(COMPILE.c) -o $@ $<
233 233 $(CTFCONVERT_O)
234 234
235 235 dmod/%.o kmod%.o: %.s
236 236 $(COMPILE.s) -o $@ $<
237 - $(CTFCONVERT_O)
238 237
239 238 dmod/%.o kmod/%.o: ../%.c
240 239 $(COMPILE.c) -o $@ $<
241 240 $(CTFCONVERT_O)
242 241
243 242 dmod/%.o kmod%.o: ../%.s
244 243 $(COMPILE.s) -o $@ $<
245 - $(CTFCONVERT_O)
246 244
247 245 dmod/%.o kmod/%.o: ../../../common/modules/$(MODNAME)/%.c
248 246 $(COMPILE.c) -o $@ $<
249 247 $(CTFCONVERT_O)
250 248
251 249 dmod/%.o kmod%.o: ../../../common/modules/$(MODNAME)/%.s
252 250 $(COMPILE.s) -o $@ $<
253 - $(CTFCONVERT_O)
254 251
255 252 dmod/%.o kmod/%.o: $$(MODSRCS_DIR)/%.c
256 253 $(COMPILE.c) -o $@ $<
257 254 $(CTFCONVERT_O)
258 255
259 256 dmod/%.o kmod%.o: $$(MODSRCS_DIR)/%.s
260 257 $(COMPILE.s) -o $@ $<
261 - $(CTFCONVERT_O)
262 258
263 259 #
264 260 # Lint
265 261 #
266 262 dmod/%.ln kmod/%.ln: %.c
267 263 $(LINT.c) -dirout=$(@D) -c $<
268 264
269 265 dmod/%.ln kmod/%.ln: %.s
270 266 $(LINT.s) -dirout=$(@D) -c $<
271 267
272 268 dmod/%.ln kmod/%.ln: ../%.c
273 269 $(LINT.c) -dirout=$(@D) -c $<
274 270
275 271 dmod/%.ln kmod/%.ln: ../%.s
276 272 $(LINT.s) -dirout=$(@D) -c $<
277 273
278 274 dmod/%.ln kmod/%.ln: ../../../common/modules/$(MODNAME)/%.c
279 275 $(LINT.c) -dirout=$(@D) -c $<
280 276
281 277 dmod/%.ln kmod/%.ln: ../../../common/modules/$(MODNAME)/%.s
282 278 $(LINT.s) -dirout=$(@D) -c $<
283 279
284 280 dmod/%.ln kmod/%.ln: $$(MODSRCS_DIR)/%.c
285 281 $(LINT.c) -dirout=$(@D) -c $<
286 282
287 283 dmod/%.ln kmod/%.ln: $$(MODSRCS_DIR)/%.s
288 284 $(LINT.s) -dirout=$(@D) -c $<
289 285
290 286 #
291 287 # Installation targets
292 288 #
293 289
294 290 $(ROOT)/usr/lib/mdb/$(MDBTGT): $(ROOT)/usr/lib/mdb
295 291 $(INS.dir)
296 292
297 293 $(ROOT)/usr/lib/mdb:
298 294 $(INS.dir)
299 295
300 296 $(ROOT)/kernel/kmdb:
301 297 $(INS.dir)
302 298
303 299 $(ROOTMOD)/$(MODULE): $(ROOTMOD)
304 300
305 301 $(ROOTKMOD)/$(KMODULE): $(ROOTKMOD)
306 302
307 303 kmod dmod:
308 304 -@mkdir -p $@
↓ open down ↓ |
37 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX