annotate make/linux/makefiles/gcc.make @ 9643:e796d52ca85b

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