Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/make/aix/makefiles/xlc.make
32284 views
#1# Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.2# Copyright (c) 2012, 2015 SAP. All rights reserved.3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.4#5# This code is free software; you can redistribute it and/or modify it6# under the terms of the GNU General Public License version 2 only, as7# published by the Free Software Foundation.8#9# This code is distributed in the hope that it will be useful, but WITHOUT10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12# version 2 for more details (a copy is included in the LICENSE file that13# accompanied this code).14#15# You should have received a copy of the GNU General Public License version16# 2 along with this work; if not, write to the Free Software Foundation,17# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18#19# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20# or visit www.oracle.com if you need additional information or have any21# questions.22#23#2425#------------------------------------------------------------------------26# CC, CXX & AS2728# Set compiler explicitly29CXX = $(COMPILER_PATH)xlC_r30CC = $(COMPILER_PATH)xlc_r31HOSTCXX = $(CXX)32HOSTCC = $(CC)3334AS = $(CC) -c3536# get xlc version which comes as VV.RR.MMMM.LLLL where 'VV' is the version,37# 'RR' is the release, 'MMMM' is the modification and 'LLLL' is the level.38# We only use 'VV.RR.LLLL' to avoid integer overflows in bash when comparing39# the version numbers (some shells only support 32-bit integer compares!).40CXX_VERSION := $(shell $(CXX) -qversion 2>&1 | \41sed -n 's/.*Version: \([0-9]\{2\}\).\([0-9]\{2\}\).[0-9]\{4\}.\([0-9]\{4\}\)/\1\2\3/p')4243# xlc 08.00.0000.0023 and higher supports -qtune=balanced44CXX_SUPPORTS_BALANCED_TUNING := $(shell if [ $(CXX_VERSION) -ge 08000023 ] ; then echo "true" ; fi)45# xlc 10.01 is used with aggressive optimizations to boost performance46CXX_IS_V10 := $(shell if [ $(CXX_VERSION) -ge 10010000 ] ; then echo "true" ; fi)4748# check for precompiled headers support4950# Switch off the precompiled header support. Neither xlC 8.0 nor xlC 10.051# support precompiled headers. Both "understand" the command line switches "-qusepcomp" and52# "-qgenpcomp" but when we specify them the following message is printed:53# "1506-755 (W) The -qusepcomp option is not supported in this release."54USE_PRECOMPILED_HEADER = 055ifneq ($(USE_PRECOMPILED_HEADER),0)56PRECOMPILED_HEADER_DIR=.57PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled/precompiled.hpp58PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.gch59endif606162#------------------------------------------------------------------------63# Compiler flags6465# position-independent code66PICFLAG = -qpic=large6768VM_PICFLAG/LIBJVM = $(PICFLAG)69VM_PICFLAG/AOUT =70VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO))7172CFLAGS += $(VM_PICFLAG)73CFLAGS += -qnortti74CFLAGS += -qnoeh7576CFLAGS += -D_REENTRANT77# no xlc counterpart for -fcheck-new78# CFLAGS += -fcheck-new7980# We need to define this on the command line if we want to use the the81# predefined format specifiers from "inttypes.h". Otherwise system headrs82# can indirectly include inttypes.h before we define __STDC_FORMAT_MACROS83# in globalDefinitions.hpp84CFLAGS += -D__STDC_FORMAT_MACROS8586ARCHFLAG = -q648788CFLAGS += $(ARCHFLAG)89AOUT_FLAGS += $(ARCHFLAG)90LFLAGS += $(ARCHFLAG)91ASFLAGS += $(ARCHFLAG)9293# Use C++ Interpreter94ifdef CC_INTERP95CFLAGS += -DCC_INTERP96endif9798# Keep temporary files (.ii, .s)99# no counterpart on xlc for -save-temps, -pipe100101# Compiler warnings are treated as errors102# Do not treat warnings as errors103# WARNINGS_ARE_ERRORS = -Werror104# Except for a few acceptable ones105# ACCEPTABLE_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare106# CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ACCEPTABLE_WARNINGS)107CFLAGS_WARN/COMMON =108CFLAGS_WARN/DEFAULT = $(CFLAGS_WARN/COMMON) $(EXTRA_WARNINGS)109# Special cases110CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))111112# The flags to use for an optimized build113OPT_CFLAGS += -O3114115# Hotspot uses very unstrict aliasing turn this optimization off116OPT_CFLAGS += -qalias=noansi117118OPT_CFLAGS/NOOPT=-qnoopt119120DEPFLAGS = -qmakedep=gcc -MF $(DEP_DIR)/$(@:%=%.d)121122#------------------------------------------------------------------------123# Linker flags124125# statically link libstdc++.so, work with gcc but ignored by g++126STATIC_STDCXX = -Wl,-lC_r127128# Enable linker optimization129# no counterpart on xlc for this130# LFLAGS += -Xlinker -O1131132# Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file.133# MAPFLAG = -Xlinker --version-script=FILENAME134135# Build shared library136SHARED_FLAG = -q64 -b64 -bexpall -G -bnoentry -qmkshrobj -brtl -bnolibpath -bernotok137138#------------------------------------------------------------------------139# Debug flags140141# Always compile with '-g' to get symbols in the stacktraces in the hs_err file142DEBUG_CFLAGS += -g143FASTDEBUG_CFLAGS += -g144OPT_CFLAGS += -g145146# DEBUG_BINARIES overrides everything, use full -g debug information147ifeq ($(DEBUG_BINARIES), true)148DEBUG_CFLAGS = -g149CFLAGS += $(DEBUG_CFLAGS)150endif151152# If we are building HEADLESS, pass on to VM153# so it can set the java.awt.headless property154ifdef HEADLESS155CFLAGS += -DHEADLESS156endif157158# We are building Embedded for a small device159# favor code space over speed160ifdef MINIMIZE_RAM_USAGE161CFLAGS += -DMINIMIZE_RAM_USAGE162endif163164ifdef CROSS_COMPILE_ARCH165STRIP = $(ALT_COMPILER_PATH)/strip166else167STRIP = strip168endif169170171