1 # |
1 # |
2 # Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. |
2 # Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. |
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 # |
4 # |
5 # This code is free software; you can redistribute it and/or modify it |
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 |
6 # under the terms of the GNU General Public License version 2 only, as |
7 # published by the Free Software Foundation. |
7 # published by the Free Software Foundation. |
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
18 # |
18 # |
19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
20 # or visit www.oracle.com if you need additional information or have any |
20 # or visit www.oracle.com if you need additional information or have any |
21 # questions. |
21 # questions. |
22 # |
22 # |
23 # |
23 # |
24 |
24 |
25 # Rules to build JVM and related libraries, included from vm.make in the build |
25 # Rules to build JVM and related libraries, included from vm.make in the build |
26 # directory. |
26 # directory. |
27 |
27 |
51 |
51 |
52 # set VPATH so make knows where to look for source files |
52 # set VPATH so make knows where to look for source files |
53 # Src_Dirs_V is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm |
53 # Src_Dirs_V is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm |
54 # The adfiles directory contains ad_<arch>.[ch]pp. |
54 # The adfiles directory contains ad_<arch>.[ch]pp. |
55 # The jvmtifiles directory contains jvmti*.[ch]pp |
55 # The jvmtifiles directory contains jvmti*.[ch]pp |
56 Src_Dirs_V += $(GENERATED)/adfiles $(GENERATED)/jvmtifiles |
56 Src_Dirs_V += $(GENERATED)/adfiles $(GENERATED)/jvmtifiles $(GENERATED)/tracefiles |
57 VPATH += $(Src_Dirs_V:%=%:) |
57 VPATH += $(Src_Dirs_V:%=%:) |
58 |
58 |
59 # set INCLUDES for C preprocessor. |
59 # set INCLUDES for C preprocessor. |
60 Src_Dirs_I += $(GENERATED) |
60 Src_Dirs_I += $(GENERATED) |
61 # The order is important for the precompiled headers to work. |
61 # The order is important for the precompiled headers to work. |
71 else |
71 else |
72 SYMFLAG = |
72 SYMFLAG = |
73 endif |
73 endif |
74 endif |
74 endif |
75 |
75 |
76 # HOTSPOT_RELEASE_VERSION and HOTSPOT_BUILD_VERSION are defined |
76 # HOTSPOT_RELEASE_VERSION and HOTSPOT_BUILD_VERSION are defined |
77 # in $(GAMMADIR)/make/defs.make |
77 # in $(GAMMADIR)/make/defs.make |
78 ifeq ($(HOTSPOT_BUILD_VERSION),) |
78 ifeq ($(HOTSPOT_BUILD_VERSION),) |
79 BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)\"" |
79 BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)\"" |
80 else |
80 else |
81 BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION)\"" |
81 BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION)\"" |
98 ${HS_LIB_ARCH} \ |
98 ${HS_LIB_ARCH} \ |
99 ${VM_DISTRO} |
99 ${VM_DISTRO} |
100 |
100 |
101 # This is VERY important! The version define must only be supplied to vm_version.o |
101 # This is VERY important! The version define must only be supplied to vm_version.o |
102 # If not, ccache will not re-use the cache at all, since the version string might contain |
102 # If not, ccache will not re-use the cache at all, since the version string might contain |
103 # a time and date. |
103 # a time and date. |
104 CXXFLAGS/vm_version.o += ${JRE_VERSION} |
104 CXXFLAGS/vm_version.o += ${JRE_VERSION} |
105 |
105 |
106 CXXFLAGS/BYFILE = $(CXXFLAGS/$@) |
106 CXXFLAGS/BYFILE = $(CXXFLAGS/$@) |
107 |
107 |
108 # File specific flags |
108 # File specific flags |
109 CXXFLAGS += $(CXXFLAGS/BYFILE) |
109 CXXFLAGS += $(CXXFLAGS/BYFILE) |
110 |
110 |
111 |
111 # Large File Support |
112 ifndef JAVASE_EMBEDDED |
112 ifneq ($(LP64), 1) |
113 ifneq (${ARCH},arm) |
113 CXXFLAGS/ostream.o += -D_FILE_OFFSET_BITS=64 |
114 CFLAGS += -DINCLUDE_TRACE |
114 endif # ifneq ($(LP64), 1) |
115 endif |
|
116 endif |
|
117 |
115 |
118 # CFLAGS_WARN holds compiler options to suppress/enable warnings. |
116 # CFLAGS_WARN holds compiler options to suppress/enable warnings. |
119 CFLAGS += $(CFLAGS_WARN/BYFILE) |
117 CFLAGS += $(CFLAGS_WARN/BYFILE) |
120 |
118 |
121 # Do not use C++ exception handling |
119 # Do not use C++ exception handling |
157 SOURCE_PATHS+=$(HS_COMMON_SRC)/os/$(Platform_os_family)/vm |
155 SOURCE_PATHS+=$(HS_COMMON_SRC)/os/$(Platform_os_family)/vm |
158 SOURCE_PATHS+=$(HS_COMMON_SRC)/os/posix/vm |
156 SOURCE_PATHS+=$(HS_COMMON_SRC)/os/posix/vm |
159 SOURCE_PATHS+=$(HS_COMMON_SRC)/cpu/$(Platform_arch)/vm |
157 SOURCE_PATHS+=$(HS_COMMON_SRC)/cpu/$(Platform_arch)/vm |
160 SOURCE_PATHS+=$(HS_COMMON_SRC)/os_cpu/$(Platform_os_arch)/vm |
158 SOURCE_PATHS+=$(HS_COMMON_SRC)/os_cpu/$(Platform_os_arch)/vm |
161 |
159 |
162 ifndef JAVASE_EMBEDDED |
160 CORE_PATHS=$(foreach path,$(SOURCE_PATHS),$(call altsrc,$(path)) $(path)) |
163 ifneq (${ARCH},arm) |
161 CORE_PATHS+=$(GENERATED)/jvmtifiles $(GENERATED)/tracefiles |
164 SOURCE_PATHS+=$(shell if [ -d $(HS_ALT_SRC)/share/vm/jfr ]; then \ |
162 |
|
163 ifneq ($(INCLUDE_TRACE), false) |
|
164 CORE_PATHS+=$(shell if [ -d $(HS_ALT_SRC)/share/vm/jfr ]; then \ |
165 find $(HS_ALT_SRC)/share/vm/jfr -type d; \ |
165 find $(HS_ALT_SRC)/share/vm/jfr -type d; \ |
166 fi) |
166 fi) |
167 endif |
167 endif |
168 endif |
|
169 |
|
170 CORE_PATHS=$(foreach path,$(SOURCE_PATHS),$(call altsrc,$(path)) $(path)) |
|
171 CORE_PATHS+=$(GENERATED)/jvmtifiles |
|
172 |
168 |
173 COMPILER1_PATHS := $(call altsrc,$(HS_COMMON_SRC)/share/vm/c1) |
169 COMPILER1_PATHS := $(call altsrc,$(HS_COMMON_SRC)/share/vm/c1) |
174 COMPILER1_PATHS += $(HS_COMMON_SRC)/share/vm/c1 |
170 COMPILER1_PATHS += $(HS_COMMON_SRC)/share/vm/c1 |
175 |
171 |
176 COMPILER2_PATHS := $(call altsrc,$(HS_COMMON_SRC)/share/vm/opto) |
172 COMPILER2_PATHS := $(call altsrc,$(HS_COMMON_SRC)/share/vm/opto) |
315 endif |
311 endif |
316 |
312 |
317 # With more recent Redhat releases (or the cutting edge version Fedora), if |
313 # With more recent Redhat releases (or the cutting edge version Fedora), if |
318 # SELinux is configured to be enabled, the runtime linker will fail to apply |
314 # SELinux is configured to be enabled, the runtime linker will fail to apply |
319 # the text relocation to libjvm.so considering that it is built as a non-PIC |
315 # the text relocation to libjvm.so considering that it is built as a non-PIC |
320 # DSO. To workaround that, we run chcon to libjvm.so after it is built. See |
316 # DSO. To workaround that, we run chcon to libjvm.so after it is built. See |
321 # details in bug 6538311. |
317 # details in bug 6538311. |
322 $(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) $(LD_SCRIPT) |
318 $(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) $(LD_SCRIPT) |
323 $(QUIETLY) { \ |
319 $(QUIETLY) { \ |
324 echo Linking vm...; \ |
320 echo Linking vm...; \ |
325 $(LINK_LIB.CXX/PRE_HOOK) \ |
321 $(LINK_LIB.CXX/PRE_HOOK) \ |