Mercurial > hg > truffle
annotate make/linux/makefiles/vm.make @ 1345:747d26efc5fa
6939180: Zero locking fix
Summary: When Zero is running with Shark enabled threads can be left with their _do_not_unlock_if_synchronized flag incorrectly set.
Reviewed-by: twisti
Contributed-by: Gary Benson <gbenson@redhat.com>
author | twisti |
---|---|
date | Tue, 30 Mar 2010 00:57:55 -0700 |
parents | 7de45b5044c3 |
children | 1f81c0d18c75 c18cbe5936b8 |
rev | line source |
---|---|
0 | 1 # |
196 | 2 # Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved. |
0 | 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | |
20 # CA 95054 USA or visit www.sun.com if you need additional information or | |
21 # have any questions. | |
22 # | |
23 # | |
24 | |
25 # Rules to build JVM and related libraries, included from vm.make in the build | |
26 # directory. | |
27 | |
28 # Common build rules. | |
91
a294fd0c4b38
6583644: Move all managed/SCCS files out of 'build' into 'make' directory
kamg
parents:
0
diff
changeset
|
29 MAKEFILES_DIR=$(GAMMADIR)/make/$(Platform_os_family)/makefiles |
0 | 30 include $(MAKEFILES_DIR)/rules.make |
31 | |
32 default: build | |
33 | |
34 #---------------------------------------------------------------------- | |
35 # Defs | |
36 | |
37 GENERATED = ../generated | |
38 | |
39 # read a generated file defining the set of .o's and the .o .h dependencies | |
40 include $(GENERATED)/Dependencies | |
41 | |
42 # read machine-specific adjustments (%%% should do this via buildtree.make?) | |
1010 | 43 ifeq ($(ZERO_BUILD), true) |
44 include $(MAKEFILES_DIR)/zeroshark.make | |
45 else | |
46 include $(MAKEFILES_DIR)/$(BUILDARCH).make | |
47 endif | |
0 | 48 |
49 # set VPATH so make knows where to look for source files | |
50 # Src_Dirs is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm | |
51 # The incls directory contains generated header file lists for inclusion. | |
52 # The adfiles directory contains ad_<arch>.[ch]pp. | |
53 # The jvmtifiles directory contains jvmti*.[ch]pp | |
54 Src_Dirs_V = $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED)/incls | |
55 VPATH += $(Src_Dirs_V:%=%:) | |
56 | |
57 # set INCLUDES for C preprocessor | |
58 Src_Dirs_I = $(PRECOMPILED_HEADER_DIR) $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED) | |
59 INCLUDES += $(Src_Dirs_I:%=-I%) | |
60 | |
61 ifeq (${VERSION}, debug) | |
62 SYMFLAG = -g | |
63 else | |
64 SYMFLAG = | |
65 endif | |
66 | |
67 # HOTSPOT_RELEASE_VERSION and HOTSPOT_BUILD_VERSION are defined | |
68 # in $(GAMMADIR)/make/defs.make | |
69 ifeq ($(HOTSPOT_BUILD_VERSION),) | |
70 BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)\"" | |
71 else | |
72 BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION)\"" | |
73 endif | |
74 | |
75 # The following variables are defined in the generated flags.make file. | |
76 BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\"" | |
77 JRE_VERSION = -DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\"" | |
100
c7c777385a15
6667042: PrintAssembly option does not work without special plugin
jrose
parents:
0
diff
changeset
|
78 HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\" |
0 | 79 BUILD_TARGET = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\"" |
80 BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\"" | |
81 VM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\"" | |
82 | |
83 CPPFLAGS = \ | |
84 ${SYSDEFS} \ | |
85 ${INCLUDES} \ | |
86 ${BUILD_VERSION} \ | |
87 ${BUILD_TARGET} \ | |
88 ${BUILD_USER} \ | |
100
c7c777385a15
6667042: PrintAssembly option does not work without special plugin
jrose
parents:
0
diff
changeset
|
89 ${HS_LIB_ARCH} \ |
0 | 90 ${JRE_VERSION} \ |
91 ${VM_DISTRO} | |
92 | |
93 # CFLAGS_WARN holds compiler options to suppress/enable warnings. | |
94 CFLAGS += $(CFLAGS_WARN/BYFILE) | |
95 | |
96 # Do not use C++ exception handling | |
97 CFLAGS += $(CFLAGS/NOEX) | |
98 | |
99 # Extra flags from gnumake's invocation or environment | |
100 CFLAGS += $(EXTRA_CFLAGS) | |
101 | |
102 LIBS += -lm -ldl -lpthread | |
103 | |
104 # By default, link the *.o into the library, not the executable. | |
105 LINK_INTO$(LINK_INTO) = LIBJVM | |
106 | |
107 JDK_LIBDIR = $(JAVA_HOME)/jre/lib/$(LIBARCH) | |
108 | |
109 #---------------------------------------------------------------------- | |
110 # jvm_db & dtrace | |
111 include $(MAKEFILES_DIR)/dtrace.make | |
112 | |
113 #---------------------------------------------------------------------- | |
114 # JVM | |
115 | |
1123
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
1010
diff
changeset
|
116 JVM = jvm |
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
1010
diff
changeset
|
117 LIBJVM = lib$(JVM).so |
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
1010
diff
changeset
|
118 LIBJVM_G = lib$(JVM)$(G_SUFFIX).so |
0 | 119 |
120 JVM_OBJ_FILES = $(Obj_Files) | |
121 | |
122 vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES)) | |
123 | |
1294
7de45b5044c3
6932270: Allow Java's ELF symtab reader to use separate debuginfo files
never
parents:
1123
diff
changeset
|
124 mapfile : $(MAPFILE) vm.def |
0 | 125 rm -f $@ |
1294
7de45b5044c3
6932270: Allow Java's ELF symtab reader to use separate debuginfo files
never
parents:
1123
diff
changeset
|
126 awk '{ if ($$0 ~ "INSERT VTABLE SYMBOLS HERE") \ |
7de45b5044c3
6932270: Allow Java's ELF symtab reader to use separate debuginfo files
never
parents:
1123
diff
changeset
|
127 { system ("cat vm.def"); } \ |
7de45b5044c3
6932270: Allow Java's ELF symtab reader to use separate debuginfo files
never
parents:
1123
diff
changeset
|
128 else \ |
7de45b5044c3
6932270: Allow Java's ELF symtab reader to use separate debuginfo files
never
parents:
1123
diff
changeset
|
129 { print $$0 } \ |
7de45b5044c3
6932270: Allow Java's ELF symtab reader to use separate debuginfo files
never
parents:
1123
diff
changeset
|
130 }' > $@ < $(MAPFILE) |
0 | 131 |
132 mapfile_reorder : mapfile $(REORDERFILE) | |
133 rm -f $@ | |
134 cat $^ > $@ | |
135 | |
1294
7de45b5044c3
6932270: Allow Java's ELF symtab reader to use separate debuginfo files
never
parents:
1123
diff
changeset
|
136 vm.def: $(Res_Files) $(Obj_Files) |
7de45b5044c3
6932270: Allow Java's ELF symtab reader to use separate debuginfo files
never
parents:
1123
diff
changeset
|
137 sh $(GAMMADIR)/make/linux/makefiles/build_vm_def.sh *.o > $@ |
7de45b5044c3
6932270: Allow Java's ELF symtab reader to use separate debuginfo files
never
parents:
1123
diff
changeset
|
138 |
1010 | 139 ifeq ($(ZERO_LIBARCH), ppc64) |
140 STATIC_CXX = false | |
141 else | |
142 STATIC_CXX = true | |
143 endif | |
0 | 144 |
145 ifeq ($(LINK_INTO),AOUT) | |
146 LIBJVM.o = | |
147 LIBJVM_MAPFILE = | |
148 LIBS_VM = $(LIBS) | |
149 else | |
150 LIBJVM.o = $(JVM_OBJ_FILES) | |
151 LIBJVM_MAPFILE$(LDNOMAP) = mapfile_reorder | |
152 LFLAGS_VM$(LDNOMAP) += $(MAPFLAG:FILENAME=$(LIBJVM_MAPFILE)) | |
153 LFLAGS_VM += $(SONAMEFLAG:SONAME=$(LIBJVM)) | |
154 | |
155 # JVM is statically linked with libgcc[_s] and libstdc++; this is needed to | |
156 # get around library dependency and compatibility issues. Must use gcc not | |
157 # g++ to link. | |
158 ifeq ($(STATIC_CXX), true) | |
159 LFLAGS_VM += $(STATIC_LIBGCC) | |
160 LIBS_VM += $(STATIC_STDCXX) | |
161 else | |
162 LIBS_VM += -lstdc++ | |
163 endif | |
164 | |
165 LIBS_VM += $(LIBS) | |
166 endif | |
1010 | 167 ifeq ($(ZERO_BUILD), true) |
168 LIBS_VM += $(LIBFFI_LIBS) | |
169 endif | |
0 | 170 |
171 LINK_VM = $(LINK_LIB.c) | |
172 | |
173 # rule for building precompiled header | |
174 $(PRECOMPILED_HEADER): $(Precompiled_Files) | |
175 $(QUIETLY) echo Generating precompiled header $@ | |
176 $(QUIETLY) mkdir -p $(PRECOMPILED_HEADER_DIR)/incls | |
177 $(QUIETLY) $(COMPILE.CC) -x c++-header -c $(GENERATED)/incls/_precompiled.incl -o $@ $(COMPILE_DONE) | |
178 | |
179 # making the library: | |
180 | |
181 ifneq ($(JVM_BASE_ADDR),) | |
182 # By default shared library is linked at base address == 0. Modify the | |
183 # linker script if JVM prefers a different base location. It can also be | |
184 # implemented with 'prelink -r'. But 'prelink' is not (yet) available on | |
185 # our build platform (AS-2.1). | |
186 LD_SCRIPT = libjvm.so.lds | |
187 $(LD_SCRIPT): $(LIBJVM_MAPFILE) | |
188 $(QUIETLY) { \ | |
189 rm -rf $@; \ | |
190 $(LINK_VM) -Wl,--verbose $(LFLAGS_VM) 2>&1 | \ | |
191 sed -e '/^======/,/^======/!d' \ | |
192 -e '/^======/d' \ | |
193 -e 's/0\( + SIZEOF_HEADERS\)/$(JVM_BASE_ADDR)\1/' \ | |
194 > $@; \ | |
195 } | |
196 LD_SCRIPT_FLAG = -Wl,-T,$(LD_SCRIPT) | |
197 endif | |
198 | |
199 # With more recent Redhat releases (or the cutting edge version Fedora), if | |
200 # SELinux is configured to be enabled, the runtime linker will fail to apply | |
201 # the text relocation to libjvm.so considering that it is built as a non-PIC | |
202 # DSO. To workaround that, we run chcon to libjvm.so after it is built. See | |
203 # details in bug 6538311. | |
204 $(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) $(LD_SCRIPT) | |
205 $(QUIETLY) { \ | |
206 echo Linking vm...; \ | |
207 $(LINK_LIB.CC/PRE_HOOK) \ | |
208 $(LINK_VM) $(LD_SCRIPT_FLAG) \ | |
209 $(LFLAGS_VM) -o $@ $(LIBJVM.o) $(LIBS_VM); \ | |
210 $(LINK_LIB.CC/POST_HOOK) \ | |
211 rm -f $@.1; ln -s $@ $@.1; \ | |
1123
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
1010
diff
changeset
|
212 [ -f $(LIBJVM_G) ] || { ln -s $@ $(LIBJVM_G); ln -s $@.1 $(LIBJVM_G).1; }; \ |
0 | 213 if [ -x /usr/sbin/selinuxenabled ] ; then \ |
214 /usr/sbin/selinuxenabled; \ | |
215 if [ $$? = 0 ] ; then \ | |
216 /usr/bin/chcon -t textrel_shlib_t $@; \ | |
217 if [ $$? != 0 ]; then \ | |
287
6e76352f1f62
6459085: naked pointer subtractions in class data sharing code
xlu
parents:
196
diff
changeset
|
218 echo "ERROR: Cannot chcon $@"; \ |
0 | 219 fi \ |
220 fi \ | |
221 fi \ | |
222 } | |
223 | |
224 DEST_JVM = $(JDK_LIBDIR)/$(VM_SUBDIR)/$(LIBJVM) | |
225 | |
226 install_jvm: $(LIBJVM) | |
227 @echo "Copying $(LIBJVM) to $(DEST_JVM)" | |
228 $(QUIETLY) cp -f $(LIBJVM) $(DEST_JVM) && echo "Done" | |
229 | |
230 #---------------------------------------------------------------------- | |
231 # Other files | |
232 | |
233 # Gamma launcher | |
234 include $(MAKEFILES_DIR)/launcher.make | |
235 | |
236 # Signal interposition library | |
237 include $(MAKEFILES_DIR)/jsig.make | |
238 | |
239 # Serviceability agent | |
240 include $(MAKEFILES_DIR)/saproc.make | |
241 | |
242 #---------------------------------------------------------------------- | |
243 | |
244 build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) checkAndBuildSA | |
245 | |
246 install: install_jvm install_jsig install_saproc | |
247 | |
248 .PHONY: default build install install_jvm |