make/hotspot/lib/CompileDtracePostJvm.gmk
author erikj
Tue, 12 Sep 2017 19:03:56 +0200
changeset 47217 72e3ae9a25eb
parent 47216 71c04702a3d5
child 49070 d7859531621b
child 56213 85ee4e5a2f92
permissions -rw-r--r--
8187444: Forest Consolidation: Make build work Reviewed-by: darcy, ihse Contributed-by: erik.joelsson@oracle.com, maurizio.cimadamore@oracle.com, sundararajan.athijegannathan@oracle.com, jonathan.gibbons@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     1
#
46539
c23c825bcfc2 8181318: Allow C++ library headers on Solaris Studio
eosterlund
parents: 42885
diff changeset
     2
# Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     4
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    10
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    15
# accompanied this code).
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    16
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    20
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    23
# questions.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    24
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    25
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    26
################################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    27
# Support for dtrace integration with libjvm, and stand-alone dtrace library
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    28
# compilation.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    29
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    30
ifeq ($(call check-jvm-feature, dtrace), true)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    31
  ##############################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    32
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    33
  ifeq ($(OPENJDK_TARGET_OS), solaris)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    34
    ############################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    35
    # Integrate with libjvm. Here we generate three object files which are
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    36
    # linked with libjvm.so. This step is complicated from a dependency
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    37
    # perspective, since it needs the rest of the compiled object files from the
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    38
    # libjvm compilation, but the output is object files that are to be included
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    39
    # when linking libjvm.so. So this generation must happen as a part of the
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    40
    # libjvm compilation.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    41
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    42
    # First we need to generate the dtraceGenOffsets tool. When run, this will
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    43
    # produce more header files and a C++ file.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    44
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    45
    # Note that generateJvmOffsets.cpp must be compiled as if it were a file
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    46
    # in the libjvm.so, using JVM_CFLAGS as setup in CompileJvm.gmk. Otherwise
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    47
    # this would preferrably have been done as a part of GensrcDtrace.gmk.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    48
    $(eval $(call SetupNativeCompilation, BUILD_DTRACE_GEN_OFFSETS, \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    49
        SRC := $(TOPDIR)/make/hotspot/src/native/dtrace, \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    50
        CC := $(BUILD_CXX), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    51
        CXX := $(BUILD_CXX), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    52
        LDEXE := $(BUILD_CXX), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    53
        generateJvmOffsets.cpp_CXXFLAGS := $(JVM_CFLAGS) -mt -xnolib -norunpath, \
46539
c23c825bcfc2 8181318: Allow C++ library headers on Solaris Studio
eosterlund
parents: 42885
diff changeset
    54
        generateJvmOffsetsMain.c_CFLAGS := -mt -m64 -norunpath -z nodefs, \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    55
        LDFLAGS := -m64, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    56
        LIBS := -lc, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    57
        OBJECT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/dtrace-gen-offsets/objs, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    58
        OUTPUT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/dtrace-gen-offsets, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    59
        PROGRAM := dtraceGenOffsets, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    60
    ))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    61
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    62
    DTRACE_GEN_OFFSETS_TOOL := $(BUILD_DTRACE_GEN_OFFSETS_TARGET)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    63
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    64
    # Argument 1: Output filename
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    65
    # Argument 2: dtrace-gen-offset tool command line option
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    66
    define SetupDtraceOffsetsGeneration
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    67
      $1: $$(BUILD_DTRACE_GEN_OFFSETS)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    68
	$$(call LogInfo, Generating dtrace $2 file $$(@F))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    69
	$$(call MakeDir, $$(@D))
