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