hotspot/make/solaris/makefiles/dtrace.make
author zgu
Fri, 25 Jan 2013 10:04:08 -0500
changeset 15432 9d976ca484d8
parent 14815 41114a74463a
child 19271 2bd33030dd6d
permissions -rw-r--r--
8000692: Remove old KERNEL code Summary: Removed depreciated kernel VM source code from hotspot VM Reviewed-by: dholmes, acorn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
#
15432
9d976ca484d8 8000692: Remove old KERNEL code
zgu
parents: 14815
diff changeset
     2
# Copyright (c) 2005, 2013, 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
15432
9d976ca484d8 8000692: Remove old KERNEL code
zgu
parents: 14815
diff changeset
    28
# but not for CORE configuration.
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
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
ifdef USE_GCC
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
dtraceCheck:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
	$(QUIETLY) echo "**NOTICE** Dtrace support disabled for gcc builds"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
JVM_DB = libjvm_db
4493
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1562
diff changeset
    40
LIBJVM_DB = libjvm_db.so
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
    42
LIBJVM_DB_DEBUGINFO   = libjvm_db.debuginfo
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
    43
LIBJVM_DB_DIZ         = libjvm_db.diz
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
    44
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
JVM_DTRACE = jvm_dtrace
4493
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1562
diff changeset
    46
LIBJVM_DTRACE = libjvm_dtrace.so
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
    48
LIBJVM_DTRACE_DEBUGINFO   = libjvm_dtrace.debuginfo
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
    49
LIBJVM_DTRACE_DIZ         = libjvm_dtrace.diz
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
    50
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
JVMOFFS = JvmOffsets
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
JVMOFFS.o = $(JVMOFFS).o
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
GENOFFS = generate$(JVMOFFS)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
DTRACE_SRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/dtrace
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
DTRACE = dtrace
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
DTRACE.o = $(DTRACE).o
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
# to remove '-g' option which causes link problems
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
# also '-z nodefs' is used as workaround
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
GENOFFS_CFLAGS = $(shell echo $(CFLAGS) | sed -e 's/ -g / /g' -e 's/ -g0 / /g';)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
ifdef LP64
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
DTRACE_OPTS = -64 -D_LP64
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
# making libjvm_db
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
# Use mapfile with libjvm_db.so
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
LIBJVM_DB_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jvm_db
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
LFLAGS_JVM_DB += $(MAPFLAG:FILENAME=$(LIBJVM_DB_MAPFILE))
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
# Use mapfile with libjvm_dtrace.so
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
LIBJVM_DTRACE_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jvm_dtrace
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
LFLAGS_JVM_DTRACE += $(MAPFLAG:FILENAME=$(LIBJVM_DTRACE_MAPFILE))
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
ifdef USE_GCC
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
LFLAGS_JVM_DB += -D_REENTRANT $(PICFLAG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
LFLAGS_JVM_DTRACE += -D_REENTRANT $(PICFLAG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
LFLAGS_JVM_DB += -mt $(PICFLAG) -xnolib
4493
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1562
diff changeset
    82
LFLAGS_JVM_DTRACE += -mt $(PICFLAG) -xnolib -ldl
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
ISA = $(subst i386,i486,$(shell isainfo -n))
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
# 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
    88
ifneq ("${ISA}","${BUILDARCH}")
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
13092
3b4aad065f27 7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents: 12767
diff changeset
    90
XLIBJVM_DIR = 64
3b4aad065f27 7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents: 12767
diff changeset
    91
XLIBJVM_DB = $(XLIBJVM_DIR)/$(LIBJVM_DB)
3b4aad065f27 7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents: 12767
diff changeset
    92
XLIBJVM_DTRACE = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
13092
3b4aad065f27 7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents: 12767
diff changeset
    94
XLIBJVM_DB_DEBUGINFO       = $(XLIBJVM_DIR)/$(LIBJVM_DB_DEBUGINFO)
3b4aad065f27 7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents: 12767
diff changeset
    95
XLIBJVM_DB_DIZ             = $(XLIBJVM_DIR)/$(LIBJVM_DB_DIZ)
3b4aad065f27 7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents: 12767
diff changeset
    96
XLIBJVM_DTRACE_DEBUGINFO   = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_DEBUGINFO)
3b4aad065f27 7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents: 12767
diff changeset
    97
XLIBJVM_DTRACE_DIZ         = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_DIZ)
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
    98
