Print this page
10468 __ctype_mask[EOF] has been working by accident
10469 GCC's -faggressive-loop-optimizations is too aggressive
10470 array over-read in has_saved_fp()
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: John Levon <john.levon@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
↓ open down ↓ |
364 lines elided |
↑ open up ↑ |
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 +#
376 +# gcc has a rather aggressive optimization on by default that infers loop
377 +# bounds based on undefined behavior (!!). This can lead to some VERY
378 +# surprising optimizations -- ones that may be technically correct in the
379 +# strictest sense but also result in incorrect program behavior. We turn
380 +# this optimization off, with extreme prejudice.
381 +#
382 +CCNOAGGRESSIVELOOPS= \
383 + -_gcc7=-fno-aggressive-loop-optimizations \
384 + -_gcc8=-fno-aggressive-loop-optimizations
385 +
375 386 # One optimization the compiler might perform is to turn this:
376 387 # #pragma weak foo
377 388 # extern int foo;
378 389 # if (&foo)
379 390 # foo = 5;
380 391 # into
381 392 # foo = 5;
382 393 # Since we do some of this (foo might be referenced in common kernel code
383 394 # but provided only for some cpu modules or platforms), we disable this
384 395 # optimization.
385 396 #
386 397 sparc_CCUNBOUND = -Wd,-xsafe=unboundsym
387 398 i386_CCUNBOUND =
388 399 CCUNBOUND = $($(MACH)_CCUNBOUND)
389 400
390 401 #
391 402 # compiler '-xarch' flag. This is here to centralize it and make it
392 403 # overridable for testing.
393 404 sparc_XARCH= -m32
394 405 sparcv9_XARCH= -m64
395 406 i386_XARCH= -m32
396 407 amd64_XARCH= -m64 -Ui386 -U__i386
397 408
398 409 # assembler '-xarch' flag. Different from compiler '-xarch' flag.
399 410 sparc_AS_XARCH= -xarch=v8plus
400 411 sparcv9_AS_XARCH= -xarch=v9
401 412 i386_AS_XARCH=
402 413 amd64_AS_XARCH= -xarch=amd64 -P -Ui386 -U__i386
403 414
404 415 #
405 416 # These flags define what we need to be 'standalone' i.e. -not- part
406 417 # of the rather more cosy userland environment. This basically means
407 418 # the kernel.
408 419 #
409 420 # XX64 future versions of gcc will make -mcmodel=kernel imply -mno-red-zone
410 421 #
411 422 sparc_STAND_FLAGS= -_gcc=-ffreestanding
412 423 sparcv9_STAND_FLAGS= -_gcc=-ffreestanding
413 424 # Disabling MMX also disables 3DNow, disabling SSE also disables all later
414 425 # additions to SSE (SSE2, AVX ,etc.)
415 426 NO_SIMD= -_gcc=-mno-mmx -_gcc=-mno-sse
416 427 i386_STAND_FLAGS= -_gcc=-ffreestanding $(NO_SIMD)
417 428 amd64_STAND_FLAGS= -xmodel=kernel $(NO_SIMD)
418 429
419 430 SAVEARGS= -Wu,-save_args
420 431 amd64_STAND_FLAGS += $(SAVEARGS)
421 432
422 433 STAND_FLAGS_32 = $($(MACH)_STAND_FLAGS)
423 434 STAND_FLAGS_64 = $($(MACH64)_STAND_FLAGS)
424 435
425 436 #
426 437 # disable the incremental linker
427 438 ILDOFF= -xildoff
428 439 #
429 440 XFFLAG= -xF=%all
430 441 XESS= -xs
431 442 XSTRCONST= -xstrconst
432 443
433 444 #
434 445 # turn warnings into errors (C)
435 446 CERRWARN = -errtags=yes -errwarn=%all
436 447 CERRWARN += -erroff=E_EMPTY_TRANSLATION_UNIT
437 448 CERRWARN += -erroff=E_STATEMENT_NOT_REACHED
438 449
439 450 CERRWARN += -_gcc=-Wno-missing-braces
440 451 CERRWARN += -_gcc=-Wno-sign-compare
441 452 CERRWARN += -_gcc=-Wno-unknown-pragmas
442 453 CERRWARN += -_gcc=-Wno-unused-parameter
443 454 CERRWARN += -_gcc=-Wno-missing-field-initializers
444 455
445 456 # Unfortunately, this option can misfire very easily and unfixably.
446 457 CERRWARN += -_gcc=-Wno-array-bounds
447 458
448 459 # DEBUG v. -nd make for frequent unused variables, empty conditions, etc. in
449 460 # -nd builds
450 461 $(RELEASE_BUILD)CERRWARN += -_gcc=-Wno-unused
451 462 $(RELEASE_BUILD)CERRWARN += -_gcc=-Wno-empty-body
452 463
453 464 CERRWARN += -_smatch=-p=illumos_user
454 465 include $(SRC)/Makefile.smatch
455 466
456 467 #
457 468 # turn warnings into errors (C++)
458 469 CCERRWARN= -xwe
459 470
460 471 # C standard. Keep Studio flags until we get rid of lint.
461 472 CSTD_GNU89= -xc99=%none
462 473 CSTD_GNU99= -xc99=%all
463 474 CSTD= $(CSTD_GNU89)
464 475 C99LMODE= $(CSTD:-xc99%=-Xc99%)
465 476
466 477 # In most places, assignments to these macros should be appended with +=
467 478 # (CPPFLAGS.first allows values to be prepended to CPPFLAGS).
468 479 sparc_CFLAGS= $(sparc_XARCH) $(CCSTATICSYM)
469 480 sparcv9_CFLAGS= $(sparcv9_XARCH) -dalign $(CCVERBOSE) $(V9ABIWARN) $(CCREGSYM) \
470 481 $(CCSTATICSYM)
471 482 i386_CFLAGS= $(i386_XARCH)
472 483 amd64_CFLAGS= $(amd64_XARCH)
473 484
474 485 sparc_ASFLAGS= $(sparc_AS_XARCH)
475 486 sparcv9_ASFLAGS=$(sparcv9_AS_XARCH)
476 487 i386_ASFLAGS= $(i386_AS_XARCH)
477 488 amd64_ASFLAGS= $(amd64_AS_XARCH)
478 489
479 490 #
480 491 sparc_COPTFLAG= -xO3
481 492 sparcv9_COPTFLAG= -xO3
482 493 i386_COPTFLAG= -O
483 494 amd64_COPTFLAG= -xO3
484 495
485 496 COPTFLAG= $($(MACH)_COPTFLAG)
486 497 COPTFLAG64= $($(MACH64)_COPTFLAG)
487 498
488 499 # When -g is used, the compiler globalizes static objects
489 500 # (gives them a unique prefix). Disable that.
490 501 CNOGLOBAL= -W0,-noglobal
491 502
492 503 # Direct the Sun Studio compiler to use a static globalization prefix based on the
493 504 # name of the module rather than something unique. Otherwise, objects
494 505 # will not build deterministically, as subsequent compilations of identical
495 506 # source will yeild objects that always look different.
496 507 #
497 508 # In the same spirit, this will also remove the date from the N_OPT stab.
498 509 CGLOBALSTATIC= -W0,-xglobalstatic
499 510
500 511 # Sometimes we want all symbols and types in debugging information even
501 512 # if they aren't used.
502 513 CALLSYMS= -W0,-xdbggen=no%usedonly
503 514
504 515 #
505 516 # We force the compilers to generate the debugging information best understood
506 517 # by the CTF tools. With Sun Studio this is stabs due to bugs in the Studio
507 518 # compilers. With GCC this is DWARF v2.
508 519 #
509 520 DEBUGFORMAT= -_cc=-xdebugformat=stabs -_gcc=-gdwarf-2
510 521
511 522 #
512 523 # Ask the compiler to include debugging information
513 524 #
514 525 CCGDEBUG= -g $(DEBUGFORMAT)
515 526
516 527 #
517 528 # Flags used to build in debug mode for ctf generation.
518 529 #
519 530 CTF_FLAGS_sparc = $(CCGDEBUG) -Wc,-Qiselect-T1 $(CSTD) $(CNOGLOBAL)
520 531 CTF_FLAGS_i386 = $(CCGDEBUG) $(CSTD) $(CNOGLOBAL)
521 532
522 533 CTF_FLAGS_sparcv9 = $(CTF_FLAGS_sparc)
523 534 CTF_FLAGS_amd64 = $(CTF_FLAGS_i386)
524 535
525 536 # Sun Studio produces broken userland code when saving arguments.
526 537 $(__GNUC)CTF_FLAGS_amd64 += $(SAVEARGS)
527 538
528 539 CTF_FLAGS_32 = $(CTF_FLAGS_$(MACH))
529 540 CTF_FLAGS_64 = $(CTF_FLAGS_$(MACH64))
530 541 CTF_FLAGS = $(CTF_FLAGS_32)
531 542
532 543 #
533 544 # Flags used with genoffsets
534 545 #
535 546 GENOFFSETS_FLAGS = $(CALLSYMS)
536 547
537 548 OFFSETS_CREATE = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
538 549 $(CW) --noecho $(CW_CC_COMPILERS) -- $(GENOFFSETS_FLAGS) \
539 550 $(CFLAGS) $(CPPFLAGS)
540 551
541 552 OFFSETS_CREATE64 = $(GENOFFSETS) -s $(CTFSTABS) -r $(CTFCONVERT) \
542 553 $(CW) --noecho $(CW_CC_COMPILERS) -- $(GENOFFSETS_FLAGS) \
543 554 $(CFLAGS64) $(CPPFLAGS)
544 555
545 556 #
546 557 # tradeoff time for space (smaller is better)
547 558 #
548 559 sparc_SPACEFLAG = -xspace -W0,-Lt
549 560 sparcv9_SPACEFLAG = -xspace -W0,-Lt
550 561 i386_SPACEFLAG = -xspace
551 562 amd64_SPACEFLAG =
552 563
553 564 SPACEFLAG = $($(MACH)_SPACEFLAG)
554 565 SPACEFLAG64 = $($(MACH64)_SPACEFLAG)
555 566
556 567 #
557 568 # The Sun Studio 11 compiler has changed the behaviour of integer
558 569 # wrap arounds and so a flag is needed to use the legacy behaviour
559 570 # (without this flag panics/hangs could be exposed within the source).
560 571 #
561 572 sparc_IROPTFLAG = -W2,-xwrap_int
562 573 sparcv9_IROPTFLAG = -W2,-xwrap_int
563 574 i386_IROPTFLAG =
564 575 amd64_IROPTFLAG =
565 576
566 577 IROPTFLAG = $($(MACH)_IROPTFLAG)
567 578 IROPTFLAG64 = $($(MACH64)_IROPTFLAG)
568 579
569 580 sparc_XREGSFLAG = -xregs=no%appl
570 581 sparcv9_XREGSFLAG = -xregs=no%appl
571 582 i386_XREGSFLAG =
572 583 amd64_XREGSFLAG =
573 584
574 585 XREGSFLAG = $($(MACH)_XREGSFLAG)
575 586 XREGSFLAG64 = $($(MACH64)_XREGSFLAG)
576 587
577 588 # dmake SOURCEDEBUG=yes ... enables source-level debugging information, and
578 589 # avoids stripping it.
579 590 SOURCEDEBUG = $(POUND_SIGN)
580 591 SRCDBGBLD = $(SOURCEDEBUG:yes=)
581 592
582 593 #
583 594 # These variables are intended ONLY for use by developers to safely pass extra
584 595 # flags to the compilers without unintentionally overriding Makefile-set
585 596 # flags. They should NEVER be set to any value in a Makefile.
586 597 #
587 598 # They come last in the associated FLAGS variable such that they can
588 599 # explicitly override things if necessary, there are gaps in this, but it's
589 600 # the best we can manage.
590 601 #
591 602 CUSERFLAGS =
592 603 CUSERFLAGS64 = $(CUSERFLAGS)
593 604 CCUSERFLAGS =
↓ open down ↓ |
209 lines elided |
↑ open up ↑ |
594 605 CCUSERFLAGS64 = $(CCUSERFLAGS)
595 606
596 607 CSOURCEDEBUGFLAGS =
597 608 CCSOURCEDEBUGFLAGS =
598 609 $(SRCDBGBLD)CSOURCEDEBUGFLAGS = $(CCGDEBUG) -xs
599 610 $(SRCDBGBLD)CCSOURCEDEBUGFLAGS = $(CCGDEBUG) -xs
600 611
601 612 CFLAGS= $(COPTFLAG) $($(MACH)_CFLAGS) $(SPACEFLAG) $(CCMODE) \
602 613 $(ILDOFF) $(CERRWARN) $(CSTD) $(CCUNBOUND) $(IROPTFLAG) \
603 614 $(CGLOBALSTATIC) $(CCNOAUTOINLINE) $(CCNOREORDER) \
615 + $(CCNOAGGRESSIVELOOPS) \
604 616 $(CSOURCEDEBUGFLAGS) $(CUSERFLAGS)
605 617 CFLAGS64= $(COPTFLAG64) $($(MACH64)_CFLAGS) $(SPACEFLAG64) $(CCMODE64) \
606 618 $(ILDOFF) $(CERRWARN) $(CSTD) $(CCUNBOUND) $(IROPTFLAG64) \
607 619 $(CGLOBALSTATIC) $(CCNOAUTOINLINE) $(CCNOREORDER) \
620 + $(CCNOAGGRESSIVELOOPS) \
608 621 $(CSOURCEDEBUGFLAGS) $(CUSERFLAGS64)
609 622 #
610 623 # Flags that are used to build parts of the code that are subsequently
611 624 # run on the build machine (also known as the NATIVE_BUILD).
612 625 #
613 626 NATIVE_CFLAGS= $(COPTFLAG) $($(NATIVE_MACH)_CFLAGS) $(CCMODE) \
614 627 $(ILDOFF) $(CERRWARN) $(CSTD) $($(NATIVE_MACH)_CCUNBOUND) \
615 628 $(IROPTFLAG) $(CGLOBALSTATIC) $(CCNOAUTOINLINE) \
616 629 $(CCNOREORDER) $(CSOURCEDEBUGFLAGS) $(CUSERFLAGS)
617 630
618 631 DTEXTDOM=-DTEXT_DOMAIN=\"$(TEXT_DOMAIN)\" # For messaging.
619 632 DTS_ERRNO=-D_TS_ERRNO
620 633 CPPFLAGS.first= # Please keep empty. Only lower makefiles should set this.
621 634 CPPFLAGS.master=$(DTEXTDOM) $(DTS_ERRNO) \
622 635 $(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4) \
623 636 $(ADJUNCT_PROTO:%=-I%/usr/include)
624 637 CPPFLAGS.native=$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) \
625 638 $(ENVCPPFLAGS4) -I$(NATIVE_ADJUNCT)/include
626 639 CPPFLAGS= $(CPPFLAGS.first) $(CPPFLAGS.master)
627 640 AS_CPPFLAGS= $(CPPFLAGS.first) $(CPPFLAGS.master)
628 641 JAVAFLAGS= -source 1.6 -target 1.6 -Xlint:deprecation,-options
629 642
630 643 #
631 644 # For source message catalogue
632 645 #
633 646 .SUFFIXES: $(SUFFIXES) .i .po
634 647 MSGROOT= $(ROOT)/catalog
635 648 MSGDOMAIN= $(MSGROOT)/$(TEXT_DOMAIN)
636 649 MSGDOMAINPOFILE = $(MSGDOMAIN)/$(POFILE)
637 650 DCMSGDOMAIN= $(MSGROOT)/LC_TIME/$(TEXT_DOMAIN)
638 651 DCMSGDOMAINPOFILE = $(DCMSGDOMAIN)/$(DCFILE:.dc=.po)
639 652
640 653 CLOBBERFILES += $(POFILE) $(POFILES)
641 654 COMPILE.cpp= $(CC) -E -C $(CFLAGS) $(CPPFLAGS)
642 655 XGETTEXT= /usr/bin/xgettext
643 656 XGETFLAGS= -c TRANSLATION_NOTE
644 657 GNUXGETTEXT= /usr/gnu/bin/xgettext
645 658 GNUXGETFLAGS= --add-comments=TRANSLATION_NOTE --keyword=_ \
646 659 --strict --no-location --omit-header
647 660 BUILD.po= $(XGETTEXT) $(XGETFLAGS) -d $(<F) $<.i ;\
648 661 $(RM) $@ ;\
649 662 $(SED) "/^domain/d" < $(<F).po > $@ ;\
650 663 $(RM) $(<F).po $<.i
651 664
652 665 #
653 666 # This is overwritten by local Makefile when PROG is a list.
654 667 #
655 668 POFILE= $(PROG).po
656 669
657 670 sparc_CCFLAGS= -cg92 -compat=4 \
658 671 -Qoption ccfe -messages=no%anachronism \
659 672 $(CCERRWARN)
660 673 sparcv9_CCFLAGS= $(sparcv9_XARCH) -dalign -compat=5 \
661 674 -Qoption ccfe -messages=no%anachronism \
662 675 -Qoption ccfe -features=no%conststrings \
663 676 $(CCCREGSYM) \
664 677 $(CCERRWARN)
665 678 i386_CCFLAGS= -compat=4 \
666 679 -Qoption ccfe -messages=no%anachronism \
667 680 -Qoption ccfe -features=no%conststrings \
668 681 $(CCERRWARN)
669 682 amd64_CCFLAGS= $(amd64_XARCH) -compat=5 \
670 683 -Qoption ccfe -messages=no%anachronism \
671 684 -Qoption ccfe -features=no%conststrings \
672 685 $(CCERRWARN)
673 686
674 687 sparc_CCOPTFLAG= -O
675 688 sparcv9_CCOPTFLAG= -O
676 689 i386_CCOPTFLAG= -O
677 690 amd64_CCOPTFLAG= -O
678 691
679 692 CCOPTFLAG= $($(MACH)_CCOPTFLAG)
680 693 CCOPTFLAG64= $($(MACH64)_CCOPTFLAG)
681 694 CCFLAGS= $(CCOPTFLAG) $($(MACH)_CCFLAGS) $(CCSOURCEDEBUGFLAGS) \
682 695 $(CCUSERFLAGS)
683 696 CCFLAGS64= $(CCOPTFLAG64) $($(MACH64)_CCFLAGS) $(CCSOURCEDEBUGFLAGS) \
684 697 $(CCUSERFLAGS64)
685 698
686 699 #
687 700 #
688 701 #
689 702 ELFWRAP_FLAGS =
690 703 ELFWRAP_FLAGS64 = -64
691 704
692 705 #
693 706 # Various mapfiles that are used throughout the build, and delivered to
694 707 # /usr/lib/ld.
695 708 #
696 709 MAPFILE.NED_i386 = $(SRC)/common/mapfiles/common/map.noexdata
697 710 MAPFILE.NED_sparc =
698 711 MAPFILE.NED = $(MAPFILE.NED_$(MACH))
699 712 MAPFILE.PGA = $(SRC)/common/mapfiles/common/map.pagealign
700 713 MAPFILE.NES = $(SRC)/common/mapfiles/common/map.noexstk
701 714 MAPFILE.FLT = $(SRC)/common/mapfiles/common/map.filter
702 715 MAPFILE.LEX = $(SRC)/common/mapfiles/common/map.lex.yy
703 716
704 717 #
705 718 # Generated mapfiles that are compiler specific, and used throughout the
706 719 # build. These mapfiles are not delivered in /usr/lib/ld.
707 720 #
708 721 MAPFILE.NGB_sparc= $(SRC)/common/mapfiles/gen/sparc_cc_map.noexeglobs
709 722 $(__GNUC64)MAPFILE.NGB_sparc= \
710 723 $(SRC)/common/mapfiles/gen/sparc_gcc_map.noexeglobs
711 724 MAPFILE.NGB_sparcv9= $(SRC)/common/mapfiles/gen/sparcv9_cc_map.noexeglobs
712 725 $(__GNUC64)MAPFILE.NGB_sparcv9= \
713 726 $(SRC)/common/mapfiles/gen/sparcv9_gcc_map.noexeglobs
714 727 MAPFILE.NGB_i386= $(SRC)/common/mapfiles/gen/i386_cc_map.noexeglobs
715 728 $(__GNUC64)MAPFILE.NGB_i386= \
716 729 $(SRC)/common/mapfiles/gen/i386_gcc_map.noexeglobs
717 730 MAPFILE.NGB_amd64= $(SRC)/common/mapfiles/gen/amd64_cc_map.noexeglobs
718 731 $(__GNUC64)MAPFILE.NGB_amd64= \
719 732 $(SRC)/common/mapfiles/gen/amd64_gcc_map.noexeglobs
720 733 MAPFILE.NGB = $(MAPFILE.NGB_$(MACH))
721 734
722 735 #
723 736 # A generic interface mapfile name, used by various dynamic objects to define
724 737 # the interfaces and interposers the object must export.
725 738 #
726 739 MAPFILE.INT = mapfile-intf
727 740
728 741 #
729 742 # LDLIBS32 and LDLIBS64 can be set in the environment to override the following
730 743 # assignments.
731 744 #
732 745 # These environment settings make sure that no libraries are searched outside
733 746 # of the local workspace proto area:
734 747 # LDLIBS32=-YP,$ROOT/lib:$ROOT/usr/lib
735 748 # LDLIBS64=-YP,$ROOT/lib/$MACH64:$ROOT/usr/lib/$MACH64
736 749 #
737 750 LDLIBS32 = $(ENVLDLIBS1) $(ENVLDLIBS2) $(ENVLDLIBS3)
738 751 LDLIBS32 += $(ADJUNCT_PROTO:%=-L%/usr/lib -L%/lib)
739 752 LDLIBS.cmd = $(LDLIBS32)
740 753 LDLIBS.lib = $(LDLIBS32)
741 754
742 755 LDLIBS64 = $(ENVLDLIBS1:%=%/$(MACH64)) \
743 756 $(ENVLDLIBS2:%=%/$(MACH64)) \
744 757 $(ENVLDLIBS3:%=%/$(MACH64))
745 758 LDLIBS64 += $(ADJUNCT_PROTO:%=-L%/usr/lib/$(MACH64) -L%/lib/$(MACH64))
746 759
747 760 #
748 761 # Define compilation macros.
749 762 #
750 763 COMPILE.c= $(CC) $(CFLAGS) $(CPPFLAGS) -c
751 764 COMPILE64.c= $(CC) $(CFLAGS64) $(CPPFLAGS) -c
752 765 COMPILE.cc= $(CCC) $(CCFLAGS) $(CPPFLAGS) -c
753 766 COMPILE64.cc= $(CCC) $(CCFLAGS64) $(CPPFLAGS) -c
754 767 COMPILE.s= $(AS) $(ASFLAGS) $(AS_CPPFLAGS)
755 768 COMPILE64.s= $(AS) $(ASFLAGS) $($(MACH64)_AS_XARCH) $(AS_CPPFLAGS)
756 769 COMPILE.d= $(DTRACE) -G -32
757 770 COMPILE64.d= $(DTRACE) -G -64
758 771 COMPILE.b= $(ELFWRAP) $(ELFWRAP_FLAGS$(CLASS))
759 772 COMPILE64.b= $(ELFWRAP) $(ELFWRAP_FLAGS$(CLASS))
760 773
761 774 CLASSPATH= .
762 775 COMPILE.java= $(JAVAC) $(JAVAFLAGS) -classpath $(CLASSPATH)
763 776
764 777 #
765 778 # Link time macros
766 779 #
767 780 CCNEEDED = -lC
768 781 CCEXTNEEDED = -lCrun -lCstd
769 782 $(__GNUC)CCNEEDED = -L$(GCCLIBDIR) -lstdc++ -lgcc_s
770 783 $(__GNUC)CCEXTNEEDED = $(CCNEEDED)
771 784
772 785 LINK.c= $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
773 786 LINK64.c= $(CC) $(CFLAGS64) $(CPPFLAGS) $(LDFLAGS)
774 787 NORUNPATH= -norunpath -nolib
775 788 LINK.cc= $(CCC) $(CCFLAGS) $(CPPFLAGS) $(NORUNPATH) \
776 789 $(LDFLAGS) $(CCNEEDED)
777 790 LINK64.cc= $(CCC) $(CCFLAGS64) $(CPPFLAGS) $(NORUNPATH) \
778 791 $(LDFLAGS) $(CCNEEDED)
779 792
780 793 #
781 794 # lint macros
782 795 #
783 796 # Note that the undefine of __PRAGMA_REDEFINE_EXTNAME can be removed once
784 797 # ON is built with a version of lint that has the fix for 4484186.
785 798 #
786 799 ALWAYS_LINT_DEFS = -errtags=yes -s
787 800 ALWAYS_LINT_DEFS += -erroff=E_PTRDIFF_OVERFLOW
788 801 ALWAYS_LINT_DEFS += -erroff=E_ASSIGN_NARROW_CONV
789 802 ALWAYS_LINT_DEFS += -U__PRAGMA_REDEFINE_EXTNAME
790 803 ALWAYS_LINT_DEFS += $(C99LMODE)
791 804 ALWAYS_LINT_DEFS += -errsecurity=$(SECLEVEL)
792 805 ALWAYS_LINT_DEFS += -erroff=E_SEC_CREAT_WITHOUT_EXCL
793 806 ALWAYS_LINT_DEFS += -erroff=E_SEC_FORBIDDEN_WARN_CREAT
794 807 # XX64 -- really only needed for amd64 lint
795 808 ALWAYS_LINT_DEFS += -erroff=E_ASSIGN_INT_TO_SMALL_INT
796 809 ALWAYS_LINT_DEFS += -erroff=E_CAST_INT_CONST_TO_SMALL_INT
797 810 ALWAYS_LINT_DEFS += -erroff=E_CAST_INT_TO_SMALL_INT
798 811 ALWAYS_LINT_DEFS += -erroff=E_CAST_TO_PTR_FROM_INT
799 812 ALWAYS_LINT_DEFS += -erroff=E_COMP_INT_WITH_LARGE_INT
800 813 ALWAYS_LINT_DEFS += -erroff=E_INTEGRAL_CONST_EXP_EXPECTED
801 814 ALWAYS_LINT_DEFS += -erroff=E_PASS_INT_TO_SMALL_INT
802 815 ALWAYS_LINT_DEFS += -erroff=E_PTR_CONV_LOSES_BITS
803 816
804 817 # This forces lint to pick up note.h and sys/note.h from Devpro rather than
805 818 # from the proto area. The note.h that ON delivers would disable NOTE().
806 819 ONLY_LINT_DEFS = -I$(SPRO_VROOT)/prod/include/lint
807 820
808 821 SECLEVEL= core
809 822 LINT.c= $(LINT) $(ONLY_LINT_DEFS) $(LINTFLAGS) $(CPPFLAGS) \
810 823 $(ALWAYS_LINT_DEFS)
811 824 LINT64.c= $(LINT) $(ONLY_LINT_DEFS) $(LINTFLAGS64) $(CPPFLAGS) \
812 825 $(ALWAYS_LINT_DEFS)
813 826 LINT.s= $(LINT.c)
814 827
815 828 # For some future builds, NATIVE_MACH and MACH might be different.
816 829 # Therefore, NATIVE_MACH needs to be redefined in the
817 830 # environment as `uname -p` to override this macro.
818 831 #
819 832 # For now at least, we cross-compile amd64 on i386 machines.
820 833 NATIVE_MACH= $(MACH:amd64=i386)
821 834
822 835 # Define native compilation macros
823 836 #
824 837
825 838 # Base directory where compilers are loaded.
826 839 # Defined here so it can be overridden by developer.
827 840 #
828 841 SPRO_ROOT= $(BUILD_TOOLS)/SUNWspro
829 842 SPRO_VROOT= $(SPRO_ROOT)/SS12
830 843 GNU_ROOT= /usr
831 844
832 845 $(__GNUC)PRIMARY_CC= gcc4,$(GNUC_ROOT)/bin/gcc,gnu
833 846 $(__SUNC)PRIMARY_CC= studio12,$(SPRO_VROOT)/bin/cc,sun
834 847 $(__GNUC)PRIMARY_CCC= gcc4,$(GNUC_ROOT)/bin/g++,gnu
835 848 $(__SUNC)PRIMARY_CCC= studio12,$(SPRO_VROOT)/bin/CC,sun
836 849
837 850 CW_CC_COMPILERS= $(PRIMARY_CC:%=--primary %) $(SHADOW_CCS:%=--shadow %)
838 851 CW_CCC_COMPILERS= $(PRIMARY_CCC:%=--primary %) $(SHADOW_CCCS:%=--shadow %)
839 852
840 853
841 854 # Till SS12u1 formally becomes the NV CBE, LINT is hard
842 855 # coded to be picked up from the $SPRO_ROOT/sunstudio12.1/
843 856 # location. Impacted variables are sparc_LINT, sparcv9_LINT,
844 857 # i386_LINT, amd64_LINT.
845 858 # Reset them when SS12u1 is rolled out.
846 859 #
847 860
848 861 # Specify platform compiler versions for languages
849 862 # that we use (currently only c and c++).
850 863 #
851 864 CW= $(ONBLD_TOOLS)/bin/$(MACH)/cw
852 865
853 866 BUILD_CC= $(CW) $(CW_CC_COMPILERS) --
854 867 BUILD_CCC= $(CW) -C $(CW_CCC_COMPILERS) --
855 868 BUILD_CPP= /usr/ccs/lib/cpp
856 869 BUILD_LD= /usr/ccs/bin/ld
857 870 BUILD_LINT= $(SPRO_ROOT)/sunstudio12.1/bin/lint
858 871
859 872 $(MACH)_CC= $(BUILD_CC)
860 873 $(MACH)_CCC= $(BUILD_CCC)
861 874 $(MACH)_CPP= $(BUILD_CPP)
862 875 $(MACH)_LD= $(BUILD_LD)
863 876 $(MACH)_LINT= $(BUILD_LINT)
864 877 $(MACH64)_CC= $(BUILD_CC)
865 878 $(MACH64)_CCC= $(BUILD_CCC)
866 879 $(MACH64)_CPP= $(BUILD_CPP)
867 880 $(MACH64)_LD= $(BUILD_LD)
868 881 $(MACH64)_LINT= $(BUILD_LINT)
869 882
870 883 sparc_AS= /usr/ccs/bin/as -xregsym=no
871 884 sparcv9_AS= $($(MACH)_AS)
872 885
873 886 i386_AS= /usr/ccs/bin/as
874 887 $(__GNUC)i386_AS= $(ONBLD_TOOLS)/bin/$(MACH)/aw
875 888 amd64_AS= $(ONBLD_TOOLS)/bin/$(MACH)/aw
876 889
877 890 NATIVECC= $($(NATIVE_MACH)_CC)
878 891 NATIVECCC= $($(NATIVE_MACH)_CCC)
879 892 NATIVECPP= $($(NATIVE_MACH)_CPP)
880 893 NATIVEAS= $($(NATIVE_MACH)_AS)
881 894 NATIVELD= $($(NATIVE_MACH)_LD)
882 895 NATIVELINT= $($(NATIVE_MACH)_LINT)
883 896
884 897 #
885 898 # Makefile.master.64 overrides these settings
886 899 #
887 900 CC= $(NATIVECC)
888 901 CCC= $(NATIVECCC)
889 902 CPP= $(NATIVECPP)
890 903 AS= $(NATIVEAS)
891 904 LD= $(NATIVELD)
892 905 LINT= $(NATIVELINT)
893 906
894 907 # Pass -Y flag to cpp (method of which is release-dependent)
895 908 CCYFLAG= -Y I,
896 909
897 910 BDIRECT= -Bdirect
898 911 BDYNAMIC= -Bdynamic
899 912 BLOCAL= -Blocal
900 913 BNODIRECT= -Bnodirect
901 914 BREDUCE= -Breduce
902 915 BSTATIC= -Bstatic
903 916
904 917 ZDEFS= -zdefs
905 918 ZDIRECT= -zdirect
906 919 ZIGNORE= -zignore
907 920 ZINITFIRST= -zinitfirst
908 921 ZINTERPOSE= -zinterpose
909 922 ZLAZYLOAD= -zlazyload
910 923 ZLOADFLTR= -zloadfltr
911 924 ZMULDEFS= -zmuldefs
912 925 ZNODEFAULTLIB= -znodefaultlib
913 926 ZNODEFS= -znodefs
914 927 ZNODELETE= -znodelete
915 928 ZNODLOPEN= -znodlopen
916 929 ZNODUMP= -znodump
917 930 ZNOLAZYLOAD= -znolazyload
918 931 ZNOLDYNSYM= -znoldynsym
919 932 ZNORELOC= -znoreloc
920 933 ZNOVERSION= -znoversion
921 934 ZRECORD= -zrecord
922 935 ZREDLOCSYM= -zredlocsym
923 936 ZTEXT= -ztext
924 937 ZVERBOSE= -zverbose
925 938
926 939 GSHARED= -G
927 940 CCMT= -mt
928 941
929 942 # Handle different PIC models on different ISAs
930 943 # (May be overridden by lower-level Makefiles)
931 944
932 945 sparc_C_PICFLAGS = -fpic
933 946 sparcv9_C_PICFLAGS = -fpic
934 947 i386_C_PICFLAGS = -fpic
935 948 amd64_C_PICFLAGS = -fpic
936 949 C_PICFLAGS = $($(MACH)_C_PICFLAGS)
937 950 C_PICFLAGS64 = $($(MACH64)_C_PICFLAGS)
938 951
939 952 sparc_C_BIGPICFLAGS = -fPIC
940 953 sparcv9_C_BIGPICFLAGS = -fPIC
941 954 i386_C_BIGPICFLAGS = -fPIC
942 955 amd64_C_BIGPICFLAGS = -fPIC
943 956 C_BIGPICFLAGS = $($(MACH)_C_BIGPICFLAGS)
944 957 C_BIGPICFLAGS64 = $($(MACH64)_C_BIGPICFLAGS)
945 958
946 959 # CC requires there to be no space between '-K' and 'pic' or 'PIC'.
947 960 # and does not support -f
948 961 sparc_CC_PICFLAGS = -_cc=-Kpic -_gcc=-fpic
949 962 sparcv9_CC_PICFLAGS = -_cc=-KPIC -_gcc=-fPIC
950 963 i386_CC_PICFLAGS = -_cc=-Kpic -_gcc=-fpic
951 964 amd64_CC_PICFLAGS = -_cc=-Kpic -_gcc=-fpic
952 965 CC_PICFLAGS = $($(MACH)_CC_PICFLAGS)
953 966 CC_PICFLAGS64 = $($(MACH64)_CC_PICFLAGS)
954 967
955 968 AS_PICFLAGS= -K pic
956 969 AS_BIGPICFLAGS= -K PIC
957 970
958 971 #
959 972 # Default label for CTF sections
960 973 #
961 974 CTFCVTFLAGS= -i -L VERSION
962 975
963 976 #
964 977 # Override to pass module-specific flags to ctfmerge. Currently used only by
965 978 # krtld to turn on fuzzy matching, and source-level debugging to inhibit
966 979 # stripping.
967 980 #
968 981 CTFMRGFLAGS=
969 982
970 983 #
971 984 # Make the transition between old and new CTF Tools. The new ctf tools
972 985 # do not support stabs (eg. Sun Studio). By setting BUILD_OLD_CTF_TOOLS
973 986 # here or in the environment file, the old ones will be built.
974 987 #
975 988 BUILD_NEW_CTF_TOOLS=
976 989 BUILD_OLD_CTF_TOOLS=$(POUND_SIGN)
977 990 $(BUILD_OLD_CTF_TOOLS)BUILD_NEW_CTF_TOOLS= $(POUND_SIGN)
978 991
979 992 CTFCONVERT_O = $(CTFCONVERT) $(CTFCVTFLAGS) $@
980 993
981 994 # Rules (normally from make.rules) and macros which are used for post
982 995 # processing files. Normally, these do stripping of the comment section
983 996 # automatically.
984 997 # RELEASE_CM: Should be editted to reflect the release.
985 998 # POST_PROCESS_O: Post-processing for `.o' files.
986 999 # POST_PROCESS_A: Post-processing for `.a' files (currently null).
987 1000 # POST_PROCESS_SO: Post-processing for `.so' files.
988 1001 # POST_PROCESS: Post-processing for executable files (no suffix).
989 1002 # Note that these macros are not completely generalized as they are to be
990 1003 # used with the file name to be processed following.
991 1004 #
992 1005 # It is left as an exercise to Release Engineering to embellish the generation
993 1006 # of the release comment string.
994 1007 #
995 1008 # If this is a standard development build:
996 1009 # compress the comment section (mcs -c)
997 1010 # add the standard comment (mcs -a $(RELEASE_CM))
998 1011 # add the development specific comment (mcs -a $(DEV_CM))
999 1012 #
1000 1013 # If this is an installation build:
1001 1014 # delete the comment section (mcs -d)
1002 1015 # add the standard comment (mcs -a $(RELEASE_CM))
1003 1016 # add the development specific comment (mcs -a $(DEV_CM))
1004 1017 #
1005 1018 # If this is an release build:
1006 1019 # delete the comment section (mcs -d)
1007 1020 # add the standard comment (mcs -a $(RELEASE_CM))
1008 1021 #
1009 1022 # The following list of macros are used in the definition of RELEASE_CM
1010 1023 # which is used to label all binaries in the build:
1011 1024 #
1012 1025 # RELEASE Specific release of the build, eg: 5.2
1013 1026 # RELEASE_MAJOR Major version number part of $(RELEASE)
1014 1027 # RELEASE_MINOR Minor version number part of $(RELEASE)
1015 1028 # VERSION Version of the build (alpha, beta, Generic)
1016 1029 # PATCHID If this is a patch this value should contain
1017 1030 # the patchid value (eg: "Generic 100832-01"), otherwise
1018 1031 # it will be set to $(VERSION)
1019 1032 # RELEASE_DATE Date of the Release Build
1020 1033 # PATCH_DATE Date the patch was created, if this is blank it
1021 1034 # will default to the RELEASE_DATE
1022 1035 #
1023 1036 RELEASE_MAJOR= 5
1024 1037 RELEASE_MINOR= 11
1025 1038 RELEASE= $(RELEASE_MAJOR).$(RELEASE_MINOR)
1026 1039 VERSION= SunOS Development
1027 1040 PATCHID= $(VERSION)
1028 1041 RELEASE_DATE= release date not set
1029 1042 PATCH_DATE= $(RELEASE_DATE)
1030 1043 RELEASE_CM= "@($(POUND_SIGN))SunOS $(RELEASE) $(PATCHID) $(PATCH_DATE)"
1031 1044 DEV_CM= "@($(POUND_SIGN))SunOS Internal Development: non-nightly build"
1032 1045
1033 1046 PROCESS_COMMENT= @?${MCS} -d -a $(RELEASE_CM) -a $(DEV_CM)
1034 1047 $(RELEASE_BUILD)PROCESS_COMMENT= @?${MCS} -d -a $(RELEASE_CM)
1035 1048
1036 1049 STRIP_STABS= $(STRIP) -x $@
1037 1050 $(SRCDBGBLD)STRIP_STABS= :
1038 1051
1039 1052 POST_PROCESS_O=
1040 1053 POST_PROCESS_A=
1041 1054 POST_PROCESS_SO= $(PROCESS_COMMENT) $@ ; $(STRIP_STABS) ; \
1042 1055 $(ELFSIGN_OBJECT)
1043 1056 POST_PROCESS= $(PROCESS_COMMENT) $@ ; $(STRIP_STABS) ; \
1044 1057 $(ELFSIGN_OBJECT)
1045 1058
1046 1059 #
1047 1060 # chk4ubin is a tool that inspects a module for a symbol table
1048 1061 # ELF section size which can trigger an OBP bug on older platforms.
1049 1062 # This problem affects only specific sun4u bootable modules.
1050 1063 #
1051 1064 CHK4UBIN= $(ONBLD_TOOLS)/bin/$(MACH)/chk4ubin
1052 1065 CHK4UBINFLAGS=
1053 1066 CHK4UBINARY= $(CHK4UBIN) $(CHK4UBINFLAGS) $@
1054 1067
1055 1068 #
1056 1069 # PKGARCHIVE specifies the default location where packages should be
1057 1070 # placed if built.
1058 1071 #
1059 1072 $(RELEASE_BUILD)PKGARCHIVESUFFIX= -nd
1060 1073 PKGARCHIVE=$(SRC)/../../packages/$(MACH)/nightly$(PKGARCHIVESUFFIX)
1061 1074
1062 1075 #
1063 1076 # The repositories will be created with these publisher settings. To
1064 1077 # update an image to the resulting repositories, this must match the
1065 1078 # publisher name provided to "pkg set-publisher."
1066 1079 #
1067 1080 PKGPUBLISHER_REDIST= on-nightly
1068 1081 PKGPUBLISHER_NONREDIST= on-extra
1069 1082
1070 1083 # Default build rules which perform comment section post-processing.
1071 1084 #
1072 1085 .c:
1073 1086 $(LINK.c) -o $@ $< $(LDLIBS)
1074 1087 $(POST_PROCESS)
1075 1088 .c.o:
1076 1089 $(COMPILE.c) $(OUTPUT_OPTION) $< $(CTFCONVERT_HOOK)
1077 1090 $(POST_PROCESS_O)
1078 1091 .c.a:
1079 1092 $(COMPILE.c) -o $% $<
1080 1093 $(PROCESS_COMMENT) $%
1081 1094 $(AR) $(ARFLAGS) $@ $%
1082 1095 $(RM) $%
1083 1096 .s.o:
1084 1097 $(COMPILE.s) -o $@ $<
1085 1098 $(POST_PROCESS_O)
1086 1099 .s.a:
1087 1100 $(COMPILE.s) -o $% $<
1088 1101 $(PROCESS_COMMENT) $%
1089 1102 $(AR) $(ARFLAGS) $@ $%
1090 1103 $(RM) $%
1091 1104 .cc:
1092 1105 $(LINK.cc) -o $@ $< $(LDLIBS)
1093 1106 $(POST_PROCESS)
1094 1107 .cc.o:
1095 1108 $(COMPILE.cc) $(OUTPUT_OPTION) $<
1096 1109 $(POST_PROCESS_O)
1097 1110 .cc.a:
1098 1111 $(COMPILE.cc) -o $% $<
1099 1112 $(AR) $(ARFLAGS) $@ $%
1100 1113 $(PROCESS_COMMENT) $%
1101 1114 $(RM) $%
1102 1115 .y:
1103 1116 $(YACC.y) $<
1104 1117 $(LINK.c) -o $@ y.tab.c $(LDLIBS)
1105 1118 $(POST_PROCESS)
1106 1119 $(RM) y.tab.c
1107 1120 .y.o:
1108 1121 $(YACC.y) $<
1109 1122 $(COMPILE.c) -o $@ y.tab.c $(CTFCONVERT_HOOK)
1110 1123 $(POST_PROCESS_O)
1111 1124 $(RM) y.tab.c
1112 1125 .l:
1113 1126 $(RM) $*.c
1114 1127 $(LEX.l) $< > $*.c
1115 1128 $(LINK.c) -o $@ $*.c -ll $(LDLIBS)
1116 1129 $(POST_PROCESS)
1117 1130 $(RM) $*.c
1118 1131 .l.o:
1119 1132 $(RM) $*.c
1120 1133 $(LEX.l) $< > $*.c
1121 1134 $(COMPILE.c) -o $@ $*.c $(CTFCONVERT_HOOK)
1122 1135 $(POST_PROCESS_O)
1123 1136 $(RM) $*.c
1124 1137
1125 1138 .bin.o:
1126 1139 $(COMPILE.b) -o $@ $<
1127 1140 $(POST_PROCESS_O)
1128 1141
1129 1142 .java.class:
1130 1143 $(COMPILE.java) $<
1131 1144
1132 1145 # Bourne and Korn shell script message catalog build rules.
1133 1146 # We extract all gettext strings with sed(1) (being careful to permit
1134 1147 # multiple gettext strings on the same line), weed out the dups, and
1135 1148 # build the catalogue with awk(1).
1136 1149
1137 1150 .sh.po .ksh.po:
1138 1151 $(SED) -n -e ":a" \
1139 1152 -e "h" \
1140 1153 -e "s/.*gettext *\(\"[^\"]*\"\).*/\1/p" \
1141 1154 -e "x" \
1142 1155 -e "s/\(.*\)gettext *\"[^\"]*\"\(.*\)/\1\2/" \
1143 1156 -e "t a" \
1144 1157 $< | sort -u | $(AWK) '{ print "msgid\t" $$0 "\nmsgstr" }' > $@
1145 1158
1146 1159 #
1147 1160 # Python and Perl executable and message catalog build rules.
1148 1161 #
1149 1162 .SUFFIXES: .pl .pm .py .pyc
1150 1163
1151 1164 .pl:
1152 1165 $(RM) $@;
1153 1166 $(SED) -e "s@TEXT_DOMAIN@\"$(TEXT_DOMAIN)\"@" $< > $@;
1154 1167 $(CHMOD) +x $@
1155 1168
1156 1169 .py:
1157 1170 $(RM) $@; $(SED) \
1158 1171 -e "1s:^\#!@PYTHON@:\#!$(PYSHEBANG):" \
1159 1172 -e "1s:^\#!@TOOLS_PYTHON@:\#!$(TOOLS_PYTHON):" \
1160 1173 < $< > $@; $(CHMOD) +x $@
1161 1174
1162 1175 .py.pyc:
1163 1176 $(RM) $@
1164 1177 $(PYTHON) -mpy_compile $<
1165 1178 @[ $(<)c = $@ ] || $(MV) $(<)c $@
1166 1179
1167 1180 .py.po:
1168 1181 $(GNUXGETTEXT) $(GNUXGETFLAGS) -d $(<F:%.py=%) $< ;
1169 1182
1170 1183 .pl.po .pm.po:
1171 1184 $(XGETTEXT) $(XGETFLAGS) -d $(<F) $< ;
1172 1185 $(RM) $@ ;
1173 1186 $(SED) "/^domain/d" < $(<F).po > $@ ;
1174 1187 $(RM) $(<F).po
1175 1188
1176 1189 #
1177 1190 # When using xgettext, we want messages to go to the default domain,
1178 1191 # rather than the specified one. This special version of the
1179 1192 # COMPILE.cpp macro effectively prevents expansion of TEXT_DOMAIN,
1180 1193 # causing xgettext to put all messages into the default domain.
1181 1194 #
1182 1195 CPPFORPO=$(COMPILE.cpp:\"$(TEXT_DOMAIN)\"=TEXT_DOMAIN)
1183 1196
1184 1197 .c.i:
1185 1198 $(CPPFORPO) $< > $@
1186 1199
1187 1200 .h.i:
1188 1201 $(CPPFORPO) $< > $@
1189 1202
1190 1203 .y.i:
1191 1204 $(YACC) -d $<
1192 1205 $(CPPFORPO) y.tab.c > $@
1193 1206 $(RM) y.tab.c
1194 1207
1195 1208 .l.i:
1196 1209 $(LEX) $<
1197 1210 $(CPPFORPO) lex.yy.c > $@
1198 1211 $(RM) lex.yy.c
1199 1212
1200 1213 .c.po:
1201 1214 $(CPPFORPO) $< > $<.i
1202 1215 $(BUILD.po)
1203 1216
1204 1217 .cc.po:
1205 1218 $(CPPFORPO) $< > $<.i
1206 1219 $(BUILD.po)
1207 1220
1208 1221 .y.po:
1209 1222 $(YACC) -d $<
1210 1223 $(CPPFORPO) y.tab.c > $<.i
1211 1224 $(BUILD.po)
1212 1225 $(RM) y.tab.c
1213 1226
1214 1227 .l.po:
1215 1228 $(LEX) $<
1216 1229 $(CPPFORPO) lex.yy.c > $<.i
1217 1230 $(BUILD.po)
1218 1231 $(RM) lex.yy.c
1219 1232
1220 1233 #
1221 1234 # Rules to perform stylistic checks
1222 1235 #
1223 1236 .SUFFIXES: .x .xml .check .xmlchk
1224 1237
1225 1238 .h.check:
1226 1239 $(DOT_H_CHECK)
1227 1240
1228 1241 .x.check:
1229 1242 $(DOT_X_CHECK)
1230 1243
1231 1244 .xml.xmlchk:
1232 1245 $(MANIFEST_CHECK)
1233 1246
1234 1247 #
1235 1248 # Include rules to render automated sccs get rules "safe".
1236 1249 #
1237 1250 include $(SRC)/Makefile.noget
↓ open down ↓ |
620 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX