author | amurillo |
Fri, 23 Aug 2013 03:01:16 -0700 | |
changeset 19351 | 14a09ddd8d8b |
parent 18447 | 1481a04c99e2 |
child 19544 | 8f3ad1962aef |
child 22818 | 34cd99df9940 |
permissions | -rw-r--r-- |
1 | 1 |
# |
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
2 |
# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. |
1 | 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 |
# |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4013
diff
changeset
|
19 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4013
diff
changeset
|
20 |
# or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4013
diff
changeset
|
21 |
# questions. |
1 | 22 |
# |
23 |
# |
|
24 |
||
25 |
#------------------------------------------------------------------------ |
|
11721
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
11205
diff
changeset
|
26 |
# CC, CXX & AS |
1 | 27 |
|
11955
aeca8151886e
7141244: build-infra merge: Include $(SPEC) in makefiles and make variables overridable
erikj
parents:
11721
diff
changeset
|
28 |
# If a SPEC is not set already, then use these defaults. |
aeca8151886e
7141244: build-infra merge: Include $(SPEC) in makefiles and make variables overridable
erikj
parents:
11721
diff
changeset
|
29 |
ifeq ($(SPEC),) |
aeca8151886e
7141244: build-infra merge: Include $(SPEC) in makefiles and make variables overridable
erikj
parents:
11721
diff
changeset
|
30 |
# When cross-compiling the ALT_COMPILER_PATH points |
aeca8151886e
7141244: build-infra merge: Include $(SPEC) in makefiles and make variables overridable
erikj
parents:
11721
diff
changeset
|
31 |
# to the cross-compilation toolset |
aeca8151886e
7141244: build-infra merge: Include $(SPEC) in makefiles and make variables overridable
erikj
parents:
11721
diff
changeset
|
32 |
ifdef CROSS_COMPILE_ARCH |
aeca8151886e
7141244: build-infra merge: Include $(SPEC) in makefiles and make variables overridable
erikj
parents:
11721
diff
changeset
|
33 |
CXX = $(ALT_COMPILER_PATH)/g++ |
aeca8151886e
7141244: build-infra merge: Include $(SPEC) in makefiles and make variables overridable
erikj
parents:
11721
diff
changeset
|
34 |
CC = $(ALT_COMPILER_PATH)/gcc |
aeca8151886e
7141244: build-infra merge: Include $(SPEC) in makefiles and make variables overridable
erikj
parents:
11721
diff
changeset
|
35 |
HOSTCXX = g++ |
aeca8151886e
7141244: build-infra merge: Include $(SPEC) in makefiles and make variables overridable
erikj
parents:
11721
diff
changeset
|
36 |
HOSTCC = gcc |
aeca8151886e
7141244: build-infra merge: Include $(SPEC) in makefiles and make variables overridable
erikj
parents:
11721
diff
changeset
|
37 |
STRIP = $(ALT_COMPILER_PATH)/strip |
aeca8151886e
7141244: build-infra merge: Include $(SPEC) in makefiles and make variables overridable
erikj
parents:
11721
diff
changeset
|
38 |
else |
17880 | 39 |
ifeq ($(USE_CLANG), true) |
40 |
CXX = clang++ |
|
41 |
CC = clang |
|
42 |
else |
|
43 |
CXX = g++ |
|
44 |
CC = gcc |
|
45 |
endif |
|
46 |
||
11955
aeca8151886e
7141244: build-infra merge: Include $(SPEC) in makefiles and make variables overridable
erikj
parents:
11721
diff
changeset
|
47 |
HOSTCXX = $(CXX) |
aeca8151886e
7141244: build-infra merge: Include $(SPEC) in makefiles and make variables overridable
erikj
parents:
11721
diff
changeset
|
48 |
HOSTCC = $(CC) |
aeca8151886e
7141244: build-infra merge: Include $(SPEC) in makefiles and make variables overridable
erikj
parents:
11721
diff
changeset
|
49 |
STRIP = strip |
aeca8151886e
7141244: build-infra merge: Include $(SPEC) in makefiles and make variables overridable
erikj
parents:
11721
diff
changeset
|
50 |
endif |
aeca8151886e
7141244: build-infra merge: Include $(SPEC) in makefiles and make variables overridable
erikj
parents:
11721
diff
changeset
|
51 |
AS = $(CC) -c |
6176
4d9030fe341f
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
5547
diff
changeset
|
52 |
endif |
4d9030fe341f
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
5547
diff
changeset
|
53 |
|
1 | 54 |
|
17880 | 55 |
ifeq ($(USE_CLANG), true) |
56 |
CC_VER_MAJOR := $(shell $(CC) -v 2>&1 | grep version | sed "s/.*version \([0-9]*\.[0-9]*\).*/\1/" | cut -d'.' -f1) |
|
57 |
CC_VER_MINOR := $(shell $(CC) -v 2>&1 | grep version | sed "s/.*version \([0-9]*\.[0-9]*\).*/\1/" | cut -d'.' -f2) |
|
58 |
else |
|
59 |
# -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only |
|
60 |
# prints the numbers (e.g. "2.95", "3.2.1") |
|
61 |
CC_VER_MAJOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1) |
|
62 |
CC_VER_MINOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2) |
|
63 |
endif |
|
64 |
||
65 |
||
66 |
ifeq ($(USE_CLANG), true) |
|
67 |
# Clang has precompiled headers support by default, but the user can switch |
|
68 |
# it off by using 'USE_PRECOMPILED_HEADER=0'. |
|
69 |
ifdef LP64 |
|
70 |
ifeq ($(USE_PRECOMPILED_HEADER),) |
|
71 |
USE_PRECOMPILED_HEADER=1 |
|
72 |
endif |
|
73 |
else |
|
74 |
# We don't support precompiled headers on 32-bit builds because there some files are |
|
75 |
# compiled with -fPIC while others are compiled without (see 'NONPIC_OBJ_FILES' rules.make) |
|
76 |
# Clang produces an error if the PCH file was compiled with other options than the actual compilation unit. |
|
77 |
USE_PRECOMPILED_HEADER=0 |
|
78 |
endif |
|
79 |
||
80 |
ifeq ($(USE_PRECOMPILED_HEADER),1) |
|
81 |
||
82 |
ifndef LP64 |
|
83 |
$(error " Precompiled Headers only supported on 64-bit platforms!") |
|
84 |
endif |
|
85 |
||
86 |
PRECOMPILED_HEADER_DIR=. |
|
87 |
PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled/precompiled.hpp |
|
88 |
PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.pch |
|
1 | 89 |
|
17880 | 90 |
PCH_FLAG = -include precompiled.hpp |
91 |
PCH_FLAG/DEFAULT = $(PCH_FLAG) |
|
92 |
PCH_FLAG/NO_PCH = -DNO_PCH |
|
93 |
PCH_FLAG/BY_FILE = $(PCH_FLAG/$@)$(PCH_FLAG/DEFAULT$(PCH_FLAG/$@)) |
|
94 |
||
95 |
VM_PCH_FLAG/LIBJVM = $(PCH_FLAG/BY_FILE) |
|
96 |
VM_PCH_FLAG/AOUT = |
|
97 |
VM_PCH_FLAG = $(VM_PCH_FLAG/$(LINK_INTO)) |
|
98 |
||
99 |
# We only use precompiled headers for the JVM build |
|
100 |
CFLAGS += $(VM_PCH_FLAG) |
|
101 |
||
102 |
# There are some files which don't like precompiled headers |
|
103 |
# The following files are build with 'OPT_CFLAGS/NOOPT' (-O0) in the opt build. |
|
104 |
# But Clang doesn't support a precompiled header which was compiled with -O3 |
|
105 |
# to be used in a compilation unit which uses '-O0'. We could also prepare an |
|
106 |
# extra '-O0' PCH file for the opt build and use it here, but it's probably |
|
107 |
# not worth the effoert as long as only two files need this special handling. |
|
108 |
PCH_FLAG/loopTransform.o = $(PCH_FLAG/NO_PCH) |
|
109 |
PCH_FLAG/sharedRuntimeTrig.o = $(PCH_FLAG/NO_PCH) |
|
110 |
PCH_FLAG/sharedRuntimeTrans.o = $(PCH_FLAG/NO_PCH) |
|
111 |
||
112 |
endif |
|
113 |
else # ($(USE_CLANG), true) |
|
114 |
# check for precompiled headers support |
|
115 |
ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0" |
|
116 |
# Allow the user to turn off precompiled headers from the command line. |
|
117 |
ifneq ($(USE_PRECOMPILED_HEADER),0) |
|
118 |
PRECOMPILED_HEADER_DIR=. |
|
119 |
PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled/precompiled.hpp |
|
120 |
PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.gch |
|
121 |
endif |
|
122 |
endif |
|
1 | 123 |
endif |
17880 | 124 |
|
125 |
# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp. |
|
126 |
ifeq ($(USE_PRECOMPILED_HEADER),0) |
|
127 |
CFLAGS += -DDONT_USE_PRECOMPILED_HEADER |
|
7408
c04a5c989f26
7003125: precompiled.hpp is included when precompiled headers are not used
stefank
parents:
7397
diff
changeset
|
128 |
endif |
1 | 129 |
|
130 |
||
131 |
#------------------------------------------------------------------------ |
|
132 |
# Compiler flags |
|
133 |
||
134 |
# position-independent code |
|
135 |
PICFLAG = -fPIC |
|
136 |
||
137 |
VM_PICFLAG/LIBJVM = $(PICFLAG) |
|
138 |
VM_PICFLAG/AOUT = |
|
139 |
VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO)) |
|
140 |
||
12156
fb31de03f649
7141246: build-infra merge: Introduce new JVM_VARIANT* to control which kind of jvm gets built
erikj
parents:
11955
diff
changeset
|
141 |
ifeq ($(JVM_VARIANT_ZERO), true) |
4013 | 142 |
CFLAGS += $(LIBFFI_CFLAGS) |
143 |
endif |
|
12156
fb31de03f649
7141246: build-infra merge: Introduce new JVM_VARIANT* to control which kind of jvm gets built
erikj
parents:
11955
diff
changeset
|
144 |
ifeq ($(JVM_VARIANT_ZEROSHARK), true) |
fb31de03f649
7141246: build-infra merge: Introduce new JVM_VARIANT* to control which kind of jvm gets built
erikj
parents:
11955
diff
changeset
|
145 |
CFLAGS += $(LIBFFI_CFLAGS) |
6187 | 146 |
CFLAGS += $(LLVM_CFLAGS) |
147 |
endif |
|
1 | 148 |
CFLAGS += $(VM_PICFLAG) |
149 |
CFLAGS += -fno-rtti |
|
150 |
CFLAGS += -fno-exceptions |
|
151 |
CFLAGS += -D_REENTRANT |
|
17880 | 152 |
ifeq ($(USE_CLANG),) |
153 |
CFLAGS += -fcheck-new |
|
154 |
# version 4 and above support fvisibility=hidden (matches jni_x86.h file) |
|
155 |
# except 4.1.2 gives pointless warnings that can't be disabled (afaik) |
|
156 |
ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0" |
|
157 |
CFLAGS += -fvisibility=hidden |
|
158 |
endif |
|
159 |
else |
|
160 |
CFLAGS += -fvisibility=hidden |
|
161 |
endif |
|
162 |
||
163 |
ifeq ($(USE_CLANG), true) |
|
164 |
# Before Clang 3.1, we had to pass the stack alignment specification directly to llvm with the help of '-mllvm' |
|
165 |
# Starting with version 3.1, Clang understands the '-mstack-alignment' (and rejects '-mllvm -stack-alignment') |
|
166 |
ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 1 \) \))" "0" |
|
167 |
STACK_ALIGNMENT_OPT = -mno-omit-leaf-frame-pointer -mstack-alignment=16 |
|
168 |
else |
|
169 |
STACK_ALIGNMENT_OPT = -mno-omit-leaf-frame-pointer -mllvm -stack-alignment=16 |
|
170 |
endif |
|
8106 | 171 |
endif |
1 | 172 |
|
173 |
ARCHFLAG = $(ARCHFLAG/$(BUILDARCH)) |
|
174 |
ARCHFLAG/i486 = -m32 -march=i586 |
|
17880 | 175 |
ARCHFLAG/amd64 = -m64 $(STACK_ALIGNMENT_OPT) |
1 | 176 |
ARCHFLAG/ia64 = |
177 |
ARCHFLAG/sparc = -m32 -mcpu=v9 |
|
178 |
ARCHFLAG/sparcv9 = -m64 -mcpu=v9 |
|
6176
4d9030fe341f
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
5547
diff
changeset
|
179 |
ARCHFLAG/arm = -fsigned-char |
4013 | 180 |
ARCHFLAG/zero = $(ZERO_ARCHFLAG) |
6176
4d9030fe341f
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
5547
diff
changeset
|
181 |
ifndef E500V2 |
4d9030fe341f
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
5547
diff
changeset
|
182 |
ARCHFLAG/ppc = -mcpu=powerpc |
4d9030fe341f
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
5547
diff
changeset
|
183 |
endif |
1 | 184 |
|
185 |
CFLAGS += $(ARCHFLAG) |
|
186 |
AOUT_FLAGS += $(ARCHFLAG) |
|
187 |
LFLAGS += $(ARCHFLAG) |
|
188 |
ASFLAGS += $(ARCHFLAG) |
|
189 |
||
6176
4d9030fe341f
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
5547
diff
changeset
|
190 |
ifdef E500V2 |
4d9030fe341f
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
5547
diff
changeset
|
191 |
CFLAGS += -DE500V2 |
4d9030fe341f
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
5547
diff
changeset
|
192 |
endif |
4d9030fe341f
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
5547
diff
changeset
|
193 |
|
1 | 194 |
# Use C++ Interpreter |
195 |
ifdef CC_INTERP |
|
196 |
CFLAGS += -DCC_INTERP |
|
197 |
endif |
|
198 |
||
199 |
# Keep temporary files (.ii, .s) |
|
200 |
ifdef NEED_ASM |
|
201 |
CFLAGS += -save-temps |
|
202 |
else |
|
203 |
CFLAGS += -pipe |
|
204 |
endif |
|
205 |
||
206 |
# Compiler warnings are treated as errors |
|
207 |
WARNINGS_ARE_ERRORS = -Werror |
|
775 | 208 |
|
17880 | 209 |
ifeq ($(USE_CLANG), true) |
210 |
# However we need to clean the code up before we can unrestrictedly enable this option with Clang |
|
211 |
WARNINGS_ARE_ERRORS += -Wno-unused-value -Wno-logical-op-parentheses -Wno-parentheses-equality -Wno-parentheses |
|
212 |
WARNINGS_ARE_ERRORS += -Wno-switch -Wno-tautological-constant-out-of-range-compare -Wno-tautological-compare |
|
213 |
WARNINGS_ARE_ERRORS += -Wno-delete-non-virtual-dtor -Wno-deprecated -Wno-format -Wno-dynamic-class-memaccess |
|
214 |
WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body |
|
215 |
endif |
|
216 |
||
18073
f02460441ddc
8014431: cleanup warnings indicated by the -Wunused-value compiler option on linux
ccheung
parents:
17880
diff
changeset
|
217 |
WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value |
16670
4af09aff4237
8003310: Enable -Wunused-function when compiling with gcc
mikael
parents:
15938
diff
changeset
|
218 |
|
17880 | 219 |
ifeq ($(USE_CLANG),) |
220 |
# Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit |
|
221 |
# conversions which might affect the values. Only enable it in earlier versions. |
|
222 |
ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0" |
|
223 |
WARNING_FLAGS += -Wconversion |
|
224 |
endif |
|
775 | 225 |
endif |
226 |
||
15938 | 227 |
CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS) |
1 | 228 |
# Special cases |
229 |
CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@)) |
|
230 |
||
231 |
# The flags to use for an Optimized g++ build |
|
13975
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13473
diff
changeset
|
232 |
OPT_CFLAGS/SIZE=-Os |
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13473
diff
changeset
|
233 |
OPT_CFLAGS/SPEED=-O3 |
1 | 234 |
|
235 |
# Hotspot uses very unstrict aliasing turn this optimization off |
|
13975
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13473
diff
changeset
|
236 |
# This option is added to CFLAGS rather than OPT_CFLAGS |
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13473
diff
changeset
|
237 |
# so that OPT_CFLAGS overrides get this option too. |
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13473
diff
changeset
|
238 |
CFLAGS += -fno-strict-aliasing |
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13473
diff
changeset
|
239 |
|
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13473
diff
changeset
|
240 |
OPT_CFLAGS_DEFAULT ?= SPEED |
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13473
diff
changeset
|
241 |
|
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13473
diff
changeset
|
242 |
ifdef OPT_CFLAGS |
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13473
diff
changeset
|
243 |
ifneq ("$(origin OPT_CFLAGS)", "command line") |
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13473
diff
changeset
|
244 |
$(error " Use OPT_EXTRAS instead of OPT_CFLAGS to add extra flags to OPT_CFLAGS.") |
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13473
diff
changeset
|
245 |
endif |
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13473
diff
changeset
|
246 |
endif |
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13473
diff
changeset
|
247 |
|
2f7431485cfa
7189254: Change makefiles for more flexibility to override defaults
jprovino
parents:
13473
diff
changeset
|
248 |
OPT_CFLAGS = $(OPT_CFLAGS/$(OPT_CFLAGS_DEFAULT)) $(OPT_EXTRAS) |
1 | 249 |
|
250 |
# The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp |
|
251 |
# if we use expensive-optimizations |
|
252 |
ifeq ($(BUILDARCH), ia64) |
|
253 |
OPT_CFLAGS += -fno-expensive-optimizations |
|
254 |
endif |
|
255 |
||
256 |
OPT_CFLAGS/NOOPT=-O0 |
|
257 |
||
17880 | 258 |
# Work around some compiler bugs. |
259 |
ifeq ($(USE_CLANG), true) |
|
260 |
ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 2), 1) |
|
261 |
OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT) |
|
262 |
endif |
|
263 |
else |
|
264 |
# 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation. |
|
265 |
ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 3), 1) |
|
266 |
OPT_CFLAGS/mulnode.o += $(OPT_CFLAGS/NOOPT) |
|
267 |
endif |
|
2734
a15982b3cd69
6835796: Fedora 9 linux_i586-fastdebug-c2-runThese_Xcomp times out
kvn
parents:
2105
diff
changeset
|
268 |
endif |
a15982b3cd69
6835796: Fedora 9 linux_i586-fastdebug-c2-runThese_Xcomp times out
kvn
parents:
2105
diff
changeset
|
269 |
|
7397 | 270 |
# Flags for generating make dependency flags. |
17880 | 271 |
DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d) |
272 |
ifeq ($(USE_CLANG),) |
|
273 |
ifneq ("${CC_VER_MAJOR}", "2") |
|
274 |
DEPFLAGS += -fpch-deps |
|
275 |
endif |
|
7408
c04a5c989f26
7003125: precompiled.hpp is included when precompiled headers are not used
stefank
parents:
7397
diff
changeset
|
276 |
endif |
c04a5c989f26
7003125: precompiled.hpp is included when precompiled headers are not used
stefank
parents:
7397
diff
changeset
|
277 |
|
1 | 278 |
#------------------------------------------------------------------------ |
279 |
# Linker flags |
|
280 |
||
281 |
# statically link libstdc++.so, work with gcc but ignored by g++ |
|
282 |
STATIC_STDCXX = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic |
|
283 |
||
17880 | 284 |
ifeq ($(USE_CLANG),) |
285 |
# statically link libgcc and/or libgcc_s, libgcc does not exist before gcc-3.x. |
|
286 |
ifneq ("${CC_VER_MAJOR}", "2") |
|
287 |
STATIC_LIBGCC += -static-libgcc |
|
288 |
endif |
|
1 | 289 |
|
17880 | 290 |
ifeq ($(BUILDARCH), ia64) |
291 |
LFLAGS += -Wl,-relax |
|
292 |
endif |
|
1 | 293 |
endif |
294 |
||
295 |
# Enable linker optimization |
|
296 |
LFLAGS += -Xlinker -O1 |
|
297 |
||
17880 | 298 |
ifeq ($(USE_CLANG),) |
299 |
# If this is a --hash-style=gnu system, use --hash-style=both |
|
300 |
# The gnu .hash section won't work on some Linux systems like SuSE 10. |
|
301 |
_HAS_HASH_STYLE_GNU:=$(shell $(CC) -dumpspecs | grep -- '--hash-style=gnu') |
|
302 |
ifneq ($(_HAS_HASH_STYLE_GNU),) |
|
303 |
LDFLAGS_HASH_STYLE = -Wl,--hash-style=both |
|
304 |
endif |
|
305 |
else |
|
306 |
# Don't know how to find out the 'hash style' of a system as '-dumpspecs' |
|
307 |
# doesn't work for Clang. So for now we'll alwys use --hash-style=both |
|
2102
4a1023ae7252
6799141: Build with --hash-style=both so that binaries can work on SuSE 10
ohair
parents:
781
diff
changeset
|
308 |
LDFLAGS_HASH_STYLE = -Wl,--hash-style=both |
4a1023ae7252
6799141: Build with --hash-style=both so that binaries can work on SuSE 10
ohair
parents:
781
diff
changeset
|
309 |
endif |
17880 | 310 |
|
2102
4a1023ae7252
6799141: Build with --hash-style=both so that binaries can work on SuSE 10
ohair
parents:
781
diff
changeset
|
311 |
LFLAGS += $(LDFLAGS_HASH_STYLE) |
4a1023ae7252
6799141: Build with --hash-style=both so that binaries can work on SuSE 10
ohair
parents:
781
diff
changeset
|
312 |
|
1 | 313 |
# Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file. |
314 |
MAPFLAG = -Xlinker --version-script=FILENAME |
|
315 |
||
316 |
# Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj |
|
317 |
SONAMEFLAG = -Xlinker -soname=SONAME |
|
318 |
||
319 |
# Build shared library |
|
320 |
SHARED_FLAG = -shared |
|
321 |
||
322 |
# Keep symbols even they are not used |
|
9408
8bb4e957dea0
7041156: gcc 4.6 doesn't recognise -export-dynamic option
dsamersoff
parents:
8921
diff
changeset
|
323 |
AOUT_FLAGS += -Xlinker -export-dynamic |
1 | 324 |
|
325 |
#------------------------------------------------------------------------ |
|
326 |
# Debug flags |
|
327 |
||
17880 | 328 |
ifeq ($(USE_CLANG), true) |
329 |
# Restrict the debug information created by Clang to avoid |
|
330 |
# too big object files and speed the build up a little bit |
|
331 |
# (see http://llvm.org/bugs/show_bug.cgi?id=7554) |
|
332 |
CFLAGS += -flimit-debug-info |
|
333 |
endif |
|
334 |
||
13473
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
335 |
# DEBUG_BINARIES uses full -g debug information for all configs |
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
336 |
ifeq ($(DEBUG_BINARIES), true) |
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
337 |
CFLAGS += -g |
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
338 |
else |
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
339 |
# Use the stabs format for debugging information (this is the default |
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
340 |
# on gcc-2.91). It's good enough, has all the information about line |
14815
41114a74463a
7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents:
13975
diff
changeset
|
341 |
# numbers and local variables, and libjvm.so is only about 16M. |
13473
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
342 |
# Change this back to "-g" if you want the most expressive format. |
14815
41114a74463a
7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents:
13975
diff
changeset
|
343 |
# (warning: that could easily inflate libjvm.so to 150M!) |
13473
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
344 |
# Note: The Itanium gcc compiler crashes when using -gstabs. |
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
345 |
DEBUG_CFLAGS/ia64 = -g |
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
346 |
DEBUG_CFLAGS/amd64 = -g |
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
347 |
DEBUG_CFLAGS/arm = -g |
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
348 |
DEBUG_CFLAGS/ppc = -g |
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
349 |
DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH)) |
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
350 |
ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),) |
17880 | 351 |
ifeq ($(USE_CLANG), true) |
352 |
# Clang doesn't understand -gstabs |
|
18447
1481a04c99e2
8017538: Clang support broke slowdebug build for i586
twisti
parents:
18073
diff
changeset
|
353 |
DEBUG_CFLAGS += -g |
17880 | 354 |
else |
18447
1481a04c99e2
8017538: Clang support broke slowdebug build for i586
twisti
parents:
18073
diff
changeset
|
355 |
DEBUG_CFLAGS += -gstabs |
17880 | 356 |
endif |
10559 | 357 |
endif |
13473
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
358 |
|
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
359 |
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
360 |
FASTDEBUG_CFLAGS/ia64 = -g |
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
361 |
FASTDEBUG_CFLAGS/amd64 = -g |
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
362 |
FASTDEBUG_CFLAGS/arm = -g |
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
363 |
FASTDEBUG_CFLAGS/ppc = -g |
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
364 |
FASTDEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH)) |
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
365 |
ifeq ($(FASTDEBUG_CFLAGS/$(BUILDARCH)),) |
17880 | 366 |
ifeq ($(USE_CLANG), true) |
367 |
# Clang doesn't understand -gstabs |
|
18447
1481a04c99e2
8017538: Clang support broke slowdebug build for i586
twisti
parents:
18073
diff
changeset
|
368 |
FASTDEBUG_CFLAGS += -g |
17880 | 369 |
else |
18447
1481a04c99e2
8017538: Clang support broke slowdebug build for i586
twisti
parents:
18073
diff
changeset
|
370 |
FASTDEBUG_CFLAGS += -gstabs |
17880 | 371 |
endif |
13473
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
372 |
endif |
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
373 |
|
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
374 |
OPT_CFLAGS/ia64 = -g |
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
375 |
OPT_CFLAGS/amd64 = -g |
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
376 |
OPT_CFLAGS/arm = -g |
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
377 |
OPT_CFLAGS/ppc = -g |
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
378 |
OPT_CFLAGS += $(OPT_CFLAGS/$(BUILDARCH)) |
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
379 |
ifeq ($(OPT_CFLAGS/$(BUILDARCH)),) |
17880 | 380 |
ifeq ($(USE_CLANG), true) |
381 |
# Clang doesn't understand -gstabs |
|
382 |
OPT_CFLAGS += -g |
|
383 |
else |
|
384 |
OPT_CFLAGS += -gstabs |
|
385 |
endif |
|
13473
9bbabe271025
7188168: 7071904 broke the DEBUG_BINARIES option on Linux
dcubed
parents:
12943
diff
changeset
|
386 |
endif |
10559 | 387 |
endif |
388 |
endif |
|
389 |
||
6176
4d9030fe341f
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
5547
diff
changeset
|
390 |
# If we are building HEADLESS, pass on to VM |
4d9030fe341f
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
5547
diff
changeset
|
391 |
# so it can set the java.awt.headless property |
4d9030fe341f
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
5547
diff
changeset
|
392 |
ifdef HEADLESS |
4d9030fe341f
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
5547
diff
changeset
|
393 |
CFLAGS += -DHEADLESS |
4d9030fe341f
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
5547
diff
changeset
|
394 |
endif |
4d9030fe341f
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
5547
diff
changeset
|
395 |
|
4d9030fe341f
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
5547
diff
changeset
|
396 |
# We are building Embedded for a small device |
4d9030fe341f
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
5547
diff
changeset
|
397 |
# favor code space over speed |
4d9030fe341f
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
5547
diff
changeset
|
398 |
ifdef MINIMIZE_RAM_USAGE |
4d9030fe341f
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
5547
diff
changeset
|
399 |
CFLAGS += -DMINIMIZE_RAM_USAGE |
4d9030fe341f
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
5547
diff
changeset
|
400 |
endif |