12767
c9cd24c9142d 7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents: 12501
diff changeset
    99
$(XLIBJVM_DB): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
	@echo Making $@
13092
3b4aad065f27 7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents: 12767
diff changeset
   101
	$(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \
1552
45c617d33fa6 6767659: Conversion from i486 to x86 missed some entries in makefiles
kvn
parents: 670
diff changeset
   102
	$(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. -I$(GENERATED) \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
		$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   104
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
12767
c9cd24c9142d 7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents: 12501
diff changeset
   105
# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
c9cd24c9142d 7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents: 12501
diff changeset
   106
# Clear the SHF_ALLOC flag (if set) from empty section headers.
c9cd24c9142d 7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents: 12501
diff changeset
   107
# An empty section header has sh_addr == 0 and sh_size == 0.
c9cd24c9142d 7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents: 12501
diff changeset
   108
# This problem has only been seen on Solaris X64, but we call this tool
c9cd24c9142d 7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents: 12501
diff changeset
   109
# on all Solaris builds just in case.
c9cd24c9142d 7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents: 12501
diff changeset
   110
	$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   111
	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DB_DEBUGINFO)
12767
c9cd24c9142d 7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents: 12501
diff changeset
   112
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
c9cd24c9142d 7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents: 12501
diff changeset
   113
# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
13092
3b4aad065f27 7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents: 12767
diff changeset
   114
#         $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB) ;
3b4aad065f27 7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents: 12767
diff changeset
   115
# Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not
3b4aad065f27 7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents: 12767
diff changeset
   116
# in the link name:
3b4aad065f27 7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents: 12767
diff changeset
   117
	( cd $(XLIBJVM_DIR) && $(ADD_GNU_DEBUGLINK) $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB) )
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   118
  ifeq ($(STRIP_POLICY),all_strip)
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   119
	$(QUIETLY) $(STRIP) $@
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   120
  else
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   121
    ifeq ($(STRIP_POLICY),min_strip)
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   122
	$(QUIETLY) $(STRIP) -x $@
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   123
    # implied else here is no stripping at all
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   124
    endif
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   125
  endif
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   126
  ifeq ($(ZIP_DEBUGINFO_FILES),1)
13092
3b4aad065f27 7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents: 12767
diff changeset
   127
# Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not
3b4aad065f27 7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents: 12767
diff changeset
   128
# in the archived name:
14815
41114a74463a 7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents: 13966
diff changeset
   129
	( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) )
41114a74463a 7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents: 13966
diff changeset
   130
	$(RM) $(XLIBJVM_DB_DEBUGINFO)
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   131
  endif
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   132
endif
4493
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1562
diff changeset
   133
12767
c9cd24c9142d 7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents: 12501
diff changeset
   134
$(XLIBJVM_DTRACE): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
	@echo Making $@
13092
3b4aad065f27 7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents: 12767
diff changeset
   136
	$(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \
1552
45c617d33fa6 6767659: Conversion from i486 to x86 missed some entries in makefiles
kvn
parents: 670
diff changeset
   137
	$(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
		$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   139
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
12767
c9cd24c9142d 7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents: 12501
diff changeset
   140
# Clear the SHF_ALLOC flag (if set) from empty section headers.
c9cd24c9142d 7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents: 12501
diff changeset
   141
	$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   142
	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DTRACE_DEBUGINFO)
12767
c9cd24c9142d 7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents: 12501
diff changeset
   143
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
13092
3b4aad065f27 7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents: 12767
diff changeset
   144
#         $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE) ;
3b4aad065f27 7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents: 12767
diff changeset
   145
# Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not
3b4aad065f27 7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents: 12767
diff changeset
   146
# in the link name:
3b4aad065f27 7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents: 12767
diff changeset
   147
	( cd $(XLIBJVM_DIR) && $(ADD_GNU_DEBUGLINK) $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE) )
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   148
  ifeq ($(STRIP_POLICY),all_strip)
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   149
	$(QUIETLY) $(STRIP) $@
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   150
  else
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   151
    ifeq ($(STRIP_POLICY),min_strip)
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   152
	$(QUIETLY) $(STRIP) -x $@
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   153
    # implied else here is no stripping at all
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   154
    endif
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   155
  endif
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   156
  ifeq ($(ZIP_DEBUGINFO_FILES),1)
