1 #
2 # Copyright (c) 1998, 2008, 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 #
32 Compiler = gcc
33
34 # -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only
35 # prints the numbers (e.g. "2.95", "3.2.1")
36 CC_VER_MAJOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1)
37 CC_VER_MINOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2)
38
39 # Check for the versions of C++ and C compilers ($CPP and $CC) used.
40
41 # Get the last thing on the line that looks like x.x+ (x is a digit).
42 COMPILER_REV := \
43 $(shell $(CPP) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1)
44 C_COMPILER_REV := \
45 $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2)
46
47
48 # check for precompiled headers support
49 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0"
50 USE_PRECOMPILED_HEADER=1
51 PRECOMPILED_HEADER_DIR=.
52 PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/incls/_precompiled.incl.gch
53 endif
54
55
56 #------------------------------------------------------------------------
57 # Compiler flags
58
59 # position-independent code
60 PICFLAG = -fPIC
61
62 VM_PICFLAG/LIBJVM = $(PICFLAG)
63 VM_PICFLAG/AOUT =
64 VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO))
65
66 CFLAGS += $(VM_PICFLAG)
67 CFLAGS += -fno-rtti
68 CFLAGS += -fno-exceptions
69 CFLAGS += -D_REENTRANT
70 CFLAGS += -fcheck-new
71
72 ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
114 ADDITIONAL_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare
115 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ADDITIONAL_WARNINGS)
116 # Special cases
117 CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
118
119 # The flags to use for an Optimized g++ build
120 OPT_CFLAGS += -O3
121
122 # Hotspot uses very unstrict aliasing turn this optimization off
123 OPT_CFLAGS += -fno-strict-aliasing
124
125 # The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp
126 # if we use expensive-optimizations
127 # Note: all ia64 setting reflect the ones for linux
128 # No actial testing was performed: there is no Solaris on ia64 presently
129 ifeq ($(BUILDARCH), ia64)
130 OPT_CFLAGS/bytecodeInterpreter.o += -fno-expensive-optimizations
131 endif
132
133 OPT_CFLAGS/NOOPT=-O0
134 #------------------------------------------------------------------------
135 # Linker flags
136
137 # statically link libstdc++.so, work with gcc but ignored by g++
138 STATIC_STDCXX = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
139
140 # statically link libgcc and/or libgcc_s, libgcc does not exist before gcc-3.x.
141 ifneq ("${CC_VER_MAJOR}", "2")
142 STATIC_LIBGCC += -static-libgcc
143 endif
144
145 ifeq ($(BUILDARCH), ia64)
146 # Note: all ia64 setting reflect the ones for linux
147 # No actial testing was performed: there is no Solaris on ia64 presently
148 LFLAGS += -Wl,-relax
149 endif
150
151 ifdef USE_GNULD
152 # Enable linker optimization
153 LFLAGS += -Xlinker -O1
|
1 #
2 # Copyright (c) 1998, 2010, 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 #
32 Compiler = gcc
33
34 # -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only
35 # prints the numbers (e.g. "2.95", "3.2.1")
36 CC_VER_MAJOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1)
37 CC_VER_MINOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2)
38
39 # Check for the versions of C++ and C compilers ($CPP and $CC) used.
40
41 # Get the last thing on the line that looks like x.x+ (x is a digit).
42 COMPILER_REV := \
43 $(shell $(CPP) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1)
44 C_COMPILER_REV := \
45 $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2)
46
47
48 # check for precompiled headers support
49 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0"
50 USE_PRECOMPILED_HEADER=1
51 PRECOMPILED_HEADER_DIR=.
52 PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled.hpp
53 PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.gch
54 endif
55
56
57 #------------------------------------------------------------------------
58 # Compiler flags
59
60 # position-independent code
61 PICFLAG = -fPIC
62
63 VM_PICFLAG/LIBJVM = $(PICFLAG)
64 VM_PICFLAG/AOUT =
65 VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO))
66
67 CFLAGS += $(VM_PICFLAG)
68 CFLAGS += -fno-rtti
69 CFLAGS += -fno-exceptions
70 CFLAGS += -D_REENTRANT
71 CFLAGS += -fcheck-new
72
73 ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
115 ADDITIONAL_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare
116 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ADDITIONAL_WARNINGS)
117 # Special cases
118 CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
119
120 # The flags to use for an Optimized g++ build
121 OPT_CFLAGS += -O3
122
123 # Hotspot uses very unstrict aliasing turn this optimization off
124 OPT_CFLAGS += -fno-strict-aliasing
125
126 # The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp
127 # if we use expensive-optimizations
128 # Note: all ia64 setting reflect the ones for linux
129 # No actial testing was performed: there is no Solaris on ia64 presently
130 ifeq ($(BUILDARCH), ia64)
131 OPT_CFLAGS/bytecodeInterpreter.o += -fno-expensive-optimizations
132 endif
133
134 OPT_CFLAGS/NOOPT=-O0
135
136 # Flags for generating make dependency flags.
137 ifneq ("${CC_VER_MAJOR}", "2")
138 DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)
139 endif
140
141 #------------------------------------------------------------------------
142 # Linker flags
143
144 # statically link libstdc++.so, work with gcc but ignored by g++
145 STATIC_STDCXX = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
146
147 # statically link libgcc and/or libgcc_s, libgcc does not exist before gcc-3.x.
148 ifneq ("${CC_VER_MAJOR}", "2")
149 STATIC_LIBGCC += -static-libgcc
150 endif
151
152 ifeq ($(BUILDARCH), ia64)
153 # Note: all ia64 setting reflect the ones for linux
154 # No actial testing was performed: there is no Solaris on ia64 presently
155 LFLAGS += -Wl,-relax
156 endif
157
158 ifdef USE_GNULD
159 # Enable linker optimization
160 LFLAGS += -Xlinker -O1
|