make/solaris/makefiles/gcc.make

Mon, 28 Nov 2011 14:58:31 +0100

author
stefank
date
Mon, 28 Nov 2011 14:58:31 +0100
changeset 3325
f4414323345f
parent 3229
95009f678859
child 3518
719f7007c8e8
permissions
-rw-r--r--

7116081: USE_PRECOMPILED_HEADER=0 triggers a single threaded build of the JVM
Summary: Changed the conditional to see if the precompiled header has been specified. Also, removed the unused PrecompiledOption.
Reviewed-by: dholmes, brutisso

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

mercurial