13092
3b4aad065f27 7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents: 12767
diff changeset
   157
# Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not
3b4aad065f27 7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents: 12767
diff changeset
   158
# in the archived name:
14815
41114a74463a 7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents: 13966
diff changeset
   159
	( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO))
41114a74463a 7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents: 13966
diff changeset
   160
	$(RM) $(XLIBJVM_DTRACE_DEBUGINFO)
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   161
  endif
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   162
endif
4493
9204129f065e 6843629: Make current hotspot build part of jdk5 control build
phh
parents: 1562
diff changeset
   163
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
endif # ifneq ("${ISA}","${BUILDARCH}")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
ifdef USE_GCC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
LFLAGS_GENOFFS += -D_REENTRANT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
LFLAGS_GENOFFS += -mt -xnolib -norunpath
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
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
   173
                  $(LIBJVM.o)
11721
dcd1f62c9caf 7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents: 10559
diff changeset
   174
	$(QUIETLY) $(CXX) $(CXXFLAGS) $(GENOFFS_CFLAGS) $(SHARED_FLAG) $(PICFLAG) \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
		 $(LFLAGS_GENOFFS) -o $@ $(DTRACE_SRCDIR)/$(GENOFFS).cpp -lc
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
$(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
   178
	$(QUIETLY) $(LINK.CXX) -z nodefs -o $@ $(DTRACE_SRCDIR)/$(GENOFFS)Main.c \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
		./lib$(GENOFFS).so
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
1559
20339a90049b 6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents: 670
diff changeset
   181
CONDITIONALLY_UPDATE_JVMOFFS_TARGET = \
20339a90049b 6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents: 670
diff changeset
   182
	cmp -s $@ $@.tmp; \
20339a90049b 6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents: 670
diff changeset
   183
	case $$? in \
20339a90049b 6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents: 670
diff changeset
   184
	0) rm -f $@.tmp;; \
20339a90049b 6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents: 670
diff changeset
   185
	*) rm -f $@ && mv $@.tmp $@ && echo Updated $@;; \
20339a90049b 6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents: 670
diff changeset
   186
	esac
20339a90049b 6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents: 670
diff changeset
   187
20339a90049b 6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents: 670
diff changeset
   188
# $@.tmp is created first to avoid an empty $(JVMOFFS).h if an error occurs.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
$(JVMOFFS).h: $(GENOFFS)
13966
7b818806118b 8000485: Hotspot build fails in Solaris Studio IDE when building dtrace
vlivanov
parents: 13115
diff changeset
   190
	$(QUIETLY) LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./$(GENOFFS) -header > $@.tmp
1559
20339a90049b 6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents: 670
diff changeset
   191
	$(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
$(JVMOFFS)Index.h: $(GENOFFS)
13966
7b818806118b 8000485: Hotspot build fails in Solaris Studio IDE when building dtrace
vlivanov
parents: 13115
diff changeset
   194
	$(QUIETLY) LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./$(GENOFFS) -index > $@.tmp
1559
20339a90049b 6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents: 670
diff changeset
   195
	$(QUIETLY)  $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
$(JVMOFFS).cpp: $(GENOFFS) $(JVMOFFS).h $(JVMOFFS)Index.h
13966
7b818806118b 8000485: Hotspot build fails in Solaris Studio IDE when building dtrace
vlivanov
parents: 13115
diff changeset
   198
	$(QUIETLY) LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./$(GENOFFS) -table > $@.tmp
1559
20339a90049b 6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents: 670
diff changeset
   199
	$(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
$(JVMOFFS.o): $(JVMOFFS).h $(JVMOFFS).cpp 
11721
dcd1f62c9caf 7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents: 10559
diff changeset
   202
	$(QUIETLY) $(CXX) -c -I. -o $@ $(ARCHFLAG) -D$(TYPE) $(JVMOFFS).cpp
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
12767
c9cd24c9142d 7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents: 12501
diff changeset
   204
$(LIBJVM_DB): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS.o) $(XLIBJVM_DB) $(LIBJVM_DB_MAPFILE)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
	@echo Making $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
	$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. -I$(GENERATED) \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
		$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   208
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
12767
c9cd24c9142d 7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents: 12501
diff changeset
   209
# Clear the SHF_ALLOC flag (if set) from empty section headers.
c9cd24c9142d 7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents: 12501
diff changeset
   210
	$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   211
	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DB_DEBUGINFO)
