66 endif
67
68 ifeq ($(call isTargetCpu, x86), true)
69 # Performance measurements show that by compiling GC related code, we could
70 # significantly reduce the GC pause time on 32 bit Linux/Unix platforms by
71 # compiling without the PIC flag (-fPIC on linux).
72 # See 6454213 for more details.
73 ALL_SRC := $(call FindFiles, $(TOPDIR)/src/hotspot/share, *.cpp)
74 NONPIC_FILTER := $(addsuffix %, $(addprefix $(TOPDIR)/src/hotspot/share/, \
75 memory oops gc))
76 # Due to what looks like a bug in the old build implementation of this, add a
77 # couple of more files that were accidentally matched as substrings of GC related
78 # files.
79 NONPIC_SRC := $(filter $(NONPIC_FILTER), $(ALL_SRC)) globals.cpp location.cpp
80 # Declare variables for each source file that needs the pic flag like this:
81 # BUILD_JVM_<srcfile>_CXXFLAGS := -fno-PIC
82 # This will get implicitly picked up by SetupNativeCompilation below.
83 $(foreach s, $(NONPIC_SRC), $(eval BUILD_LIBJVM_$(notdir $s)_CXXFLAGS := -fno-PIC))
84 endif
85
86 else ifeq ($(call isTargetOs, solaris), true)
87 ifneq ($(DEBUG_LEVEL), slowdebug)
88 # dev studio 12.6 workaround
89 BUILD_LIBJVM_arguments.cpp_OPTIMIZATION := LOW
90 # Workaround for a bug in dtrace. If ciEnv::post_compiled_method_load_event()
91 # is inlined, the resulting dtrace object file needs a reference to this
92 # function, whose symbol name is too long for dtrace. So disable inlining
93 # for this method for now. (fix this when dtrace bug 6258412 is fixed)
94 BUILD_LIBJVM_ciEnv.cpp_CXXFLAGS := \
95 -xinline=no%__1cFciEnvbFpost_compiled_method_load_event6MpnHnmethod__v_
96 # dtrace cannot handle tail call optimization (6672627, 6693876)
97 BUILD_LIBJVM_jni.cpp_CXXFLAGS := -Qoption ube -O~yz
98 BUILD_LIBJVM_stubGenerator_$(HOTSPOT_TARGET_CPU).cpp_CXXFLAGS := -xspace
99
100 ifeq ($(call isTargetCpu, x86_64), true)
101 # Temporary until SS10 C++ compiler is fixed
102 BUILD_LIBJVM_generateOptoStub.cpp_CXXFLAGS := -xO2
103 # Temporary util SS12u1 C++ compiler is fixed
104 BUILD_LIBJVM_c1_LinearScan.cpp_CXXFLAGS := -xO2
105 endif
106 endif
107
108 # Need extra inlining to get oop_ps_push_contents functions to perform well enough.
109 ifeq ($(DEBUG_LEVEL),release)
110 BUILD_LIBJVM_psPromotionManager.cpp_CXXFLAGS := -W2,-Ainline:inc=1000
111 endif
112
113 ifeq ($(DEBUG_LEVEL), fastdebug)
114 # this hangs in iropt now (7113504)
115 BUILD_LIBJVM_compileBroker.cpp_CXXFLAGS := -xO2
116
117 # Frame size > 100k if we allow inlining via -g0!
118 BUILD_LIBJVM_bytecodeInterpreter.cpp_CXXFLAGS := +d
119 BUILD_LIBJVM_bytecodeInterpreterWithChecks.cpp_CXXFLAGS := +d
120
121 ifeq ($(call isTargetCpuArch, x86), true)
122 # ube explodes on x86
123 BUILD_LIBJVM_bytecodeInterpreter.cpp_CXXFLAGS += -xO1
124 BUILD_LIBJVM_bytecodeInterpreterWithChecks.cpp_CXXFLAGS += -xO1
125 endif
126
127 endif
128
129 # Workaround for jvmciCompilerToVM.cpp long compilation time
130 BUILD_LIBJVM_jvmciCompilerToVMInit.cpp_OPTIMIZATION := NONE
131
132 else ifeq ($(call isTargetOs, macosx), true)
133 # The copied fdlibm routines in these files must not be optimized
134 BUILD_LIBJVM_sharedRuntimeTrig.cpp_CXXFLAGS := $(FDLIBM_CFLAGS) $(LIBJVM_FDLIBM_COPY_OPT_FLAG)
135 BUILD_LIBJVM_sharedRuntimeTrans.cpp_CXXFLAGS := $(FDLIBM_CFLAGS) $(LIBJVM_FDLIBM_COPY_OPT_FLAG)
136 ifeq ($(TOOLCHAIN_TYPE), clang)
137 # NOTE: The old build tested clang version to make sure this workaround
138 # for the clang bug was still needed.
139 BUILD_LIBJVM_loopTransform.cpp_CXXFLAGS := $(CXX_O_FLAG_NONE)
140 ifneq ($(DEBUG_LEVEL), slowdebug)
141 BUILD_LIBJVM_unsafe.cpp_CXXFLAGS := -O1
142 endif
143
144 # The following files are compiled at various optimization
145 # levels due to optimization issues encountered at the
146 # default level. The Clang compiler issues a compile
147 # time error if there is an optimization level specification
148 # skew between the PCH file and the C++ file. Especially if the
149 # PCH file is compiled at a higher optimization level than
150 # the C++ file. One solution might be to prepare extra optimization
151 # level specific PCH files for the opt build and use them here, but
|
66 endif
67
68 ifeq ($(call isTargetCpu, x86), true)
69 # Performance measurements show that by compiling GC related code, we could
70 # significantly reduce the GC pause time on 32 bit Linux/Unix platforms by
71 # compiling without the PIC flag (-fPIC on linux).
72 # See 6454213 for more details.
73 ALL_SRC := $(call FindFiles, $(TOPDIR)/src/hotspot/share, *.cpp)
74 NONPIC_FILTER := $(addsuffix %, $(addprefix $(TOPDIR)/src/hotspot/share/, \
75 memory oops gc))
76 # Due to what looks like a bug in the old build implementation of this, add a
77 # couple of more files that were accidentally matched as substrings of GC related
78 # files.
79 NONPIC_SRC := $(filter $(NONPIC_FILTER), $(ALL_SRC)) globals.cpp location.cpp
80 # Declare variables for each source file that needs the pic flag like this:
81 # BUILD_JVM_<srcfile>_CXXFLAGS := -fno-PIC
82 # This will get implicitly picked up by SetupNativeCompilation below.
83 $(foreach s, $(NONPIC_SRC), $(eval BUILD_LIBJVM_$(notdir $s)_CXXFLAGS := -fno-PIC))
84 endif
85
86 else ifeq ($(call isTargetOs, macosx), true)
87 # The copied fdlibm routines in these files must not be optimized
88 BUILD_LIBJVM_sharedRuntimeTrig.cpp_CXXFLAGS := $(FDLIBM_CFLAGS) $(LIBJVM_FDLIBM_COPY_OPT_FLAG)
89 BUILD_LIBJVM_sharedRuntimeTrans.cpp_CXXFLAGS := $(FDLIBM_CFLAGS) $(LIBJVM_FDLIBM_COPY_OPT_FLAG)
90 ifeq ($(TOOLCHAIN_TYPE), clang)
91 # NOTE: The old build tested clang version to make sure this workaround
92 # for the clang bug was still needed.
93 BUILD_LIBJVM_loopTransform.cpp_CXXFLAGS := $(CXX_O_FLAG_NONE)
94 ifneq ($(DEBUG_LEVEL), slowdebug)
95 BUILD_LIBJVM_unsafe.cpp_CXXFLAGS := -O1
96 endif
97
98 # The following files are compiled at various optimization
99 # levels due to optimization issues encountered at the
100 # default level. The Clang compiler issues a compile
101 # time error if there is an optimization level specification
102 # skew between the PCH file and the C++ file. Especially if the
103 # PCH file is compiled at a higher optimization level than
104 # the C++ file. One solution might be to prepare extra optimization
105 # level specific PCH files for the opt build and use them here, but
|