make/solaris/makefiles/gcc.make

Mon, 28 Jul 2014 15:06:38 -0700

author
fzhinkin
date
Mon, 28 Jul 2014 15:06:38 -0700
changeset 6997
dbb05f6d93c4
parent 6198
55fb97c4c58d
child 6876
710a3c8b516e
permissions
-rw-r--r--

8051344: JVM crashed in Compile::start() during method parsing w/ UseRTMDeopt turned on
Summary: call rtm_deopt() only if there were no compilation bailouts before.
Reviewed-by: kvn

duke@435 1 #
mikael@6198 2 # Copyright (c) 1998, 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 CXX = g++
erikj@3600 31 CC = gcc
erikj@3600 32 AS = $(CC) -c
erikj@3600 33 MCS = /usr/ccs/bin/mcs
erikj@3600 34 endif
duke@435 35
duke@435 36 Compiler = gcc
duke@435 37
duke@435 38 # -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only
duke@435 39 # prints the numbers (e.g. "2.95", "3.2.1")
duke@435 40 CC_VER_MAJOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1)
duke@435 41 CC_VER_MINOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2)
duke@435 42
erikj@3518 43 # Check for the versions of C++ and C compilers ($CXX and $CC) used.
duke@435 44
duke@435 45 # Get the last thing on the line that looks like x.x+ (x is a digit).
duke@435 46 COMPILER_REV := \
erikj@3518 47 $(shell $(CXX) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1)
erikj@3518 48 CC_COMPILER_REV := \
duke@435 49 $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2)
duke@435 50
duke@435 51
duke@435 52 # check for precompiled headers support
duke@435 53 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0"
stefank@2325 54 # Allow the user to turn off precompiled headers from the command line.
stefank@2325 55 ifneq ($(USE_PRECOMPILED_HEADER),0)
duke@435 56 PRECOMPILED_HEADER_DIR=.
brutisso@3229 57 PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled/precompiled.hpp
stefank@2314 58 PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.gch
duke@435 59 endif
stefank@2325 60 endif
duke@435 61
duke@435 62
duke@435 63 #------------------------------------------------------------------------
duke@435 64 # Compiler flags
duke@435 65
duke@435 66 # position-independent code
duke@435 67 PICFLAG = -fPIC
duke@435 68
duke@435 69 VM_PICFLAG/LIBJVM = $(PICFLAG)
duke@435 70 VM_PICFLAG/AOUT =
duke@435 71 VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO))
duke@435 72
duke@435 73 CFLAGS += $(VM_PICFLAG)
duke@435 74 CFLAGS += -fno-rtti
duke@435 75 CFLAGS += -fno-exceptions
duke@435 76 CFLAGS += -D_REENTRANT
duke@435 77 CFLAGS += -fcheck-new
duke@435 78
duke@435 79 ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
duke@435 80
duke@435 81 ARCHFLAG/sparc = -m32 -mcpu=v9
duke@435 82 ARCHFLAG/sparcv9 = -m64 -mcpu=v9
duke@435 83 ARCHFLAG/i486 = -m32 -march=i586
duke@435 84 ARCHFLAG/amd64 = -m64 -march=k8
duke@435 85
duke@435 86
duke@435 87 # Optional sub-directory in /usr/lib where BUILDARCH libraries are kept.
duke@435 88 ISA_DIR=$(ISA_DIR/$(BUILDARCH))
duke@435 89 ISA_DIR/amd64=/amd64
duke@435 90 ISA_DIR/i486=
duke@435 91 ISA_DIR/sparcv9=/64
duke@435 92
duke@435 93
duke@435 94 CFLAGS += $(ARCHFLAG)
duke@435 95 AOUT_FLAGS += $(ARCHFLAG)
duke@435 96 LFLAGS += $(ARCHFLAG)
duke@435 97 ASFLAGS += $(ARCHFLAG)
duke@435 98
duke@435 99 ifeq ($(BUILDARCH), amd64)
duke@435 100 ASFLAGS += -march=k8 -march=amd64
duke@435 101 LFLAGS += -march=k8
duke@435 102 endif
duke@435 103
duke@435 104
duke@435 105 # Use C++ Interpreter
duke@435 106 ifdef CC_INTERP
duke@435 107 CFLAGS += -DCC_INTERP
duke@435 108 endif
duke@435 109
duke@435 110 # Keep temporary files (.ii, .s)
duke@435 111 ifdef NEED_ASM
duke@435 112 CFLAGS += -save-temps
duke@435 113 else
duke@435 114 CFLAGS += -pipe
duke@435 115 endif
duke@435 116
duke@435 117
duke@435 118 # Compiler warnings are treated as errors
duke@435 119 WARNINGS_ARE_ERRORS = -Werror
duke@435 120 # Enable these warnings. See 'info gcc' about details on these options
jprovino@4722 121 WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef
jprovino@4722 122 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
duke@435 123 # Special cases
duke@435 124 CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
duke@435 125
duke@435 126 # The flags to use for an Optimized g++ build
duke@435 127 OPT_CFLAGS += -O3
duke@435 128
duke@435 129 # Hotspot uses very unstrict aliasing turn this optimization off
duke@435 130 OPT_CFLAGS += -fno-strict-aliasing
duke@435 131
duke@435 132 # The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp
duke@435 133 # if we use expensive-optimizations
duke@435 134 # Note: all ia64 setting reflect the ones for linux
duke@435 135 # No actial testing was performed: there is no Solaris on ia64 presently
duke@435 136 ifeq ($(BUILDARCH), ia64)
duke@435 137 OPT_CFLAGS/bytecodeInterpreter.o += -fno-expensive-optimizations
duke@435 138 endif
duke@435 139
duke@435 140 OPT_CFLAGS/NOOPT=-O0
stefank@2314 141
stefank@2314 142 # Flags for generating make dependency flags.
stefank@2314 143 ifneq ("${CC_VER_MAJOR}", "2")
kamg@3832 144 DEPFLAGS = -fpch-deps -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)
stefank@2314 145 endif
stefank@2314 146
stefank@2325 147 # -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
stefank@3325 148 ifeq ($(USE_PRECOMPILED_HEADER),0)
stefank@2325 149 CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
stefank@2325 150 endif
stefank@2325 151
duke@435 152 #------------------------------------------------------------------------
duke@435 153 # Linker flags
duke@435 154
duke@435 155 # statically link libstdc++.so, work with gcc but ignored by g++
duke@435 156 STATIC_STDCXX = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
duke@435 157
duke@435 158 # statically link libgcc and/or libgcc_s, libgcc does not exist before gcc-3.x.
duke@435 159 ifneq ("${CC_VER_MAJOR}", "2")
duke@435 160 STATIC_LIBGCC += -static-libgcc
duke@435 161 endif
duke@435 162
duke@435 163 ifeq ($(BUILDARCH), ia64)
duke@435 164 # Note: all ia64 setting reflect the ones for linux
duke@435 165 # No actial testing was performed: there is no Solaris on ia64 presently
duke@435 166 LFLAGS += -Wl,-relax
duke@435 167 endif
duke@435 168
duke@435 169 ifdef USE_GNULD
duke@435 170 # Enable linker optimization
duke@435 171 LFLAGS += -Xlinker -O1
duke@435 172
duke@435 173 # Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file.
duke@435 174 MAPFLAG = -Xlinker --version-script=FILENAME
duke@435 175 else
duke@435 176 MAPFLAG = -Xlinker -M -Xlinker FILENAME
duke@435 177 endif
duke@435 178
duke@435 179 # Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj
duke@435 180 SONAMEFLAG = -Xlinker -soname=SONAME
duke@435 181
duke@435 182 # Build shared library
duke@435 183 SHARED_FLAG = -shared
duke@435 184
duke@435 185 #------------------------------------------------------------------------
duke@435 186 # Debug flags
duke@435 187
duke@435 188 # Use the stabs format for debugging information (this is the default
duke@435 189 # on gcc-2.91). It's good enough, has all the information about line
dcubed@4344 190 # numbers and local variables, and libjvm.so is only about 16M.
duke@435 191 # Change this back to "-g" if you want the most expressive format.
dcubed@4344 192 # (warning: that could easily inflate libjvm.so to 150M!)
duke@435 193 # Note: The Itanium gcc compiler crashes when using -gstabs.
duke@435 194 DEBUG_CFLAGS/ia64 = -g
duke@435 195 DEBUG_CFLAGS/amd64 = -g
duke@435 196 DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
duke@435 197 ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),)
duke@435 198 DEBUG_CFLAGS += -gstabs
duke@435 199 endif

mercurial