author | xdono |
Wed, 02 Jul 2008 12:55:45 -0700 | |
changeset 715 | f16baef3a20e |
parent 642 | d1f02d5e4c74 |
child 917 | 75261da60fff |
child 849 | be386e469547 |
permissions | -rw-r--r-- |
2 | 1 |
# |
715 | 2 |
# Copyright 1995-2008 Sun Microsystems, Inc. All Rights Reserved. |
2 | 3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
# |
|
5 |
# This code is free software; you can redistribute it and/or modify it |
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
|
7 |
# published by the Free Software Foundation. Sun designates this |
|
8 |
# particular file as subject to the "Classpath" exception as provided |
|
9 |
# by Sun in the LICENSE file that accompanied this code. |
|
10 |
# |
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
# accompanied this code). |
|
16 |
# |
|
17 |
# You should have received a copy of the GNU General Public License version |
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
# |
|
21 |
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
|
22 |
# CA 95054 USA or visit www.sun.com if you need additional information or |
|
23 |
# have any questions. |
|
24 |
# |
|
25 |
||
26 |
# |
|
27 |
# Makefile to specify compiler flags for programs and libraries |
|
28 |
# targeted to Solaris. Should not contain any rules. |
|
29 |
# |
|
30 |
# WARNING: This file is shared with other workspaces. |
|
31 |
# So when it includes other files, it must use JDK_TOPDIR. |
|
32 |
# |
|
33 |
||
34 |
# Warning: the following variables are overridden by Defs.gmk. Set |
|
35 |
# values will be silently ignored: |
|
36 |
# CFLAGS (set $(OTHER_CFLAGS) instead) |
|
37 |
# CPPFLAGS (set $(OTHER_CPPFLAGS) instead) |
|
38 |
# CXXFLAGS (set $(OTHER_CXXFLAGS) instead) |
|
39 |
# LDFLAGS (set $(OTHER_LDFAGS) instead) |
|
40 |
# LDLIBS (set $(EXTRA_LIBS) instead) |
|
41 |
# LDLIBS_COMMON (set $(EXTRA_LIBS) instead) |
|
42 |
# LINTFLAGS (set $(OTHER_LINTFLAGS) instead) |
|
43 |
||
44 |
# Get shared JDK settings |
|
45 |
include $(JDK_MAKE_SHARED_DIR)/Defs.gmk |
|
46 |
||
47 |
ifndef PLATFORM_SRC |
|
30
7ea1edf98bfe
6668781: Openjdk windows cygwin build failure: no rule to make linker_md.obj target
ohair
parents:
2
diff
changeset
|
48 |
PLATFORM_SRC = $(BUILDDIR)/../src/solaris |
2 | 49 |
endif # PLATFORM_SRC |
50 |
||
51 |
# Platform specific closed sources |
|
52 |
ifndef OPENJDK |
|
53 |
ifndef CLOSED_PLATFORM_SRC |
|
30
7ea1edf98bfe
6668781: Openjdk windows cygwin build failure: no rule to make linker_md.obj target
ohair
parents:
2
diff
changeset
|
54 |
CLOSED_PLATFORM_SRC = $(BUILDDIR)/../src/closed/solaris |
2 | 55 |
endif |
56 |
endif |
|
57 |
||
58 |
# platform specific include files |
|
59 |
PLATFORM_INCLUDE_NAME = $(PLATFORM) |
|
60 |
PLATFORM_INCLUDE = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME) |
|
61 |
||
62 |
# suffix used for make dependencies files |
|
63 |
DEPEND_SUFFIX = d |
|
64 |
# suffix used for lint files |
|
65 |
LINT_SUFFIX = ln |
|
66 |
# The suffix applied to the library name for FDLIBM |
|
67 |
FDDLIBM_SUFFIX = a |
|
68 |
# The suffix applied to scripts (.bat for windows, nothing for unix) |
|
69 |
SCRIPT_SUFFIX = |
|
70 |
# CC compiler object code output directive flag value |
|
71 |
CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required! |
|
72 |
CC_PROGRAM_OUTPUT_FLAG = -o #trailing blank required! |
|
73 |
||
74 |
# |
|
75 |
# Default HPI libraries. Build will build only native unless |
|
76 |
# overriden at the make command line. This makes it convenient for |
|
77 |
# people doing, say, a pthreads port -- they can create a posix |
|
78 |
# directory here, and say "gnumake HPIS=posix" at the top |
|
79 |
# level. |
|
80 |
# |
|
81 |
HPIS = native |
|
82 |
||
83 |
# |
|
84 |
# Java default optimization (-x04/-O2) etc. Applies to the VM. |
|
85 |
# |
|
86 |
ifeq ($(PRODUCT), java) |
|
87 |
_OPT = $(CC_HIGHER_OPT) |
|
88 |
else |
|
89 |
_OPT = $(CC_LOWER_OPT) |
|
90 |
CPPFLAGS_DBG += -DLOGGING -DDBINFO |
|
91 |
endif |
|
92 |
||
93 |
# |
|
94 |
# If -Xa is in CFLAGS_COMMON it will end up ahead of $(POPT) for the |
|
95 |
# optimized build, and that ordering of the flags completely freaks |
|
96 |
# out cc. Hence, -Xa is instead in each CFLAGS variant. |
|
97 |
# |
|
98 |
# The more unusual options to the Sun C compiler: |
|
99 |
# -v Stricter type checking, more error checking |
|
100 |
# (To turn ALL warnings into fatals, use -errwarn=%all) |
|
101 |
# -xstrconst Place string literals and constants in read-only area |
|
102 |
# (means you can't write on your string literals) |
|
103 |
# -xs Force debug information (stabs) into the .so or a.out |
|
104 |
# (makes the library/executable debuggable without the |
|
105 |
# .o files needing to be around, but at a space cost) |
|
106 |
# -g & -O If you add the -g option to the optimized compiles |
|
107 |
# you will get better stack retraces, the code is |
|
108 |
# still optimized. This includes a space cost too. |
|
109 |
# -xc99=%none Do NOT allow for c99 extensions to be used. |
|
110 |
# e.g. declarations must precede statements |
|
111 |
# -xCC Allow the C++ style of comments in C: // |
|
112 |
# Required with many of the source files. |
|
113 |
# -mt Assume multi-threaded (important) |
|
114 |
# |
|
115 |
||
116 |
# |
|
117 |
# Debug flag for C and C++ compiler |
|
118 |
# |
|
119 |
CFLAGS_DEBUG_OPTION=-g |
|
120 |
CXXFLAGS_DEBUG_OPTION=-g |
|
121 |
||
122 |
# Turn off -g if we are doing tcov build |
|
123 |
ifdef TCOV_BUILD |
|
124 |
CFLAGS_DEBUG_OPTION= |
|
125 |
CXXFLAGS_DEBUG_OPTION= |
|
126 |
endif |
|
127 |
||
128 |
# FASTDEBUG: Optimize the -g builds, gives us a faster debug java |
|
129 |
# If true adds -O to the debug compiles. This allows for any assert |
|
130 |
# tests to remain and debug checking. The resulting code is faster |
|
131 |
# but less debuggable. Stack traces are still valid, although only |
|
132 |
# approximate line numbers are given. Printing of local variables |
|
133 |
# during a debugging session is not possible, but stepping and |
|
134 |
# printing of global or static variables should be possible. |
|
135 |
# Performance/size of files should be about the same, maybe smaller. |
|
136 |
# |
|
137 |
ifeq ($(FASTDEBUG), true) |
|
138 |
CC_FASTDEBUG_OPT = $(CC_LOWER_OPT) |
|
139 |
CFLAGS_DEBUG_OPTION = -g $(CC_FASTDEBUG_OPT) |
|
140 |
CXXFLAGS_DEBUG_OPTION = -g0 $(CC_FASTDEBUG_OPT) |
|
141 |
endif |
|
142 |
||
143 |
CFLAGS_COMMON = -v -mt -L$(OBJDIR) -xc99=%none |
|
144 |
CFLAGS_COMMON += -xCC |
|
145 |
CFLAGS_COMMON += -errshort=tags |
|
146 |
CFLAGS_OPT = $(POPT) |
|
147 |
CFLAGS_DBG = $(CFLAGS_DEBUG_OPTION) |
|
148 |
CFLAGS_COMMON += -Xa $(CFLAGS_REQUIRED) |
|
149 |
||
150 |
# Assume MT behavior all the time (important) |
|
151 |
CXXFLAGS_COMMON = -mt |
|
152 |
||
153 |
# Assume no C++ exceptions are used |
|
154 |
CXXFLAGS_COMMON += -features=no%except -DCC_NOEX |
|
155 |
||
156 |
# For C++, these options tell it to assume nothing about locating libraries |
|
157 |
# either at compile time, or at runtime. Use of these options will likely |
|
158 |
# require the use of -L and -R options to indicate where libraries will |
|
159 |
# be found at compile time (-L) and at runtime (-R). |
|
160 |
# The /usr/lib location comes for free, so no need to specify that one. |
|
161 |
# Note: C is much simplier and there is no need for these options. This |
|
162 |
# is mostly needed to avoid dependencies on libraries in the |
|
163 |
# Compiler install area, also see LIBCXX and LIBM. |
|
164 |
CXXFLAGS_COMMON += -norunpath -xnolib |
|
165 |
||
166 |
# |
|
167 |
# Treat compiler warnings as errors, if requested |
|
168 |
# |
|
169 |
ifeq ($(COMPILER_WARNINGS_FATAL),true) |
|
170 |
CFLAGS_COMMON += -errwarn=%all |
|
171 |
CXXFLAGS_COMMON += -errwarn=%all |
|
172 |
endif |
|
173 |
||
174 |
CXXFLAGS_OPT = $(POPT) |
|
175 |
CXXFLAGS_DBG = $(CXXFLAGS_DEBUG_OPTION) |
|
176 |
CXXFLAGS_COMMON += $(CFLAGS_REQUIRED) |
|
177 |
||
178 |
# Add -xstrconst to the library compiles. This forces all string |
|
179 |
# literals into the read-only data section, which prevents them from |
|
180 |
# being written to and increases the runtime pages shared on the system. |
|
181 |
# |
|
182 |
ifdef LIBRARY |
|
183 |
CFLAGS_COMMON +=-xstrconst |
|
184 |
endif |
|
185 |
||
186 |
# Source browser database |
|
187 |
# |
|
188 |
# COMPILE_WITH_SB |
|
189 |
# If defined adds -xsb to compiles and creates a |
|
190 |
# source browsing database during compilation. |
|
191 |
# |
|
192 |
ifdef COMPILE_WITH_SB |
|
193 |
ifeq ($(LIBRARY), java) |
|
194 |
CFLAGS_DBG += -xsb |
|
195 |
endif |
|
196 |
endif |
|
197 |
||
198 |
# Lint Flags: |
|
199 |
# -Xa ANSI C plus K&R, favor ANSI rules |
|
200 |
# -fd report on old style func defs |
|
201 |
# -errchk=structarg report on 64bit struct args by value |
|
202 |
# -errchk=longptr64 report on 64bit to 32bit issues (ignores casts) |
|
203 |
# -errchk=parentheses report on suggested use of extra parens |
|
204 |
# -v suppress unused args |
|
205 |
# -x suppress unused externs |
|
206 |
# -u suppress extern func/vars used/defined |
|
207 |
# -errfmt=simple use one line errors with position info |
|
642
d1f02d5e4c74
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
30
diff
changeset
|
208 |
# $(LINT_XARCH_OPTION) See Compiler-sun.gwk |
2 | 209 |
|
210 |
LINTFLAGS_COMMON = -Xa |
|
211 |
LINTFLAGS_COMMON += -fd |
|
212 |
LINTFLAGS_COMMON += -errchk=structarg,longptr64,parentheses |
|
213 |
LINTFLAGS_COMMON += -v |
|
214 |
LINTFLAGS_COMMON += -x |
|
215 |
LINTFLAGS_COMMON += -u |
|
216 |
LINTFLAGS_COMMON += -errfmt=simple |
|
217 |
LINTFLAGS_OPT = |
|
218 |
LINTFLAGS_DBG = |
|
219 |
||
220 |
# The -W0,-noglobal tells the compiler to NOT generate mangled global |
|
221 |
# ELF data symbols for file local static data. |
|
222 |
# This can break fix&continue, but we'd rather do the same compilations |
|
223 |
# for deliverable bits as we do for non-deliverable bits |
|
224 |
# Tell the compilers to never generate globalized names, all the time. |
|
225 |
CFLAGS_COMMON += -W0,-noglobal |
|
226 |
||
642
d1f02d5e4c74
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
30
diff
changeset
|
227 |
# If we have a specific arch value to use, add it |
d1f02d5e4c74
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
30
diff
changeset
|
228 |
CFLAGS_COMMON += $(XARCH_OPTION) |
d1f02d5e4c74
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
30
diff
changeset
|
229 |
CXXFLAGS_COMMON += $(XARCH_OPTION) |
d1f02d5e4c74
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
30
diff
changeset
|
230 |
ASFLAGS_COMMON += $(AS_XARCH_OPTION) |
d1f02d5e4c74
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
30
diff
changeset
|
231 |
EXTRA_LIBS += $(XARCH_OPTION) |
d1f02d5e4c74
6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents:
30
diff
changeset
|
232 |
LINTFLAGS_COMMON += $(LINT_XARCH_OPTION) |
2 | 233 |
|
234 |
# |
|
235 |
# uncomment the following to build with PERTURBALOT set |
|
236 |
# |
|
237 |
# OTHER_CFLAGS += -DPERTURBALOT |
|
238 |
# |
|
239 |
||
240 |
CPPFLAGS_COMMON = -D$(ARCH_FAMILY) -D__solaris__ -D_REENTRANT |
|
241 |
CPPFLAGS_OPT = |
|
242 |
CPPFLAGS_DBG = -DDEBUG |
|
243 |
||
244 |
ifeq ($(ARCH_FAMILY), i586) |
|
245 |
# The macro _LITTLE_ENDIAN needs to be defined the same to avoid the |
|
246 |
# Sun C compiler warning message: warning: macro redefined: _LITTLE_ENDIAN |
|
247 |
# (The Solaris X86 system defines this in file /usr/include/sys/isa_defs.h). |
|
248 |
# Note: -Dmacro is the same as #define macro 1 |
|
249 |
# -Dmacro= is the same as #define macro |
|
250 |
# |
|
251 |
CPPFLAGS_COMMON += -DcpuIntel -D_LITTLE_ENDIAN= -D$(LIBARCH) |
|
252 |
# Turn off a superfluous compiler error message on Intel |
|
253 |
CFLAGS_COMMON += -erroff=E_BAD_PRAGMA_PACK_VALUE |
|
254 |
endif |
|
255 |
||
256 |
# Java memory management is based on memory mapping by default, but a |
|
257 |
# system only assuming malloc/free can be built by adding -DUSE_MALLOC |
|
258 |
||
259 |
CPPFLAGS_COMMON += -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS |
|
260 |
CPPFLAGS_OPT += -DTRIMMED |
|
261 |
||
262 |
LDFLAGS_DEFS_OPTION = -z defs |
|
263 |
LDFLAGS_COMMON += $(LDFLAGS_DEFS_OPTION) |
|
264 |
||
265 |
# |
|
266 |
# -L paths for finding and -ljava |
|
267 |
# |
|
268 |
LDFLAGS_COMMON += -L$(LIBDIR)/$(LIBARCH) |
|
269 |
LDFLAGS_OPT = |
|
270 |
LDFLAGS_DBG = |
|
271 |
||
272 |
# |
|
273 |
# We never really want the incremental linker, ever |
|
274 |
# The -xildoff option tells Sun's compilers to NOT use incremental linker |
|
275 |
# |
|
276 |
LDFLAGS_COMMON += -xildoff |
|
277 |
||
278 |
ifdef LIBRARY |
|
279 |
# Libraries need to locate other libraries at runtime, and you can tell |
|
280 |
# a library where to look by way of the dynamic runpaths (RPATH or RUNPATH) |
|
281 |
# buried inside the .so. The $ORIGIN says to look relative to where |
|
282 |
# the library itself is and it can be followed with relative paths from |
|
283 |
# that. By default we always look in $ORIGIN, optionally we add relative |
|
284 |
# paths if the Makefile sets LD_RUNPATH_EXTRAS to those relative paths. |
|
285 |
# The environment variable LD_LIBRARY_PATH will over-ride these runpaths. |
|
286 |
# Try: 'dump -Lv lib*.so' to see these settings in a library. |
|
287 |
# |
|
288 |
LDFLAGS_COMMON += -R\$$ORIGIN |
|
289 |
LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=-R\$$ORIGIN/%) |
|
290 |
endif |
|
291 |
||
292 |
EXTRA_LIBS += -lc |
|
293 |
||
294 |
# Postprocessing is done on the images directories only |
|
295 |
# |
|
296 |
ifeq ($(VARIANT), OPT) |
|
297 |
ifeq ($(PARTIAL_GPROF), true) |
|
298 |
NO_STRIP = true |
|
299 |
endif |
|
300 |
ifeq ($(GPROF), true) |
|
301 |
NO_STRIP = true |
|
302 |
endif |
|
303 |
ifneq ($(NO_STRIP), true) |
|
304 |
# Debug 'strip -x' leaves local function Elf symbols (better stack traces) |
|
305 |
POST_STRIP_PROCESS = $(STRIP) -x |
|
306 |
endif |
|
307 |
endif |
|
308 |
POST_MCS_PROCESS=$(MCS) -d -a "JDK $(FULL_VERSION)" |
|
309 |
||
310 |
# |
|
311 |
# Sun C compiler will take -M and pass it on to ld. |
|
312 |
# Usage: ld $(LD_MAPFILE_FLAG) mapfile *.o |
|
313 |
# |
|
314 |
ifeq ($(CC_VERSION),gcc) |
|
315 |
LD_MAPFILE_FLAG = -Xlinker -M -Xlinker |
|
316 |
else |
|
317 |
LD_MAPFILE_FLAG = -M |
|
318 |
endif |
|
319 |
||
320 |
# |
|
321 |
# Variables globally settable from the make command line (default |
|
322 |
# values in brackets): |
|
323 |
# GPROF (false) |
|
324 |
# Eg: % gnumake GPROF=true |
|
325 |
GPROF = false |
|
326 |
ifeq ($(GPROF), true) |
|
327 |
CFLAGS_COMMON += -DGPROF -xpg |
|
328 |
EXTRA_LIBS += -xpg |
|
329 |
endif |
|
330 |
||
331 |
# PARTIAL_GPROF is to be used ONLY during compilation - it should not |
|
332 |
# appear during linking of libraries or programs. It also should |
|
333 |
# prevent linking with -z defs to allow a symbol to remain undefined. |
|
334 |
# |
|
335 |
PARTIAL_GPROF = false |
|
336 |
ifeq ($(PARTIAL_GPROF), true) |
|
337 |
CFLAGS_GPROF += -xpg |
|
338 |
LDFLAGS_DEFS_OPTION = -z nodefs |
|
339 |
endif |
|
340 |
||
341 |
# |
|
342 |
# For a TCOV build we add in the TCOV_OPTION |
|
343 |
# |
|
344 |
ifdef TCOV_BUILD |
|
345 |
TCOV_OPTION = -xprofile=tcov |
|
346 |
LDFLAGS_COMMON += $(TCOV_OPTION) -Kpic |
|
347 |
CFLAGS_COMMON += $(TCOV_OPTION) |
|
348 |
CXXFLAGS_COMMON += $(TCOV_OPTION) |
|
349 |
EXTRA_LIBS += $(TCOV_OPTION) |
|
350 |
LDNOMAP=true |
|
351 |
endif |
|
352 |
||
353 |
# |
|
354 |
# Solaris only uses native threads. |
|
355 |
# |
|
356 |
THREADS_FLAG= native |
|
357 |
THREADS_DIR= threads |
|
358 |
||
359 |
# |
|
360 |
# Support for Quantify. |
|
361 |
# |
|
362 |
ifdef QUANTIFY |
|
363 |
QUANTIFY_CMD = quantify |
|
364 |
QUANTIFY_OPTIONS = -cache-dir=/tmp/quantify -always-use-cache-dir=yes |
|
365 |
LINK_PRE_CMD = $(QUANTIFY_CMD) $(QUANTIFY_OPTIONS) |
|
366 |
ifdef LIBRARY |
|
367 |
CFLAGS_COMMON += -K PIC |
|
368 |
endif |
|
369 |
endif |
|
370 |
||
371 |
# |
|
372 |
# Support for Purify. |
|
373 |
# |
|
374 |
ifdef PURIFY |
|
375 |
PURIFY_CMD = /net/suntools.eng/export/tools/sparc/bin/purify |
|
376 |
PURIFY_OPTIONS = -cache-dir=/tmp/quantify -always-use-cache-dir=yes |
|
377 |
LINK_PRE_CMD = $(PURIFY_CMD) $(PURIFY_OPTIONS) |
|
378 |
ifdef LIBRARY |
|
379 |
CFLAGS_COMMON += -K PIC |
|
380 |
endif |
|
381 |
endif |
|
382 |
||
383 |
# |
|
384 |
# Different "levels" of optimization. |
|
385 |
# |
|
386 |
ifeq ($(CC_VERSION),gcc) |
|
387 |
CC_HIGHEST_OPT = -O3 |
|
388 |
CC_HIGHER_OPT = -O3 |
|
389 |
CC_LOWER_OPT = -O2 |
|
390 |
CFLAGS_REQUIRED_i586 += -fno-omit-frame-pointer |
|
391 |
CFLAGS_REQUIRED_amd64 += -fno-omit-frame-pointer |
|
392 |
# Automatic precompiled header option to use (if COMPILE_APPROACH=batch) |
|
393 |
# (See Rules.gmk) May need to wait for gcc 5? |
|
394 |
AUTOMATIC_PCH_OPTION = |
|
395 |
else |
|
396 |
# Highest could be -xO5, but indications are that -xO5 should be reserved |
|
397 |
# for a per-file use, on sources with known performance impacts. |
|
398 |
CC_HIGHEST_OPT = -xO4 |
|
399 |
CC_HIGHER_OPT = -xO4 |
|
400 |
CC_LOWER_OPT = -xO2 |
|
401 |
# |
|
402 |
# WARNING: Use of _OPT=$(CC_HIGHEST_OPT) in your Makefile needs to be |
|
403 |
# done with care, there are some assumptions below that need to |
|
404 |
# be understood about the use of pointers, and IEEE behavior. |
|
405 |
# |
|
406 |
# Use non-standard floating point mode (not IEEE 754) |
|
407 |
CC_HIGHEST_OPT += -fns |
|
408 |
# Do some simplification of floating point arithmetic (not IEEE 754) |
|
409 |
CC_HIGHEST_OPT += -fsimple |
|
410 |
# Use single precision floating point with 'float' |
|
411 |
CC_HIGHEST_OPT += -fsingle |
|
412 |
# Assume memory references via basic pointer types do not alias |
|
413 |
# (Source with excessing pointer casting and data access with mixed |
|
414 |
# pointer types are not recommended) |
|
415 |
CC_HIGHEST_OPT += -xalias_level=basic |
|
416 |
# Use intrinsic or inline versions for math/std functions |
|
417 |
# (If you expect perfect errno behavior, do not use this) |
|
418 |
CC_HIGHEST_OPT += -xbuiltin=%all |
|
419 |
# Loop data dependency optimizations (need -xO3 or higher) |
|
420 |
CC_HIGHEST_OPT += -xdepend |
|
421 |
# Pointer parameters to functions do not overlap |
|
422 |
# (Similar to -xalias_level=basic usage, but less obvious sometimes. |
|
423 |
# If you pass in multiple pointers to the same data, do not use this) |
|
424 |
CC_HIGHEST_OPT += -xrestrict |
|
425 |
# Inline some library routines |
|
426 |
# (If you expect perfect errno behavior, do not use this) |
|
427 |
CC_HIGHEST_OPT += -xlibmil |
|
428 |
# Use optimized math routines |
|
429 |
# (If you expect perfect errno behavior, do not use this) |
|
430 |
# Can cause undefined external on Solaris 8 X86 on __sincos, removing for now |
|
431 |
# CC_HIGHEST_OPT += -xlibmopt |
|
432 |
ifeq ($(ARCH_FAMILY), sparc) |
|
433 |
# Assume at most 8byte alignment, raise SIGBUS on error |
|
434 |
### Presents an ABI issue with customer JNI libs? |
|
435 |
####CC_HIGHEST_OPT += -xmemalign=8s |
|
436 |
# Automatic prefetch instructions, explicit prefetch macros |
|
437 |
CC_HIGHEST_OPT += -xprefetch=auto,explicit |
|
438 |
# Pick ultra as the chip to optimize to |
|
439 |
CC_HIGHEST_OPT += -xchip=ultra |
|
440 |
endif |
|
441 |
ifeq ($(ARCH), i586) |
|
442 |
# Pick pentium as the chip to optimize to |
|
443 |
CC_HIGHEST_OPT += -xchip=pentium |
|
444 |
endif |
|
445 |
ifdef LIBRARY |
|
446 |
# The Solaris CBE (Common Build Environment) requires that the use |
|
447 |
# of appl registers be disabled when compiling a public library (or |
|
448 |
# a library that's loaded by a public library) on sparc. |
|
449 |
CFLAGS_REQUIRED_sparc += -xregs=no%appl |
|
450 |
CFLAGS_REQUIRED_sparcv9 += -xregs=no%appl |
|
451 |
endif |
|
452 |
ifeq ($(shell $(EXPR) $(CC_VER) \> 5.6), 1) |
|
453 |
# Do NOT use the frame pointer register as a general purpose opt register |
|
454 |
CFLAGS_REQUIRED_i586 += -xregs=no%frameptr |
|
455 |
CFLAGS_REQUIRED_amd64 += -xregs=no%frameptr |
|
456 |
# We MUST allow data alignment of 4 for sparc V8 (32bit) |
|
457 |
# Presents an ABI issue with customer JNI libs? We must be able to |
|
458 |
# to handle 4byte aligned objects? (rare occurance, but possible?) |
|
459 |
CFLAGS_REQUIRED_sparc += -xmemalign=4s |
|
460 |
endif |
|
461 |
# Just incase someone trys to use the SOS9 compilers |
|
462 |
ifeq ($(CC_VER), 5.6) |
|
463 |
# We MUST allow data alignment of 4 for sparc (sparcv9 is ok at 8s) |
|
464 |
CFLAGS_REQUIRED_sparc += -xmemalign=4s |
|
465 |
endif |
|
466 |
# Automatic precompiled header option to use (if COMPILE_APPROACH=batch) |
|
467 |
# (See Rules.gmk) The SS11 -xpch=auto* options appear to be broken. |
|
468 |
AUTOMATIC_PCH_OPTION = |
|
469 |
endif |
|
470 |
CC_NO_OPT = |
|
471 |
||
472 |
# If NO_OPTIMIZATIONS is defined in the environment, turn all optimzations off |
|
473 |
ifdef NO_OPTIMIZATIONS |
|
474 |
CC_HIGHEST_OPT = $(CC_NO_OPT) |
|
475 |
CC_HIGHER_OPT = $(CC_NO_OPT) |
|
476 |
CC_LOWER_OPT = $(CC_NO_OPT) |
|
477 |
endif |
|
478 |
||
479 |
# Flags required all the time |
|
480 |
CFLAGS_REQUIRED = $(CFLAGS_REQUIRED_$(ARCH)) |
|
481 |
||
482 |
# Add processor specific options for optimizations |
|
483 |
CC_HIGHEST_OPT += $(_OPT_$(ARCH)) |
|
484 |
CC_HIGHER_OPT += $(_OPT_$(ARCH)) |
|
485 |
CC_LOWER_OPT += $(_OPT_$(ARCH)) |
|
486 |
||
487 |
# Secret compiler optimization options that should be in the above macros |
|
488 |
# but since they differ in format from C to C++, are added into the C or |
|
489 |
# C++ specific macros for compiler flags. |
|
490 |
# |
|
491 |
# On i586 we need to tell the code generator to ALWAYS use a |
|
492 |
# frame pointer. |
|
493 |
ifeq ($(ARCH_FAMILY), i586) |
|
494 |
# Note that in 5.7, this is done with -xregs=no%frameptr |
|
495 |
ifeq ($(CC_VER), 5.5) |
|
496 |
# It's not exactly clear when this optimization kicks in, the |
|
497 |
# current assumption is -xO4 or greater and for C++ with |
|
498 |
# the -features=no%except option and -xO4 and greater. |
|
499 |
# Bottom line is, we ALWAYS want a frame pointer! |
|
500 |
CXXFLAGS_OPT += -Qoption ube -Z~B |
|
501 |
CFLAGS_OPT += -Wu,-Z~B |
|
502 |
ifeq ($(FASTDEBUG), true) |
|
503 |
CXXFLAGS_DBG += -Qoption ube -Z~B |
|
504 |
CFLAGS_DBG += -Wu,-Z~B |
|
505 |
endif |
|
506 |
endif |
|
507 |
endif |
|
508 |
# |
|
509 |
# Optimizer for sparc needs to be told not to do certain things |
|
510 |
# related to frames or save instructions. |
|
511 |
ifeq ($(ARCH_FAMILY), sparc) |
|
512 |
# NOTE: Someday the compilers will provide a high-level option for this. |
|
513 |
# Use save instructions instead of add instructions |
|
514 |
# This was an optimization starting in SC5.0 that made it hard for us to |
|
515 |
# find the "save" instruction (which got turned into an "add") |
|
516 |
CXXFLAGS_OPT += -Qoption cg -Qrm-s |
|
517 |
CFLAGS_OPT += -Wc,-Qrm-s |
|
518 |
ifeq ($(FASTDEBUG), true) |
|
519 |
CXXFLAGS_DBG += -Qoption cg -Qrm-s |
|
520 |
CFLAGS_DBG += -Wc,-Qrm-s |
|
521 |
endif |
|
522 |
# |
|
523 |
# NOTE: Someday the compilers will provide a high-level option for this. |
|
524 |
# Don't allow tail call code optimization. Started in SC5.0. |
|
525 |
# We don't like code of this form: |
|
526 |
# save |
|
527 |
# <code> |
|
528 |
# call foo |
|
529 |
# restore |
|
530 |
# because we can't tell if the method will have a stack frame |
|
531 |
# and register windows or not. |
|
532 |
CXXFLAGS_OPT += -Qoption cg -Qiselect-T0 |
|
533 |
CFLAGS_OPT += -Wc,-Qiselect-T0 |
|
534 |
ifeq ($(FASTDEBUG), true) |
|
535 |
CXXFLAGS_DBG += -Qoption cg -Qiselect-T0 |
|
536 |
CFLAGS_DBG += -Wc,-Qiselect-T0 |
|
537 |
endif |
|
538 |
endif |
|
539 |
||
540 |
# |
|
541 |
# Path and option to link against the VM, if you have to. Note that |
|
542 |
# there are libraries that link against only -ljava, but they do get |
|
543 |
# -L to the -ljvm, this is because -ljava depends on -ljvm, whereas |
|
544 |
# the library itself should not. |
|
545 |
# |
|
546 |
VM_NAME = server |
|
547 |
JVMLIB = -L$(LIBDIR)/$(LIBARCH)/$(VM_NAME) -ljvm |
|
548 |
JAVALIB = -ljava $(JVMLIB) |
|
549 |
||
550 |
# Part of INCREMENTAL_BUILD mechanism. |
|
551 |
# Compiler emits things like: path/file.o: file.h |
|
552 |
# We want something like: relative_path/file.o relative_path/file.d: file.h |
|
553 |
# In addition on Solaris, any include file starting with / is deleted, |
|
554 |
# this gets rid of things like /usr/include files, which never change. |
|
555 |
CC_DEPEND = -xM1 |
|
556 |
CC_DEPEND_FILTER = $(SED) -e '/:[ ]*[/]/d' -e 's!$*\.$(OBJECT_SUFFIX)!$(dir $@)& $(dir $@)$*.$(DEPEND_SUFFIX)!g' | $(SORT) -u |
|
557 |
||
558 |
# Location of openwin libraries (do we really need this anymore?) |
|
559 |
OPENWIN_HOME = /usr/openwin |
|
560 |
OPENWIN_LIB = $(OPENWIN_HOME)/lib$(ISA_DIR) |
|
561 |
||
562 |
# Runtime graphics library search paths... |
|
563 |
OPENWIN_RUNTIME_LIB = /usr/openwin/lib$(ISA_DIR) |
|
564 |
AWT_RUNPATH = -R/usr/dt/lib$(ISA_DIR) -R$(OPENWIN_RUNTIME_LIB) |
|
565 |
||
566 |
# C++ Runtime library (libCrun.so), use instead of -lCrun. |
|
567 |
# Originally used instead of -lCrun to guarantee use of the system |
|
568 |
# .so version and not the .a or .so that came with the compilers. |
|
569 |
# With the newer compilers this could probably change back to -lCrun but |
|
570 |
# in general this is ok to continue to do. |
|
571 |
LIBCXX = /usr/lib$(ISA_DIR)/libCrun.so.1 |
|
572 |
||
573 |
# Math Library (libm.so), do not use -lm. |
|
574 |
# There might be two versions of libm.so on the build system: |
|
575 |
# libm.so.1 and libm.so.2, and we want libm.so.1. |
|
576 |
# Depending on the Solaris release being used to build with, |
|
577 |
# /usr/lib/libm.so could point at a libm.so.2, so we are |
|
578 |
# explicit here so that the libjvm.so you have built will work on an |
|
579 |
# older Solaris release that might not have libm.so.2. |
|
580 |
# This is a critical factor in allowing builds on Solaris 10 or newer |
|
581 |
# to run on Solaris 8 or 9. |
|
582 |
# |
|
583 |
# Note: Historically there was also a problem picking up a static version |
|
584 |
# of libm.a from the compiler area, but that problem has gone away |
|
585 |
# with the newer compilers. Use of libm.a would cause .so bloat. |
|
586 |
# |
|
587 |
LIBM = /usr/lib$(ISA_DIR)/libm.so.1 |
|
588 |
||
589 |
# Socket library |
|
590 |
LIBSOCKET = -lsocket |
|
591 |
||
592 |
# GLOBAL_KPIC: If set means all libraries are PIC, position independent code |
|
593 |
# EXCEPT for select compiles |
|
594 |
# If a .o file is compiled non-PIC then it should be forced |
|
595 |
# into the RW data segment with a mapfile option. This is done |
|
596 |
# with object files which generated from .s files. |
|
597 |
# The -ztext enforces that no relocations remain in the text segment |
|
598 |
# so that it remains purely read-only for optimum system performance. |
|
599 |
# Some libraries may use a smaller size (13bit -Kpic) on sparc instead of |
|
600 |
# (32 bit -KPIC) and will override GLOBAL_KPIC appropriately. |
|
601 |
# |
|
602 |
PIC_CODE_LARGE = -KPIC |
|
603 |
PIC_CODE_SMALL = -Kpic |
|
604 |
ifndef TCOV_BUILD |
|
605 |
GLOBAL_KPIC = $(PIC_CODE_LARGE) |
|
606 |
CXXFLAGS_COMMON += $(GLOBAL_KPIC) |
|
607 |
CFLAGS_COMMON += $(GLOBAL_KPIC) |
|
608 |
LDFLAGS_COMMON += -ztext |
|
609 |
endif # TCOV_BUILD |
|
610 |
||
611 |
# If your platform has DPS, it will have Type1 fonts too, in which case |
|
612 |
# it is best to enable DPS support until such time as 2D's rasteriser |
|
613 |
# can fully handle Type1 fonts in all cases. Default is "yes". |
|
614 |
# HAVE_DPS should only be "no" if the platform has no DPS headers or libs |
|
615 |
# DPS (Displayable PostScript) is available on Solaris machines |
|
616 |
||
617 |
HAVE_DPS = yes |
|
618 |
||
619 |
# |
|
620 |
# Japanese manpages |
|
621 |
# |
|
622 |
JA_SOURCE_ENCODING = eucJP |
|
623 |
JA_TARGET_ENCODINGS = eucJP UTF-8 PCK |
|
624 |
||
625 |
# Settings for the JDI - Serviceability Agent binding. |
|
626 |
HOTSPOT_SALIB_PATH = $(HOTSPOT_IMPORT_PATH)/jre/lib/$(LIBARCH) |
|
627 |
SALIB_NAME = $(LIB_PREFIX)saproc.$(LIBRARY_SUFFIX) |
|
628 |
INCLUDE_SA=true |
|
629 |