12767
c9cd24c9142d 7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents: 12501
diff changeset
   212
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
c9cd24c9142d 7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents: 12501
diff changeset
   213
#	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $@
c9cd24c9142d 7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents: 12501
diff changeset
   214
	$(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBJVM_DB_DEBUGINFO) $@
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   215
  ifeq ($(STRIP_POLICY),all_strip)
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   216
	$(QUIETLY) $(STRIP) $@
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   217
  else
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   218
    ifeq ($(STRIP_POLICY),min_strip)
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   219
	$(QUIETLY) $(STRIP) -x $@
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   220
    # implied else here is no stripping at all
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   221
    endif
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   222
  endif
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   223
  ifeq ($(ZIP_DEBUGINFO_FILES),1)
14815
41114a74463a 7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents: 13966
diff changeset
   224
	$(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO)
41114a74463a 7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents: 13966
diff changeset
   225
	$(RM) $(LIBJVM_DB_DEBUGINFO)
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   226
  endif
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   227
endif
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
12767
c9cd24c9142d 7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents: 12501
diff changeset
   229
$(LIBJVM_DTRACE): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(XLIBJVM_DTRACE) $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
	@echo Making $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
	$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I.  \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
		$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   233
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
12767
c9cd24c9142d 7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents: 12501
diff changeset
   234
# Clear the SHF_ALLOC flag (if set) from empty section headers.
c9cd24c9142d 7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents: 12501
diff changeset
   235
	$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   236
	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DTRACE_DEBUGINFO)
12767
c9cd24c9142d 7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents: 12501
diff changeset
   237
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
c9cd24c9142d 7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents: 12501
diff changeset
   238
#	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $@
c9cd24c9142d 7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents: 12501
diff changeset
   239
	$(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBJVM_DTRACE_DEBUGINFO) $@
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   240
  ifeq ($(STRIP_POLICY),all_strip)
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   241
	$(QUIETLY) $(STRIP) $@
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   242
  else
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   243
    ifeq ($(STRIP_POLICY),min_strip)
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   244
	$(QUIETLY) $(STRIP) -x $@
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   245
    # implied else here is no stripping at all
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   246
    endif
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   247
  endif
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   248
  ifeq ($(ZIP_DEBUGINFO_FILES),1)
14815
41114a74463a 7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents: 13966
diff changeset
   249
	$(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) 
41114a74463a 7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents: 13966
diff changeset
   250
	$(RM) $(LIBJVM_DTRACE_DEBUGINFO)
12501
ea7feae692ae 7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents: 11721
diff changeset
   251
  endif
10559
a94d067da388 7071904: 4/4 HotSpot: Full Debug Symbols
dcubed
parents: 7397
diff changeset
   252
endif
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
$(DTRACE).d: $(DTRACE_SRCDIR)/hotspot.d $(DTRACE_SRCDIR)/hotspot_jni.d \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
             $(DTRACE_SRCDIR)/hs_private.d $(DTRACE_SRCDIR)/jhelper.d
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
	$(QUIETLY) cat $^ > $@
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   258
DTraced_Files = ciEnv.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   259
                classLoadingService.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   260
                compileBroker.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   261
                hashtable.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   262
                instanceKlass.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   263
                java.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   264
                jni.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   265
                jvm.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   266
                memoryManager.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   267
                nmethod.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   268
                objectMonitor.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   269
                runtimeService.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   270
                sharedRuntime.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   271
                synchronizer.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   272
                thread.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   273
                unsafe.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   274
                vmThread.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   275
                vmCMSOperations.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   276
                vmPSOperations.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   277
                vmGCOperations.o \
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6469
diff changeset
   278
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   279
# Dtrace is available, so we build $(DTRACE.o)  
489c9b5090e2 Initial load
duke
parents:
diff changeset
   280
