hotspot/make/bsd/makefiles/dtrace.make
author mikael
Tue, 09 Oct 2012 10:09:34 -0700
changeset 13963 e5b53c306fb5
parent 11721 dcd1f62c9caf
child 13974 791cba24758f
permissions -rw-r--r--
7197424: update copyright year to match last edit in jdk8 hotspot repository Summary: Update copyright year to 2012 for relevant files Reviewed-by: dholmes, coleenp
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10565
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     1
#
13963
e5b53c306fb5 7197424: update copyright year to match last edit in jdk8 hotspot repository
mikael
parents: 11721
diff changeset
     2
# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
10565
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     4
#
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     7
# published by the Free Software Foundation.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     8
#
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    13
# accompanied this code).
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    14
#
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    18
#
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    19
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    20
# or visit www.oracle.com if you need additional information or have any
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    21
# questions.
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    22
#  
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    23
#
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
    24
10739
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    25
# Rules to build jvm_db/dtrace, used by vm.make
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    26
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    27
# We build libjvm_dtrace/libjvm_db/dtrace for COMPILER1 and COMPILER2
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    28
# but not for CORE or KERNEL configurations.
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    29
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    30
ifneq ("${TYPE}", "CORE")
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    31
ifneq ("${TYPE}", "KERNEL")
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    32
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    33
ifeq ($(OS_VENDOR), Darwin)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    34
# we build dtrace for macosx using USDT2 probes
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    35
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    36
DtraceOutDir = $(GENERATED)/dtracefiles
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    37
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    38
# Bsd does not build libjvm_db, does not compile on macosx
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    39
# disabled in build: rule in vm.make
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    40
JVM_DB = libjvm_db
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    41
#LIBJVM_DB = libjvm_db.dylib
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    42
LIBJVM_DB = libjvm$(G_SUFFIX)_db.dylib
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    43
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    44
JVM_DTRACE = jvm_dtrace
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    45
#LIBJVM_DTRACE = libjvm_dtrace.dylib
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    46
LIBJVM_DTRACE = libjvm$(G_SUFFIX)_dtrace.dylib
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    47
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    48
JVMOFFS = JvmOffsets
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    49
JVMOFFS.o = $(JVMOFFS).o
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    50
GENOFFS = generate$(JVMOFFS)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    51
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    52
DTRACE_SRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/dtrace
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    53
DTRACE = dtrace
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    54
DTRACE.o = $(DTRACE).o
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    55
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    56
# to remove '-g' option which causes link problems
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    57
# also '-z nodefs' is used as workaround
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    58
GENOFFS_CFLAGS = $(shell echo $(CFLAGS) | sed -e 's/ -g / /g' -e 's/ -g0 / /g';)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    59
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    60
ifdef LP64
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    61
DTRACE_OPTS = -D_LP64
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    62
endif
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    63
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    64
# making libjvm_db
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    65
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    66
# Use mapfile with libjvm_db.so
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    67
LIBJVM_DB_MAPFILE = # no mapfile for usdt2 # $(MAKEFILES_DIR)/mapfile-vers-jvm_db
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    68
#LFLAGS_JVM_DB += $(MAPFLAG:FILENAME=$(LIBJVM_DB_MAPFILE))
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    69
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    70
# Use mapfile with libjvm_dtrace.so
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    71
LIBJVM_DTRACE_MAPFILE = # no mapfile for usdt2 # $(MAKEFILES_DIR)/mapfile-vers-jvm_dtrace
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    72
#LFLAGS_JVM_DTRACE += $(MAPFLAG:FILENAME=$(LIBJVM_DTRACE_MAPFILE))
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    73
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    74
LFLAGS_JVM_DB += $(PICFLAG) # -D_REENTRANT
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    75
LFLAGS_JVM_DTRACE += $(PICFLAG) # -D_REENTRANT
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    76
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    77
ISA = $(subst i386,i486,$(BUILDARCH))
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    78
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    79
# Making 64/libjvm_db.so: 64-bit version of libjvm_db.so which handles 32-bit libjvm.so
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    80
ifneq ("${ISA}","${BUILDARCH}")
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    81
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    82
XLIBJVM_DB = 64/$(LIBJVM_DB)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    83
XLIBJVM_DB_G = 64/$(LIBJVM_DB_G)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    84
XLIBJVM_DTRACE = 64/$(LIBJVM_DTRACE)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    85
XLIBJVM_DTRACE_G = 64/$(LIBJVM_DTRACE_G)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    86
XARCH = $(subst sparcv9,v9,$(shell echo $(ISA)))
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    87
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    88
$(XLIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    89
	@echo Making $@
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    90
	$(QUIETLY) mkdir -p 64/ ; \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    91
	$(CC) $(SYMFLAG) -xarch=$(XARCH) -D$(TYPE) -I. -I$(GENERATED) \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    92
		$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c #-lc
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    93
#	[ -f $(XLIBJVM_DB_G) ] || { ln -s $(LIBJVM_DB) $(XLIBJVM_DB_G); }
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    94
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    95
$(XLIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    96
	@echo Making $@
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    97
	$(QUIETLY) mkdir -p 64/ ; \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    98
	$(CC) $(SYMFLAG) -xarch=$(XARCH) -D$(TYPE) -I. \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
    99
		$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c #-lc -lthread -ldoor
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   100
#	[ -f $(XLIBJVM_DTRACE_G) ] || { ln -s $(LIBJVM_DTRACE) $(XLIBJVM_DTRACE_G); }
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   101
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   102
endif # ifneq ("${ISA}","${BUILDARCH}")
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   103
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   104
LFLAGS_GENOFFS += -L.
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   105
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   106
lib$(GENOFFS).dylib: $(DTRACE_SRCDIR)/$(GENOFFS).cpp $(DTRACE_SRCDIR)/$(GENOFFS).h \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   107
                  $(LIBJVM.o)
11721
dcd1f62c9caf 7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents: 10739
diff changeset
   108
	$(QUIETLY) $(CXX) $(CXXFLAGS) $(GENOFFS_CFLAGS) $(SHARED_FLAG) $(PICFLAG) \
10739
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   109
		 $(LFLAGS_GENOFFS) -o $@ $(DTRACE_SRCDIR)/$(GENOFFS).cpp -ljvm
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   110
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   111
$(GENOFFS): $(DTRACE_SRCDIR)/$(GENOFFS)Main.c lib$(GENOFFS).dylib
11721
dcd1f62c9caf 7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents: 10739
diff changeset
   112
	$(QUIETLY) $(LINK.CXX) -o $@ $(DTRACE_SRCDIR)/$(GENOFFS)Main.c \
10739
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   113
		./lib$(GENOFFS).dylib
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   114
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   115
# $@.tmp is created first to avoid an empty $(JVMOFFS).h if an error occurs.
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   116
$(JVMOFFS).h: $(GENOFFS)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   117
	$(QUIETLY) DYLD_LIBRARY_PATH=. ./$(GENOFFS) -header > $@.tmp; touch $@; \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   118
	if [ `diff $@.tmp $@ > /dev/null 2>&1; echo $$?` -ne 0 ] ; \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   119
	then rm -f $@; mv $@.tmp $@; \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   120
	else rm -f $@.tmp; \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   121
	fi
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   122
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   123
$(JVMOFFS)Index.h: $(GENOFFS)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   124
	$(QUIETLY) DYLD_LIBRARY_PATH=. ./$(GENOFFS) -index > $@.tmp; touch $@; \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   125
	if [ `diff $@.tmp $@ > /dev/null 2>&1; echo $$?` -ne 0 ] ; \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   126
	then rm -f $@; mv $@.tmp $@; \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   127
	else rm -f $@.tmp; \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   128
	fi
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   129
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   130
$(JVMOFFS).cpp: $(GENOFFS) $(JVMOFFS).h $(JVMOFFS)Index.h
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   131
	$(QUIETLY) DYLD_LIBRARY_PATH=. ./$(GENOFFS) -table > $@.tmp; touch $@; \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   132
	if [ `diff $@.tmp $@ > /dev/null 2>&1; echo $$?` -ne 0 ] ; \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   133
	then rm -f $@; mv $@.tmp $@; \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   134
	else rm -f $@.tmp; \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   135
	fi
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   136
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   137
$(JVMOFFS.o): $(JVMOFFS).h $(JVMOFFS).cpp 
11721
dcd1f62c9caf 7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents: 10739
diff changeset
   138
	$(QUIETLY) $(CXX) -c -I. -o $@ $(ARCHFLAG) -D$(TYPE) $(JVMOFFS).cpp
10739
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   139
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   140
$(LIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS.o) $(XLIBJVM_DB) $(LIBJVM_DB_MAPFILE)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   141
	@echo Making $@
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   142
	$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. -I$(GENERATED) \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   143
		$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -Wall # -lc
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   144
#	[ -f $(LIBJVM_DB_G) ] || { ln -s $@ $(LIBJVM_DB_G); }
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   145
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   146
$(LIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(XLIBJVM_DTRACE) $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   147
	@echo Making $@
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   148
	$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I.  \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   149
		$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c #-lc -lthread -ldoor
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   150
#	[ -f $(LIBJVM_DTRACE_G) ] || { ln -s $@ $(LIBJVM_DTRACE_G); }
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   151
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   152
#$(DTRACE).d: $(DTRACE_SRCDIR)/hotspot.d $(DTRACE_SRCDIR)/hotspot_jni.d \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   153
#             $(DTRACE_SRCDIR)/hs_private.d $(DTRACE_SRCDIR)/jhelper.d
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   154
#	$(QUIETLY) cat $^ > $@
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   155
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   156
$(DtraceOutDir):
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   157
	mkdir $(DtraceOutDir)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   158
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   159
$(DtraceOutDir)/hotspot.h: $(DTRACE_SRCDIR)/hotspot.d | $(DtraceOutDir)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   160
	$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hotspot.d
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   161
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   162
$(DtraceOutDir)/hotspot_jni.h: $(DTRACE_SRCDIR)/hotspot_jni.d | $(DtraceOutDir)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   163
	$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hotspot_jni.d
10565
dc90c239f4ec 7089790: integrate bsd-port changes
never
parents:
diff changeset
   164
10739
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   165
$(DtraceOutDir)/hs_private.h: $(DTRACE_SRCDIR)/hs_private.d | $(DtraceOutDir)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   166
	$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hs_private.d
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   167
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   168
$(DtraceOutDir)/jhelper.h: $(DTRACE_SRCDIR)/jhelper.d $(JVMOFFS).o | $(DtraceOutDir)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   169
	$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/jhelper.d
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   170
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   171
# jhelper currently disabled
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   172
dtrace_gen_headers: $(DtraceOutDir)/hotspot.h $(DtraceOutDir)/hotspot_jni.h $(DtraceOutDir)/hs_private.h 
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   173
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   174
DTraced_Files = ciEnv.o \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   175
                classLoadingService.o \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   176
                compileBroker.o \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   177
                hashtable.o \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   178
                instanceKlass.o \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   179
                java.o \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   180
                jni.o \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   181
                jvm.o \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   182
                memoryManager.o \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   183
                nmethod.o \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   184
                objectMonitor.o \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   185
                runtimeService.o \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   186
                sharedRuntime.o \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   187
                synchronizer.o \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   188
                thread.o \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   189
                unsafe.o \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   190
                vmThread.o \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   191
                vmCMSOperations.o \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   192
                vmPSOperations.o \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   193
                vmGCOperations.o \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   194
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   195
# Dtrace is available, so we build $(DTRACE.o)  
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   196
#$(DTRACE.o): $(DTRACE).d $(JVMOFFS).h $(JVMOFFS)Index.h $(DTraced_Files)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   197
#	@echo Compiling $(DTRACE).d
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   198
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   199
#	$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -G -xlazyload -o $@ -s $(DTRACE).d \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   200
#     $(DTraced_Files) ||\
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   201
#  STATUS=$$?;\
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   202
#	if [ x"$$STATUS" = x"1" -a \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   203
#       x`uname -r` = x"5.10" -a \
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   204
#       x`uname -p` = x"sparc" ]; then\
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   205
#    echo "*****************************************************************";\
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   206
#    echo "* If you are building server compiler, and the error message is ";\
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   207
#    echo "* \"incorrect ELF machine type...\", you have run into solaris bug ";\
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   208
#    echo "* 6213962, \"dtrace -G doesn't work on sparcv8+ object files\".";\
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   209
#    echo "* Either patch/upgrade your system (>= S10u1_15), or set the ";\
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   210
#    echo "* environment variable HOTSPOT_DISABLE_DTRACE_PROBES to disable ";\
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   211
#    echo "* dtrace probes for this build.";\
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   212
#    echo "*****************************************************************";\
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   213
#  fi;\
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   214
#  exit $$STATUS
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   215
  # Since some DTraced_Files are in LIBJVM.o and they are touched by this
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   216
  # command, and libgenerateJvmOffsets.so depends on LIBJVM.o, 'make' will
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   217
  # think it needs to rebuild libgenerateJvmOffsets.so and thus JvmOffsets*
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   218
  # files, but it doesn't, so we touch the necessary files to prevent later
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   219
  # recompilation. Note: we only touch the necessary files if they already
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   220
  # exist in order to close a race where an empty file can be created
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   221
  # before the real build rule is executed.
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   222
  # But, we can't touch the *.h files:  This rule depends
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   223
  # on them, and that would cause an infinite cycle of rebuilding.
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   224
  # Neither the *.h or *.ccp files need to be touched, since they have
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   225
  # rules which do not update them when the generator file has not
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   226
  # changed their contents.
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   227
#	$(QUIETLY) if [ -f lib$(GENOFFS).so ]; then touch lib$(GENOFFS).so; fi
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   228
#	$(QUIETLY) if [ -f $(GENOFFS) ]; then touch $(GENOFFS); fi
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   229
#	$(QUIETLY) if [ -f $(JVMOFFS.o) ]; then touch $(JVMOFFS.o); fi
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   230
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   231
.PHONY: dtraceCheck
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   232
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   233
#SYSTEM_DTRACE_H = /usr/include/dtrace.h
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   234
SYSTEM_DTRACE_PROG = /usr/sbin/dtrace
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   235
#PATCH_DTRACE_PROG = /opt/SUNWdtrd/sbin/dtrace
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   236
systemDtraceFound := $(wildcard ${SYSTEM_DTRACE_PROG})
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   237
#patchDtraceFound := $(wildcard ${PATCH_DTRACE_PROG})
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   238
#systemDtraceHdrFound := $(wildcard $(SYSTEM_DTRACE_H))
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   239
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   240
#ifneq ("$(systemDtraceHdrFound)", "") 
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   241
#CFLAGS += -DHAVE_DTRACE_H
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   242
#endif
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   243
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   244
#ifneq ("$(patchDtraceFound)", "")
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   245
#DTRACE_PROG=$(PATCH_DTRACE_PROG)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   246
#DTRACE_INCL=-I/opt/SUNWdtrd/include
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   247
#else
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   248
ifneq ("$(systemDtraceFound)", "")
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   249
DTRACE_PROG=$(SYSTEM_DTRACE_PROG)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   250
else
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   251
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   252
endif # ifneq ("$(systemDtraceFound)", "")
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   253
#endif # ifneq ("$(patchDtraceFound)", "")
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   254
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   255
ifneq ("${DTRACE_PROG}", "")
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   256
ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "")
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   257
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   258
DTRACE_OBJS = $(DTRACE.o) #$(JVMOFFS.o)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   259
CFLAGS += -DDTRACE_ENABLED #$(DTRACE_INCL)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   260
#clangCFLAGS += -DDTRACE_ENABLED -fno-optimize-sibling-calls
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   261
#MAPFILE_DTRACE_OPT = $(MAPFILE_DTRACE)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   262
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   263
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   264
dtraceCheck:
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   265
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   266
dtrace_stuff: dtrace_gen_headers
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   267
	$(QUIETLY) echo "dtrace headers generated"
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   268
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   269
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   270
else # manually disabled
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   271
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   272
dtraceCheck:
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   273
	$(QUIETLY) echo "**NOTICE** Dtrace support disabled via environment variable"
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   274
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   275
dtrace_stuff:
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   276
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   277
endif # ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "")
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   278
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   279
else # No dtrace program found
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   280
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   281
dtraceCheck:
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   282
	$(QUIETLY) echo "**NOTICE** Dtrace support disabled: not supported by system"
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   283
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   284
dtrace_stuff:
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   285
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   286
endif # ifneq ("${dtraceFound}", "")
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   287
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   288
endif # ifeq ($(OS_VENDOR), Darwin)
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   289
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   290
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   291
else # KERNEL build
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   292
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   293
dtraceCheck:
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   294
	$(QUIETLY) echo "**NOTICE** Dtrace support disabled for KERNEL builds"
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   295
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   296
endif # ifneq ("${TYPE}", "KERNEL")
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   297
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   298
else # CORE build
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   299
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   300
dtraceCheck:
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   301
	$(QUIETLY) echo "**NOTICE** Dtrace support disabled for CORE builds"
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   302
91935236600e 7098194: integrate macosx-port changes
dcubed
parents: 10565
diff changeset
   303
endif # ifneq ("${TYPE}", "CORE")