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/Makefile.master
+++ new/usr/src/Makefile.master
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
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 (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
24 24 # Copyright (c) 2012 by Delphix. All rights reserved.
25 25 # Copyright 2014 Garrett D'Amore <garrett@damore.org>
26 26 # Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
27 27 # Copyright 2015 Gary Mills
28 28 # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
29 29 # Copyright 2016 Toomas Soome <tsoome@me.com>
30 30 # Copyright 2018 OmniOS Community Edition (OmniOSce) Association.
31 31 # Copyright (c) 2019, Joyent, Inc.
32 32 #
33 33
34 34 #
35 35 # Makefile.master, global definitions for system source
36 36 #
37 37 ROOT= /proto
38 38
39 39 #
40 40 # Adjunct root, containing an additional proto area to be used for headers
41 41 # and libraries.
42 42 #
43 43 ADJUNCT_PROTO=
44 44
45 45 #
46 46 # Adjunct for building things that run on the build machine.
47 47 #
48 48 NATIVE_ADJUNCT= /usr
49 49
50 50 #
51 51 # RELEASE_BUILD should be cleared for final release builds.
52 52 # NOT_RELEASE_BUILD is exactly what the name implies.
53 53 #
54 54 # __GNUC toggles the building of ON components using gcc and related tools.
55 55 # Normally set to `#', set it to `' to do gcc build.
56 56 #
57 57 # The declaration POUND_SIGN is always '#'. This is needed to get around the
58 58 # make feature that '#' is always a comment delimiter, even when escaped or
59 59 # quoted. We use this macro expansion method to get POUND_SIGN rather than
60 60 # always breaking out a shell because the general case can cause a noticable
61 61 # slowdown in build times when so many Makefiles include Makefile.master.
62 62 #
63 63 # While the majority of users are expected to override the setting below
64 64 # with an env file (via nightly or bldenv), if you aren't building that way
65 65 # (ie, you're using "ws" or some other bootstrapping method) then you need
66 66 # this definition in order to avoid the subshell invocation mentioned above.
67 67 #
68 68
69 69 PRE_POUND= pre\#
70 70 POUND_SIGN= $(PRE_POUND:pre\%=%)
71 71
72 72 NOT_RELEASE_BUILD=
73 73 RELEASE_BUILD= $(POUND_SIGN)
74 74 $(RELEASE_BUILD)NOT_RELEASE_BUILD= $(POUND_SIGN)
75 75 PATCH_BUILD= $(POUND_SIGN)
76 76
77 77 # SPARC_BLD is '#' for an Intel build.
78 78 # INTEL_BLD is '#' for a Sparc build.
79 79 SPARC_BLD_1= $(MACH:i386=$(POUND_SIGN))
80 80 SPARC_BLD= $(SPARC_BLD_1:sparc=)
81 81 INTEL_BLD_1= $(MACH:sparc=$(POUND_SIGN))
82 82 INTEL_BLD= $(INTEL_BLD_1:i386=)
83 83
84 84 # The variables below control the compilers used during the build.
85 85 # There are a number of permutations.
86 86 #
87 87 # __GNUC and __SUNC control (and indicate) the primary compiler. Whichever
88 88 # one is not POUND_SIGN is the primary, with the other as the shadow. They
89 89 # may also be used to control entirely compiler-specific Makefile assignments.
90 90 # __GNUC and GCC are the default.
91 91 #
92 92 # __GNUC64 indicates that the 64bit build should use the GNU C compiler.
93 93 # There is no Sun C analogue.
94 94 #
95 95 # The following version-specific options are operative regardless of which
96 96 # compiler is primary, and control the versions of the given compilers to be
97 97 # used. They also allow compiler-version specific Makefile fragments.
98 98 #
99 99
100 100 __SUNC= $(POUND_SIGN)
101 101 $(__SUNC)__GNUC= $(POUND_SIGN)
102 102 __GNUC64= $(__GNUC)
103 103
104 104 # Allow build-time "configuration" to enable or disable some things.
105 105 # The default is POUND_SIGN, meaning "not enabled". If the environment
106 106 # passes in an override like ENABLE_SMB_PRINTING= (empty) that will
107 107 # uncomment things in the lower Makefiles to enable the feature.
108 108 ENABLE_SMB_PRINTING= $(POUND_SIGN)
109 109
110 110 # CLOSED is the root of the tree that contains source which isn't released
111 111 # as open source
112 112 CLOSED= $(SRC)/../closed
113 113
114 114 # BUILD_TOOLS is the root of all tools including compilers.
115 115 # ONBLD_TOOLS is the root of all the tools that are part of SUNWonbld.
116 116
117 117 BUILD_TOOLS= /ws/onnv-tools
118 118 ONBLD_TOOLS= $(BUILD_TOOLS)/onbld
119 119
120 120 # define runtime JAVA_HOME, primarily for cmd/pools/poold
121 121 JAVA_HOME= /usr/java
122 122 # define buildtime JAVA_ROOT
123 123 JAVA_ROOT= /usr/java
124 124 # Build uses java7 by default. Pass one the variables below set to empty
125 125 # string in the environment to override.
126 126 BLD_JAVA_6= $(POUND_SIGN)
127 127 BLD_JAVA_8= $(POUND_SIGN)
128 128
129 129 GNUC_ROOT= /opt/gcc/4.4.4
130 130 GCCLIBDIR= $(GNUC_ROOT)/lib
131 131 GCCLIBDIR64= $(GNUC_ROOT)/lib/$(MACH64)
132 132
133 133 DOCBOOK_XSL_ROOT= /usr/share/sgml/docbook/xsl-stylesheets
134 134
135 135 RPCGEN= /usr/bin/rpcgen
136 136 STABS= $(ONBLD_TOOLS)/bin/$(MACH)/stabs
137 137 ELFEXTRACT= $(ONBLD_TOOLS)/bin/$(MACH)/elfextract
138 138 MBH_PATCH= $(ONBLD_TOOLS)/bin/$(MACH)/mbh_patch
139 139 BTXLD= $(ONBLD_TOOLS)/bin/$(MACH)/btxld
140 140 VTFONTCVT= $(ONBLD_TOOLS)/bin/$(MACH)/vtfontcvt
141 141 # echo(1) and true(1) are specified without absolute paths, so that the shell
142 142 # spawned by make(1) may use the built-in versions. This is minimally
143 143 # problematic, as the shell spawned by make(1) is known and under control, the
144 144 # only risk being if the shell falls back to $PATH.
145 145 #
146 146 # We specifically want an echo(1) that does interpolation of escape sequences,
147 147 # which ksh93, /bin/sh, and bash will all provide.
148 148 ECHO= echo
149 149 TRUE= true
150 150 INS= $(ONBLD_TOOLS)/bin/$(MACH)/install
151 151 SYMLINK= /usr/bin/ln -s
152 152 LN= /usr/bin/ln
153 153 MKDIR= /usr/bin/mkdir
154 154 CHMOD= /usr/bin/chmod
155 155 MV= /usr/bin/mv -f
156 156 RM= /usr/bin/rm -f
157 157 CUT= /usr/bin/cut
158 158 NM= /usr/ccs/bin/nm
159 159 DIFF= /usr/bin/diff
160 160 GREP= /usr/bin/grep
161 161 EGREP= /usr/bin/egrep
162 162 ELFWRAP= /usr/bin/elfwrap
163 163 KSH93= /usr/bin/ksh93
164 164 SED= /usr/bin/sed
165 165 AWK= /usr/bin/nawk
166 166 CP= /usr/bin/cp -f
167 167 MCS= /usr/ccs/bin/mcs
168 168 CAT= /usr/bin/cat
169 169 ELFDUMP= /usr/ccs/bin/elfdump
170 170 M4= /usr/bin/m4
171 171 GM4= /usr/bin/gm4
172 172 STRIP= /usr/ccs/bin/strip
173 173 LEX= /usr/ccs/bin/lex
174 174 FLEX= /usr/bin/flex
175 175 YACC= /usr/ccs/bin/yacc
176 176 BISON= /usr/bin/bison
177 177 CPP= /usr/lib/cpp
178 178 ANSI_CPP= $(GNUC_ROOT)/bin/cpp
179 179 JAVAC= $(JAVA_ROOT)/bin/javac
180 180 JAVAH= $(JAVA_ROOT)/bin/javah
181 181 JAVADOC= $(JAVA_ROOT)/bin/javadoc
182 182 RMIC= $(JAVA_ROOT)/bin/rmic
183 183 JAR= $(JAVA_ROOT)/bin/jar
184 184 CTFCONVERT= $(ONBLD_TOOLS)/bin/$(MACH)/ctfconvert
185 185 CTFDIFF= $(ONBLD_TOOLS)/bin/$(MACH)/ctfdiff
186 186 CTFMERGE= $(ONBLD_TOOLS)/bin/$(MACH)/ctfmerge
187 187 CTFSTABS= $(ONBLD_TOOLS)/bin/$(MACH)/ctfstabs
188 188 CTFSTRIP= $(ONBLD_TOOLS)/bin/$(MACH)/ctfstrip
189 189 NDRGEN= $(ONBLD_TOOLS)/bin/$(MACH)/ndrgen
190 190 GENOFFSETS= $(ONBLD_TOOLS)/bin/genoffsets
191 191 XREF= $(ONBLD_TOOLS)/bin/xref
192 192 FIND= /usr/bin/find
193 193 PERL= /usr/bin/perl
194 194 PERL_VERSION= 5.10.0
195 195 PERL_PKGVERS= -510
196 196 PERL_ARCH = i86pc-solaris-64int
197 197 $(SPARC_BLD)PERL_ARCH = sun4-solaris-64int
198 198 PYTHON_VERSION= 2.7
199 199 PYTHON_PKGVERS= -27
200 200 PYTHON_SUFFIX=
201 201 PYTHON= /usr/bin/python$(PYTHON_VERSION)
202 202 PYTHON3_VERSION= 3.5
203 203 PYTHON3_PKGVERS= -35
204 204 PYTHON3_SUFFIX= m
205 205 PYTHON3= /usr/bin/python$(PYTHON3_VERSION)
206 206 $(BUILDPY3TOOLS)TOOLS_PYTHON= $(PYTHON3)
207 207 $(BUILDPY2TOOLS)TOOLS_PYTHON= $(PYTHON)
208 208 SORT= /usr/bin/sort
209 209 TR= /usr/bin/tr
210 210 TOUCH= /usr/bin/touch
211 211 WC= /usr/bin/wc
212 212 XARGS= /usr/bin/xargs
213 213 ELFEDIT= /usr/bin/elfedit
214 214 DTRACE= /usr/sbin/dtrace -xnolibs
215 215 UNIQ= /usr/bin/uniq
216 216 TAR= /usr/bin/tar
217 217 ASTBINDIR= /usr/ast/bin
218 218 MSGCC= $(ASTBINDIR)/msgcc
219 219 MSGFMT= /usr/bin/msgfmt -s
220 220 LCDEF= $(ONBLD_TOOLS)/bin/$(MACH)/localedef
221 221 TIC= $(ONBLD_TOOLS)/bin/$(MACH)/tic
222 222 ZIC= $(ONBLD_TOOLS)/bin/$(MACH)/zic
223 223 OPENSSL= /usr/bin/openssl
224 224 CPCGEN= $(ONBLD_TOOLS)/bin/$(MACH)/cpcgen
225 225
226 226 FILEMODE= 644
227 227 DIRMODE= 755
228 228
229 229 # Declare that nothing should be built in parallel.
230 230 # Individual Makefiles can use the .PARALLEL target to declare otherwise.
231 231 .NO_PARALLEL:
232 232
233 233 # For stylistic checks
234 234 #
235 235 # Note that the X and C checks are not used at this time and may need
236 236 # modification when they are actually used.
237 237 #
238 238 CSTYLE= $(ONBLD_TOOLS)/bin/cstyle
239 239 CSTYLE_TAIL=
240 240 HDRCHK= $(ONBLD_TOOLS)/bin/hdrchk
241 241 HDRCHK_TAIL=
242 242 JSTYLE= $(ONBLD_TOOLS)/bin/jstyle
243 243
244 244 DOT_H_CHECK= \
245 245 @$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL); \
246 246 $(HDRCHK) $< $(HDRCHK_TAIL)
247 247
248 248 DOT_X_CHECK= \
249 249 @$(ECHO) "checking $<"; $(RPCGEN) -C -h $< | $(CSTYLE) $(CSTYLE_TAIL); \
250 250 $(RPCGEN) -C -h $< | $(HDRCHK) $< $(HDRCHK_TAIL)
251 251
252 252 DOT_C_CHECK= \
253 253 @$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL)
254 254
255 255 MANIFEST_CHECK= \
256 256 @$(ECHO) "checking $<"; \
257 257 SVCCFG_DTD=$(SRC)/cmd/svc/dtd/service_bundle.dtd.1 \
258 258 SVCCFG_REPOSITORY=$(SRC)/cmd/svc/seed/global.db \
259 259 SVCCFG_CONFIGD_PATH=$(SRC)/cmd/svc/configd/svc.configd-native \
260 260 $(SRC)/cmd/svc/svccfg/svccfg-native validate $<
261 261
262 262 INS.file= $(RM) $@; $(INS) -s -m $(FILEMODE) -f $(@D) $<
263 263 INS.dir= $(INS) -s -d -m $(DIRMODE) $@
264 264 # installs and renames at once
265 265 #
266 266 INS.rename= $(INS.file); $(MV) $(@D)/$(<F) $@
267 267
268 268 # install a link
269 269 INSLINKTARGET= $<
270 270 INS.link= $(RM) $@; $(LN) $(INSLINKTARGET) $@
271 271 INS.symlink= $(RM) $@; $(SYMLINK) $(INSLINKTARGET) $@
272 272
273 273 # The path to python that will be used for the shebang line when installing
274 274 # python scripts to the proto area. This is overridden by makefiles to
275 275 # select to the correct version.
276 276 PYSHEBANG= $(PYTHON)
277 277
278 278 #
279 279 # Python bakes the mtime of the .py file into the compiled .pyc and
280 280 # rebuilds if the baked-in mtime != the mtime of the source file
281 281 # (rather than only if it's less than), thus when installing python
282 282 # files we must make certain to not adjust the mtime of the source
283 283 # (.py) file.
284 284 #
285 285 INS.pyfile= $(RM) $@; $(SED) \
286 286 -e "1s:^\#!@PYTHON@:\#!$(PYSHEBANG):" \
287 287 -e "1s:^\#!@TOOLS_PYTHON@:\#!$(TOOLS_PYTHON):" \
288 288 < $< > $@; $(CHMOD) $(FILEMODE) $@; $(TOUCH) -r $< $@
289 289
290 290 # MACH must be set in the shell environment per uname -p on the build host
291 291 # More specific architecture variables should be set in lower makefiles.
292 292 #
293 293 # MACH64 is derived from MACH, and BUILD64 is set to `#' for
294 294 # architectures on which we do not build 64-bit versions.
295 295 # (There are no such architectures at the moment.)
296 296 #
297 297 # Set BUILD64=# in the environment to disable 64-bit amd64
298 298 # builds on i386 machines.
299 299
300 300 MACH64_1= $(MACH:sparc=sparcv9)
301 301 MACH64= $(MACH64_1:i386=amd64)
302 302
303 303 MACH32_1= $(MACH:sparc=sparcv7)
304 304 MACH32= $(MACH32_1:i386=i86)
305 305
306 306 sparc_BUILD64=
307 307 i386_BUILD64=
308 308 BUILD64= $($(MACH)_BUILD64)
309 309
310 310 #
311 311 # C compiler mode. Future compilers may change the default on us,
312 312 # so force extended ANSI mode globally. Lower level makefiles can
313 313 # override this by setting CCMODE.
314 314 #
315 315 CCMODE= -Xa
316 316 CCMODE64= -Xa
317 317
318 318 #
319 319 # C compiler verbose mode. This is so we can enable it globally,
320 320 # but turn it off in the lower level makefiles of things we cannot
321 321 # (or aren't going to) fix.
322 322 #
323 323 CCVERBOSE= -v
324 324
325 325 # set this to the secret flag "-Wc,-Qiselect-v9abiwarn=1" to get warnings
326 326 # from the compiler about places the -xarch=v9 may differ from -xarch=v9c.
327 327 V9ABIWARN=
328 328
329 329 # set this to the secret flag "-Wc,-Qiselect-regsym=0" to disable register
330 330 # symbols (used to detect conflicts between objects that use global registers)
331 331 # we disable this now for safety, and because genunix doesn't link with
332 332 # this feature (the v9 default) enabled.
333 333 #
334 334 # REGSYM is separate since the C++ driver syntax is different.
335 335 CCREGSYM= -Wc,-Qiselect-regsym=0
336 336 CCCREGSYM= -Qoption cg -Qiselect-regsym=0
337 337
338 338 # Prevent the removal of static symbols by the SPARC code generator (cg).
339 339 # The x86 code generator (ube) does not remove such symbols and as such
340 340 # using this workaround is not applicable for x86.
341 341 #
342 342 CCSTATICSYM= -Wc,-Qassembler-ounrefsym=0
343 343 #
344 344 # generate 32-bit addresses in the v9 kernel. Saves memory.
345 345 CCABS32= -Wc,-xcode=abs32
346 346 #
347 347 # generate v9 code which tolerates callers using the v7 ABI, for the sake of
348 348 # system calls.
349 349 CC32BITCALLERS= -_gcc=-massume-32bit-callers
350 350
351 351 # GCC, especially, is increasingly beginning to auto-inline functions and
352 352 # sadly does so separately not under the general -fno-inline-functions
353 353 # Additionally, we wish to prevent optimisations which cause GCC to clone
354 354 # functions -- in particular, these may cause unhelpful symbols to be
355 355 # emitted instead of function names
356 356 CCNOAUTOINLINE= \
357 357 -_gcc=-fno-inline-small-functions \
358 358 -_gcc=-fno-inline-functions-called-once \
359 359 -_gcc=-fno-ipa-cp \
360 360 -_gcc7=-fno-ipa-icf \
361 361 -_gcc8=-fno-ipa-icf \
362 362 -_gcc7=-fno-clone-functions \
363 363 -_gcc8=-fno-clone-functions
364 364
365 365 # GCC may put functions in different named sub-sections of .text based on
366 366 # their presumed calling frequency. At least in the kernel, where we actually
367 367 # deliver relocatable objects, we don't want this to happen.
368 368 #
369 369 # Since at present we don't benefit from this even in userland, we disable it globally,
370 370 # but the application of this may move into usr/src/uts/ in future.
371 371 CCNOREORDER= \
372 372 -_gcc7=-fno-reorder-functions \
373 373 -_gcc8=-fno-reorder-functions
374 374
375 375 #
376 376 # gcc has a rather aggressive optimization on by default that infers loop
377 377 # bounds based on undefined behavior (!!). This can lead to some VERY
378 378 # surprising optimizations -- ones that may be technically correct in the
379 379 # strictest sense but also result in incorrect program behavior. We turn
380 380 # this optimization off, with extreme prejudice.
381 381 #
382 382 CCNOAGGRESSIVELOOPS= \
383 383 -_gcc7=-fno-aggressive-loop-optimizations \
384 384 -_gcc8=-fno-aggressive-loop-optimizations
385 385
386 386 # One optimization the compiler might perform is to turn this:
387 387 # #pragma weak foo
388 388 # extern int foo;
389 389 # if (&foo)
390 390 # foo = 5;
391 391 # into
392 392 # foo = 5;
393 393 # Since we do some of this (foo might be referenced in common kernel code
394 394 # but provided only for some cpu modules or platforms), we disable this
395 395 # optimization.
396 396 #
397 397 sparc_CCUNBOUND = -Wd,-xsafe=unboundsym
398 398 i386_CCUNBOUND =
399 399 CCUNBOUND = $($(MACH)_CCUNBOUND)
400 400
401 401 #
402 402 # compiler '-xarch' flag. This is here to centralize it and make it
403 403 # overridable for testing.
404 404 sparc_XARCH= -m32
405 405 sparcv9_XARCH= -m64
406 406 i386_XARCH= -m32
407 407 amd64_XARCH= -m64 -Ui386 -U__i386
408 408
409 409 # assembler '-xarch' flag. Different from compiler '-xarch' flag.
410 410 sparc_AS_XARCH= -xarch=v8plus
411 411 sparcv9_AS_XARCH= -xarch=v9
412 412 i386_AS_XARCH=
413 413 amd64_AS_XARCH= -xarch=amd64 -P -Ui386 -U__i386
414 414
415 415 #
416 416 # These flags define what we need to be 'standalone' i.e. -not- part
417 417 # of the rather more cosy userland environment. This basically means
418 418 # the kernel.
419 419 #
420 420 # XX64 future versions of gcc will make -mcmodel=kernel imply -mno-red-zone
421 421 #
422 422 sparc_STAND_FLAGS= -_gcc=-ffreestanding
423 423 sparcv9_STAND_FLAGS= -_gcc=-ffreestanding
424 424 # Disabling MMX also disables 3DNow, disabling SSE also disables all later
425 425 # additions to SSE (SSE2, AVX ,etc.)
426 426 NO_SIMD= -_gcc=-mno-mmx -_gcc=-mno-sse
427 427 i386_STAND_FLAGS= -_gcc=-ffreestanding $(NO_SIMD)
428 428 amd64_STAND_FLAGS= -xmodel=kernel $(NO_SIMD)
429 429
430 430 SAVEARGS= -Wu,-save_args
431 431 amd64_STAND_FLAGS += $(SAVEARGS)
432 432
433 433 STAND_FLAGS_32 = $($(MACH)_STAND_FLAGS)
434 434 STAND_FLAGS_64 = $($(MACH64)_STAND_FLAGS)
435 435
436 436 #
437 437 # disable the incremental linker
438 438 ILDOFF= -xildoff
439 439 #
440 440 XFFLAG= -xF=%all
441 441 XESS= -xs
442 442 XSTRCONST= -xstrconst
443 443
444 444 #
445 445 # turn warnings into errors (C)
446 446 CERRWARN = -errtags=yes -errwarn=%all
447 447 CERRWARN += -erroff=E_EMPTY_TRANSLATION_UNIT
448 448 CERRWARN += -erroff=E_STATEMENT_NOT_REACHED
449 449
450 450 CERRWARN += -_gcc=-Wno-missing-braces
451 451 CERRWARN += -_gcc=-Wno-sign-compare
452 452 CERRWARN += -_gcc=-Wno-unknown-pragmas
453 453 CERRWARN += -_gcc=-Wno-unused-parameter
454 454 CERRWARN += -_gcc=-Wno-missing-field-initializers
455 455
456 456 # Unfortunately, this option can misfire very easily and unfixably.
457 457 CERRWARN += -_gcc=-Wno-array-bounds
458 458
459 459
460 460 CERRWARN += -_smatch=-p=illumos_user
461 461 include $(SRC)/Makefile.smatch
462 462
463 463 #
464 464 # turn warnings into errors (C++)
465 465 CCERRWARN= -xwe
466 466
467 467 # C standard. Keep Studio flags until we get rid of lint.
468 468 CSTD_GNU89= -xc99=%none
469 469 CSTD_GNU99= -xc99=%all
470 470 CSTD= $(CSTD_GNU89)
471 471 C99LMODE= $(CSTD:-xc99%=-Xc99%)
472 472
473 473 # In most places, assignments to these macros should be appended with +=
474 474 # (CPPFLAGS.first allows values to be prepended to CPPFLAGS).
475 475 sparc_CFLAGS= $(sparc_XARCH) $(CCSTATICSYM)
476 476 sparcv9_CFLAGS= $(sparcv9_XARCH) -dalign $(CCVERBOSE) $(V9ABIWARN) $(CCREGSYM) \
477 477 $(CCSTATICSYM)
478 478 i386_CFLAGS= $(i386_XARCH)
479 479 amd64_CFLAGS= $(amd64_XARCH)
480 480
481 481 sparc_ASFLAGS= $(sparc_AS_XARCH)
482 482 sparcv9_ASFLAGS=$(sparcv9_AS_XARCH)
483 483 i386_ASFLAGS= $(i386_AS_XARCH)
484 484 amd64_ASFLAGS= $(amd64_AS_XARCH)
485 485
486 486 #
487 487 sparc_COPTFLAG= -xO3
488 488 sparcv9_COPTFLAG= -xO3
489 489 i386_COPTFLAG= -O
490 490 amd64_COPTFLAG= -xO3
491 491
492 492 COPTFLAG= $($(MACH)_COPTFLAG)
493 493 COPTFLAG64= $($(MACH64)_COPTFLAG)
494 494
495 495 # When -g is used, the compiler globalizes static objects
496 496 # (gives them a unique prefix). Disable that.
497 497 CNOGLOBAL= -W0,-noglobal
498 498
499 499 # Direct the Sun Studio compiler to use a static globalization prefix based on the
500 500 # name of the module rather than something unique. Otherwise, objects
501 501 # will not build deterministically, as subsequent compilations of identical
502 502 # source will yeild objects that always look different.
503 503 #
504 504 # In the same spirit, this will also remove the date from the N_OPT stab.
505 505 CGLOBALSTATIC= -W0,-xglobalstatic
506 506
507 507 # Sometimes we want all symbols and types in debugging information even
508 508 # if they aren't used.
509 509 CALLSYMS= -W0,-xdbggen=no%usedonly
510 510
511 511 #
512 512 # We force the compilers to generate the debugging information best understood
513 513 # by the CTF tools. With Sun Studio this is stabs due to bugs in the Studio
514 514 # compilers. With GCC this is DWARF v2.
515 515 #
516 516 DEBUGFORMAT= -_cc=-xdebugformat=stabs -_gcc=-gdwarf-2
517 517
518 518 #
519 519 # Ask the compiler to include debugging information
520 520 #
521 521 CCGDEBUG= -g $(DEBUGFORMAT)
522 522
523 523 #
524 524 # Flags used to build in debug mode for ctf generation.
525 525 #
526 526 CTF_FLAGS_sparc = $(CCGDEBUG) -Wc,-Qiselect-T1 $(CSTD) $(CNOGLOBAL)
527 527 CTF_FLAGS_i386 = $(CCGDEBUG) $(CSTD) $(CNOGLOBAL)
528 528
529 529 CTF_FLAGS_sparcv9 = $(CTF_FLAGS_sparc)
530 530 CTF_FLAGS_amd64 = $(CTF_FLAGS_i386)
531 531
532 532 # Sun Studio produces broken userland code when saving arguments.
533 533 $(__GNUC)CTF_FLAGS_amd64 += $(SAVEARGS)
534 534
535 535 CTF_FLAGS_32 = $(CTF_FLAGS_$(MACH))
536 536 CTF_FLAGS_64 = $(CTF_FLAGS_$(MACH64))
537 537 CTF_FLAGS = $(CTF_FLAGS_32)
538 538
539 539 #
540 540 # Flags used with genoffsets
541 541 #
542 542 GENOFFSETS_FLAGS = $(CALLSYMS)
543 543
544 544 OFFSETS_CREATE = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
545 545 $(CW) --noecho $(CW_CC_COMPILERS) -- $(GENOFFSETS_FLAGS) \
546 546 $(CFLAGS) $(CPPFLAGS)
547 547
548 548 OFFSETS_CREATE64 = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
549 549 $(CW) --noecho $(CW_CC_COMPILERS) -- $(GENOFFSETS_FLAGS) \
550 550 $(CFLAGS64) $(CPPFLAGS)
551 551
552 552 #
553 553 # tradeoff time for space (smaller is better)
554 554 #
555 555 sparc_SPACEFLAG = -xspace -W0,-Lt
556 556 sparcv9_SPACEFLAG = -xspace -W0,-Lt
557 557 i386_SPACEFLAG = -xspace
558 558 amd64_SPACEFLAG =
559 559
560 560 SPACEFLAG = $($(MACH)_SPACEFLAG)
561 561 SPACEFLAG64 = $($(MACH64)_SPACEFLAG)
562 562
563 563 #
564 564 # The Sun Studio 11 compiler has changed the behaviour of integer
565 565 # wrap arounds and so a flag is needed to use the legacy behaviour
566 566 # (without this flag panics/hangs could be exposed within the source).
567 567 #
568 568 sparc_IROPTFLAG = -W2,-xwrap_int
569 569 sparcv9_IROPTFLAG = -W2,-xwrap_int
570 570 i386_IROPTFLAG =
571 571 amd64_IROPTFLAG =
572 572
573 573 IROPTFLAG = $($(MACH)_IROPTFLAG)
574 574 IROPTFLAG64 = $($(MACH64)_IROPTFLAG)
575 575
576 576 sparc_XREGSFLAG = -xregs=no%appl
577 577 sparcv9_XREGSFLAG = -xregs=no%appl
578 578 i386_XREGSFLAG =
579 579 amd64_XREGSFLAG =
580 580
581 581 XREGSFLAG = $($(MACH)_XREGSFLAG)
582 582 XREGSFLAG64 = $($(MACH64)_XREGSFLAG)
583 583
584 584 # dmake SOURCEDEBUG=yes ... enables source-level debugging information, and
585 585 # avoids stripping it.
586 586 SOURCEDEBUG = $(POUND_SIGN)
587 587 SRCDBGBLD = $(SOURCEDEBUG:yes=)
588 588
589 589 #
590 590 # These variables are intended ONLY for use by developers to safely pass extra
591 591 # flags to the compilers without unintentionally overriding Makefile-set
592 592 # flags. They should NEVER be set to any value in a Makefile.
593 593 #
594 594 # They come last in the associated FLAGS variable such that they can
595 595 # explicitly override things if necessary, there are gaps in this, but it's
596 596 # the best we can manage.
597 597 #
598 598 CUSERFLAGS =
599 599 CUSERFLAGS64 = $(CUSERFLAGS)
600 600 CCUSERFLAGS =
601 601 CCUSERFLAGS64 = $(CCUSERFLAGS)
602 602
603 603 CSOURCEDEBUGFLAGS =
604 604 CCSOURCEDEBUGFLAGS =
605 605 $(SRCDBGBLD)CSOURCEDEBUGFLAGS = $(CCGDEBUG) -xs
606 606 $(SRCDBGBLD)CCSOURCEDEBUGFLAGS = $(CCGDEBUG) -xs
607 607
608 608 CFLAGS= $(COPTFLAG) $($(MACH)_CFLAGS) $(SPACEFLAG) $(CCMODE) \
609 609 $(ILDOFF) $(CERRWARN) $(CSTD) $(CCUNBOUND) $(IROPTFLAG) \
610 610 $(CGLOBALSTATIC) $(CCNOAUTOINLINE) $(CCNOREORDER) \
611 611 $(CCNOAGGRESSIVELOOPS) \
612 612 $(CSOURCEDEBUGFLAGS) $(CUSERFLAGS)
613 613 CFLAGS64= $(COPTFLAG64) $($(MACH64)_CFLAGS) $(SPACEFLAG64) $(CCMODE64) \
614 614 $(ILDOFF) $(CERRWARN) $(CSTD) $(CCUNBOUND) $(IROPTFLAG64) \
615 615 $(CGLOBALSTATIC) $(CCNOAUTOINLINE) $(CCNOREORDER) \
616 616 $(CCNOAGGRESSIVELOOPS) \
617 617 $(CSOURCEDEBUGFLAGS) $(CUSERFLAGS64)
618 618 #
619 619 # Flags that are used to build parts of the code that are subsequently
620 620 # run on the build machine (also known as the NATIVE_BUILD).
621 621 #
622 622 NATIVE_CFLAGS= $(COPTFLAG) $($(NATIVE_MACH)_CFLAGS) $(CCMODE) \
623 623 $(ILDOFF) $(CERRWARN) $(CSTD) $($(NATIVE_MACH)_CCUNBOUND) \
624 624 $(IROPTFLAG) $(CGLOBALSTATIC) $(CCNOAUTOINLINE) \
625 625 $(CCNOREORDER) $(CSOURCEDEBUGFLAGS) $(CUSERFLAGS)
626 626
627 627 DTEXTDOM=-DTEXT_DOMAIN=\"$(TEXT_DOMAIN)\" # For messaging.
628 628 DTS_ERRNO=-D_TS_ERRNO
629 629 CPPFLAGS.first= # Please keep empty. Only lower makefiles should set this.
630 630 CPPFLAGS.master=$(DTEXTDOM) $(DTS_ERRNO) \
631 631 $(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4) \
632 632 $(ADJUNCT_PROTO:%=-I%/usr/include)
633 633 CPPFLAGS.native=$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) \
634 634 $(ENVCPPFLAGS4) -I$(NATIVE_ADJUNCT)/include
635 635 CPPFLAGS= $(CPPFLAGS.first) $(CPPFLAGS.master)
636 636 AS_CPPFLAGS= $(CPPFLAGS.first) $(CPPFLAGS.master)
637 637 JAVAFLAGS= -source 1.6 -target 1.6 -Xlint:deprecation,-options
638 638
639 639 #
640 640 # For source message catalogue
641 641 #
642 642 .SUFFIXES: $(SUFFIXES) .i .po
643 643 MSGROOT= $(ROOT)/catalog
644 644 MSGDOMAIN= $(MSGROOT)/$(TEXT_DOMAIN)
645 645 MSGDOMAINPOFILE = $(MSGDOMAIN)/$(POFILE)
646 646 DCMSGDOMAIN= $(MSGROOT)/LC_TIME/$(TEXT_DOMAIN)
647 647 DCMSGDOMAINPOFILE = $(DCMSGDOMAIN)/$(DCFILE:.dc=.po)
648 648
649 649 CLOBBERFILES += $(POFILE) $(POFILES)
650 650 COMPILE.cpp= $(CC) -E -C $(CFLAGS) $(CPPFLAGS)
651 651 XGETTEXT= /usr/bin/xgettext
652 652 XGETFLAGS= -c TRANSLATION_NOTE
653 653 GNUXGETTEXT= /usr/gnu/bin/xgettext
654 654 GNUXGETFLAGS= --add-comments=TRANSLATION_NOTE --keyword=_ \
655 655 --strict --no-location --omit-header
656 656 BUILD.po= $(XGETTEXT) $(XGETFLAGS) -d $(<F) $<.i ;\
657 657 $(RM) $@ ;\
658 658 $(SED) "/^domain/d" < $(<F).po > $@ ;\
659 659 $(RM) $(<F).po $<.i
660 660
661 661 #
662 662 # This is overwritten by local Makefile when PROG is a list.
663 663 #
664 664 POFILE= $(PROG).po
665 665
666 666 sparc_CCFLAGS= -cg92 -compat=4 \
667 667 -Qoption ccfe -messages=no%anachronism \
668 668 $(CCERRWARN)
669 669 sparcv9_CCFLAGS= $(sparcv9_XARCH) -dalign -compat=5 \
670 670 -Qoption ccfe -messages=no%anachronism \
671 671 -Qoption ccfe -features=no%conststrings \
672 672 $(CCCREGSYM) \
673 673 $(CCERRWARN)
674 674 i386_CCFLAGS= -compat=4 \
675 675 -Qoption ccfe -messages=no%anachronism \
676 676 -Qoption ccfe -features=no%conststrings \
677 677 $(CCERRWARN)
678 678 amd64_CCFLAGS= $(amd64_XARCH) -compat=5 \
679 679 -Qoption ccfe -messages=no%anachronism \
680 680 -Qoption ccfe -features=no%conststrings \
681 681 $(CCERRWARN)
682 682
683 683 sparc_CCOPTFLAG= -O
684 684 sparcv9_CCOPTFLAG= -O
685 685 i386_CCOPTFLAG= -O
686 686 amd64_CCOPTFLAG= -O
687 687
688 688 CCOPTFLAG= $($(MACH)_CCOPTFLAG)
689 689 CCOPTFLAG64= $($(MACH64)_CCOPTFLAG)
690 690 CCFLAGS= $(CCOPTFLAG) $($(MACH)_CCFLAGS) $(CCSOURCEDEBUGFLAGS) \
691 691 $(CCUSERFLAGS)
692 692 CCFLAGS64= $(CCOPTFLAG64) $($(MACH64)_CCFLAGS) $(CCSOURCEDEBUGFLAGS) \
693 693 $(CCUSERFLAGS64)
694 694
695 695 #
696 696 #
697 697 #
698 698 ELFWRAP_FLAGS =
699 699 ELFWRAP_FLAGS64 = -64
700 700
701 701 #
702 702 # Various mapfiles that are used throughout the build, and delivered to
703 703 # /usr/lib/ld.
704 704 #
705 705 MAPFILE.NED_i386 = $(SRC)/common/mapfiles/common/map.noexdata
706 706 MAPFILE.NED_sparc =
707 707 MAPFILE.NED = $(MAPFILE.NED_$(MACH))
708 708 MAPFILE.PGA = $(SRC)/common/mapfiles/common/map.pagealign
709 709 MAPFILE.NES = $(SRC)/common/mapfiles/common/map.noexstk
710 710 MAPFILE.FLT = $(SRC)/common/mapfiles/common/map.filter
711 711 MAPFILE.LEX = $(SRC)/common/mapfiles/common/map.lex.yy
712 712
713 713 #
714 714 # Generated mapfiles that are compiler specific, and used throughout the
715 715 # build. These mapfiles are not delivered in /usr/lib/ld.
716 716 #
717 717 MAPFILE.NGB_sparc= $(SRC)/common/mapfiles/gen/sparc_cc_map.noexeglobs
718 718 $(__GNUC64)MAPFILE.NGB_sparc= \
719 719 $(SRC)/common/mapfiles/gen/sparc_gcc_map.noexeglobs
720 720 MAPFILE.NGB_sparcv9= $(SRC)/common/mapfiles/gen/sparcv9_cc_map.noexeglobs
721 721 $(__GNUC64)MAPFILE.NGB_sparcv9= \
722 722 $(SRC)/common/mapfiles/gen/sparcv9_gcc_map.noexeglobs
723 723 MAPFILE.NGB_i386= $(SRC)/common/mapfiles/gen/i386_cc_map.noexeglobs
724 724 $(__GNUC64)MAPFILE.NGB_i386= \
725 725 $(SRC)/common/mapfiles/gen/i386_gcc_map.noexeglobs
726 726 MAPFILE.NGB_amd64= $(SRC)/common/mapfiles/gen/amd64_cc_map.noexeglobs
727 727 $(__GNUC64)MAPFILE.NGB_amd64= \
728 728 $(SRC)/common/mapfiles/gen/amd64_gcc_map.noexeglobs
729 729 MAPFILE.NGB = $(MAPFILE.NGB_$(MACH))
730 730
731 731 #
732 732 # A generic interface mapfile name, used by various dynamic objects to define
733 733 # the interfaces and interposers the object must export.
734 734 #
735 735 MAPFILE.INT = mapfile-intf
736 736
737 737 #
738 738 # LDLIBS32 and LDLIBS64 can be set in the environment to override the following
739 739 # assignments.
740 740 #
741 741 # These environment settings make sure that no libraries are searched outside
742 742 # of the local workspace proto area:
743 743 # LDLIBS32=-YP,$ROOT/lib:$ROOT/usr/lib
744 744 # LDLIBS64=-YP,$ROOT/lib/$MACH64:$ROOT/usr/lib/$MACH64
745 745 #
746 746 LDLIBS32 = $(ENVLDLIBS1) $(ENVLDLIBS2) $(ENVLDLIBS3)
747 747 LDLIBS32 += $(ADJUNCT_PROTO:%=-L%/usr/lib -L%/lib)
748 748 LDLIBS.cmd = $(LDLIBS32)
749 749 LDLIBS.lib = $(LDLIBS32)
750 750
751 751 LDLIBS64 = $(ENVLDLIBS1:%=%/$(MACH64)) \
752 752 $(ENVLDLIBS2:%=%/$(MACH64)) \
753 753 $(ENVLDLIBS3:%=%/$(MACH64))
754 754 LDLIBS64 += $(ADJUNCT_PROTO:%=-L%/usr/lib/$(MACH64) -L%/lib/$(MACH64))
755 755
756 756 #
757 757 # Define compilation macros.
758 758 #
759 759 COMPILE.c= $(CC) $(CFLAGS) $(CPPFLAGS) -c
760 760 COMPILE64.c= $(CC) $(CFLAGS64) $(CPPFLAGS) -c
761 761 COMPILE.cc= $(CCC) $(CCFLAGS) $(CPPFLAGS) -c
762 762 COMPILE64.cc= $(CCC) $(CCFLAGS64) $(CPPFLAGS) -c
763 763 COMPILE.s= $(AS) $(ASFLAGS) $(AS_CPPFLAGS)
764 764 COMPILE64.s= $(AS) $(ASFLAGS) $($(MACH64)_AS_XARCH) $(AS_CPPFLAGS)
765 765 COMPILE.d= $(DTRACE) -G -32
766 766 COMPILE64.d= $(DTRACE) -G -64
767 767 COMPILE.b= $(ELFWRAP) $(ELFWRAP_FLAGS$(CLASS))
768 768 COMPILE64.b= $(ELFWRAP) $(ELFWRAP_FLAGS$(CLASS))
769 769
770 770 CLASSPATH= .
771 771 COMPILE.java= $(JAVAC) $(JAVAFLAGS) -classpath $(CLASSPATH)
772 772
773 773 #
774 774 # Link time macros
775 775 #
776 776 CCNEEDED = -lC
777 777 CCEXTNEEDED = -lCrun -lCstd
778 778 $(__GNUC)CCNEEDED = -L$(GCCLIBDIR) -lstdc++ -lgcc_s
779 779 $(__GNUC)CCEXTNEEDED = $(CCNEEDED)
780 780
781 781 LINK.c= $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
782 782 LINK64.c= $(CC) $(CFLAGS64) $(CPPFLAGS) $(LDFLAGS)
783 783 NORUNPATH= -norunpath -nolib
784 784 LINK.cc= $(CCC) $(CCFLAGS) $(CPPFLAGS) $(NORUNPATH) \
785 785 $(LDFLAGS) $(CCNEEDED)
786 786 LINK64.cc= $(CCC) $(CCFLAGS64) $(CPPFLAGS) $(NORUNPATH) \
787 787 $(LDFLAGS) $(CCNEEDED)
788 788
789 789 #
790 790 # lint macros
791 791 #
792 792 # Note that the undefine of __PRAGMA_REDEFINE_EXTNAME can be removed once
793 793 # ON is built with a version of lint that has the fix for 4484186.
794 794 #
795 795 ALWAYS_LINT_DEFS = -errtags=yes -s
796 796 ALWAYS_LINT_DEFS += -erroff=E_PTRDIFF_OVERFLOW
797 797 ALWAYS_LINT_DEFS += -erroff=E_ASSIGN_NARROW_CONV
798 798 ALWAYS_LINT_DEFS += -U__PRAGMA_REDEFINE_EXTNAME
799 799 ALWAYS_LINT_DEFS += $(C99LMODE)
800 800 ALWAYS_LINT_DEFS += -errsecurity=$(SECLEVEL)
801 801 ALWAYS_LINT_DEFS += -erroff=E_SEC_CREAT_WITHOUT_EXCL
802 802 ALWAYS_LINT_DEFS += -erroff=E_SEC_FORBIDDEN_WARN_CREAT
803 803 # XX64 -- really only needed for amd64 lint
804 804 ALWAYS_LINT_DEFS += -erroff=E_ASSIGN_INT_TO_SMALL_INT
805 805 ALWAYS_LINT_DEFS += -erroff=E_CAST_INT_CONST_TO_SMALL_INT
806 806 ALWAYS_LINT_DEFS += -erroff=E_CAST_INT_TO_SMALL_INT
807 807 ALWAYS_LINT_DEFS += -erroff=E_CAST_TO_PTR_FROM_INT
808 808 ALWAYS_LINT_DEFS += -erroff=E_COMP_INT_WITH_LARGE_INT
809 809 ALWAYS_LINT_DEFS += -erroff=E_INTEGRAL_CONST_EXP_EXPECTED
810 810 ALWAYS_LINT_DEFS += -erroff=E_PASS_INT_TO_SMALL_INT
811 811 ALWAYS_LINT_DEFS += -erroff=E_PTR_CONV_LOSES_BITS
812 812
813 813 # This forces lint to pick up note.h and sys/note.h from Devpro rather than
814 814 # from the proto area. The note.h that ON delivers would disable NOTE().
815 815 ONLY_LINT_DEFS = -I$(SPRO_VROOT)/prod/include/lint
816 816
817 817 SECLEVEL= core
818 818 LINT.c= $(LINT) $(ONLY_LINT_DEFS) $(LINTFLAGS) $(CPPFLAGS) \
819 819 $(ALWAYS_LINT_DEFS)
820 820 LINT64.c= $(LINT) $(ONLY_LINT_DEFS) $(LINTFLAGS64) $(CPPFLAGS) \
821 821 $(ALWAYS_LINT_DEFS)
822 822 LINT.s= $(LINT.c)
823 823
824 824 # For some future builds, NATIVE_MACH and MACH might be different.
825 825 # Therefore, NATIVE_MACH needs to be redefined in the
826 826 # environment as `uname -p` to override this macro.
827 827 #
828 828 # For now at least, we cross-compile amd64 on i386 machines.
829 829 NATIVE_MACH= $(MACH:amd64=i386)
830 830
831 831 # Define native compilation macros
832 832 #
833 833
834 834 # Base directory where compilers are loaded.
835 835 # Defined here so it can be overridden by developer.
836 836 #
837 837 SPRO_ROOT= $(BUILD_TOOLS)/SUNWspro
838 838 SPRO_VROOT= $(SPRO_ROOT)/SS12
839 839 GNU_ROOT= /usr
840 840
841 841 $(__GNUC)PRIMARY_CC= gcc4,$(GNUC_ROOT)/bin/gcc,gnu
842 842 $(__SUNC)PRIMARY_CC= studio12,$(SPRO_VROOT)/bin/cc,sun
843 843 $(__GNUC)PRIMARY_CCC= gcc4,$(GNUC_ROOT)/bin/g++,gnu
844 844 $(__SUNC)PRIMARY_CCC= studio12,$(SPRO_VROOT)/bin/CC,sun
845 845
846 846 CW_CC_COMPILERS= $(PRIMARY_CC:%=--primary %) $(SHADOW_CCS:%=--shadow %)
847 847 CW_CCC_COMPILERS= $(PRIMARY_CCC:%=--primary %) $(SHADOW_CCCS:%=--shadow %)
848 848
849 849
850 850 # Till SS12u1 formally becomes the NV CBE, LINT is hard
851 851 # coded to be picked up from the $SPRO_ROOT/sunstudio12.1/
852 852 # location. Impacted variables are sparc_LINT, sparcv9_LINT,
853 853 # i386_LINT, amd64_LINT.
854 854 # Reset them when SS12u1 is rolled out.
855 855 #
856 856
857 857 # Specify platform compiler versions for languages
858 858 # that we use (currently only c and c++).
859 859 #
860 860 CW= $(ONBLD_TOOLS)/bin/$(MACH)/cw
861 861
862 862 BUILD_CC= $(CW) $(CW_CC_COMPILERS) --
863 863 BUILD_CCC= $(CW) -C $(CW_CCC_COMPILERS) --
864 864 BUILD_CPP= /usr/ccs/lib/cpp
865 865 BUILD_LD= /usr/ccs/bin/ld
866 866 BUILD_LINT= $(SPRO_ROOT)/sunstudio12.1/bin/lint
867 867
868 868 $(MACH)_CC= $(BUILD_CC)
869 869 $(MACH)_CCC= $(BUILD_CCC)
870 870 $(MACH)_CPP= $(BUILD_CPP)
871 871 $(MACH)_LD= $(BUILD_LD)
872 872 $(MACH)_LINT= $(BUILD_LINT)
873 873 $(MACH64)_CC= $(BUILD_CC)
874 874 $(MACH64)_CCC= $(BUILD_CCC)
875 875 $(MACH64)_CPP= $(BUILD_CPP)
876 876 $(MACH64)_LD= $(BUILD_LD)
877 877 $(MACH64)_LINT= $(BUILD_LINT)
878 878
879 879 sparc_AS= /usr/ccs/bin/as -xregsym=no
880 880 sparcv9_AS= $($(MACH)_AS)
881 881
882 882 i386_AS= /usr/ccs/bin/as
883 883 $(__GNUC)i386_AS= $(ONBLD_TOOLS)/bin/$(MACH)/aw
884 884 amd64_AS= $(ONBLD_TOOLS)/bin/$(MACH)/aw
885 885
886 886 NATIVECC= $($(NATIVE_MACH)_CC)
887 887 NATIVECCC= $($(NATIVE_MACH)_CCC)
888 888 NATIVECPP= $($(NATIVE_MACH)_CPP)
889 889 NATIVEAS= $($(NATIVE_MACH)_AS)
890 890 NATIVELD= $($(NATIVE_MACH)_LD)
891 891 NATIVELINT= $($(NATIVE_MACH)_LINT)
892 892
893 893 #
894 894 # Makefile.master.64 overrides these settings
895 895 #
896 896 CC= $(NATIVECC)
897 897 CCC= $(NATIVECCC)
898 898 CPP= $(NATIVECPP)
899 899 AS= $(NATIVEAS)
900 900 LD= $(NATIVELD)
901 901 LINT= $(NATIVELINT)
902 902
903 903 # Pass -Y flag to cpp (method of which is release-dependent)
904 904 CCYFLAG= -Y I,
905 905
906 906 BDIRECT= -Bdirect
907 907 BDYNAMIC= -Bdynamic
908 908 BLOCAL= -Blocal
909 909 BNODIRECT= -Bnodirect
910 910 BREDUCE= -Breduce
911 911 BSTATIC= -Bstatic
912 912
913 913 ZDEFS= -zdefs
914 914 ZDIRECT= -zdirect
915 915 ZIGNORE= -zignore
916 916 ZINITFIRST= -zinitfirst
917 917 ZINTERPOSE= -zinterpose
918 918 ZLAZYLOAD= -zlazyload
919 919 ZLOADFLTR= -zloadfltr
920 920 ZMULDEFS= -zmuldefs
921 921 ZNODEFAULTLIB= -znodefaultlib
922 922 ZNODEFS= -znodefs
923 923 ZNODELETE= -znodelete
924 924 ZNODLOPEN= -znodlopen
925 925 ZNODUMP= -znodump
926 926 ZNOLAZYLOAD= -znolazyload
927 927 ZNOLDYNSYM= -znoldynsym
928 928 ZNORELOC= -znoreloc
929 929 ZNOVERSION= -znoversion
930 930 ZRECORD= -zrecord
931 931 ZREDLOCSYM= -zredlocsym
932 932 ZTEXT= -ztext
933 933 ZVERBOSE= -zverbose
934 934
935 935 GSHARED= -G
936 936 CCMT= -mt
937 937
938 938 # Handle different PIC models on different ISAs
939 939 # (May be overridden by lower-level Makefiles)
940 940
941 941 sparc_C_PICFLAGS = -fpic
942 942 sparcv9_C_PICFLAGS = -fpic
943 943 i386_C_PICFLAGS = -fpic
944 944 amd64_C_PICFLAGS = -fpic
945 945 C_PICFLAGS = $($(MACH)_C_PICFLAGS)
946 946 C_PICFLAGS64 = $($(MACH64)_C_PICFLAGS)
947 947
948 948 sparc_C_BIGPICFLAGS = -fPIC
949 949 sparcv9_C_BIGPICFLAGS = -fPIC
950 950 i386_C_BIGPICFLAGS = -fPIC
951 951 amd64_C_BIGPICFLAGS = -fPIC
952 952 C_BIGPICFLAGS = $($(MACH)_C_BIGPICFLAGS)
953 953 C_BIGPICFLAGS64 = $($(MACH64)_C_BIGPICFLAGS)
954 954
955 955 # CC requires there to be no space between '-K' and 'pic' or 'PIC'.
956 956 # and does not support -f
957 957 sparc_CC_PICFLAGS = -_cc=-Kpic -_gcc=-fpic
958 958 sparcv9_CC_PICFLAGS = -_cc=-KPIC -_gcc=-fPIC
959 959 i386_CC_PICFLAGS = -_cc=-Kpic -_gcc=-fpic
↓ open down ↓ |
959 lines elided |
↑ open up ↑ |
960 960 amd64_CC_PICFLAGS = -_cc=-Kpic -_gcc=-fpic
961 961 CC_PICFLAGS = $($(MACH)_CC_PICFLAGS)
962 962 CC_PICFLAGS64 = $($(MACH64)_CC_PICFLAGS)
963 963
964 964 AS_PICFLAGS= -K pic
965 965 AS_BIGPICFLAGS= -K PIC
966 966
967 967 #
968 968 # Default label for CTF sections
969 969 #
970 -CTFCVTFLAGS= -i -L VERSION
970 +CTFCVTFLAGS= -L VERSION
971 971
972 972 #
973 973 # Override to pass module-specific flags to ctfmerge. Currently used only by
974 974 # krtld to turn on fuzzy matching, and source-level debugging to inhibit
975 975 # stripping.
976 976 #
977 977 CTFMRGFLAGS=
978 978
979 979 #
980 980 # Make the transition between old and new CTF Tools. The new ctf tools
981 981 # do not support stabs (eg. Sun Studio). By setting BUILD_OLD_CTF_TOOLS
982 982 # here or in the environment file, the old ones will be built.
↓ open down ↓ |
2 lines elided |
↑ open up ↑ |
983 983 #
984 984 BUILD_NEW_CTF_TOOLS=
985 985 BUILD_OLD_CTF_TOOLS=$(POUND_SIGN)
986 986 $(BUILD_OLD_CTF_TOOLS)BUILD_NEW_CTF_TOOLS= $(POUND_SIGN)
987 987
988 988 CTFCONVERT_O = $(CTFCONVERT) $(CTFCVTFLAGS) $@
989 989
990 990 # Rules (normally from make.rules) and macros which are used for post
991 991 # processing files. Normally, these do stripping of the comment section
992 992 # automatically.
993 -# RELEASE_CM: Should be editted to reflect the release.
994 -# POST_PROCESS_O: Post-processing for `.o' files.
995 -# POST_PROCESS_A: Post-processing for `.a' files (currently null).
993 +# RELEASE_CM: Should be edited to reflect the release.
994 +# POST_PROCESS_O: Post-processing for `.o' files (typically C source)
995 +# POST_PROCESS_S_O: Post-processing for `.o' files built from asssembly
996 +# POST_PROCESS_CC_O: Post-processing for `.o' files built from C++
997 +# POST_PROCESS_A: Post-processing for `.a' files (currently null).
996 998 # POST_PROCESS_SO: Post-processing for `.so' files.
997 999 # POST_PROCESS: Post-processing for executable files (no suffix).
1000 +#
998 1001 # Note that these macros are not completely generalized as they are to be
999 1002 # used with the file name to be processed following.
1000 1003 #
1001 1004 # It is left as an exercise to Release Engineering to embellish the generation
1002 1005 # of the release comment string.
1003 1006 #
1004 1007 # If this is a standard development build:
1005 1008 # compress the comment section (mcs -c)
1006 1009 # add the standard comment (mcs -a $(RELEASE_CM))
1007 1010 # add the development specific comment (mcs -a $(DEV_CM))
1008 1011 #
1009 1012 # If this is an installation build:
1010 1013 # delete the comment section (mcs -d)
1011 1014 # add the standard comment (mcs -a $(RELEASE_CM))
1012 1015 # add the development specific comment (mcs -a $(DEV_CM))
1013 1016 #
1014 1017 # If this is an release build:
1015 1018 # delete the comment section (mcs -d)
1016 1019 # add the standard comment (mcs -a $(RELEASE_CM))
1017 1020 #
1018 1021 # The following list of macros are used in the definition of RELEASE_CM
1019 1022 # which is used to label all binaries in the build:
1020 1023 #
1021 1024 # RELEASE Specific release of the build, eg: 5.2
1022 1025 # RELEASE_MAJOR Major version number part of $(RELEASE)
1023 1026 # RELEASE_MINOR Minor version number part of $(RELEASE)
1024 1027 # VERSION Version of the build (alpha, beta, Generic)
1025 1028 # PATCHID If this is a patch this value should contain
1026 1029 # the patchid value (eg: "Generic 100832-01"), otherwise
1027 1030 # it will be set to $(VERSION)
1028 1031 # RELEASE_DATE Date of the Release Build
1029 1032 # PATCH_DATE Date the patch was created, if this is blank it
1030 1033 # will default to the RELEASE_DATE
1031 1034 #
1032 1035 RELEASE_MAJOR= 5
1033 1036 RELEASE_MINOR= 11
1034 1037 RELEASE= $(RELEASE_MAJOR).$(RELEASE_MINOR)
1035 1038 VERSION= SunOS Development
1036 1039 PATCHID= $(VERSION)
1037 1040 RELEASE_DATE= release date not set
1038 1041 PATCH_DATE= $(RELEASE_DATE)
↓ open down ↓ |
31 lines elided |
↑ open up ↑ |
1039 1042 RELEASE_CM= "@($(POUND_SIGN))SunOS $(RELEASE) $(PATCHID) $(PATCH_DATE)"
1040 1043 DEV_CM= "@($(POUND_SIGN))SunOS Internal Development: non-nightly build"
1041 1044
1042 1045 PROCESS_COMMENT= @?${MCS} -d -a $(RELEASE_CM) -a $(DEV_CM)
1043 1046 $(RELEASE_BUILD)PROCESS_COMMENT= @?${MCS} -d -a $(RELEASE_CM)
1044 1047
1045 1048 STRIP_STABS= $(STRIP) -x $@
1046 1049 $(SRCDBGBLD)STRIP_STABS= :
1047 1050
1048 1051 POST_PROCESS_O=
1052 +POST_PROCESS_S_O=
1053 +POST_PROCESS_CC_O=
1049 1054 POST_PROCESS_A=
1050 1055 POST_PROCESS_SO= $(PROCESS_COMMENT) $@ ; $(STRIP_STABS) ; \
1051 1056 $(ELFSIGN_OBJECT)
1052 1057 POST_PROCESS= $(PROCESS_COMMENT) $@ ; $(STRIP_STABS) ; \
1053 1058 $(ELFSIGN_OBJECT)
1054 1059
1055 1060 #
1056 1061 # chk4ubin is a tool that inspects a module for a symbol table
1057 1062 # ELF section size which can trigger an OBP bug on older platforms.
1058 1063 # This problem affects only specific sun4u bootable modules.
1059 1064 #
1060 1065 CHK4UBIN= $(ONBLD_TOOLS)/bin/$(MACH)/chk4ubin
1061 1066 CHK4UBINFLAGS=
1062 1067 CHK4UBINARY= $(CHK4UBIN) $(CHK4UBINFLAGS) $@
1063 1068
1064 1069 #
1065 1070 # PKGARCHIVE specifies the default location where packages should be
1066 1071 # placed if built.
1067 1072 #
1068 1073 $(RELEASE_BUILD)PKGARCHIVESUFFIX= -nd
1069 1074 PKGARCHIVE=$(SRC)/../../packages/$(MACH)/nightly$(PKGARCHIVESUFFIX)
1070 1075
1071 1076 #
1072 1077 # The repositories will be created with these publisher settings. To
1073 1078 # update an image to the resulting repositories, this must match the
1074 1079 # publisher name provided to "pkg set-publisher."
1075 1080 #
1076 1081 PKGPUBLISHER_REDIST= on-nightly
1077 1082 PKGPUBLISHER_NONREDIST= on-extra
1078 1083
1079 1084 # Default build rules which perform comment section post-processing.
1080 1085 #
1081 1086 .c:
1082 1087 $(LINK.c) -o $@ $< $(LDLIBS)
1083 1088 $(POST_PROCESS)
↓ open down ↓ |
25 lines elided |
↑ open up ↑ |
1084 1089 .c.o:
1085 1090 $(COMPILE.c) $(OUTPUT_OPTION) $< $(CTFCONVERT_HOOK)
1086 1091 $(POST_PROCESS_O)
1087 1092 .c.a:
1088 1093 $(COMPILE.c) -o $% $<
1089 1094 $(PROCESS_COMMENT) $%
1090 1095 $(AR) $(ARFLAGS) $@ $%
1091 1096 $(RM) $%
1092 1097 .s.o:
1093 1098 $(COMPILE.s) -o $@ $<
1094 - $(POST_PROCESS_O)
1099 + $(POST_PROCESS_S_O)
1095 1100 .s.a:
1096 1101 $(COMPILE.s) -o $% $<
1097 1102 $(PROCESS_COMMENT) $%
1098 1103 $(AR) $(ARFLAGS) $@ $%
1099 1104 $(RM) $%
1100 1105 .cc:
1101 1106 $(LINK.cc) -o $@ $< $(LDLIBS)
1102 1107 $(POST_PROCESS)
1103 1108 .cc.o:
1104 1109 $(COMPILE.cc) $(OUTPUT_OPTION) $<
1105 - $(POST_PROCESS_O)
1110 + $(POST_PROCESS_CC_O)
1106 1111 .cc.a:
1107 1112 $(COMPILE.cc) -o $% $<
1108 1113 $(AR) $(ARFLAGS) $@ $%
1109 1114 $(PROCESS_COMMENT) $%
1110 1115 $(RM) $%
1111 1116 .y:
1112 1117 $(YACC.y) $<
1113 1118 $(LINK.c) -o $@ y.tab.c $(LDLIBS)
1114 1119 $(POST_PROCESS)
1115 1120 $(RM) y.tab.c
1116 1121 .y.o:
1117 1122 $(YACC.y) $<
1118 1123 $(COMPILE.c) -o $@ y.tab.c $(CTFCONVERT_HOOK)
1119 1124 $(POST_PROCESS_O)
1120 1125 $(RM) y.tab.c
1121 1126 .l:
1122 1127 $(RM) $*.c
1123 1128 $(LEX.l) $< > $*.c
1124 1129 $(LINK.c) -o $@ $*.c -ll $(LDLIBS)
1125 1130 $(POST_PROCESS)
1126 1131 $(RM) $*.c
1127 1132 .l.o:
1128 1133 $(RM) $*.c
1129 1134 $(LEX.l) $< > $*.c
1130 1135 $(COMPILE.c) -o $@ $*.c $(CTFCONVERT_HOOK)
1131 1136 $(POST_PROCESS_O)
1132 1137 $(RM) $*.c
1133 1138
1134 1139 .bin.o:
1135 1140 $(COMPILE.b) -o $@ $<
1136 1141 $(POST_PROCESS_O)
1137 1142
1138 1143 .java.class:
1139 1144 $(COMPILE.java) $<
1140 1145
1141 1146 # Bourne and Korn shell script message catalog build rules.
1142 1147 # We extract all gettext strings with sed(1) (being careful to permit
1143 1148 # multiple gettext strings on the same line), weed out the dups, and
1144 1149 # build the catalogue with awk(1).
1145 1150
1146 1151 .sh.po .ksh.po:
1147 1152 $(SED) -n -e ":a" \
1148 1153 -e "h" \
1149 1154 -e "s/.*gettext *\(\"[^\"]*\"\).*/\1/p" \
1150 1155 -e "x" \
1151 1156 -e "s/\(.*\)gettext *\"[^\"]*\"\(.*\)/\1\2/" \
1152 1157 -e "t a" \
1153 1158 $< | sort -u | $(AWK) '{ print "msgid\t" $$0 "\nmsgstr" }' > $@
1154 1159
1155 1160 #
1156 1161 # Python and Perl executable and message catalog build rules.
1157 1162 #
1158 1163 .SUFFIXES: .pl .pm .py .pyc
1159 1164
1160 1165 .pl:
1161 1166 $(RM) $@;
1162 1167 $(SED) -e "s@TEXT_DOMAIN@\"$(TEXT_DOMAIN)\"@" $< > $@;
1163 1168 $(CHMOD) +x $@
1164 1169
1165 1170 .py:
1166 1171 $(RM) $@; $(SED) \
1167 1172 -e "1s:^\#!@PYTHON@:\#!$(PYSHEBANG):" \
1168 1173 -e "1s:^\#!@TOOLS_PYTHON@:\#!$(TOOLS_PYTHON):" \
1169 1174 < $< > $@; $(CHMOD) +x $@
1170 1175
1171 1176 .py.pyc:
1172 1177 $(RM) $@
1173 1178 $(PYTHON) -mpy_compile $<
1174 1179 @[ $(<)c = $@ ] || $(MV) $(<)c $@
1175 1180
1176 1181 .py.po:
1177 1182 $(GNUXGETTEXT) $(GNUXGETFLAGS) -d $(<F:%.py=%) $< ;
1178 1183
1179 1184 .pl.po .pm.po:
1180 1185 $(XGETTEXT) $(XGETFLAGS) -d $(<F) $< ;
1181 1186 $(RM) $@ ;
1182 1187 $(SED) "/^domain/d" < $(<F).po > $@ ;
1183 1188 $(RM) $(<F).po
1184 1189
1185 1190 #
1186 1191 # When using xgettext, we want messages to go to the default domain,
1187 1192 # rather than the specified one. This special version of the
1188 1193 # COMPILE.cpp macro effectively prevents expansion of TEXT_DOMAIN,
1189 1194 # causing xgettext to put all messages into the default domain.
1190 1195 #
1191 1196 CPPFORPO=$(COMPILE.cpp:\"$(TEXT_DOMAIN)\"=TEXT_DOMAIN)
1192 1197
1193 1198 .c.i:
1194 1199 $(CPPFORPO) $< > $@
1195 1200
1196 1201 .h.i:
1197 1202 $(CPPFORPO) $< > $@
1198 1203
1199 1204 .y.i:
1200 1205 $(YACC) -d $<
1201 1206 $(CPPFORPO) y.tab.c > $@
1202 1207 $(RM) y.tab.c
1203 1208
1204 1209 .l.i:
1205 1210 $(LEX) $<
1206 1211 $(CPPFORPO) lex.yy.c > $@
1207 1212 $(RM) lex.yy.c
1208 1213
1209 1214 .c.po:
1210 1215 $(CPPFORPO) $< > $<.i
1211 1216 $(BUILD.po)
1212 1217
1213 1218 .cc.po:
1214 1219 $(CPPFORPO) $< > $<.i
1215 1220 $(BUILD.po)
1216 1221
1217 1222 .y.po:
1218 1223 $(YACC) -d $<
1219 1224 $(CPPFORPO) y.tab.c > $<.i
1220 1225 $(BUILD.po)
1221 1226 $(RM) y.tab.c
1222 1227
1223 1228 .l.po:
1224 1229 $(LEX) $<
1225 1230 $(CPPFORPO) lex.yy.c > $<.i
1226 1231 $(BUILD.po)
1227 1232 $(RM) lex.yy.c
1228 1233
1229 1234 #
1230 1235 # Rules to perform stylistic checks
1231 1236 #
1232 1237 .SUFFIXES: .x .xml .check .xmlchk
1233 1238
1234 1239 .h.check:
1235 1240 $(DOT_H_CHECK)
1236 1241
1237 1242 .x.check:
1238 1243 $(DOT_X_CHECK)
1239 1244
1240 1245 .xml.xmlchk:
1241 1246 $(MANIFEST_CHECK)
1242 1247
1243 1248 #
1244 1249 # Include rules to render automated sccs get rules "safe".
1245 1250 #
1246 1251 include $(SRC)/Makefile.noget
↓ open down ↓ |
131 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX