Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/make/solaris/makefiles/gcc.make
32284 views
#1# Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.2# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3#4# This code is free software; you can redistribute it and/or modify it5# under the terms of the GNU General Public License version 2 only, as6# published by the Free Software Foundation.7#8# This code is distributed in the hope that it will be useful, but WITHOUT9# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11# version 2 for more details (a copy is included in the LICENSE file that12# accompanied this code).13#14# You should have received a copy of the GNU General Public License version15# 2 along with this work; if not, write to the Free Software Foundation,16# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17#18# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19# or visit www.oracle.com if you need additional information or have any20# questions.21#22#2324#------------------------------------------------------------------------25# CC, CXX & AS2627# If a SPEC is not set already, then use these defaults.28ifeq ($(SPEC),)29CXX = g++30CC = gcc31AS = $(CC) -c32MCS = /usr/ccs/bin/mcs33endif3435Compiler = gcc3637# -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only38# prints the numbers (e.g. "2.95", "3.2.1")39CC_VER_MAJOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1)40CC_VER_MINOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2)4142# Check for the versions of C++ and C compilers ($CXX and $CC) used.4344# Get the last thing on the line that looks like x.x+ (x is a digit).45COMPILER_REV := \46$(shell $(CXX) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1)47CC_COMPILER_REV := \48$(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2)495051# check for precompiled headers support52ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0"53# Allow the user to turn off precompiled headers from the command line.54ifneq ($(USE_PRECOMPILED_HEADER),0)55PRECOMPILED_HEADER_DIR=.56PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled/precompiled.hpp57PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.gch58endif59endif606162#------------------------------------------------------------------------63# Compiler flags6465# position-independent code66PICFLAG = -fPIC6768VM_PICFLAG/LIBJVM = $(PICFLAG)69VM_PICFLAG/AOUT =70VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO))7172CFLAGS += $(VM_PICFLAG)73CFLAGS += -fno-rtti74CFLAGS += -fno-exceptions75CFLAGS += -D_REENTRANT76CFLAGS += -fcheck-new77CFLAGS += -fstack-protector7879ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))8081ARCHFLAG/sparc = -m32 -mcpu=v982ARCHFLAG/sparcv9 = -m64 -mcpu=v983ARCHFLAG/i486 = -m32 -march=i58684ARCHFLAG/amd64 = -m64 -march=k8858687# Optional sub-directory in /usr/lib where BUILDARCH libraries are kept.88ISA_DIR=$(ISA_DIR/$(BUILDARCH))89ISA_DIR/amd64=/amd6490ISA_DIR/i486=91ISA_DIR/sparcv9=/64929394CFLAGS += $(ARCHFLAG)95AOUT_FLAGS += $(ARCHFLAG)96LFLAGS += $(ARCHFLAG)97ASFLAGS += $(ARCHFLAG)9899ifeq ($(BUILDARCH), amd64)100ASFLAGS += -march=k8 -march=amd64101LFLAGS += -march=k8102endif103104105# Use C++ Interpreter106ifdef CC_INTERP107CFLAGS += -DCC_INTERP108endif109110# Keep temporary files (.ii, .s)111ifdef NEED_ASM112CFLAGS += -save-temps113else114CFLAGS += -pipe115endif116117118# Compiler warnings are treated as errors119WARNINGS_ARE_ERRORS = -Werror120# Enable these warnings. See 'info gcc' about details on these options121WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef -Wformat=2122CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)123# Special cases124CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))125126# The flags to use for an Optimized g++ build127OPT_CFLAGS += -O3128129# Hotspot uses very unstrict aliasing turn this optimization off130OPT_CFLAGS += -fno-strict-aliasing131132# The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp133# if we use expensive-optimizations134# Note: all ia64 setting reflect the ones for linux135# No actial testing was performed: there is no Solaris on ia64 presently136ifeq ($(BUILDARCH), ia64)137OPT_CFLAGS/bytecodeInterpreter.o += -fno-expensive-optimizations138endif139140OPT_CFLAGS/NOOPT=-O0141142# Flags for generating make dependency flags.143ifneq ("${CC_VER_MAJOR}", "2")144DEPFLAGS = -fpch-deps -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)145endif146147# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.148ifeq ($(USE_PRECOMPILED_HEADER),0)149CFLAGS += -DDONT_USE_PRECOMPILED_HEADER150endif151152#------------------------------------------------------------------------153# Linker flags154155# statically link libstdc++.so, work with gcc but ignored by g++156STATIC_STDCXX = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic157158# statically link libgcc and/or libgcc_s, libgcc does not exist before gcc-3.x.159ifneq ("${CC_VER_MAJOR}", "2")160STATIC_LIBGCC += -static-libgcc161endif162163ifeq ($(BUILDARCH), ia64)164# Note: all ia64 setting reflect the ones for linux165# No actial testing was performed: there is no Solaris on ia64 presently166LFLAGS += -Wl,-relax167endif168169ifdef USE_GNULD170# Enable linker optimization171LFLAGS += -Xlinker -O1172173# Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file.174MAPFLAG = -Xlinker --version-script=FILENAME175else176MAPFLAG = -Xlinker -M -Xlinker FILENAME177endif178179# Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj180SONAMEFLAG = -Xlinker -soname=SONAME181182# Build shared library183SHARED_FLAG = -shared184185#------------------------------------------------------------------------186# Debug flags187188# Use the stabs format for debugging information (this is the default189# on gcc-2.91). It's good enough, has all the information about line190# numbers and local variables, and libjvm.so is only about 16M.191# Change this back to "-g" if you want the most expressive format.192# (warning: that could easily inflate libjvm.so to 150M!)193# Note: The Itanium gcc compiler crashes when using -gstabs.194DEBUG_CFLAGS/ia64 = -g195DEBUG_CFLAGS/amd64 = -g196DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))197ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),)198DEBUG_CFLAGS += -gstabs199endif200201202