make/solaris/makefiles/vm.make

Print this page
rev 4773 : 8005849: JEP 167: Event-Based JVM Tracing
Reviewed-by: acorn, coleenp, sla
Contributed-by: Karen Kinnear <karen.kinnear@oracle.com>, Bengt Rutisson <bengt.rutisson@oracle.com>, Calvin Cheung <calvin.cheung@oracle.com>, Erik Gahlin <erik.gahlin@oracle.com>, Erik Helin <erik.helin@oracle.com>, Jesper Wilhelmsson <jesper.wilhelmsson@oracle.com>, Keith McGuigan <keith.mcguigan@oracle.com>, Mattias Tobiasson <mattias.tobiasson@oracle.com>, Markus Gronlund <markus.gronlund@oracle.com>, Mikael Auno <mikael.auno@oracle.com>, Nils Eliasson <nils.eliasson@oracle.com>, Nils Loodin <nils.loodin@oracle.com>, Rickard Backman <rickard.backman@oracle.com>, Staffan Larsen <staffan.larsen@oracle.com>, Stefan Karlsson <stefan.karlsson@oracle.com>, Yekaterina Kantserova <yekaterina.kantserova@oracle.com>
   1 #
   2 # Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.
   8 #
   9 # This code is distributed in the hope that it will be useful, but WITHOUT
  10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12 # version 2 for more details (a copy is included in the LICENSE file that
  13 # accompanied this code).
  14 #
  15 # You should have received a copy of the GNU General Public License version
  16 # 2 along with this work; if not, write to the Free Software Foundation,
  17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18 #
  19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 # or visit www.oracle.com if you need additional information or have any
  21 # questions.
  22 #  


  31 include $(GAMMADIR)/make/altsrc.make
  32 
  33 default: build
  34 
  35 #----------------------------------------------------------------------
  36 # Defs
  37 
  38 GENERATED     = ../generated
  39 DEP_DIR       = $(GENERATED)/dependencies
  40 
  41 # reads the generated files defining the set of .o's and the .o .h dependencies
  42 -include $(DEP_DIR)/*.d
  43 
  44 # read machine-specific adjustments (%%% should do this via buildtree.make?)
  45 include $(MAKEFILES_DIR)/$(BUILDARCH).make
  46 
  47 # set VPATH so make knows where to look for source files
  48 # Src_Dirs_V is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
  49 # The adfiles directory contains ad_<arch>.[ch]pp.
  50 # The jvmtifiles directory contains jvmti*.[ch]pp
  51 Src_Dirs_V += $(GENERATED)/adfiles $(GENERATED)/jvmtifiles
  52 VPATH += $(Src_Dirs_V:%=%:)
  53 
  54 # set INCLUDES for C preprocessor
  55 Src_Dirs_I += $(GENERATED)
  56 INCLUDES += $(Src_Dirs_I:%=-I%)
  57 
  58 # SYMFLAG is used by {dtrace,jsig,saproc}.make.
  59 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
  60   # always build with debug info when we can create .debuginfo files
  61   # and disable 'lazy debug info' so the .so has everything.
  62   SYMFLAG = -g -xs
  63 else
  64   ifeq (${VERSION}, debug)
  65     SYMFLAG = -g
  66   else
  67     SYMFLAG =
  68   endif
  69 endif
  70 
  71 # The following variables are defined in the generated flags.make file.


  86   ${VM_DISTRO}
  87 
  88 # This is VERY important! The version define must only be supplied to vm_version.o
  89 # If not, ccache will not re-use the cache at all, since the version string might contain
  90 # a time and date. 
  91 CXXFLAGS/vm_version.o += ${JRE_VERSION}
  92 
  93 CXXFLAGS/BYFILE = $(CXXFLAGS/$@)
  94 
  95 # File specific flags
  96 CXXFLAGS += $(CXXFLAGS/BYFILE)
  97 
  98 
  99 # CFLAGS_WARN holds compiler options to suppress/enable warnings.
 100 CFLAGS += $(CFLAGS_WARN)
 101 
 102 # Do not use C++ exception handling
 103 CFLAGS += $(CFLAGS/NOEX)
 104 
 105 # Extra flags from gnumake's invocation or environment
 106 CFLAGS += $(EXTRA_CFLAGS) -DINCLUDE_TRACE
 107 
 108 # Math Library (libm.so), do not use -lm.
 109 #    There might be two versions of libm.so on the build system:
 110 #    libm.so.1 and libm.so.2, and we want libm.so.1.
 111 #    Depending on the Solaris release being used to build with,
 112 #    /usr/lib/libm.so could point at a libm.so.2, so we are
 113 #    explicit here so that the libjvm.so you have built will work on an
 114 #    older Solaris release that might not have libm.so.2.
 115 #    This is a critical factor in allowing builds on Solaris 10 or newer
 116 #    to run on Solaris 8 or 9.
 117 #
 118 LIBM=/usr/lib$(ISA_DIR)/libm.so.1
 119 
 120 ifeq ("${Platform_compiler}", "sparcWorks")
 121 # The whole megilla:
 122 ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 505), 1)
 123 # Old Comment: List the libraries in the order the compiler was designed for
 124 # Not sure what the 'designed for' comment is referring too above.
 125 #   The order may not be too significant anymore, but I have placed this
 126 #   older libm before libCrun, just to make sure it's found and used first.
 127 LIBS += -lsocket -lsched -ldl $(LIBM) -lCrun -lthread -ldoor -lc -ldemangle
 128 else
 129 ifeq ($(COMPILER_REV_NUMERIC), 502)
 130 # SC6.1 has it's own libm.so: specifying anything else provokes a name conflict.
 131 LIBS += -ldl -lthread -lsocket -lm -lsched -ldoor -ldemangle
 132 else
 133 LIBS += -ldl -lthread -lsocket $(LIBM) -lsched -ldoor -ldemangle
 134 endif # 502
 135 endif # 505
 136 else
 137 LIBS += -lsocket -lsched -ldl $(LIBM) -lthread -lc -ldemangle
 138 endif # sparcWorks
 139 
 140 ifeq ("${Platform_arch}", "sparc")
 141 LIBS += -lkstat
 142 endif
 143 
 144 # By default, link the *.o into the library, not the executable.
 145 LINK_INTO$(LINK_INTO) = LIBJVM
 146 
 147 JDK_LIBDIR = $(JAVA_HOME)/jre/lib/$(LIBARCH)
 148 
 149 #----------------------------------------------------------------------
 150 # jvm_db & dtrace
 151 include $(MAKEFILES_DIR)/dtrace.make
 152 
 153 #----------------------------------------------------------------------
 154 # add_gnu_debuglink tool
 155 include $(MAKEFILES_DIR)/add_gnu_debuglink.make
 156 
 157 #----------------------------------------------------------------------
 158 # fix_empty_sec_hdr_flags tool
 159 include $(MAKEFILES_DIR)/fix_empty_sec_hdr_flags.make
 160 
 161 #----------------------------------------------------------------------
 162 # JVM
 163 
 164 JVM      = jvm
 165 LIBJVM   = lib$(JVM).so
 166 
 167 LIBJVM_DEBUGINFO   = lib$(JVM).debuginfo
 168 LIBJVM_DIZ         = lib$(JVM).diz
 169 
 170 SPECIAL_PATHS:=adlc c1 dist gc_implementation opto shark libadt
 171 
 172 SOURCE_PATHS=\
 173   $(shell find $(HS_COMMON_SRC)/share/vm/* -type d \! \
 174       \( -name DUMMY $(foreach dir,$(SPECIAL_PATHS),-o -name $(dir)) \))
 175 SOURCE_PATHS+=$(HS_COMMON_SRC)/os/$(Platform_os_family)/vm
 176 SOURCE_PATHS+=$(HS_COMMON_SRC)/os/posix/vm
 177 SOURCE_PATHS+=$(HS_COMMON_SRC)/cpu/$(Platform_arch)/vm
 178 SOURCE_PATHS+=$(HS_COMMON_SRC)/os_cpu/$(Platform_os_arch)/vm
 179 
 180 SOURCE_PATHS+=$(shell if [ -d $(HS_ALT_SRC)/share/vm/jfr ]; then \




 181   find $(HS_ALT_SRC)/share/vm/jfr -type d; \
 182   fi)
 183 
 184 CORE_PATHS=$(foreach path,$(SOURCE_PATHS),$(call altsrc,$(path)) $(path))
 185 CORE_PATHS+=$(GENERATED)/jvmtifiles
 186 
 187 COMPILER1_PATHS := $(call altsrc,$(HS_COMMON_SRC)/share/vm/c1)
 188 COMPILER1_PATHS += $(HS_COMMON_SRC)/share/vm/c1
 189 
 190 COMPILER2_PATHS := $(call altsrc,$(HS_COMMON_SRC)/share/vm/opto)
 191 COMPILER2_PATHS += $(call altsrc,$(HS_COMMON_SRC)/share/vm/libadt)
 192 COMPILER2_PATHS += $(HS_COMMON_SRC)/share/vm/opto
 193 COMPILER2_PATHS += $(HS_COMMON_SRC)/share/vm/libadt
 194 COMPILER2_PATHS +=  $(GENERATED)/adfiles
 195 
 196 # Include dirs per type.
 197 Src_Dirs/CORE      := $(CORE_PATHS)
 198 Src_Dirs/COMPILER1 := $(CORE_PATHS) $(COMPILER1_PATHS)
 199 Src_Dirs/COMPILER2 := $(CORE_PATHS) $(COMPILER2_PATHS)
 200 Src_Dirs/TIERED    := $(CORE_PATHS) $(COMPILER1_PATHS) $(COMPILER2_PATHS)
 201 Src_Dirs/ZERO      := $(CORE_PATHS)
 202 Src_Dirs/SHARK     := $(CORE_PATHS)
 203 Src_Dirs := $(Src_Dirs/$(TYPE))
 204 
 205 COMPILER2_SPECIFIC_FILES := opto libadt bcEscapeAnalyzer.cpp c2_\* runtime_\*


   1 #
   2 # Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.
   8 #
   9 # This code is distributed in the hope that it will be useful, but WITHOUT
  10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12 # version 2 for more details (a copy is included in the LICENSE file that
  13 # accompanied this code).
  14 #
  15 # You should have received a copy of the GNU General Public License version
  16 # 2 along with this work; if not, write to the Free Software Foundation,
  17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18 #
  19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 # or visit www.oracle.com if you need additional information or have any
  21 # questions.
  22 #


  31 include $(GAMMADIR)/make/altsrc.make
  32 
  33 default: build
  34 
  35 #----------------------------------------------------------------------
  36 # Defs
  37 
  38 GENERATED     = ../generated
  39 DEP_DIR       = $(GENERATED)/dependencies
  40 
  41 # reads the generated files defining the set of .o's and the .o .h dependencies
  42 -include $(DEP_DIR)/*.d
  43 
  44 # read machine-specific adjustments (%%% should do this via buildtree.make?)
  45 include $(MAKEFILES_DIR)/$(BUILDARCH).make
  46 
  47 # set VPATH so make knows where to look for source files
  48 # Src_Dirs_V is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
  49 # The adfiles directory contains ad_<arch>.[ch]pp.
  50 # The jvmtifiles directory contains jvmti*.[ch]pp
  51 Src_Dirs_V += $(GENERATED)/adfiles $(GENERATED)/jvmtifiles $(GENERATED)/tracefiles
  52 VPATH += $(Src_Dirs_V:%=%:)
  53 
  54 # set INCLUDES for C preprocessor
  55 Src_Dirs_I += $(GENERATED)
  56 INCLUDES += $(Src_Dirs_I:%=-I%)
  57 
  58 # SYMFLAG is used by {dtrace,jsig,saproc}.make.
  59 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
  60   # always build with debug info when we can create .debuginfo files
  61   # and disable 'lazy debug info' so the .so has everything.
  62   SYMFLAG = -g -xs
  63 else
  64   ifeq (${VERSION}, debug)
  65     SYMFLAG = -g
  66   else
  67     SYMFLAG =
  68   endif
  69 endif
  70 
  71 # The following variables are defined in the generated flags.make file.


  86   ${VM_DISTRO}
  87 
  88 # This is VERY important! The version define must only be supplied to vm_version.o
  89 # If not, ccache will not re-use the cache at all, since the version string might contain
  90 # a time and date.
  91 CXXFLAGS/vm_version.o += ${JRE_VERSION}
  92 
  93 CXXFLAGS/BYFILE = $(CXXFLAGS/$@)
  94 
  95 # File specific flags
  96 CXXFLAGS += $(CXXFLAGS/BYFILE)
  97 
  98 
  99 # CFLAGS_WARN holds compiler options to suppress/enable warnings.
 100 CFLAGS += $(CFLAGS_WARN)
 101 
 102 # Do not use C++ exception handling
 103 CFLAGS += $(CFLAGS/NOEX)
 104 
 105 # Extra flags from gnumake's invocation or environment
 106 CFLAGS += $(EXTRA_CFLAGS)
 107 
 108 # Math Library (libm.so), do not use -lm.
 109 #    There might be two versions of libm.so on the build system:
 110 #    libm.so.1 and libm.so.2, and we want libm.so.1.
 111 #    Depending on the Solaris release being used to build with,
 112 #    /usr/lib/libm.so could point at a libm.so.2, so we are
 113 #    explicit here so that the libjvm.so you have built will work on an
 114 #    older Solaris release that might not have libm.so.2.
 115 #    This is a critical factor in allowing builds on Solaris 10 or newer
 116 #    to run on Solaris 8 or 9.
 117 #
 118 LIBM=/usr/lib$(ISA_DIR)/libm.so.1
 119 
 120 ifeq ("${Platform_compiler}", "sparcWorks")
 121 # The whole megilla:
 122 ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 505), 1)
 123 # Old Comment: List the libraries in the order the compiler was designed for
 124 # Not sure what the 'designed for' comment is referring too above.
 125 #   The order may not be too significant anymore, but I have placed this
 126 #   older libm before libCrun, just to make sure it's found and used first.
 127 LIBS += -lsocket -lsched -ldl $(LIBM) -lCrun -lthread -ldoor -lc -ldemangle
 128 else
 129 ifeq ($(COMPILER_REV_NUMERIC), 502)
 130 # SC6.1 has it's own libm.so: specifying anything else provokes a name conflict.
 131 LIBS += -ldl -lthread -lsocket -lm -lsched -ldoor -ldemangle
 132 else
 133 LIBS += -ldl -lthread -lsocket $(LIBM) -lsched -ldoor -ldemangle
 134 endif # 502
 135 endif # 505
 136 else
 137 LIBS += -lsocket -lsched -ldl $(LIBM) -lthread -lc -ldemangle
 138 endif # sparcWorks
 139 

 140 LIBS += -lkstat

 141 
 142 # By default, link the *.o into the library, not the executable.
 143 LINK_INTO$(LINK_INTO) = LIBJVM
 144 
 145 JDK_LIBDIR = $(JAVA_HOME)/jre/lib/$(LIBARCH)
 146 
 147 #----------------------------------------------------------------------
 148 # jvm_db & dtrace
 149 include $(MAKEFILES_DIR)/dtrace.make
 150 
 151 #----------------------------------------------------------------------
 152 # add_gnu_debuglink tool
 153 include $(MAKEFILES_DIR)/add_gnu_debuglink.make
 154 
 155 #----------------------------------------------------------------------
 156 # fix_empty_sec_hdr_flags tool
 157 include $(MAKEFILES_DIR)/fix_empty_sec_hdr_flags.make
 158 
 159 #----------------------------------------------------------------------
 160 # JVM
 161 
 162 JVM      = jvm
 163 LIBJVM   = lib$(JVM).so
 164 
 165 LIBJVM_DEBUGINFO   = lib$(JVM).debuginfo
 166 LIBJVM_DIZ         = lib$(JVM).diz
 167 
 168 SPECIAL_PATHS:=adlc c1 dist gc_implementation opto shark libadt
 169 
 170 SOURCE_PATHS=\
 171   $(shell find $(HS_COMMON_SRC)/share/vm/* -type d \! \
 172       \( -name DUMMY $(foreach dir,$(SPECIAL_PATHS),-o -name $(dir)) \))
 173 SOURCE_PATHS+=$(HS_COMMON_SRC)/os/$(Platform_os_family)/vm
 174 SOURCE_PATHS+=$(HS_COMMON_SRC)/os/posix/vm
 175 SOURCE_PATHS+=$(HS_COMMON_SRC)/cpu/$(Platform_arch)/vm
 176 SOURCE_PATHS+=$(HS_COMMON_SRC)/os_cpu/$(Platform_os_arch)/vm
 177 
 178 CORE_PATHS=$(foreach path,$(SOURCE_PATHS),$(call altsrc,$(path)) $(path))
 179 CORE_PATHS+=$(GENERATED)/jvmtifiles $(GENERATED)/tracefiles
 180 
 181 ifneq ($(INCLUDE_TRACE), false)
 182 CORE_PATHS+=$(shell if [ -d $(HS_ALT_SRC)/share/vm/jfr ]; then \
 183   find $(HS_ALT_SRC)/share/vm/jfr -type d; \
 184   fi)
 185 endif


 186 
 187 COMPILER1_PATHS := $(call altsrc,$(HS_COMMON_SRC)/share/vm/c1)
 188 COMPILER1_PATHS += $(HS_COMMON_SRC)/share/vm/c1
 189 
 190 COMPILER2_PATHS := $(call altsrc,$(HS_COMMON_SRC)/share/vm/opto)
 191 COMPILER2_PATHS += $(call altsrc,$(HS_COMMON_SRC)/share/vm/libadt)
 192 COMPILER2_PATHS += $(HS_COMMON_SRC)/share/vm/opto
 193 COMPILER2_PATHS += $(HS_COMMON_SRC)/share/vm/libadt
 194 COMPILER2_PATHS +=  $(GENERATED)/adfiles
 195 
 196 # Include dirs per type.
 197 Src_Dirs/CORE      := $(CORE_PATHS)
 198 Src_Dirs/COMPILER1 := $(CORE_PATHS) $(COMPILER1_PATHS)
 199 Src_Dirs/COMPILER2 := $(CORE_PATHS) $(COMPILER2_PATHS)
 200 Src_Dirs/TIERED    := $(CORE_PATHS) $(COMPILER1_PATHS) $(COMPILER2_PATHS)
 201 Src_Dirs/ZERO      := $(CORE_PATHS)
 202 Src_Dirs/SHARK     := $(CORE_PATHS)
 203 Src_Dirs := $(Src_Dirs/$(TYPE))
 204 
 205 COMPILER2_SPECIFIC_FILES := opto libadt bcEscapeAnalyzer.cpp c2_\* runtime_\*