Path: blob/jdk8u272-b10-aarch32-20201026/hotspot/make/solaris/makefiles/gcc.make
83397 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-new7778ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))7980ARCHFLAG/sparc = -m32 -mcpu=v981ARCHFLAG/sparcv9 = -m64 -mcpu=v982ARCHFLAG/i486 = -m32 -march=i58683ARCHFLAG/amd64 = -m64 -march=k8848586# Optional sub-directory in /usr/lib where BUILDARCH libraries are kept.87ISA_DIR=$(ISA_DIR/$(BUILDARCH))88ISA_DIR/amd64=/amd6489ISA_DIR/i486=90ISA_DIR/sparcv9=/64919293CFLAGS += $(ARCHFLAG)94AOUT_FLAGS += $(ARCHFLAG)95LFLAGS += $(ARCHFLAG)96ASFLAGS += $(ARCHFLAG)9798ifeq ($(BUILDARCH), amd64)99ASFLAGS += -march=k8 -march=amd64100LFLAGS += -march=k8101endif102103104# Use C++ Interpreter105ifdef CC_INTERP106CFLAGS += -DCC_INTERP107endif108109# Keep temporary files (.ii, .s)110ifdef NEED_ASM111CFLAGS += -save-temps112else113CFLAGS += -pipe114endif115116117# Compiler warnings are treated as errors118WARNINGS_ARE_ERRORS = -Werror119# Enable these warnings. See 'info gcc' about details on these options120WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef -Wformat=2121CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)122# Special cases123CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))124125# The flags to use for an Optimized g++ build126OPT_CFLAGS += -O3127128# Hotspot uses very unstrict aliasing turn this optimization off129OPT_CFLAGS += -fno-strict-aliasing130131# The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp132# if we use expensive-optimizations133# Note: all ia64 setting reflect the ones for linux134# No actial testing was performed: there is no Solaris on ia64 presently135ifeq ($(BUILDARCH), ia64)136OPT_CFLAGS/bytecodeInterpreter.o += -fno-expensive-optimizations137endif138139OPT_CFLAGS/NOOPT=-O0140141# Flags for generating make dependency flags.142ifneq ("${CC_VER_MAJOR}", "2")143DEPFLAGS = -fpch-deps -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)144endif145146# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.147ifeq ($(USE_PRECOMPILED_HEADER),0)148CFLAGS += -DDONT_USE_PRECOMPILED_HEADER149endif150151#------------------------------------------------------------------------152# Linker flags153154# statically link libstdc++.so, work with gcc but ignored by g++155STATIC_STDCXX = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic156157# statically link libgcc and/or libgcc_s, libgcc does not exist before gcc-3.x.158ifneq ("${CC_VER_MAJOR}", "2")159STATIC_LIBGCC += -static-libgcc160endif161162ifeq ($(BUILDARCH), ia64)163# Note: all ia64 setting reflect the ones for linux164# No actial testing was performed: there is no Solaris on ia64 presently165LFLAGS += -Wl,-relax166endif167168ifdef USE_GNULD169# Enable linker optimization170LFLAGS += -Xlinker -O1171172# Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file.173MAPFLAG = -Xlinker --version-script=FILENAME174else175MAPFLAG = -Xlinker -M -Xlinker FILENAME176endif177178# Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj179SONAMEFLAG = -Xlinker -soname=SONAME180181# Build shared library182SHARED_FLAG = -shared183184#------------------------------------------------------------------------185# Debug flags186187# Use the stabs format for debugging information (this is the default188# on gcc-2.91). It's good enough, has all the information about line189# numbers and local variables, and libjvm.so is only about 16M.190# Change this back to "-g" if you want the most expressive format.191# (warning: that could easily inflate libjvm.so to 150M!)192# Note: The Itanium gcc compiler crashes when using -gstabs.193DEBUG_CFLAGS/ia64 = -g194DEBUG_CFLAGS/amd64 = -g195DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))196ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),)197DEBUG_CFLAGS += -gstabs198endif199200201