1 #
2 # Copyright (c) 1999, 2015, 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.
8 #
9 # This code is distributed in the hope that it will be useful, but WITHOUT
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 # version 2 for more details (a copy is included in the LICENSE file that
13 # accompanied this code).
14 #
15 # You should have received a copy of the GNU General Public License version
16 # 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 USA
20 # or visit www.oracle.com if you need additional information or have any
21 # questions.
22 #
248 OPT_CFLAGS_DEFAULT ?= SPEED
249
250 # Hotspot uses very unstrict aliasing turn this optimization off
251 # This option is added to CFLAGS rather than OPT_CFLAGS
252 # so that OPT_CFLAGS overrides get this option too.
253 CFLAGS += -fno-strict-aliasing
254
255 ifdef OPT_CFLAGS
256 ifneq ("$(origin OPT_CFLAGS)", "command line")
257 $(error " Use OPT_EXTRAS instead of OPT_CFLAGS to add extra flags to OPT_CFLAGS.")
258 endif
259 endif
260
261 OPT_CFLAGS = $(OPT_CFLAGS/$(OPT_CFLAGS_DEFAULT)) $(OPT_EXTRAS)
262
263 # Variable tracking size limit exceeded for VMStructs::init()
264 ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "1"
265 # GCC >= 4.3
266 # Gcc 4.1.2 does not support this flag, nor does it have problems compiling the file.
267 OPT_CFLAGS/vmStructs.o += -fno-var-tracking-assignments
268 endif
269
270 # The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp
271 # if we use expensive-optimizations
272 ifeq ($(BUILDARCH), ia64)
273 OPT_CFLAGS += -fno-expensive-optimizations
274 endif
275
276 # Work around some compiler bugs.
277 ifeq ($(USE_CLANG), true)
278 ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 2), 1)
279 OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT)
280 endif
281 else
282 # Do not allow GCC 4.1.1
283 ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 1 \& $(CC_VER_MICRO) = 1), 1)
284 $(error "GCC $(CC_VER_MAJOR).$(CC_VER_MINOR).$(CC_VER_MICRO) not supported because of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=27724")
285 endif
286 # 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation.
287 ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 3), 1)
288 OPT_CFLAGS/mulnode.o += $(OPT_CFLAGS/NOOPT)
289 endif
290 endif
291
292 # Flags for generating make dependency flags.
293 DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)
294 ifeq ($(USE_CLANG),)
295 ifneq ($(CC_VER_MAJOR), 2)
296 DEPFLAGS += -fpch-deps
297 endif
298 endif
299
|
1 #
2 # Copyright (c) 1999, 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.
8 #
9 # This code is distributed in the hope that it will be useful, but WITHOUT
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 # version 2 for more details (a copy is included in the LICENSE file that
13 # accompanied this code).
14 #
15 # You should have received a copy of the GNU General Public License version
16 # 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 USA
20 # or visit www.oracle.com if you need additional information or have any
21 # questions.
22 #
248 OPT_CFLAGS_DEFAULT ?= SPEED
249
250 # Hotspot uses very unstrict aliasing turn this optimization off
251 # This option is added to CFLAGS rather than OPT_CFLAGS
252 # so that OPT_CFLAGS overrides get this option too.
253 CFLAGS += -fno-strict-aliasing
254
255 ifdef OPT_CFLAGS
256 ifneq ("$(origin OPT_CFLAGS)", "command line")
257 $(error " Use OPT_EXTRAS instead of OPT_CFLAGS to add extra flags to OPT_CFLAGS.")
258 endif
259 endif
260
261 OPT_CFLAGS = $(OPT_CFLAGS/$(OPT_CFLAGS_DEFAULT)) $(OPT_EXTRAS)
262
263 # Variable tracking size limit exceeded for VMStructs::init()
264 ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "1"
265 # GCC >= 4.3
266 # Gcc 4.1.2 does not support this flag, nor does it have problems compiling the file.
267 OPT_CFLAGS/vmStructs.o += -fno-var-tracking-assignments
268 # The debug flag is added to OPT_CFLAGS, but lost in case of per-file overrides
269 # of OPT_CFLAGS. Restore it here.
270 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
271 OPT_CFLAGS/vmStructs.o += -g
272 endif
273 endif
274
275 # The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp
276 # if we use expensive-optimizations
277 ifeq ($(BUILDARCH), ia64)
278 OPT_CFLAGS += -fno-expensive-optimizations
279 endif
280
281 # Work around some compiler bugs.
282 ifeq ($(USE_CLANG), true)
283 ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 2), 1)
284 OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT)
285 # The debug flag is added to OPT_CFLAGS, but lost in case of per-file overrides
286 # of OPT_CFLAGS. Restore it here.
287 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
288 OPT_CFLAGS/loopTransform.o += -g
289 endif
290 endif
291 else
292 # Do not allow GCC 4.1.1
293 ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 1 \& $(CC_VER_MICRO) = 1), 1)
294 $(error "GCC $(CC_VER_MAJOR).$(CC_VER_MINOR).$(CC_VER_MICRO) not supported because of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=27724")
295 endif
296 # 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation.
297 ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 3), 1)
298 OPT_CFLAGS/mulnode.o += $(OPT_CFLAGS/NOOPT)
299 endif
300 endif
301
302 # Flags for generating make dependency flags.
303 DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)
304 ifeq ($(USE_CLANG),)
305 ifneq ($(CC_VER_MAJOR), 2)
306 DEPFLAGS += -fpch-deps
307 endif
308 endif
309
|