$(DTRACE.o): $(DTRACE).d $(JVMOFFS).h $(JVMOFFS)Index.h $(DTraced_Files)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   281
	@echo Compiling $(DTRACE).d
489c9b5090e2 Initial load
duke
parents:
diff changeset
   282
6469
d32518d9eba5 6974813: JVM needs to use demand loading for its DTrace probes
kamg
parents: 5547
diff changeset
   283
	$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -G -xlazyload -o $@ -s $(DTRACE).d \
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   284
     $(DTraced_Files) ||\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   285
  STATUS=$$?;\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   286
	if [ x"$$STATUS" = x"1" -a \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
       x`uname -r` = x"5.10" -a \
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
       x`uname -p` = x"sparc" ]; then\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   289
    echo "*****************************************************************";\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   290
    echo "* If you are building server compiler, and the error message is ";\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   291
    echo "* \"incorrect ELF machine type...\", you have run into solaris bug ";\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
    echo "* 6213962, \"dtrace -G doesn't work on sparcv8+ object files\".";\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
    echo "* Either patch/upgrade your system (>= S10u1_15), or set the ";\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
    echo "* environment variable HOTSPOT_DISABLE_DTRACE_PROBES to disable ";\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   295
    echo "* dtrace probes for this build.";\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   296
    echo "*****************************************************************";\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   297
  fi;\
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
  exit $$STATUS
489c9b5090e2 Initial load
duke
parents:
diff changeset
   299
  # Since some DTraced_Files are in LIBJVM.o and they are touched by this
489c9b5090e2 Initial load
duke
parents:
diff changeset
   300
  # command, and libgenerateJvmOffsets.so depends on LIBJVM.o, 'make' will
489c9b5090e2 Initial load
duke
parents:
diff changeset
   301
  # think it needs to rebuild libgenerateJvmOffsets.so and thus JvmOffsets*
489c9b5090e2 Initial load
duke
parents:
diff changeset
   302
  # files, but it doesn't, so we touch the necessary files to prevent later
489c9b5090e2 Initial load
duke
parents:
diff changeset
   303
  # recompilation. Note: we only touch the necessary files if they already
489c9b5090e2 Initial load
duke
parents:
diff changeset
   304
  # exist in order to close a race where an empty file can be created
489c9b5090e2 Initial load
duke
parents:
diff changeset
   305
  # before the real build rule is executed.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   306
  # But, we can't touch the *.h files:  This rule depends
489c9b5090e2 Initial load
duke
parents:
diff changeset
   307
  # on them, and that would cause an infinite cycle of rebuilding.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   308
  # Neither the *.h or *.ccp files need to be touched, since they have
489c9b5090e2 Initial load
duke
parents:
diff changeset
   309
  # rules which do not update them when the generator file has not
489c9b5090e2 Initial load
duke
parents:
diff changeset
   310
  # changed their contents.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   311
	$(QUIETLY) if [ -f lib$(GENOFFS).so ]; then touch lib$(GENOFFS).so; fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
   312
	$(QUIETLY) if [ -f $(GENOFFS) ]; then touch $(GENOFFS); fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
   313
	$(QUIETLY) if [ -f $(JVMOFFS.o) ]; then touch $(JVMOFFS.o); fi
489c9b5090e2 Initial load
duke
parents:
diff changeset
   314
489c9b5090e2 Initial load
duke
parents:
diff changeset
   315
.PHONY: dtraceCheck
489c9b5090e2 Initial load
duke
parents:
diff changeset
   316
363
99d43e8a76ad 6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents: 338
diff changeset
   317
SYSTEM_DTRACE_H = /usr/include/dtrace.h
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   318
SYSTEM_DTRACE_PROG = /usr/sbin/dtrace
489c9b5090e2 Initial load
duke
parents:
diff changeset
   319
