1 # 2 # Copyright (c) 2013, 2016, Oracle and/or its affiliates. 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 it 6 # under the terms of the GNU General Public License version 2 only, as 7 # published by the Free Software Foundation. Oracle designates this 8 # particular file as subject to the "Classpath" exception as provided 9 # by Oracle in the LICENSE file that accompanied this code. 10 # 11 # This code is distributed in the hope that it will be useful, but WITHOUT 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 # version 2 for more details (a copy is included in the LICENSE file that 15 # accompanied this code). 16 # 17 # You should have received a copy of the GNU General Public License version 18 # 2 along with this work; if not, write to the Free Software Foundation, 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 # 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 # or visit www.oracle.com if you need additional information or have any 23 # questions. 24 # 25 26 $(eval $(call IncludeCustomExtension, hotspot, lib/JvmOverrideFiles.gmk)) 27 28 ################################################################################ 29 # This file contains explicit overrides of CFLAGS and/or precompiled header 30 # status for individual files on specific platforms. 31 32 ifeq ($(TOOLCHAIN_TYPE), gcc) 33 BUILD_LIBJVM_vmStructs.cpp_CXXFLAGS := -fno-var-tracking-assignments -O0 34 endif 35 36 ifeq ($(OPENJDK_TARGET_OS), linux) 37 BUILD_LIBJVM_ostream.cpp_CXXFLAGS := -D_FILE_OFFSET_BITS=64 38 39 ifeq ($(OPENJDK_TARGET_CPU_ARCH), x86) 40 BUILD_LIBJVM_sharedRuntimeTrig.cpp_CXXFLAGS := -DNO_PCH $(CXX_O_FLAG_NONE) 41 BUILD_LIBJVM_sharedRuntimeTrans.cpp_CXXFLAGS := -DNO_PCH $(CXX_O_FLAG_NONE) 42 43 ifeq ($(TOOLCHAIN_TYPE), clang) 44 JVM_PRECOMPILED_HEADER_EXCLUDE := \ 45 sharedRuntimeTrig.cpp \ 46 sharedRuntimeTrans.cpp \ 47 # 48 endif 49 endif 50 51 ifeq ($(OPENJDK_TARGET_CPU), x86) 52 # Performance measurements show that by compiling GC related code, we could 53 # significantly reduce the GC pause time on 32 bit Linux/Unix platforms by 54 # compiling without the PIC flag (-fPIC on linux). 55 # See 6454213 for more details. 56 ALL_SRC := $(filter %.cpp, $(call CacheFind, $(HOTSPOT_TOPDIR)/src/share/vm)) 57 NONPIC_FILTER := $(addsuffix %, $(addprefix $(HOTSPOT_TOPDIR)/src/share/vm/, \ 58 memory oops gc)) 59 # Due to what looks like a bug in the old build implementation of this, add a 60 # couple of more files that were accidentally matched as substrings of GC related 61 # files. 62 NONPIC_SRC := $(filter $(NONPIC_FILTER), $(ALL_SRC)) globals.cpp location.cpp 63 # Declare variables for each source file that needs the pic flag like this: 64 # BUILD_JVM_<srcfile>_CXXFLAGS := -fno-PIC 65 # This will get implicitly picked up by SetupNativeCompilation below. 66 $(foreach s, $(NONPIC_SRC), $(eval BUILD_LIBJVM_$(notdir $s)_CXXFLAGS := -fno-PIC)) 67 endif 68 69 else ifeq ($(OPENJDK_TARGET_OS), solaris) 70 ifneq ($(DEBUG_LEVEL), slowdebug) 71 # Workaround for a bug in dtrace. If ciEnv::post_compiled_method_load_event() 72 # is inlined, the resulting dtrace object file needs a reference to this 73 # function, whose symbol name is too long for dtrace. So disable inlining 74 # for this method for now. (fix this when dtrace bug 6258412 is fixed) 75 BUILD_LIBJVM_ciEnv.cpp_CXXFLAGS := \ 76 -xinline=no%__1cFciEnvbFpost_compiled_method_load_event6MpnHnmethod__v_ 77 # dtrace cannot handle tail call optimization (6672627, 6693876) 78 BUILD_LIBJVM_jni.cpp_CXXFLAGS := -Qoption ube -O~yz 79 BUILD_LIBJVM_stubGenerator_$(HOTSPOT_TARGET_CPU).cpp_CXXFLAGS := -xspace 80 81 ifeq ($(OPENJDK_TARGET_CPU), x86_64) 82 # Temporary until SS10 C++ compiler is fixed 83 BUILD_LIBJVM_generateOptoStub.cpp_CXXFLAGS := -xO2 84 # Temporary util SS12u1 C++ compiler is fixed 85 BUILD_LIBJVM_c1_LinearScan.cpp_CXXFLAGS := -xO2 86 endif 87 endif 88 89 # Need extra inlining to get oop_ps_push_contents functions to perform well enough. 90 ifeq ($(DEBUG_LEVEL),release) 91 BUILD_LIBJVM_psPromotionManager.cpp_CXXFLAGS := -W2,-Ainline:inc=1000 92 endif 93 94 ifeq ($(DEBUG_LEVEL), fastdebug) 95 # this hangs in iropt now (7113504) 96 BUILD_LIBJVM_compileBroker.cpp_CXXFLAGS := -xO2 97 98 # Frame size > 100k if we allow inlining via -g0! 99 BUILD_LIBJVM_bytecodeInterpreter.cpp_CXXFLAGS := +d 100 BUILD_LIBJVM_bytecodeInterpreterWithChecks.cpp_CXXFLAGS := +d 101 102 ifeq ($(OPENJDK_TARGET_CPU_ARCH), x86) 103 # ube explodes on x86 104 BUILD_LIBJVM_bytecodeInterpreter.cpp_CXXFLAGS += -xO1 105 BUILD_LIBJVM_bytecodeInterpreterWithChecks.cpp_CXXFLAGS += -xO1 106 endif 107 108 endif 109 110 else ifeq ($(OPENJDK_TARGET_OS), macosx) 111 # The copied fdlibm routines in these files must not be optimized 112 BUILD_LIBJVM_sharedRuntimeTrans.cpp_CXXFLAGS := $(CXX_O_FLAG_NONE) 113 BUILD_LIBJVM_sharedRuntimeTrig.cpp_CXXFLAGS := $(CXX_O_FLAG_NONE) 114 ifeq ($(TOOLCHAIN_TYPE), clang) 115 # NOTE: The old build tested clang version to make sure this workaround 116 # for the clang bug was still needed. 117 BUILD_LIBJVM_loopTransform.cpp_CXXFLAGS := $(CXX_O_FLAG_NONE) 118 ifneq ($(DEBUG_LEVEL), slowdebug) 119 BUILD_LIBJVM_unsafe.cpp_CXXFLAGS := -O1 120 endif 121 122 # The following files are compiled at various optimization 123 # levels due to optimization issues encountered at the 124 # default level. The Clang compiler issues a compile 125 # time error if there is an optimization level specification 126 # skew between the PCH file and the C++ file. Especially if the 127 # PCH file is compiled at a higher optimization level than 128 # the C++ file. One solution might be to prepare extra optimization 129 # level specific PCH files for the opt build and use them here, but 130 # it's probably not worth the effort as long as only a few files 131 # need this special handling. 132 JVM_PRECOMPILED_HEADER_EXCLUDE := \ 133 sharedRuntimeTrig.cpp \ 134 sharedRuntimeTrans.cpp \ 135 loopTransform.cpp \ 136 unsafe.cpp \ 137 jvmciCompilerToVM.cpp \ 138 # 139 endif 140 141 else ifeq ($(OPENJDK_TARGET_OS), aix) 142 BUILD_LIBJVM_synchronizer.cpp_CXXFLAGS := -qnoinline 143 BUILD_LIBJVM_sharedRuntimeTrans.cpp_CXXFLAGS := $(CXX_O_FLAG_NONE) 144 # Disable aggressive optimizations for functions in sharedRuntimeTrig.cpp 145 # and sharedRuntimeTrans.cpp on ppc64. 146 # -qstrict turns off the following optimizations: 147 # * Performing code motion and scheduling on computations such as loads 148 # and floating-point computations that may trigger an exception. 149 # * Relaxing conformance to IEEE rules. 150 # * Reassociating floating-point expressions. 151 # When using '-qstrict' there still remains one problem 152 # in javasoft.sqe.tests.api.java.lang.Math.sin5Tests when run in compile-all 153 # mode, so don't optimize sharedRuntimeTrig.cpp at all. 154 BUILD_LIBJVM_sharedRuntimeTrig.cpp_CXXFLAGS := $(CXX_O_FLAG_NONE) 155 156 # Disable ELF decoder on AIX (AIX uses XCOFF). 157 JVM_EXCLUDE_PATTERNS += elf 158 159 else ifeq ($(OPENJDK_TARGET_OS), windows) 160 JVM_PRECOMPILED_HEADER_EXCLUDE := \ 161 bytecodeInterpreter.cpp \ 162 bytecodeInterpreterWithChecks.cpp \ 163 opcodes.cpp \ 164 os_windows.cpp \ 165 os_windows_x86.cpp \ 166 osThread_windows.cpp \ 167 # 168 endif