annotate make/linux/makefiles/gcc.make @ 12108:badf4244ceae

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