hotspot/make/lib/CompileDtracePostJvm.gmk
author vlivanov
Fri, 06 May 2016 19:45:22 +0300
changeset 38245 c6c2ac29463b
parent 38097 1ca3d6f508b1
child 39622 ea5433c14f21
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     1
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     2
# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
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, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    49
        SRC := $(HOTSPOT_TOPDIR)/src/os/$(OPENJDK_TARGET_OS)/dtrace, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    50
        INCLUDE_FILES := generateJvmOffsets.cpp generateJvmOffsetsMain.c, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    51
        CC := $(BUILD_CXX), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    52
        CXX := $(BUILD_CXX), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    53
        LDEXE := $(BUILD_CXX), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    54
        generateJvmOffsets.cpp_CXXFLAGS := $(JVM_CFLAGS) -mt -xnolib -norunpath, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    55
        generateJvmOffsetsMain.c_CFLAGS := -library=%none -mt -m64 -norunpath -z nodefs, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    56
        LDFLAGS := -m64, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    57
        LIBS := -lc, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    58
        OBJECT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/dtrace-gen-offsets/objs, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    59
        OUTPUT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/dtrace-gen-offsets, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    60
        PROGRAM := dtraceGenOffsets, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    61
    ))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    62
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    63
    DTRACE_GEN_OFFSETS_TOOL := $(BUILD_DTRACE_GEN_OFFSETS_TARGET)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    64
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    65
    # Argument 1: Output filename
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    66
    # Argument 2: dtrace-gen-offset tool command line option
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    67
    define SetupDtraceOffsetsGeneration
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    68
      $1: $$(BUILD_DTRACE_GEN_OFFSETS)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    69
	$$(call LogInfo, Generating dtrace $2 file $$(@F))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    70
	$$(call MakeDir, $$(@D))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    71
	$$(call ExecuteWithLog, $$@, $$(DTRACE_GEN_OFFSETS_TOOL) -$$(strip $2) > $$@)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    72
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    73
      TARGETS += $1
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    74
    endef
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    75
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    76
    JVM_OFFSETS_H := $(DTRACE_SUPPORT_DIR)/JvmOffsets.h
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    77
    JVM_OFFSETS_CPP := $(DTRACE_SUPPORT_DIR)/JvmOffsets.cpp
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    78
    JVM_OFFSETS_INDEX_H := $(DTRACE_SUPPORT_DIR)/JvmOffsetsIndex.h
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    79
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    80
    # Run the dtrace-gen-offset tool to generate these three files.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    81
    $(eval $(call SetupDtraceOffsetsGeneration, $(JVM_OFFSETS_H), header))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    82
    $(eval $(call SetupDtraceOffsetsGeneration, $(JVM_OFFSETS_INDEX_H), index))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    83
    $(eval $(call SetupDtraceOffsetsGeneration, $(JVM_OFFSETS_CPP), table))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    84
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    85
    ############################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    86
    # Compile JVM_OFFSETS_OBJ which is linked with libjvm.so.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    87
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    88
    # JvmOffsets.cpp is compiled without the common JVM_CFLAGS. Otherwise, the
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    89
    # natural way would have been to included this source code in BUILD_LIBJVM.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    90
    JVM_OFFSETS_CFLAGS := -m64
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    91
    ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    92
      JVM_OFFSETS_CFLAGS += -xarch=sparc
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    93
    endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    94
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    95
    $(JVM_OFFSETS_OBJ): $(JVM_OFFSETS_CPP) $(JVM_OFFSETS_H)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    96
	$(call LogInfo, Compiling dtrace file JvmOffsets.cpp (for libjvm.so))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    97
	$(call ExecuteWithLog, $@, $(CXX) -c -I$(<D) -o $@ $(JVM_OFFSETS_CFLAGS) $<)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    98
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    99
    ############################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   100
    # Generate DTRACE_OBJ which is linked with libjvm.so.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   101
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   102
    # Concatenate all *.d files into a single file
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   103
    DTRACE_SOURCE_FILES := $(addprefix $(HOTSPOT_TOPDIR)/src/os/posix/dtrace/, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   104
        hotspot_jni.d \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   105
        hotspot.d \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   106
        hs_private.d \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   107
    )
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   108
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   109
    $(JVM_OUTPUTDIR)/objs/dtrace.d: $(DTRACE_SOURCE_FILES)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   110
	$(call LogInfo, Generating $(@F))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   111
	$(call MakeDir, $(@D))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   112
	$(CAT) $^ > $@
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   113
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   114
    DTRACE_INSTRUMENTED_OBJS := $(addprefix $(JVM_OUTPUTDIR)/objs/, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   115
        ciEnv.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   116
        classLoadingService.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   117
        compileBroker.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   118
        hashtable.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   119
        instanceKlass.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   120
        java.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   121
        jni.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   122
        jvm.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   123
        memoryManager.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   124
        nmethod.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   125
        objectMonitor.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   126
        runtimeService.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   127
        sharedRuntime.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   128
        synchronizer.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   129
        thread.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   130
        unsafe.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   131
        vmThread.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   132
        vmGCOperations.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   133
    )
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   134
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   135
    ifeq ($(call check-jvm-feature, all-gcs), true)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   136
      DTRACE_INSTRUMENTED_OBJS += $(addprefix $(JVM_OUTPUTDIR)/objs/, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   137
          vmCMSOperations.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   138
          vmPSOperations.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   139
      )
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   140
    endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   141
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   142
    DTRACE_FLAGS := -64 -G
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   143
    DTRACE_CPP_FLAGS := -D_LP64
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   144
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   145
    # Make sure we run our selected compiler for preprocessing instead of letting
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   146
    # the dtrace tool pick it on it's own.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   147
    $(DTRACE_OBJ): $(JVM_OUTPUTDIR)/objs/dtrace.d $(DTRACE_INSTRUMENTED_OBJS)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   148
	$(call LogInfo, Generating $(@F) from $(<F) and object files)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   149
	$(call MakeDir, $(DTRACE_SUPPORT_DIR))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   150
	$(call ExecuteWithLog, $(DTRACE_SUPPORT_DIR)/$(@F).d, $(CC) -E \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   151
	    $(DTRACE_CPP_FLAGS) $< > $(DTRACE_SUPPORT_DIR)/$(@F).d)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   152
	$(call ExecuteWithLog, $@, $(DTRACE) $(DTRACE_FLAGS) -xlazyload -o $@ \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   153
	    -s $(DTRACE_SUPPORT_DIR)/$(@F).d $(sort $(DTRACE_INSTRUMENTED_OBJS)))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   154
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   155
    ############################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   156
    # Generate DTRACE_JHELPER_OBJ which is linked with libjvm.so.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   157
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   158
    # Unfortunately dtrace generates incorrect types for some symbols in
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   159
    # dtrace_jhelper.o, resulting in "warning: symbol X has differing types"
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   160
    # This is tracked in JDK-6890703.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   161
    $(DTRACE_JHELPER_OBJ): $(HOTSPOT_TOPDIR)/src/os/solaris/dtrace/jhelper.d \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   162
        $(JVM_OFFSETS_INDEX_H)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   163
	$(call LogInfo, Running dtrace for $(<F))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   164
	$(call ExecuteWithLog, $@, $(DTRACE) $(DTRACE_FLAGS) $(DTRACE_CPP_FLAGS) -C \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   165
	    -I$(DTRACE_SUPPORT_DIR) -o $@ -s $<)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   166
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   167
    # NOTE: We should really do something like this, but unfortunately this
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   168
    # results in a compilation error. :-(
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   169
    # $(call MakeDir, $(DTRACE_SUPPORT_DIR))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   170
    # $(call ExecuteWithLog, $(DTRACE_SUPPORT_DIR)/$(@F).d, $(CC) -E \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   171
    #     $(DTRACE_CPP_FLAGS) -I$(DTRACE_SUPPORT_DIR) $^ \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   172
    #     > $(DTRACE_SUPPORT_DIR)/$(@F).d)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   173
    # $(call ExecuteWithLog, $@, $(DTRACE) $(DTRACE_FLAGS) -o $@ \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   174
    #     -s $(DTRACE_SUPPORT_DIR)/$(@F).d)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   175
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   176
    ############################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   177
    # Build the stand-alone dtrace libraries
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   178
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   179
    LIBJVM_DTRACE_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/libjvm_dtrace
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   180
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   181
    $(eval $(call SetupNativeCompilation, BUILD_LIBJVM_DTRACE, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   182
        LIBRARY := jvm_dtrace, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   183
        OUTPUT_DIR := $(LIBJVM_DTRACE_OUTPUTDIR), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   184
        SRC := $(HOTSPOT_TOPDIR)/src/os/solaris/dtrace, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   185
        INCLUDE_FILES := jvm_dtrace.c, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   186
        CFLAGS := -m64 -G -mt -KPIC, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   187
        LDFLAGS := -m64 -mt -xnolib $(SHARED_LIBRARY_FLAGS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   188
        LIBS := $(LIBDL) -lc -lthread -ldoor, \
38097
1ca3d6f508b1 8150601: Remove the old Hotspot build system
erikj
parents: 37437
diff changeset
   189
        MAPFILE := $(HOTSPOT_TOPDIR)/make/mapfiles/libjvm_dtrace/mapfile-vers, \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   190
        OBJECT_DIR := $(LIBJVM_DTRACE_OUTPUTDIR)/objs, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   191
        STRIP_SYMBOLS := true, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   192
    ))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   193
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   194
    LIBJVM_DB_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/libjvm_db
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   195
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   196
    # 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
   197
    # the old build.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   198
    $(eval $(call SetupNativeCompilation, BUILD_LIBJVM_DB, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   199
        LIBRARY := jvm_db, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   200
        OUTPUT_DIR := $(LIBJVM_DB_OUTPUTDIR), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   201
        SRC := $(HOTSPOT_TOPDIR)/src/os/solaris/dtrace, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   202
        INCLUDE_FILES := libjvm_db.c, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   203
        CFLAGS := -I$(JVM_VARIANT_OUTPUTDIR)/gensrc -I$(DTRACE_SUPPORT_DIR) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   204
            -m64 -G -mt -KPIC, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   205
        LDFLAGS := -m64 -mt -xnolib $(SHARED_LIBRARY_FLAGS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   206
        LIBS := -lc, \
38097
1ca3d6f508b1 8150601: Remove the old Hotspot build system
erikj
parents: 37437
diff changeset
   207
        MAPFILE := $(HOTSPOT_TOPDIR)/make/mapfiles/libjvm_db/mapfile-vers, \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   208
        OBJECT_DIR := $(LIBJVM_DB_OUTPUTDIR)/objs, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   209
        STRIP_SYMBOLS := true, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   210
    ))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   211
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   212
    # 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
   213
    $(BUILD_LIBJVM_DB_ALL_OBJS): $(JVM_OFFSETS_H)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   214
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   215
    TARGETS += $(BUILD_LIBJVM_DTRACE) $(BUILD_LIBJVM_DB)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   216
  endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   217
endif