4170N/A# Copyright (c) 2005, 2013, Oracle
and/or its affiliates. All rights reserved.
2796N/A# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2796N/A# This code is free software; you can redistribute it
and/or modify it
2796N/A# under the terms of the GNU General Public License version 2 only, as
2796N/A# published by the Free Software Foundation.
2796N/A# This code is distributed in the hope that it will be useful, but WITHOUT
2796N/A# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2796N/A# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2796N/A# version 2 for more details (a copy is included in the LICENSE file that
2796N/A# You should have received a copy of the GNU General Public License version
2796N/A# 2 along with this work; if not, write to the Free Software Foundation,
2796N/A# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2796N/A# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
4170N/A# but not for CORE configuration.
2842N/A# we build dtrace for macosx using USDT2 probes
2842N/ADtraceOutDir = $(GENERATED)/dtracefiles
2842N/A# Bsd does not build libjvm_db, does not compile on macosx
2842N/AGENOFFS = generate$(JVMOFFS)
2842N/ADTRACE_SRCDIR = $(GAMMADIR)
/src/os/$(Platform_os_family)/dtrace
2842N/A# to remove '-g' option which causes link problems
2842N/A# also '-z nodefs' is used as workaround
2842N/AGENOFFS_CFLAGS = $(shell echo $(CFLAGS) | sed -e 's/ -g / /g' -e 's/ -g0 / /g';)
2842N/ALIBJVM_DB_MAPFILE = # no mapfile for usdt2 # $(MAKEFILES_DIR)/mapfile-vers-jvm_db
2842N/A#LFLAGS_JVM_DB += $(MAPFLAG:FILENAME=$(LIBJVM_DB_MAPFILE))
2842N/ALIBJVM_DTRACE_MAPFILE = # no mapfile for usdt2 # $(MAKEFILES_DIR)/mapfile-vers-jvm_dtrace
2842N/A#LFLAGS_JVM_DTRACE += $(MAPFLAG:FILENAME=$(LIBJVM_DTRACE_MAPFILE))
2842N/ALFLAGS_JVM_DB += $(PICFLAG) # -D_REENTRANT
2842N/ALFLAGS_JVM_DTRACE += $(PICFLAG) # -D_REENTRANT
2842N/AISA = $(subst i386,i486,$(BUILDARCH))
2842N/Aifneq ("${ISA}","${BUILDARCH}")
2842N/AXLIBJVM_DB = 64/$(LIBJVM_DB)
2842N/AXLIBJVM_DB_G = 64/$(LIBJVM_DB_G)
2842N/AXLIBJVM_DTRACE = 64/$(LIBJVM_DTRACE)
2842N/AXLIBJVM_DTRACE_G = 64/$(LIBJVM_DTRACE_G)
2842N/AXARCH = $(subst sparcv9,v9,$(shell echo $(ISA)))
2842N/A$(XLIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE)
2842N/A $(QUIETLY) mkdir -p 64/ ; \
2842N/A $(CC) $(SYMFLAG) -xarch=$(XARCH) -D$(TYPE) -I. -I$(GENERATED) \
2842N/A $(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c #-lc
2842N/A# [ -f $(XLIBJVM_DB_G) ] || { ln -s $(LIBJVM_DB) $(XLIBJVM_DB_G); }
2842N/A$(XLIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
2842N/A $(QUIETLY) mkdir -p 64/ ; \
2842N/A $(CC) $(SYMFLAG) -xarch=$(XARCH) -D$(TYPE) -I. \
2842N/A $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c #-lc -lthread -ldoor
2842N/A# [ -f $(XLIBJVM_DTRACE_G) ] || { ln -s $(LIBJVM_DTRACE) $(XLIBJVM_DTRACE_G); }
2842N/Aendif # ifneq ("${ISA}","${BUILDARCH}")
2842N/Alib$(GENOFFS).dylib: $(DTRACE_SRCDIR)/$(GENOFFS).cpp $(DTRACE_SRCDIR)/$(GENOFFS).h \
3178N/A $(QUIETLY) $(CXX) $(CXXFLAGS) $(GENOFFS_CFLAGS) $(SHARED_FLAG) $(PICFLAG) \
2842N/A $(LFLAGS_GENOFFS) -o $@ $(DTRACE_SRCDIR)/$(GENOFFS).cpp -ljvm
2842N/A$(GENOFFS): $(DTRACE_SRCDIR)/$(GENOFFS)
Main.c lib$(GENOFFS).dylib
2842N/A# $@.tmp is created first to avoid an empty $(JVMOFFS).h if an error occurs.
4029N/A $(QUIETLY) DYLD_LIBRARY_PATH=.:$(DYLD_LIBRARY_PATH) ./$(GENOFFS) -header > $@.tmp; touch $@; \
2842N/A then rm -f $@; mv $@.tmp $@; \
4029N/A $(QUIETLY) DYLD_LIBRARY_PATH=.:$(DYLD_LIBRARY_PATH) ./$(GENOFFS) -index > $@.tmp; touch $@; \
2842N/A then rm -f $@; mv $@.tmp $@; \
4029N/A $(QUIETLY) DYLD_LIBRARY_PATH=.:$(DYLD_LIBRARY_PATH) ./$(GENOFFS) -table > $@.tmp; touch $@; \
2842N/A then rm -f $@; mv $@.tmp $@; \
3178N/A $(QUIETLY) $(CXX) -c -I. -o $@ $(ARCHFLAG) -D$(TYPE) $(JVMOFFS).cpp
2842N/A$(LIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(
JVMOFFS.o) $(XLIBJVM_DB) $(LIBJVM_DB_MAPFILE)
2842N/A $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. -I$(GENERATED) \
2842N/A $(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -Wall # -lc
2842N/A# [ -f $(LIBJVM_DB_G) ] || { ln -s $@ $(LIBJVM_DB_G); }
2842N/A$(LIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(XLIBJVM_DTRACE) $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
2842N/A $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. \
2842N/A $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c #-lc -lthread -ldoor
2842N/A# [ -f $(LIBJVM_DTRACE_G) ] || { ln -s $@ $(LIBJVM_DTRACE_G); }
2842N/A $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/
hotspot.d 2842N/A $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/
hs_private.d 2842N/A $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/
jhelper.d 2842N/A# jhelper currently disabled
2842N/A# @echo Compiling $(DTRACE).d
2842N/A# $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -G -xlazyload -o $@ -s $(DTRACE).d \
2842N/A# if [ x"$$STATUS" = x"1" -a \
2842N/A# x`uname -r` = x"5.10" -a \
2842N/A# x`uname -p` = x"sparc" ]; then\
2842N/A# echo "*****************************************************************";\
2842N/A# echo "* If you are building server compiler, and the error message is ";\
2842N/A# echo "* \"incorrect ELF machine type...\", you have run into solaris bug ";\
2842N/A# echo "* 6213962, \"dtrace -G doesn't work on sparcv8+ object files\".";\
2842N/A# echo "* environment variable HOTSPOT_DISABLE_DTRACE_PROBES to disable ";\
2842N/A# echo "* dtrace probes for this build.";\
2842N/A# echo "*****************************************************************";\
2842N/A # Since some DTraced_Files are in
LIBJVM.o and they are touched by this
2842N/A # files, but it doesn't, so we touch the necessary files to prevent later
2842N/A # recompilation. Note: we only touch the necessary files if they already
2842N/A # exist in order to close a race where an empty file can be created
2842N/A # before the real build rule is executed.
2842N/A # But, we can't touch the *.h files: This rule depends
2842N/A # on them, and that would cause an infinite cycle of rebuilding.
2842N/A # Neither the *.h or *.ccp files need to be touched, since they have
2842N/A # rules which do not update them when the generator file has not
2842N/A# $(QUIETLY) if [ -f lib$(GENOFFS).so ]; then touch lib$(GENOFFS).so; fi
2842N/A# $(QUIETLY) if [ -f $(GENOFFS) ]; then touch $(GENOFFS); fi
2842N/AsystemDtraceFound := $(wildcard ${SYSTEM_DTRACE_PROG})
2842N/A#patchDtraceFound := $(wildcard ${PATCH_DTRACE_PROG})
2842N/A#systemDtraceHdrFound := $(wildcard $(SYSTEM_DTRACE_H))
2842N/A#ifneq ("$(systemDtraceHdrFound)", "")
2842N/A#ifneq ("$(patchDtraceFound)", "")
2842N/A#DTRACE_PROG=$(PATCH_DTRACE_PROG)
2842N/Aifneq ("$(systemDtraceFound)", "")
2842N/ADTRACE_PROG=$(SYSTEM_DTRACE_PROG)
2842N/Aendif # ifneq ("$(systemDtraceFound)", "")
2842N/A#endif # ifneq ("$(patchDtraceFound)", "")
2842N/Aifneq ("${DTRACE_PROG}", "")
2842N/Aifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "")
2842N/ACFLAGS += -DDTRACE_ENABLED #$(DTRACE_INCL)
2842N/A#clangCFLAGS += -DDTRACE_ENABLED -fno-optimize-sibling-calls
2842N/A#MAPFILE_DTRACE_OPT = $(MAPFILE_DTRACE)
2842N/Adtrace_stuff: dtrace_gen_headers
2842N/A $(QUIETLY) echo "dtrace headers generated"
2842N/A $(QUIETLY) echo "**NOTICE** Dtrace support disabled via environment variable"
2842N/Aendif # ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "")
2842N/Aelse # No dtrace program found
2842N/A $(QUIETLY) echo "**NOTICE** Dtrace support disabled: not supported by system"
2842N/Aendif # ifneq ("${dtraceFound}", "")
2842N/Aendif # ifeq ($(OS_VENDOR), Darwin)
2842N/A $(QUIETLY) echo "**NOTICE** Dtrace support disabled for CORE builds"
2842N/Aendif # ifneq ("${TYPE}", "CORE")