hotspot/make/solaris/makefiles/dtrace.make
author dcubed
Fri, 23 Mar 2012 11:50:33 -0700
changeset 12501 ea7feae692ae
parent 11721 dcd1f62c9caf
child 12767 c9cd24c9142d
permissions -rw-r--r--
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris Summary: Add support for ENABLE_FULL_DEBUG_SYMBOLS and ZIP_DEBUGINFO_FILES build flags. Add support for .diz files. Reviewed-by: dholmes, ohair, sspitsyn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
#
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
     2
# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
# published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
# accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
#
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 4493
diff changeset
    19
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 4493
diff changeset
    20
# or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 4493
diff changeset
    21
# questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
#  
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
#
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
# Rules to build jvm_db/dtrace, used by vm.make
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
4493
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1562
diff changeset
    27
# We build libjvm_dtrace/libjvm_db/dtrace for COMPILER1 and COMPILER2
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1562
diff changeset
    28
# but not for CORE or KERNEL configurations.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
ifneq ("${TYPE}", "CORE")
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
ifneq ("${TYPE}", "KERNEL")
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
ifdef USE_GCC
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
dtraceCheck:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
	$(QUIETLY) echo "**NOTICE** Dtrace support disabled for gcc builds"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
JVM_DB = libjvm_db
4493
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1562
diff changeset
    41
LIBJVM_DB = libjvm_db.so
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1562
diff changeset
    42
LIBJVM_DB_G = libjvm$(G_SUFFIX)_db.so
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
    44
LIBJVM_DB_DEBUGINFO   = libjvm_db.debuginfo
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
    45
LIBJVM_DB_DIZ         = libjvm_db.diz
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
    46
LIBJVM_DB_G_DEBUGINFO = libjvm$(G_SUFFIX)_db.debuginfo
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
    47
LIBJVM_DB_G_DIZ       = libjvm$(G_SUFFIX)_db.diz
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
    48
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
JVM_DTRACE = jvm_dtrace
4493
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1562
diff changeset
    50
LIBJVM_DTRACE = libjvm_dtrace.so
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1562
diff changeset
    51
LIBJVM_DTRACE_G = libjvm$(G_SUFFIX)_dtrace.so
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
    53
LIBJVM_DTRACE_DEBUGINFO   = libjvm_dtrace.debuginfo
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
    54
LIBJVM_DTRACE_DIZ         = libjvm_dtrace.diz
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
    55
LIBJVM_DTRACE_G_DEBUGINFO = libjvm$(G_SUFFIX)_dtrace.debuginfo
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
    56