PATCH_DTRACE_PROG = /opt/SUNWdtrd/sbin/dtrace
489c9b5090e2 Initial load
duke
parents:
diff changeset
   320
systemDtraceFound := $(wildcard ${SYSTEM_DTRACE_PROG})
489c9b5090e2 Initial load
duke
parents:
diff changeset
   321
patchDtraceFound := $(wildcard ${PATCH_DTRACE_PROG})
363
99d43e8a76ad 6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents: 338
diff changeset
   322
systemDtraceHdrFound := $(wildcard $(SYSTEM_DTRACE_H))
99d43e8a76ad 6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents: 338
diff changeset
   323
99d43e8a76ad 6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents: 338
diff changeset
   324
ifneq ("$(systemDtraceHdrFound)", "") 
99d43e8a76ad 6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents: 338
diff changeset
   325
CFLAGS += -DHAVE_DTRACE_H
99d43e8a76ad 6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents: 338
diff changeset
   326
endif
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   327
489c9b5090e2 Initial load
duke
parents:
diff changeset
   328
ifneq ("$(patchDtraceFound)", "")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   329
DTRACE_PROG=$(PATCH_DTRACE_PROG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   330
DTRACE_INCL=-I/opt/SUNWdtrd/include
489c9b5090e2 Initial load
duke
parents:
diff changeset
   331
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   332
ifneq ("$(systemDtraceFound)", "")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   333
DTRACE_PROG=$(SYSTEM_DTRACE_PROG)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   334
else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   335
489c9b5090e2 Initial load
duke
parents:
diff changeset
   336
endif # ifneq ("$(systemDtraceFound)", "")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   337
endif # ifneq ("$(patchDtraceFound)", "")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   338
489c9b5090e2 Initial load
duke
parents:
diff changeset
   339
ifneq ("${DTRACE_PROG}", "")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   340
ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   341
489c9b5090e2 Initial load
duke
parents:
diff changeset
   342
DTRACE_OBJS = $(DTRACE.o) $(JVMOFFS.o)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   343
CFLAGS += $(DTRACE_INCL) -DDTRACE_ENABLED
489c9b5090e2 Initial load
duke
parents:
diff changeset
   344
MAPFILE_DTRACE_OPT = $(MAPFILE_DTRACE)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   345
489c9b5090e2 Initial load
duke
parents:
diff changeset
   346
dtraceCheck:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   347
489c9b5090e2 Initial load
duke
parents:
diff changeset
   348
else # manually disabled
489c9b5090e2 Initial load
duke
parents:
diff changeset
   349
489c9b5090e2 Initial load
duke
parents:
diff changeset
   350
dtraceCheck:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   351
	$(QUIETLY) echo "**NOTICE** Dtrace support disabled via environment variable"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   352
489c9b5090e2 Initial load
duke
parents:
diff changeset
   353
endif # ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   354
489c9b5090e2 Initial load
duke
parents:
diff changeset
   355
else # No dtrace program found
489c9b5090e2 Initial load
duke
parents:
diff changeset
   356
489c9b5090e2 Initial load
duke
parents:
diff changeset
   357
dtraceCheck:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   358
	$(QUIETLY) echo "**NOTICE** Dtrace support disabled: not supported by system"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   359
489c9b5090e2 Initial load
duke
parents:
diff changeset
   360
endif # ifneq ("${dtraceFound}", "")
489c9b5090e2 Initial load
duke
parents:
diff changeset
   361
489c9b5090e2 Initial load
duke
parents:
diff changeset
   362
endif # ifdef USE_GCC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   363
489c9b5090e2 Initial load
duke
parents:
diff changeset
   364
else # CORE build
489c9b5090e2 Initial load
duke
parents:
diff changeset
   365
489c9b5090e2 Initial load
duke
parents:
diff changeset
   366
dtraceCheck:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   367
	$(QUIETLY) echo "**NOTICE** Dtrace support disabled for CORE builds"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   368
489c9b5090e2 Initial load
duke
parents:
diff changeset
   369
endif # ifneq ("${TYPE}", "CORE")