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