LIBJVM_DTRACE_G_DIZ       = libjvm$(G_SUFFIX)_dtrace.diz
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
    57
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
JVMOFFS = JvmOffsets
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
JVMOFFS.o = $(JVMOFFS).o
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
GENOFFS = generate$(JVMOFFS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
DTRACE_SRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/dtrace
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
DTRACE = dtrace
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
DTRACE.o = $(DTRACE).o
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
# to remove '-g' option which causes link problems
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
# also '-z nodefs' is used as workaround
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
GENOFFS_CFLAGS = $(shell echo $(CFLAGS) | sed -e 's/ -g / /g' -e 's/ -g0 / /g';)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
ifdef LP64
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
DTRACE_OPTS = -64 -D_LP64
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
# making libjvm_db
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
# Use mapfile with libjvm_db.so
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
LIBJVM_DB_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jvm_db
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
LFLAGS_JVM_DB += $(MAPFLAG:FILENAME=$(LIBJVM_DB_MAPFILE))
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
# Use mapfile with libjvm_dtrace.so
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
LIBJVM_DTRACE_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jvm_dtrace
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
LFLAGS_JVM_DTRACE += $(MAPFLAG:FILENAME=$(LIBJVM_DTRACE_MAPFILE))
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
ifdef USE_GCC
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
LFLAGS_JVM_DB += -D_REENTRANT $(PICFLAG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
LFLAGS_JVM_DTRACE += -D_REENTRANT $(PICFLAG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
LFLAGS_JVM_DB += -mt $(PICFLAG) -xnolib
4493
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1562
diff changeset
    89
LFLAGS_JVM_DTRACE += -mt $(PICFLAG) -xnolib -ldl
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
ISA = $(subst i386,i486,$(shell isainfo -n))
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
# Making 64/libjvm_db.so: 64-bit version of libjvm_db.so which handles 32-bit libjvm.so
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
ifneq ("${ISA}","${BUILDARCH}")
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
XLIBJVM_DB = 64/$(LIBJVM_DB)
4493
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1562
diff changeset
    98
XLIBJVM_DB_G = 64/$(LIBJVM_DB_G)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
XLIBJVM_DTRACE = 64/$(LIBJVM_DTRACE)
4493
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1562
diff changeset
   100
XLIBJVM_DTRACE_G = 64/$(LIBJVM_DTRACE_G)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   102
XLIBJVM_DB_DEBUGINFO       = 64/$(LIBJVM_DB_DEBUGINFO)
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   103
XLIBJVM_DB_DIZ             = 64/$(LIBJVM_DB_DIZ)
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   104
XLIBJVM_DB_G_DEBUGINFO     = 64/$(LIBJVM_DB_G_DEBUGINFO)
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   105
XLIBJVM_DB_G_DIZ           = 64/$(LIBJVM_DB_G_DIZ)
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   106
XLIBJVM_DTRACE_DEBUGINFO   = 64/$(LIBJVM_DTRACE_DEBUGINFO)
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   107
XLIBJVM_DTRACE_DIZ         = 64/$(LIBJVM_DTRACE_DIZ)
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   108
XLIBJVM_DTRACE_G_DEBUGINFO = 64/$(LIBJVM_DTRACE_G_DEBUGINFO)
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   109
XLIBJVM_DTRACE_G_DIZ       = 64/$(LIBJVM_DTRACE_G_DIZ)
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   110
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
$(XLIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
	@echo Making $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
	$(QUIETLY) mkdir -p 64/ ; \
1552
45c617d33fa6 6767659: Conversion from i486 to x86 missed some entries in makefiles
kvn
parents: 670
diff changeset
   114
	$(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. -I$(GENERATED) \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
		$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc
4493
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1562
diff changeset
   116
	[ -f $(XLIBJVM_DB_G) ] || { ln -s $(LIBJVM_DB) $(XLIBJVM_DB_G); }
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   117
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   118
	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DB_DEBUGINFO)
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   119
	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(XLIBJVM_DB_DEBUGINFO) $@
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   120
  ifeq ($(STRIP_POLICY),all_strip)
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   121
	$(QUIETLY) $(STRIP) $@
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   122
  else
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   123
    ifeq ($(STRIP_POLICY),min_strip)
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   124
	$(QUIETLY) $(STRIP) -x $@
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   125
    # implied else here is no stripping at all
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   126
    endif
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   127
  endif
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   128
	[ -f $(XLIBJVM_DB_G_DEBUGINFO) ] || { ln -s $(XLIBJVM_DB_DEBUGINFO) $(XLIBJVM_DB_G_DEBUGINFO); }
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   129
  ifeq ($(ZIP_DEBUGINFO_FILES),1)
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   130
	$(ZIPEXE) -q -y $(XLIBJVM_DB_DIZ) $(XLIBJVM_DB_DEBUGINFO) $(XLIBJVM_DB_G_DEBUGINFO)
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   131
	$(RM) $(XLIBJVM_DB_DEBUGINFO) $(XLIBJVM_DB_G_DEBUGINFO)
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   132
	[ -f $(XLIBJVM_DB_G_DIZ) ] || { ln -s $(XLIBJVM_DB_DIZ) $(XLIBJVM_DB_G_DIZ); }
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   133
  endif
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   134
endif
4493
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1562
diff changeset
   135
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
$(XLIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
	@echo Making $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
	$(QUIETLY) mkdir -p 64/ ; \
1552
45c617d33fa6 6767659: Conversion from i486 to x86 missed some entries in makefiles
kvn
parents: 670
diff changeset
   139
	$(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
		$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor
4493
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1562
diff changeset
   141
	[ -f $(XLIBJVM_DTRACE_G) ] || { ln -s $(LIBJVM_DTRACE) $(XLIBJVM_DTRACE_G); }
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   142
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   143
	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DTRACE_DEBUGINFO)
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   144
	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(XLIBJVM_DTRACE_DEBUGINFO) $@
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   145
  ifeq ($(STRIP_POLICY),all_strip)
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   146
	$(QUIETLY) $(STRIP) $@
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   147
  else
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   148
    ifeq ($(STRIP_POLICY),min_strip)
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   149
	$(QUIETLY) $(STRIP) -x $@
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   150
    # implied else here is no stripping at all
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   151
    endif
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   152
  endif
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   153
	[ -f $(XLIBJVM_DTRACE_G_DEBUGINFO) ] || { ln -s $(XLIBJVM_DTRACE_DEBUGINFO) $(XLIBJVM_DTRACE_G_DEBUGINFO); }
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   154
  ifeq ($(ZIP_DEBUGINFO_FILES),1)
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   155
	$(ZIPEXE) -q -y $(XLIBJVM_DTRACE_DIZ) $(XLIBJVM_DTRACE_DEBUGINFO) $(XLIBJVM_DTRACE_G_DEBUGINFO)
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   156
	$(RM) $(XLIBJVM_DTRACE_DEBUGINFO) $(XLIBJVM_DTRACE_G_DEBUGINFO)
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   157
	[ -f $(XLIBJVM_DTRACE_G_DIZ) ] || { ln -s $(XLIBJVM_DTRACE_DIZ) $(XLIBJVM_DTRACE_G_DIZ); }
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   158
  endif
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   159
endif
4493
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1562
diff changeset
   160
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
endif # ifneq ("${ISA}","${BUILDARCH}")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
ifdef USE_GCC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
LFLAGS_GENOFFS += -D_REENTRANT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
LFLAGS_GENOFFS += -mt -xnolib -norunpath
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
lib$(GENOFFS).so: $(DTRACE_SRCDIR)/$(GENOFFS).cpp $(DTRACE_SRCDIR)/$(GENOFFS).h \
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   170
                  $(LIBJVM.o)
11721
dcd1f62c9caf 7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents: 10559
diff changeset
   171
	$(QUIETLY) $(CXX) $(CXXFLAGS) $(GENOFFS_CFLAGS) $(SHARED_FLAG) $(PICFLAG) \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
		 $(LFLAGS_GENOFFS) -o $@ $(DTRACE_SRCDIR)/$(GENOFFS).cpp -lc
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
$(GENOFFS): $(DTRACE_SRCDIR)/$(GENOFFS)Main.c lib$(GENOFFS).so
11721
dcd1f62c9caf 7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents: 10559
diff changeset
   175
	$(QUIETLY) $(LINK.CXX) -z nodefs -o $@ $(DTRACE_SRCDIR)/$(GENOFFS)Main.c \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
		./lib$(GENOFFS).so
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
1559
20339a90049b 6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents: 670
diff changeset
   178
CONDITIONALLY_UPDATE_JVMOFFS_TARGET = \
20339a90049b 6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents: 670
diff changeset
   179
	cmp -s $@ $@.tmp; \
20339a90049b 6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents: 670
diff changeset
   180
	case $$? in \
20339a90049b 6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents: 670
diff changeset
   181
	0) rm -f $@.tmp;; \
20339a90049b 6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents: 670
diff changeset
   182
	*) rm -f $@ && mv $@.tmp $@ && echo Updated $@;; \
20339a90049b 6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents: 670
diff changeset
   183
	esac
20339a90049b 6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents: 670
diff changeset
   184
20339a90049b 6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents: 670
diff changeset
   185
# $@.tmp is created first to avoid an empty $(JVMOFFS).h if an error occurs.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
$(JVMOFFS).h: $(GENOFFS)
1559
20339a90049b 6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents: 670
diff changeset
   187
	$(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -header > $@.tmp
20339a90049b 6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents: 670
diff changeset
   188
	$(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
$(JVMOFFS)Index.h: $(GENOFFS)
1559
20339a90049b 6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents: 670
diff changeset
   191
	$(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -index > $@.tmp
20339a90049b 6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents: 670
diff changeset
   192
	$(QUIETLY)  $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
$(JVMOFFS).cpp: $(GENOFFS) $(JVMOFFS).h $(JVMOFFS)Index.h
1559
20339a90049b 6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents: 670
diff changeset
   195
	$(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -table > $@.tmp
20339a90049b 6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents: 670
diff changeset
   196
	$(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
$(JVMOFFS.o): $(JVMOFFS).h $(JVMOFFS).cpp 
11721
dcd1f62c9caf 7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents: 10559
diff changeset
   199
	$(QUIETLY) $(CXX) -c -I. -o $@ $(ARCHFLAG) -D$(TYPE) $(JVMOFFS).cpp
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
$(LIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS.o) $(XLIBJVM_DB) $(LIBJVM_DB_MAPFILE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
	@echo Making $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
	$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. -I$(GENERATED) \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
		$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc
4493
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1562
diff changeset
   205
	[ -f $(LIBJVM_DB_G) ] || { ln -s $@ $(LIBJVM_DB_G); }
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   206
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   207
	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DB_DEBUGINFO)
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   208
	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $@
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   209
  ifeq ($(STRIP_POLICY),all_strip)
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   210
	$(QUIETLY) $(STRIP) $@
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   211
  else
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   212
    ifeq ($(STRIP_POLICY),min_strip)
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   213
	$(QUIETLY) $(STRIP) -x $@
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   214
    # implied else here is no stripping at all
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   215
    endif
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   216
  endif
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   217
	[ -f $(LIBJVM_DB_G_DEBUGINFO) ] || { ln -s $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB_G_DEBUGINFO); }
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   218
  ifeq ($(ZIP_DEBUGINFO_FILES),1)
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   219
	$(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB_G_DEBUGINFO)
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   220
	$(RM) $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB_G_DEBUGINFO)
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   221
	[ -f $(LIBJVM_DB_G_DIZ) ] || { ln -s $(LIBJVM_DB_DIZ) $(LIBJVM_DB_G_DIZ); }
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   222
  endif
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   223
endif
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
$(LIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(XLIBJVM_DTRACE) $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
	@echo Making $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
	$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I.  \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
		$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor
4493
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1562
diff changeset
   229
	[ -f $(LIBJVM_DTRACE_G) ] || { ln -s $@ $(LIBJVM_DTRACE_G); }
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   230
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   231
	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DTRACE_DEBUGINFO)
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   232
	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $@
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   233
  ifeq ($(STRIP_POLICY),all_strip)
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   234
	$(QUIETLY) $(STRIP) $@
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   235
  else
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   236
    ifeq ($(STRIP_POLICY),min_strip)
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   237
	$(QUIETLY) $(STRIP) -x $@
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   238
    # implied else here is no stripping at all
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   239
    endif
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   240
  endif
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   241
	[ -f $(LIBJVM_DTRACE_G_DEBUGINFO) ] || { ln -s $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE_G_DEBUGINFO); }
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   242
  ifeq ($(ZIP_DEBUGINFO_FILES),1)
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   243
	$(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE_G_DEBUGINFO)
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   244
	$(RM) $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE_G_DEBUGINFO)
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   245
	[ -f $(LIBJVM_DTRACE_G_DIZ) ] || { ln -s $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_G_DIZ); }
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   246
  endif
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   247
endif
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
$(DTRACE).d: $(DTRACE_SRCDIR)/hotspot.d $(DTRACE_SRCDIR)/hotspot_jni.d \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
             $(DTRACE_SRCDIR)/hs_private.d $(DTRACE_SRCDIR)/jhelper.d
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
	$(QUIETLY) cat $^ > $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   253
DTraced_Files = ciEnv.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   254
                classLoadingService.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   255
                compileBroker.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   256
                hashtable.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   257
                instanceKlass.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   258
                java.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   259
                jni.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   260
                jvm.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   261
                memoryManager.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   262
                nmethod.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   263
                objectMonitor.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   264
                runtimeService.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   265
                sharedRuntime.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   266
                synchronizer.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   267
                thread.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   268
                unsafe.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   269
                vmThread.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   270
                vmCMSOperations.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   271
                vmPSOperations.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   272
                vmGCOperations.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   273
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   274
# Dtrace is available, so we build $(DTRACE.o)  
489c9b5090e2 Initial load
duke
parents:
diff changeset
   275
$(DTRACE.o): $(DTRACE).d $(JVMOFFS).h $(JVMOFFS)Index.h $(DTraced_Files)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   276
	@echo Compiling $(DTRACE).d
489c9b5090e2 Initial load
duke
parents:
diff changeset
   277
6469
d32518d9eba5 6974813: JVM needs to use demand loading for its DTrace probes
kamg
parents: 5547
diff changeset
   278
	$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -G -xlazyload -o $@ -s $(DTRACE).d \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   279
     $(DTraced_Files) ||\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   280
  STATUS=$$?;\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   281
	if [ x"$$STATUS" = x"1" -a \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   282
       x`uname -r` = x"5.10" -a \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   283
       x`uname -p` = x"sparc" ]; then\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   284
    echo "*****************************************************************";\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   285
    echo "* If you are building server compiler, and the error message is ";\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   286
    echo "* \"incorrect ELF machine type...\", you have run into solaris bug ";\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
    echo "* 6213962, \"dtrace -G doesn't work on sparcv8+ object files\".";\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
    echo "* Either patch/upgrade your system (>= S10u1_15), or set the ";\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   289
    echo "* environment variable HOTSPOT_DISABLE_DTRACE_PROBES to disable ";\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   290
    echo "* dtrace probes for this build.";\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   291
    echo "*****************************************************************";\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
  fi;\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
  exit $$STATUS
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
  # Since some DTraced_Files are in LIBJVM.o and they are touched by this
489c9b5090e2 Initial load
duke
parents:
diff changeset
   295
  # command, and libgenerateJvmOffsets.so depends on LIBJVM.o, 'make' will
489c9b5090e2 Initial load
duke
parents:
diff changeset
   296
  # think it needs to rebuild libgenerateJvmOffsets.so and thus JvmOffsets*
489c9b5090e2 Initial load
duke
parents:
diff changeset
   297
  # files, but it doesn't, so we touch the necessary files to prevent later
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
  # recompilation. Note: we only touch the necessary files if they already
489c9b5090e2 Initial load
duke
parents:
diff changeset
   299
  # exist in order to close a race where an empty file can be created
489c9b5090e2 Initial load
duke
parents:
diff changeset
   300
  # before the real build rule is executed.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   301
  # But, we can't touch the *.h files:  This rule depends
489c9b5090e2 Initial load
duke
parents:
diff changeset
   302
  # on them, and that would cause an infinite cycle of rebuilding.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   303
  # Neither the *.h or *.ccp files need to be touched, since they have
489c9b5090e2 Initial load
duke
parents:
diff changeset
   304
  # rules which do not update them when the generator file has not
489c9b5090e2 Initial load
duke
parents:
diff changeset
   305
  # changed their contents.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   306
	$(QUIETLY) if [ -f lib$(GENOFFS).so ]; then touch lib$(GENOFFS).so; fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
   307
	$(QUIETLY) if [ -f $(GENOFFS) ]; then touch $(GENOFFS); fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
   308
	$(QUIETLY) if [ -f $(JVMOFFS.o) ]; then touch $(JVMOFFS.o); fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
   309
489c9b5090e2 Initial load
duke
parents:
diff changeset
   310
.PHONY: dtraceCheck
489c9b5090e2 Initial load
duke
parents:
diff changeset
   311
363
99d43e8a76ad 6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents: 338
diff changeset
   312
SYSTEM_DTRACE_H = /usr/include/dtrace.h
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   313
SYSTEM_DTRACE_PROG = /usr/sbin/dtrace
489c9b5090e2 Initial load
duke
parents:
diff changeset
   314
PATCH_DTRACE_PROG = /opt/SUNWdtrd/sbin/dtrace
489c9b5090e2 Initial load
duke
parents:
diff changeset
   315
systemDtraceFound := $(wildcard ${SYSTEM_DTRACE_PROG})
489c9b5090e2 Initial load
duke
parents:
diff changeset
   316
patchDtraceFound := $(wildcard ${PATCH_DTRACE_PROG})
363
99d43e8a76ad 6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents: 338
diff changeset
   317
systemDtraceHdrFound := $(wildcard $(SYSTEM_DTRACE_H))
99d43e8a76ad 6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents: 338
diff changeset
   318
99d43e8a76ad 6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents: 338
diff changeset
   319
ifneq ("$(systemDtraceHdrFound)", "") 
99d43e8a76ad 6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents: 338
diff changeset
   320
CFLAGS += -DHAVE_DTRACE_H
99d43e8a76ad 6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents: 338
diff changeset
   321
endif
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   322
489c9b5090e2 Initial load
duke
parents:
diff changeset
   323
ifneq ("$(patchDtraceFound)", "")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   324
DTRACE_PROG=$(PATCH_DTRACE_PROG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   325
DTRACE_INCL=-I/opt/SUNWdtrd/include
489c9b5090e2 Initial load
duke
parents:
diff changeset
   326
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   327
ifneq ("$(systemDtraceFound)", "")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   328
DTRACE_PROG=$(SYSTEM_DTRACE_PROG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   329
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   330
489c9b5090e2 Initial load
duke
parents:
diff changeset
   331
endif # ifneq ("$(systemDtraceFound)", "")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   332
endif # ifneq ("$(patchDtraceFound)", "")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   333
489c9b5090e2 Initial load
duke
parents:
diff changeset
   334
ifneq ("${DTRACE_PROG}", "")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   335
ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   336
489c9b5090e2 Initial load
duke
parents:
diff changeset
   337
DTRACE_OBJS = $(DTRACE.o) $(JVMOFFS.o)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   338
CFLAGS += $(DTRACE_INCL) -DDTRACE_ENABLED
489c9b5090e2 Initial load
duke
parents:
diff changeset
   339
MAPFILE_DTRACE_OPT = $(MAPFILE_DTRACE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   340
489c9b5090e2 Initial load
duke
parents:
diff changeset
   341
dtraceCheck:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   342
489c9b5090e2 Initial load
duke
parents:
diff changeset
   343
else # manually disabled
489c9b5090e2 Initial load
duke
parents:
diff changeset
   344
489c9b5090e2 Initial load
duke
parents:
diff changeset
   345
dtraceCheck:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   346
	$(QUIETLY) echo "**NOTICE** Dtrace support disabled via environment variable"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   347
489c9b5090e2 Initial load
duke
parents:
diff changeset
   348
endif # ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   349
489c9b5090e2 Initial load
duke
parents:
diff changeset
   350
else # No dtrace program found
489c9b5090e2 Initial load
duke
parents:
diff changeset
   351
489c9b5090e2 Initial load
duke
parents:
diff changeset
   352
dtraceCheck:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   353
	$(QUIETLY) echo "**NOTICE** Dtrace support disabled: not supported by system"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   354
489c9b5090e2 Initial load
duke
parents:
diff changeset
   355
endif # ifneq ("${dtraceFound}", "")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   356
489c9b5090e2 Initial load
duke
parents:
diff changeset
   357
endif # ifdef USE_GCC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   358
489c9b5090e2 Initial load
duke
parents:
diff changeset
   359
else # KERNEL build
489c9b5090e2 Initial load
duke
parents:
diff changeset
   360
489c9b5090e2 Initial load
duke
parents:
diff changeset
   361
dtraceCheck:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   362
	$(QUIETLY) echo "**NOTICE** Dtrace support disabled for KERNEL builds"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   363
489c9b5090e2 Initial load
duke
parents:
diff changeset
   364
endif # ifneq ("${TYPE}", "KERNEL")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   365
489c9b5090e2 Initial load
duke
parents:
diff changeset
   366
else # CORE build
489c9b5090e2 Initial load
duke
parents:
diff changeset
   367
489c9b5090e2 Initial load
duke
parents:
diff changeset
   368
dtraceCheck:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   369
	$(QUIETLY) echo "**NOTICE** Dtrace support disabled for CORE builds"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   370
489c9b5090e2 Initial load
duke
parents:
diff changeset
   371
endif # ifneq ("${TYPE}", "CORE")