annotate make/common/Defs-solaris.gmk @ 7:82c85cfd8402

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