make/aix/makefiles/xlc.make

Fri, 06 Sep 2013 20:08:29 +0200

author
simonis
date
Fri, 06 Sep 2013 20:08:29 +0200
changeset 6464
b83f7d608548
parent 0
f90c822e73f8
child 7515
b9c06f87e476
permissions
-rw-r--r--

8023034: PPC64 (part 14): Implement AIX/PPC64 support in HotSpot makefiles
Reviewed-by: kvn

aoqi@0 1 #
aoqi@0 2 # Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 # Copyright (c) 2012, 2013 SAP. All rights reserved.
aoqi@0 4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 5 #
aoqi@0 6 # This code is free software; you can redistribute it and/or modify it
aoqi@0 7 # under the terms of the GNU General Public License version 2 only, as
aoqi@0 8 # published by the Free Software Foundation.
aoqi@0 9 #
aoqi@0 10 # This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 13 # version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 14 # accompanied this code).
aoqi@0 15 #
aoqi@0 16 # You should have received a copy of the GNU General Public License version
aoqi@0 17 # 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 18 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 19 #
aoqi@0 20 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 21 # or visit www.oracle.com if you need additional information or have any
aoqi@0 22 # questions.
aoqi@0 23 #
aoqi@0 24 #
aoqi@0 25
aoqi@0 26 #------------------------------------------------------------------------
aoqi@0 27 # CC, CXX & AS
aoqi@0 28
aoqi@0 29 # Set compiler explicitly
aoqi@0 30 CXX = $(COMPILER_PATH)xlC_r
aoqi@0 31 CC = $(COMPILER_PATH)xlc_r
aoqi@0 32 HOSTCXX = $(CXX)
aoqi@0 33 HOSTCC = $(CC)
aoqi@0 34
aoqi@0 35 AS = $(CC) -c
aoqi@0 36
aoqi@0 37 # get xlc version
aoqi@0 38 CXX_VERSION := $(shell $(CXX) -qversion 2>&1 | sed -n 's/.*Version: \([0-9.]*\)/\1/p')
aoqi@0 39
aoqi@0 40 # xlc 08.00.0000.0023 and higher supports -qtune=balanced
aoqi@0 41 CXX_SUPPORTS_BALANCED_TUNING=$(shell if [ $(subst .,,$(CXX_VERSION)) -ge 080000000023 ] ; then echo "true" ; fi)
aoqi@0 42 # xlc 10.01 is used with aggressive optimizations to boost performance
aoqi@0 43 CXX_IS_V10=$(shell if [ $(subst .,,$(CXX_VERSION)) -ge 100100000000 ] ; then echo "true" ; fi)
aoqi@0 44
aoqi@0 45 # check for precompiled headers support
aoqi@0 46
aoqi@0 47 # Switch off the precompiled header support. Neither xlC 8.0 nor xlC 10.0
aoqi@0 48 # support precompiled headers. Both "understand" the command line switches "-qusepcomp" and
aoqi@0 49 # "-qgenpcomp" but when we specify them the following message is printed:
aoqi@0 50 # "1506-755 (W) The -qusepcomp option is not supported in this release."
aoqi@0 51 USE_PRECOMPILED_HEADER = 0
aoqi@0 52 ifneq ($(USE_PRECOMPILED_HEADER),0)
aoqi@0 53 PRECOMPILED_HEADER_DIR=.
aoqi@0 54 PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled/precompiled.hpp
aoqi@0 55 PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.gch
aoqi@0 56 endif
aoqi@0 57
aoqi@0 58
aoqi@0 59 #------------------------------------------------------------------------
aoqi@0 60 # Compiler flags
aoqi@0 61
aoqi@0 62 # position-independent code
aoqi@0 63 PICFLAG = -qpic=large
aoqi@0 64
aoqi@0 65 VM_PICFLAG/LIBJVM = $(PICFLAG)
aoqi@0 66 VM_PICFLAG/AOUT =
aoqi@0 67 VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO))
aoqi@0 68
aoqi@0 69 CFLAGS += $(VM_PICFLAG)
aoqi@0 70 CFLAGS += -qnortti
aoqi@0 71 CFLAGS += -qnoeh
aoqi@0 72
aoqi@0 73 CFLAGS += -D_REENTRANT
aoqi@0 74 # no xlc counterpart for -fcheck-new
aoqi@0 75 # CFLAGS += -fcheck-new
aoqi@0 76
aoqi@0 77 ARCHFLAG = -q64
aoqi@0 78
aoqi@0 79 CFLAGS += $(ARCHFLAG)
aoqi@0 80 AOUT_FLAGS += $(ARCHFLAG)
aoqi@0 81 LFLAGS += $(ARCHFLAG)
aoqi@0 82 ASFLAGS += $(ARCHFLAG)
aoqi@0 83
aoqi@0 84 # Use C++ Interpreter
aoqi@0 85 ifdef CC_INTERP
aoqi@0 86 CFLAGS += -DCC_INTERP
aoqi@0 87 endif
aoqi@0 88
aoqi@0 89 # Keep temporary files (.ii, .s)
aoqi@0 90 # no counterpart on xlc for -save-temps, -pipe
aoqi@0 91
aoqi@0 92 # Compiler warnings are treated as errors
aoqi@0 93 # Do not treat warnings as errors
aoqi@0 94 # WARNINGS_ARE_ERRORS = -Werror
aoqi@0 95 # Except for a few acceptable ones
aoqi@0 96 # ACCEPTABLE_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare
aoqi@0 97 # CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ACCEPTABLE_WARNINGS)
aoqi@0 98 CFLAGS_WARN/COMMON =
aoqi@0 99 CFLAGS_WARN/DEFAULT = $(CFLAGS_WARN/COMMON) $(EXTRA_WARNINGS)
aoqi@0 100 # Special cases
aoqi@0 101 CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
aoqi@0 102
aoqi@0 103 # The flags to use for an optimized build
aoqi@0 104 OPT_CFLAGS += -O3
aoqi@0 105
aoqi@0 106 # Hotspot uses very unstrict aliasing turn this optimization off
aoqi@0 107 OPT_CFLAGS += -qalias=noansi
aoqi@0 108
aoqi@0 109 OPT_CFLAGS/NOOPT=-qnoopt
aoqi@0 110
aoqi@0 111 DEPFLAGS = -qmakedep=gcc -MF $(DEP_DIR)/$(@:%=%.d)
aoqi@0 112
aoqi@0 113 #------------------------------------------------------------------------
aoqi@0 114 # Linker flags
aoqi@0 115
aoqi@0 116 # statically link libstdc++.so, work with gcc but ignored by g++
aoqi@0 117 STATIC_STDCXX = -Wl,-lC_r
aoqi@0 118
aoqi@0 119 # Enable linker optimization
aoqi@0 120 # no counterpart on xlc for this
aoqi@0 121 # LFLAGS += -Xlinker -O1
aoqi@0 122
aoqi@0 123 # Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file.
aoqi@0 124 # MAPFLAG = -Xlinker --version-script=FILENAME
aoqi@0 125
aoqi@0 126 # Build shared library
aoqi@0 127 SHARED_FLAG = -q64 -b64 -bexpall -G -bnoentry -qmkshrobj -brtl -bnolibpath
aoqi@0 128
aoqi@0 129 #------------------------------------------------------------------------
aoqi@0 130 # Debug flags
aoqi@0 131
aoqi@0 132 # Always compile with '-g' to get symbols in the stacktraces in the hs_err file
aoqi@0 133 DEBUG_CFLAGS += -g
aoqi@0 134 FASTDEBUG_CFLAGS += -g
aoqi@0 135 OPT_CFLAGS += -g
aoqi@0 136
aoqi@0 137 # DEBUG_BINARIES overrides everything, use full -g debug information
aoqi@0 138 ifeq ($(DEBUG_BINARIES), true)
aoqi@0 139 DEBUG_CFLAGS = -g
aoqi@0 140 CFLAGS += $(DEBUG_CFLAGS)
aoqi@0 141 endif
aoqi@0 142
aoqi@0 143 # If we are building HEADLESS, pass on to VM
aoqi@0 144 # so it can set the java.awt.headless property
aoqi@0 145 ifdef HEADLESS
aoqi@0 146 CFLAGS += -DHEADLESS
aoqi@0 147 endif
aoqi@0 148
aoqi@0 149 # We are building Embedded for a small device
aoqi@0 150 # favor code space over speed
aoqi@0 151 ifdef MINIMIZE_RAM_USAGE
aoqi@0 152 CFLAGS += -DMINIMIZE_RAM_USAGE
aoqi@0 153 endif
aoqi@0 154
aoqi@0 155 ifdef CROSS_COMPILE_ARCH
aoqi@0 156 STRIP = $(ALT_COMPILER_PATH)/strip
aoqi@0 157 else
aoqi@0 158 STRIP = strip
aoqi@0 159 endif

mercurial