Wed, 04 Jun 2014 06:53:06 -0700
Merge
duke@435 | 1 | # |
hseigel@5576 | 2 | # Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. |
duke@435 | 3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@435 | 4 | # |
duke@435 | 5 | # This code is free software; you can redistribute it and/or modify it |
duke@435 | 6 | # under the terms of the GNU General Public License version 2 only, as |
duke@435 | 7 | # published by the Free Software Foundation. |
duke@435 | 8 | # |
duke@435 | 9 | # This code is distributed in the hope that it will be useful, but WITHOUT |
duke@435 | 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@435 | 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@435 | 12 | # version 2 for more details (a copy is included in the LICENSE file that |
duke@435 | 13 | # accompanied this code). |
duke@435 | 14 | # |
duke@435 | 15 | # You should have received a copy of the GNU General Public License version |
duke@435 | 16 | # 2 along with this work; if not, write to the Free Software Foundation, |
duke@435 | 17 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@435 | 18 | # |
trims@1907 | 19 | # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
trims@1907 | 20 | # or visit www.oracle.com if you need additional information or have any |
trims@1907 | 21 | # questions. |
duke@435 | 22 | # |
duke@435 | 23 | # |
duke@435 | 24 | |
duke@435 | 25 | #------------------------------------------------------------------------ |
erikj@3518 | 26 | # CC, CXX & AS |
duke@435 | 27 | |
erikj@3600 | 28 | # If a SPEC is not set already, then use these defaults. |
erikj@3600 | 29 | ifeq ($(SPEC),) |
erikj@3600 | 30 | # When cross-compiling the ALT_COMPILER_PATH points |
erikj@3600 | 31 | # to the cross-compilation toolset |
erikj@3600 | 32 | ifdef CROSS_COMPILE_ARCH |
erikj@3600 | 33 | CXX = $(ALT_COMPILER_PATH)/g++ |
erikj@3600 | 34 | CC = $(ALT_COMPILER_PATH)/gcc |
erikj@3600 | 35 | HOSTCXX = g++ |
erikj@3600 | 36 | HOSTCC = gcc |
erikj@3600 | 37 | STRIP = $(ALT_COMPILER_PATH)/strip |
erikj@3600 | 38 | else |
simonis@5230 | 39 | ifeq ($(USE_CLANG), true) |
simonis@5230 | 40 | CXX = clang++ |
simonis@5230 | 41 | CC = clang |
simonis@5230 | 42 | else |
simonis@5230 | 43 | CXX = g++ |
simonis@5230 | 44 | CC = gcc |
simonis@5230 | 45 | endif |
simonis@5230 | 46 | |
erikj@3600 | 47 | HOSTCXX = $(CXX) |
erikj@3600 | 48 | HOSTCC = $(CC) |
erikj@3600 | 49 | STRIP = strip |
erikj@3600 | 50 | endif |
erikj@3600 | 51 | AS = $(CC) -c |
bobv@2036 | 52 | endif |
bobv@2036 | 53 | |
duke@435 | 54 | |
simonis@5230 | 55 | ifeq ($(USE_CLANG), true) |
simonis@5230 | 56 | CC_VER_MAJOR := $(shell $(CC) -v 2>&1 | grep version | sed "s/.*version \([0-9]*\.[0-9]*\).*/\1/" | cut -d'.' -f1) |
simonis@5230 | 57 | CC_VER_MINOR := $(shell $(CC) -v 2>&1 | grep version | sed "s/.*version \([0-9]*\.[0-9]*\).*/\1/" | cut -d'.' -f2) |
simonis@5230 | 58 | else |
simonis@5230 | 59 | # -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only |
simonis@5230 | 60 | # prints the numbers (e.g. "2.95", "3.2.1") |
simonis@5230 | 61 | CC_VER_MAJOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1) |
simonis@5230 | 62 | CC_VER_MINOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2) |
simonis@5230 | 63 | endif |
duke@435 | 64 | |
simonis@5230 | 65 | |
simonis@5230 | 66 | ifeq ($(USE_CLANG), true) |
simonis@5230 | 67 | # Clang has precompiled headers support by default, but the user can switch |
simonis@5230 | 68 | # it off by using 'USE_PRECOMPILED_HEADER=0'. |
simonis@5230 | 69 | ifdef LP64 |
simonis@5230 | 70 | ifeq ($(USE_PRECOMPILED_HEADER),) |
simonis@5230 | 71 | USE_PRECOMPILED_HEADER=1 |
simonis@5230 | 72 | endif |
simonis@5230 | 73 | else |
simonis@5230 | 74 | # We don't support precompiled headers on 32-bit builds because there some files are |
simonis@5230 | 75 | # compiled with -fPIC while others are compiled without (see 'NONPIC_OBJ_FILES' rules.make) |
simonis@5230 | 76 | # Clang produces an error if the PCH file was compiled with other options than the actual compilation unit. |
simonis@5230 | 77 | USE_PRECOMPILED_HEADER=0 |
simonis@5230 | 78 | endif |
simonis@5230 | 79 | |
simonis@5230 | 80 | ifeq ($(USE_PRECOMPILED_HEADER),1) |
simonis@5230 | 81 | |
simonis@5230 | 82 | ifndef LP64 |
simonis@5230 | 83 | $(error " Precompiled Headers only supported on 64-bit platforms!") |
simonis@5230 | 84 | endif |
simonis@5230 | 85 | |
simonis@5230 | 86 | PRECOMPILED_HEADER_DIR=. |
simonis@5230 | 87 | PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled/precompiled.hpp |
simonis@5230 | 88 | PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.pch |
simonis@5230 | 89 | |
simonis@5230 | 90 | PCH_FLAG = -include precompiled.hpp |
simonis@5230 | 91 | PCH_FLAG/DEFAULT = $(PCH_FLAG) |
simonis@5230 | 92 | PCH_FLAG/NO_PCH = -DNO_PCH |
simonis@5230 | 93 | PCH_FLAG/BY_FILE = $(PCH_FLAG/$@)$(PCH_FLAG/DEFAULT$(PCH_FLAG/$@)) |
simonis@5230 | 94 | |
simonis@5230 | 95 | VM_PCH_FLAG/LIBJVM = $(PCH_FLAG/BY_FILE) |
simonis@5230 | 96 | VM_PCH_FLAG/AOUT = |
simonis@5230 | 97 | VM_PCH_FLAG = $(VM_PCH_FLAG/$(LINK_INTO)) |
simonis@5230 | 98 | |
simonis@5230 | 99 | # We only use precompiled headers for the JVM build |
simonis@5230 | 100 | CFLAGS += $(VM_PCH_FLAG) |
simonis@5230 | 101 | |
simonis@5230 | 102 | # There are some files which don't like precompiled headers |
simonis@5230 | 103 | # The following files are build with 'OPT_CFLAGS/NOOPT' (-O0) in the opt build. |
simonis@5230 | 104 | # But Clang doesn't support a precompiled header which was compiled with -O3 |
simonis@5230 | 105 | # to be used in a compilation unit which uses '-O0'. We could also prepare an |
simonis@5230 | 106 | # extra '-O0' PCH file for the opt build and use it here, but it's probably |
simonis@5230 | 107 | # not worth the effoert as long as only two files need this special handling. |
simonis@5230 | 108 | PCH_FLAG/loopTransform.o = $(PCH_FLAG/NO_PCH) |
simonis@5230 | 109 | PCH_FLAG/sharedRuntimeTrig.o = $(PCH_FLAG/NO_PCH) |
simonis@5230 | 110 | PCH_FLAG/sharedRuntimeTrans.o = $(PCH_FLAG/NO_PCH) |
simonis@5230 | 111 | |
simonis@5230 | 112 | endif |
simonis@5230 | 113 | else # ($(USE_CLANG), true) |
simonis@5230 | 114 | # check for precompiled headers support |
simonis@5230 | 115 | ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0" |
simonis@5230 | 116 | # Allow the user to turn off precompiled headers from the command line. |
simonis@5230 | 117 | ifneq ($(USE_PRECOMPILED_HEADER),0) |
simonis@5230 | 118 | PRECOMPILED_HEADER_DIR=. |
simonis@5230 | 119 | PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled/precompiled.hpp |
simonis@5230 | 120 | PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.gch |
simonis@5230 | 121 | endif |
simonis@5230 | 122 | endif |
duke@435 | 123 | endif |
simonis@5230 | 124 | |
simonis@5230 | 125 | # -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp. |
simonis@5230 | 126 | ifeq ($(USE_PRECOMPILED_HEADER),0) |
simonis@5230 | 127 | CFLAGS += -DDONT_USE_PRECOMPILED_HEADER |
stefank@2325 | 128 | endif |
duke@435 | 129 | |
duke@435 | 130 | |
duke@435 | 131 | #------------------------------------------------------------------------ |
duke@435 | 132 | # Compiler flags |
duke@435 | 133 | |
duke@435 | 134 | # position-independent code |
duke@435 | 135 | PICFLAG = -fPIC |
duke@435 | 136 | |
duke@435 | 137 | VM_PICFLAG/LIBJVM = $(PICFLAG) |
duke@435 | 138 | VM_PICFLAG/AOUT = |
duke@435 | 139 | VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO)) |
duke@435 | 140 | |
erikj@3649 | 141 | ifeq ($(JVM_VARIANT_ZERO), true) |
never@1445 | 142 | CFLAGS += $(LIBFFI_CFLAGS) |
never@1445 | 143 | endif |
erikj@3649 | 144 | ifeq ($(JVM_VARIANT_ZEROSHARK), true) |
erikj@3649 | 145 | CFLAGS += $(LIBFFI_CFLAGS) |
twisti@2047 | 146 | CFLAGS += $(LLVM_CFLAGS) |
twisti@2047 | 147 | endif |
duke@435 | 148 | CFLAGS += $(VM_PICFLAG) |
duke@435 | 149 | CFLAGS += -fno-rtti |
duke@435 | 150 | CFLAGS += -fno-exceptions |
duke@435 | 151 | CFLAGS += -D_REENTRANT |
simonis@5230 | 152 | ifeq ($(USE_CLANG),) |
simonis@5230 | 153 | CFLAGS += -fcheck-new |
simonis@5230 | 154 | # version 4 and above support fvisibility=hidden (matches jni_x86.h file) |
simonis@5230 | 155 | # except 4.1.2 gives pointless warnings that can't be disabled (afaik) |
simonis@5230 | 156 | ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0" |
simonis@5230 | 157 | CFLAGS += -fvisibility=hidden |
simonis@5230 | 158 | endif |
simonis@5230 | 159 | else |
simonis@5230 | 160 | CFLAGS += -fvisibility=hidden |
simonis@5230 | 161 | endif |
simonis@5230 | 162 | |
simonis@5230 | 163 | ifeq ($(USE_CLANG), true) |
simonis@5230 | 164 | # Before Clang 3.1, we had to pass the stack alignment specification directly to llvm with the help of '-mllvm' |
simonis@5230 | 165 | # Starting with version 3.1, Clang understands the '-mstack-alignment' (and rejects '-mllvm -stack-alignment') |
simonis@5230 | 166 | ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 1 \) \))" "0" |
simonis@5230 | 167 | STACK_ALIGNMENT_OPT = -mno-omit-leaf-frame-pointer -mstack-alignment=16 |
simonis@5230 | 168 | else |
simonis@5230 | 169 | STACK_ALIGNMENT_OPT = -mno-omit-leaf-frame-pointer -mllvm -stack-alignment=16 |
simonis@5230 | 170 | endif |
coleenp@2507 | 171 | endif |
duke@435 | 172 | |
duke@435 | 173 | ARCHFLAG = $(ARCHFLAG/$(BUILDARCH)) |
duke@435 | 174 | ARCHFLAG/i486 = -m32 -march=i586 |
simonis@5230 | 175 | ARCHFLAG/amd64 = -m64 $(STACK_ALIGNMENT_OPT) |
duke@435 | 176 | ARCHFLAG/ia64 = |
duke@435 | 177 | ARCHFLAG/sparc = -m32 -mcpu=v9 |
duke@435 | 178 | ARCHFLAG/sparcv9 = -m64 -mcpu=v9 |
bobv@2036 | 179 | ARCHFLAG/arm = -fsigned-char |
never@1445 | 180 | ARCHFLAG/zero = $(ZERO_ARCHFLAG) |
bobv@2036 | 181 | ifndef E500V2 |
bobv@2036 | 182 | ARCHFLAG/ppc = -mcpu=powerpc |
bobv@2036 | 183 | endif |
simonis@6452 | 184 | ARCHFLAG/ppc64 = -m64 |
duke@435 | 185 | |
duke@435 | 186 | CFLAGS += $(ARCHFLAG) |
duke@435 | 187 | AOUT_FLAGS += $(ARCHFLAG) |
duke@435 | 188 | LFLAGS += $(ARCHFLAG) |
duke@435 | 189 | ASFLAGS += $(ARCHFLAG) |
duke@435 | 190 | |
bobv@2036 | 191 | ifdef E500V2 |
bobv@2036 | 192 | CFLAGS += -DE500V2 |
bobv@2036 | 193 | endif |
bobv@2036 | 194 | |
duke@435 | 195 | # Use C++ Interpreter |
duke@435 | 196 | ifdef CC_INTERP |
duke@435 | 197 | CFLAGS += -DCC_INTERP |
duke@435 | 198 | endif |
duke@435 | 199 | |
duke@435 | 200 | # Keep temporary files (.ii, .s) |
duke@435 | 201 | ifdef NEED_ASM |
duke@435 | 202 | CFLAGS += -save-temps |
duke@435 | 203 | else |
duke@435 | 204 | CFLAGS += -pipe |
duke@435 | 205 | endif |
duke@435 | 206 | |
duke@435 | 207 | # Compiler warnings are treated as errors |
duke@435 | 208 | WARNINGS_ARE_ERRORS = -Werror |
xlu@664 | 209 | |
simonis@5230 | 210 | ifeq ($(USE_CLANG), true) |
simonis@5230 | 211 | # However we need to clean the code up before we can unrestrictedly enable this option with Clang |
twisti@5797 | 212 | WARNINGS_ARE_ERRORS += -Wno-logical-op-parentheses -Wno-parentheses-equality -Wno-parentheses |
simonis@5230 | 213 | WARNINGS_ARE_ERRORS += -Wno-switch -Wno-tautological-constant-out-of-range-compare -Wno-tautological-compare |
simonis@5230 | 214 | WARNINGS_ARE_ERRORS += -Wno-delete-non-virtual-dtor -Wno-deprecated -Wno-format -Wno-dynamic-class-memaccess |
simonis@5230 | 215 | WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body |
simonis@5230 | 216 | endif |
simonis@5230 | 217 | |
ccheung@5259 | 218 | WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value |
mikael@4889 | 219 | |
simonis@5230 | 220 | ifeq ($(USE_CLANG),) |
simonis@5230 | 221 | # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit |
simonis@5230 | 222 | # conversions which might affect the values. Only enable it in earlier versions. |
simonis@5230 | 223 | ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0" |
simonis@5230 | 224 | WARNING_FLAGS += -Wconversion |
simonis@5230 | 225 | endif |
xlu@664 | 226 | endif |
xlu@664 | 227 | |
jprovino@4722 | 228 | CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS) |
duke@435 | 229 | # Special cases |
duke@435 | 230 | CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@)) |
duke@435 | 231 | |
duke@435 | 232 | # The flags to use for an Optimized g++ build |
jprovino@4165 | 233 | OPT_CFLAGS/SIZE=-Os |
jprovino@4165 | 234 | OPT_CFLAGS/SPEED=-O3 |
duke@435 | 235 | |
duke@435 | 236 | # Hotspot uses very unstrict aliasing turn this optimization off |
jprovino@4165 | 237 | # This option is added to CFLAGS rather than OPT_CFLAGS |
jprovino@4165 | 238 | # so that OPT_CFLAGS overrides get this option too. |
jprovino@4165 | 239 | CFLAGS += -fno-strict-aliasing |
jprovino@4165 | 240 | |
jprovino@4165 | 241 | OPT_CFLAGS_DEFAULT ?= SPEED |
jprovino@4165 | 242 | |
jprovino@4165 | 243 | ifdef OPT_CFLAGS |
jprovino@4165 | 244 | ifneq ("$(origin OPT_CFLAGS)", "command line") |
jprovino@4165 | 245 | $(error " Use OPT_EXTRAS instead of OPT_CFLAGS to add extra flags to OPT_CFLAGS.") |
jprovino@4165 | 246 | endif |
jprovino@4165 | 247 | endif |
jprovino@4165 | 248 | |
jprovino@4165 | 249 | OPT_CFLAGS = $(OPT_CFLAGS/$(OPT_CFLAGS_DEFAULT)) $(OPT_EXTRAS) |
duke@435 | 250 | |
duke@435 | 251 | # The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp |
duke@435 | 252 | # if we use expensive-optimizations |
duke@435 | 253 | ifeq ($(BUILDARCH), ia64) |
duke@435 | 254 | OPT_CFLAGS += -fno-expensive-optimizations |
duke@435 | 255 | endif |
duke@435 | 256 | |
duke@435 | 257 | OPT_CFLAGS/NOOPT=-O0 |
duke@435 | 258 | |
simonis@5230 | 259 | # Work around some compiler bugs. |
simonis@5230 | 260 | ifeq ($(USE_CLANG), true) |
simonis@5230 | 261 | ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 2), 1) |
simonis@5230 | 262 | OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT) |
simonis@5230 | 263 | endif |
simonis@5230 | 264 | else |
simonis@5230 | 265 | # 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation. |
simonis@5230 | 266 | ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 3), 1) |
simonis@5230 | 267 | OPT_CFLAGS/mulnode.o += $(OPT_CFLAGS/NOOPT) |
simonis@5230 | 268 | endif |
kvn@1179 | 269 | endif |
kvn@1179 | 270 | |
stefank@2314 | 271 | # Flags for generating make dependency flags. |
simonis@5230 | 272 | DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d) |
simonis@5230 | 273 | ifeq ($(USE_CLANG),) |
simonis@5230 | 274 | ifneq ("${CC_VER_MAJOR}", "2") |
simonis@5230 | 275 | DEPFLAGS += -fpch-deps |
simonis@5230 | 276 | endif |
stefank@2325 | 277 | endif |
stefank@2325 | 278 | |
duke@435 | 279 | #------------------------------------------------------------------------ |
duke@435 | 280 | # Linker flags |
duke@435 | 281 | |
duke@435 | 282 | # statically link libstdc++.so, work with gcc but ignored by g++ |
duke@435 | 283 | STATIC_STDCXX = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic |
duke@435 | 284 | |
simonis@5230 | 285 | ifeq ($(USE_CLANG),) |
simonis@5230 | 286 | # statically link libgcc and/or libgcc_s, libgcc does not exist before gcc-3.x. |
simonis@5230 | 287 | ifneq ("${CC_VER_MAJOR}", "2") |
simonis@5230 | 288 | STATIC_LIBGCC += -static-libgcc |
simonis@5230 | 289 | endif |
duke@435 | 290 | |
simonis@5230 | 291 | ifeq ($(BUILDARCH), ia64) |
simonis@5230 | 292 | LFLAGS += -Wl,-relax |
simonis@5230 | 293 | endif |
duke@435 | 294 | endif |
duke@435 | 295 | |
duke@435 | 296 | # Enable linker optimization |
duke@435 | 297 | LFLAGS += -Xlinker -O1 |
duke@435 | 298 | |
simonis@5230 | 299 | ifeq ($(USE_CLANG),) |
simonis@5230 | 300 | # If this is a --hash-style=gnu system, use --hash-style=both |
simonis@5230 | 301 | # The gnu .hash section won't work on some Linux systems like SuSE 10. |
simonis@5230 | 302 | _HAS_HASH_STYLE_GNU:=$(shell $(CC) -dumpspecs | grep -- '--hash-style=gnu') |
simonis@5230 | 303 | ifneq ($(_HAS_HASH_STYLE_GNU),) |
simonis@5230 | 304 | LDFLAGS_HASH_STYLE = -Wl,--hash-style=both |
simonis@5230 | 305 | endif |
simonis@5230 | 306 | else |
simonis@5230 | 307 | # Don't know how to find out the 'hash style' of a system as '-dumpspecs' |
simonis@5230 | 308 | # doesn't work for Clang. So for now we'll alwys use --hash-style=both |
ohair@1011 | 309 | LDFLAGS_HASH_STYLE = -Wl,--hash-style=both |
ohair@1011 | 310 | endif |
simonis@5230 | 311 | |
ohair@1011 | 312 | LFLAGS += $(LDFLAGS_HASH_STYLE) |
ohair@1011 | 313 | |
duke@435 | 314 | # Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file. |
duke@435 | 315 | MAPFLAG = -Xlinker --version-script=FILENAME |
duke@435 | 316 | |
duke@435 | 317 | # Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj |
duke@435 | 318 | SONAMEFLAG = -Xlinker -soname=SONAME |
duke@435 | 319 | |
duke@435 | 320 | # Build shared library |
duke@435 | 321 | SHARED_FLAG = -shared |
duke@435 | 322 | |
duke@435 | 323 | # Keep symbols even they are not used |
dsamersoff@2839 | 324 | AOUT_FLAGS += -Xlinker -export-dynamic |
duke@435 | 325 | |
duke@435 | 326 | #------------------------------------------------------------------------ |
duke@435 | 327 | # Debug flags |
duke@435 | 328 | |
simonis@5230 | 329 | ifeq ($(USE_CLANG), true) |
simonis@5230 | 330 | # Restrict the debug information created by Clang to avoid |
simonis@5230 | 331 | # too big object files and speed the build up a little bit |
simonis@5230 | 332 | # (see http://llvm.org/bugs/show_bug.cgi?id=7554) |
simonis@5230 | 333 | CFLAGS += -flimit-debug-info |
simonis@5230 | 334 | endif |
simonis@5230 | 335 | |
dcubed@3989 | 336 | # DEBUG_BINARIES uses full -g debug information for all configs |
dcubed@3989 | 337 | ifeq ($(DEBUG_BINARIES), true) |
dcubed@3989 | 338 | CFLAGS += -g |
dcubed@3989 | 339 | else |
dcubed@3989 | 340 | # Use the stabs format for debugging information (this is the default |
dcubed@3989 | 341 | # on gcc-2.91). It's good enough, has all the information about line |
dcubed@4344 | 342 | # numbers and local variables, and libjvm.so is only about 16M. |
dcubed@3989 | 343 | # Change this back to "-g" if you want the most expressive format. |
dcubed@4344 | 344 | # (warning: that could easily inflate libjvm.so to 150M!) |
dcubed@3989 | 345 | # Note: The Itanium gcc compiler crashes when using -gstabs. |
dcubed@3989 | 346 | DEBUG_CFLAGS/ia64 = -g |
dcubed@3989 | 347 | DEBUG_CFLAGS/amd64 = -g |
dcubed@3989 | 348 | DEBUG_CFLAGS/arm = -g |
dcubed@3989 | 349 | DEBUG_CFLAGS/ppc = -g |
simonis@6452 | 350 | DEBUG_CFLAGS/ppc64 = -g |
dcubed@3989 | 351 | DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH)) |
dcubed@3989 | 352 | ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),) |
simonis@5230 | 353 | ifeq ($(USE_CLANG), true) |
simonis@5230 | 354 | # Clang doesn't understand -gstabs |
twisti@5315 | 355 | DEBUG_CFLAGS += -g |
simonis@5230 | 356 | else |
twisti@5315 | 357 | DEBUG_CFLAGS += -gstabs |
simonis@5230 | 358 | endif |
dcubed@3150 | 359 | endif |
dcubed@3989 | 360 | |
dcubed@3989 | 361 | ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
dcubed@3989 | 362 | FASTDEBUG_CFLAGS/ia64 = -g |
dcubed@3989 | 363 | FASTDEBUG_CFLAGS/amd64 = -g |
dcubed@3989 | 364 | FASTDEBUG_CFLAGS/arm = -g |
dcubed@3989 | 365 | FASTDEBUG_CFLAGS/ppc = -g |
simonis@6452 | 366 | FASTDEBUG_CFLAGS/ppc64 = -g |
dcubed@3989 | 367 | FASTDEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH)) |
dcubed@3989 | 368 | ifeq ($(FASTDEBUG_CFLAGS/$(BUILDARCH)),) |
simonis@5230 | 369 | ifeq ($(USE_CLANG), true) |
simonis@5230 | 370 | # Clang doesn't understand -gstabs |
twisti@5315 | 371 | FASTDEBUG_CFLAGS += -g |
simonis@5230 | 372 | else |
twisti@5315 | 373 | FASTDEBUG_CFLAGS += -gstabs |
simonis@5230 | 374 | endif |
dcubed@3989 | 375 | endif |
dcubed@3989 | 376 | |
dcubed@3989 | 377 | OPT_CFLAGS/ia64 = -g |
dcubed@3989 | 378 | OPT_CFLAGS/amd64 = -g |
dcubed@3989 | 379 | OPT_CFLAGS/arm = -g |
dcubed@3989 | 380 | OPT_CFLAGS/ppc = -g |
simonis@6452 | 381 | OPT_CFLAGS/ppc64 = -g |
dcubed@3989 | 382 | OPT_CFLAGS += $(OPT_CFLAGS/$(BUILDARCH)) |
dcubed@3989 | 383 | ifeq ($(OPT_CFLAGS/$(BUILDARCH)),) |
simonis@5230 | 384 | ifeq ($(USE_CLANG), true) |
simonis@5230 | 385 | # Clang doesn't understand -gstabs |
simonis@5230 | 386 | OPT_CFLAGS += -g |
simonis@5230 | 387 | else |
simonis@5230 | 388 | OPT_CFLAGS += -gstabs |
simonis@5230 | 389 | endif |
dcubed@3989 | 390 | endif |
dcubed@3150 | 391 | endif |
dcubed@3150 | 392 | endif |
dcubed@3150 | 393 | |
bobv@2036 | 394 | # If we are building HEADLESS, pass on to VM |
bobv@2036 | 395 | # so it can set the java.awt.headless property |
bobv@2036 | 396 | ifdef HEADLESS |
bobv@2036 | 397 | CFLAGS += -DHEADLESS |
bobv@2036 | 398 | endif |
bobv@2036 | 399 | |
bobv@2036 | 400 | # We are building Embedded for a small device |
bobv@2036 | 401 | # favor code space over speed |
bobv@2036 | 402 | ifdef MINIMIZE_RAM_USAGE |
bobv@2036 | 403 | CFLAGS += -DMINIMIZE_RAM_USAGE |
bobv@2036 | 404 | endif |
hseigel@5576 | 405 | |
hseigel@5576 | 406 | # Stack walking in the JVM relies on frame pointer (%rbp) to walk thread stack. |
hseigel@5576 | 407 | # Explicitly specify -fno-omit-frame-pointer because it is off by default |
hseigel@5576 | 408 | # starting with gcc 4.6. |
hseigel@5576 | 409 | ifndef USE_SUNCC |
hseigel@5576 | 410 | CFLAGS += -fno-omit-frame-pointer |
hseigel@5576 | 411 | endif |