39622
ea5433c14f21 8158629: bash >(...) construct still causes race conditions
erikj
parents: 38097
diff changeset
    70
	$$(call ExecuteWithLog, $$@, ( $$(DTRACE_GEN_OFFSETS_TOOL) -$$(strip $2) > $$@ ) )
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    71
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    72
      TARGETS += $1
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    73
    endef
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    74
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    75
    JVM_OFFSETS_H := $(DTRACE_SUPPORT_DIR)/JvmOffsets.h
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    76
    JVM_OFFSETS_CPP := $(DTRACE_SUPPORT_DIR)/JvmOffsets.cpp
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    77
    JVM_OFFSETS_INDEX_H := $(DTRACE_SUPPORT_DIR)/JvmOffsetsIndex.h
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    78
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    79
    # Run the dtrace-gen-offset tool to generate these three files.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    80
    $(eval $(call SetupDtraceOffsetsGeneration, $(JVM_OFFSETS_H), header))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    81
    $(eval $(call SetupDtraceOffsetsGeneration, $(JVM_OFFSETS_INDEX_H), index))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    82
    $(eval $(call SetupDtraceOffsetsGeneration, $(JVM_OFFSETS_CPP), table))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    83
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    84
    ############################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    85
    # Compile JVM_OFFSETS_OBJ which is linked with libjvm.so.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    86
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    87
    # JvmOffsets.cpp is compiled without the common JVM_CFLAGS. Otherwise, the
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    88
    # natural way would have been to included this source code in BUILD_LIBJVM.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    89
    JVM_OFFSETS_CFLAGS := -m64
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    90
    ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    91
      JVM_OFFSETS_CFLAGS += -xarch=sparc
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    92
    endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    93
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    94
    $(JVM_OFFSETS_OBJ): $(JVM_OFFSETS_CPP) $(JVM_OFFSETS_H)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    95
	$(call LogInfo, Compiling dtrace file JvmOffsets.cpp (for libjvm.so))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    96
	$(call ExecuteWithLog, $@, $(CXX) -c -I$(<D) -o $@ $(JVM_OFFSETS_CFLAGS) $<)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    97
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    98
    ############################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    99
    # Generate DTRACE_OBJ which is linked with libjvm.so.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   100
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   101
    # Concatenate all *.d files into a single file
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   102
    DTRACE_SOURCE_FILES := $(addprefix $(TOPDIR)/src/hotspot/os/posix/dtrace/, \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   103
        hotspot_jni.d \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   104
        hotspot.d \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   105
        hs_private.d \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   106
    )
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   107
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   108
    $(JVM_OUTPUTDIR)/objs/dtrace.d: $(DTRACE_SOURCE_FILES)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   109
	$(call LogInfo, Generating $(@F))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   110
	$(call MakeDir, $(@D))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   111
	$(CAT) $^ > $@
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   112
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   113
    DTRACE_INSTRUMENTED_OBJS := $(addprefix $(JVM_OUTPUTDIR)/objs/, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   114
        ciEnv.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   115
        classLoadingService.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   116
        compileBroker.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   117
        hashtable.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   118
        instanceKlass.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   119
        java.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   120
        jni.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   121
        jvm.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   122
        memoryManager.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   123
        nmethod.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   124
        objectMonitor.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   125
        runtimeService.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   126
        sharedRuntime.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   127
        synchronizer.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   128
        thread.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   129
        unsafe.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   130
        vmThread.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   131
        vmGCOperations.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   132
    )
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   133
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   134
    ifeq ($(call check-jvm-feature, all-gcs), true)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   135
      DTRACE_INSTRUMENTED_OBJS += $(addprefix $(JVM_OUTPUTDIR)/objs/, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   136
          vmCMSOperations.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   137
          vmPSOperations.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   138
      )
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   139
    endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   140
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   141
    DTRACE_FLAGS := -64 -G
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   142
    DTRACE_CPP_FLAGS := -D_LP64
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   143
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   144
    # Make sure we run our selected compiler for preprocessing instead of letting
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   145
    # the dtrace tool pick it on it's own.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   146
    $(DTRACE_OBJ): $(JVM_OUTPUTDIR)/objs/dtrace.d $(DTRACE_INSTRUMENTED_OBJS)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   147
	$(call LogInfo, Generating $(@F) from $(<F) and object files)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   148
	$(call MakeDir, $(DTRACE_SUPPORT_DIR))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   149
	$(call ExecuteWithLog, $(DTRACE_SUPPORT_DIR)/$(@F).d, $(CC) -E \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   150
	    $(DTRACE_CPP_FLAGS) $< > $(DTRACE_SUPPORT_DIR)/$(@F).d)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   151
	$(call ExecuteWithLog, $@, $(DTRACE) $(DTRACE_FLAGS) -xlazyload -o $@ \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   152
	    -s $(DTRACE_SUPPORT_DIR)/$(@F).d $(sort $(DTRACE_INSTRUMENTED_OBJS)))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   153
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   154
    ############################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   155
    # Generate DTRACE_JHELPER_OBJ which is linked with libjvm.so.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   156
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   157
    # Unfortunately dtrace generates incorrect types for some symbols in
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   158
    # dtrace_jhelper.o, resulting in "warning: symbol X has differing types"
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   159
    # This is tracked in JDK-6890703.
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   160
    $(DTRACE_JHELPER_OBJ): $(TOPDIR)/src/hotspot/os/solaris/dtrace/jhelper.d \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   161
        $(JVM_OFFSETS_INDEX_H)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   162
	$(call LogInfo, Running dtrace for $(<F))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   163
	$(call ExecuteWithLog, $@, $(DTRACE) $(DTRACE_FLAGS) $(DTRACE_CPP_FLAGS) -C \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   164
	    -I$(DTRACE_SUPPORT_DIR) -o $@ -s $<)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   165
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   166
    # NOTE: We should really do something like this, but unfortunately this
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   167
    # results in a compilation error. :-(
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   168
    # $(call MakeDir, $(DTRACE_SUPPORT_DIR))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   169
    # $(call ExecuteWithLog, $(DTRACE_SUPPORT_DIR)/$(@F).d, $(CC) -E \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   170
    #     $(DTRACE_CPP_FLAGS) -I$(DTRACE_SUPPORT_DIR) $^ \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   171
    #     > $(DTRACE_SUPPORT_DIR)/$(@F).d)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   172
    # $(call ExecuteWithLog, $@, $(DTRACE) $(DTRACE_FLAGS) -o $@ \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   173
    #     -s $(DTRACE_SUPPORT_DIR)/$(@F).d)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   174
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   175
    ############################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   176
    # Build the stand-alone dtrace libraries
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   177
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   178
    LIBJVM_DTRACE_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/libjvm_dtrace
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   179
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   180
    $(eval $(call SetupNativeCompilation, BUILD_LIBJVM_DTRACE, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   181
        LIBRARY := jvm_dtrace, \
41277
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 39622
diff changeset
   182
        OUTPUT_DIR := $(JVM_LIB_OUTPUTDIR), \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   183
        SRC := $(TOPDIR)/src/java.base/solaris/native/libjvm_dtrace, \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   184
        CFLAGS := -m64 -G -mt -KPIC, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   185
        LDFLAGS := -m64 -mt -xnolib $(SHARED_LIBRARY_FLAGS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   186
        LIBS := $(LIBDL) -lc -lthread -ldoor, \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   187
        MAPFILE := $(TOPDIR)/make/mapfiles/libjvm_dtrace/mapfile-vers, \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   188
        OBJECT_DIR := $(LIBJVM_DTRACE_OUTPUTDIR)/objs, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   189
    ))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   190
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   191
    LIBJVM_DB_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/libjvm_db
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   192
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   193
    # Note that libjvm_db.c has tests for COMPILER2, but this was never set by
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   194
    # the old build.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   195
    $(eval $(call SetupNativeCompilation, BUILD_LIBJVM_DB, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   196
        LIBRARY := jvm_db, \
41277
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 39622
diff changeset
   197
        OUTPUT_DIR := $(JVM_LIB_OUTPUTDIR), \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   198
        SRC := $(TOPDIR)/src/java.base/solaris/native/libjvm_db, \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   199
        CFLAGS := -I$(JVM_VARIANT_OUTPUTDIR)/gensrc -I$(DTRACE_SUPPORT_DIR) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   200
            -m64 -G -mt -KPIC, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   201
        LDFLAGS := -m64 -mt -xnolib $(SHARED_LIBRARY_FLAGS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   202
        LIBS := -lc, \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   203
        MAPFILE := $(TOPDIR)/make/mapfiles/libjvm_db/mapfile-vers, \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   204
        OBJECT_DIR := $(LIBJVM_DB_OUTPUTDIR)/objs, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   205
    ))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   206
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   207
    # We need the generated JvmOffsets.h before we can compile the libjvm_db source code.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   208
    $(BUILD_LIBJVM_DB_ALL_OBJS): $(JVM_OFFSETS_H)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   209
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   210
    TARGETS += $(BUILD_LIBJVM_DTRACE) $(BUILD_LIBJVM_DB)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   211
  endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   212
endif