make/hotspot/lib/CompileDtracePostJvm.gmk
author ihse
Wed, 14 Mar 2018 19:12:30 +0100
changeset 49241 de4b3a04feae
parent 49157 2478f56cf409
child 56312 a52bcf4118eb
permissions -rw-r--r--
8199606: Set -lc as global LIBS on solstudio Reviewed-by: erikj
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     1
#
49070
d7859531621b 8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents: 47217
diff changeset
     2
# Copyright (c) 2013, 2018, 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, \
49070
d7859531621b 8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents: 47217
diff changeset
    49
        NAME := dtraceGenOffsets, \
d7859531621b 8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents: 47217
diff changeset
    50
        TYPE := EXECUTABLE, \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    51
        SRC := $(TOPDIR)/make/hotspot/src/native/dtrace, \
49124
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 49078
diff changeset
    52
        TOOLCHAIN := $(TOOLCHAIN_BUILD), \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    53
        LDFLAGS := -m64, \
49124
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 49078
diff changeset
    54
        CFLAGS := -m64 $(JVM_CFLAGS), \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    55
        OBJECT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/dtrace-gen-offsets/objs, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    56
        OUTPUT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/dtrace-gen-offsets, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    57
    ))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    58
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    59
    DTRACE_GEN_OFFSETS_TOOL := $(BUILD_DTRACE_GEN_OFFSETS_TARGET)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    60
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    61
    # Argument 1: Output filename
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    62
    # Argument 2: dtrace-gen-offset tool command line option
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    63
    define SetupDtraceOffsetsGeneration
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    64
      $1: $$(BUILD_DTRACE_GEN_OFFSETS)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    65
	$$(call LogInfo, Generating dtrace $2 file $$(@F))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    66
	$$(call MakeDir, $$(@D))
39622
ea5433c14f21 8158629: bash >(...) construct still causes race conditions
erikj
parents: 38097
diff changeset
    67
	$$(call ExecuteWithLog, $$@, ( $$(DTRACE_GEN_OFFSETS_TOOL) -$$(strip $2) > $$@ ) )
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    68
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    69
      TARGETS += $1
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    70
    endef
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    71
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    72
    JVM_OFFSETS_H := $(DTRACE_SUPPORT_DIR)/JvmOffsets.h
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    73
    JVM_OFFSETS_CPP := $(DTRACE_SUPPORT_DIR)/JvmOffsets.cpp
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    74
    JVM_OFFSETS_INDEX_H := $(DTRACE_SUPPORT_DIR)/JvmOffsetsIndex.h
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    75
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    76
    # Run the dtrace-gen-offset tool to generate these three files.
49124
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 49078
diff changeset
    77
    # The generated JvmOffsets.cpp is compiled with the rest of libjvm.
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    78
    $(eval $(call SetupDtraceOffsetsGeneration, $(JVM_OFFSETS_H), header))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    79
    $(eval $(call SetupDtraceOffsetsGeneration, $(JVM_OFFSETS_INDEX_H), index))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    80
    $(eval $(call SetupDtraceOffsetsGeneration, $(JVM_OFFSETS_CPP), table))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    81
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    82
    ############################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    83
    # Generate DTRACE_OBJ which is linked with libjvm.so.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    84
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    85
    # Concatenate all *.d files into a single file
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    86
    DTRACE_SOURCE_FILES := $(addprefix $(TOPDIR)/src/hotspot/os/posix/dtrace/, \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    87
        hotspot_jni.d \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    88
        hotspot.d \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    89
        hs_private.d \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    90
    )
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    91
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    92
    $(JVM_OUTPUTDIR)/objs/dtrace.d: $(DTRACE_SOURCE_FILES)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    93
	$(call LogInfo, Generating $(@F))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    94
	$(call MakeDir, $(@D))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    95
	$(CAT) $^ > $@
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    96
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    97
    DTRACE_INSTRUMENTED_OBJS := $(addprefix $(JVM_OUTPUTDIR)/objs/, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    98
        ciEnv.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    99
        classLoadingService.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   100
        compileBroker.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   101
        hashtable.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   102
        instanceKlass.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   103
        java.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   104
        jni.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   105
        jvm.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   106
        memoryManager.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   107
        nmethod.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   108
        objectMonitor.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   109
        runtimeService.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   110
        sharedRuntime.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   111
        synchronizer.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   112
        thread.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   113
        unsafe.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   114
        vmThread.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   115
        vmGCOperations.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   116
    )
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   117
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   118
    ifeq ($(call check-jvm-feature, all-gcs), true)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   119
      DTRACE_INSTRUMENTED_OBJS += $(addprefix $(JVM_OUTPUTDIR)/objs/, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   120
          vmCMSOperations.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   121
          vmPSOperations.o \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   122
      )
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   123
    endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   124
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   125
    DTRACE_FLAGS := -64 -G
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   126
    DTRACE_CPP_FLAGS := -D_LP64
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   127
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   128
    # Make sure we run our selected compiler for preprocessing instead of letting
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   129
    # the dtrace tool pick it on it's own.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   130
    $(DTRACE_OBJ): $(JVM_OUTPUTDIR)/objs/dtrace.d $(DTRACE_INSTRUMENTED_OBJS)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   131
	$(call LogInfo, Generating $(@F) from $(<F) and object files)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   132
	$(call MakeDir, $(DTRACE_SUPPORT_DIR))
49124
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 49078
diff changeset
   133
	$(call ExecuteWithLog, $(DTRACE_SUPPORT_DIR)/$(@F).d, \
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 49078
diff changeset
   134
	    ($(CPP) $(DTRACE_CPP_FLAGS) $< > $(DTRACE_SUPPORT_DIR)/$(@F).d))
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   135
	$(call ExecuteWithLog, $@, $(DTRACE) $(DTRACE_FLAGS) -xlazyload -o $@ \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   136
	    -s $(DTRACE_SUPPORT_DIR)/$(@F).d $(sort $(DTRACE_INSTRUMENTED_OBJS)))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   137
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   138
    ############################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   139
    # Generate DTRACE_JHELPER_OBJ which is linked with libjvm.so.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   140
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   141
    # Unfortunately dtrace generates incorrect types for some symbols in
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   142
    # dtrace_jhelper.o, resulting in "warning: symbol X has differing types"
49078
039e63e471e1 8198859: Use elfedit to silence linker warnings on solaris
ihse
parents: 49070
diff changeset
   143
    # See JDK-6890703 for details.
039e63e471e1 8198859: Use elfedit to silence linker warnings on solaris
ihse
parents: 49070
diff changeset
   144
    # We work around this by fixing the types for these symbols using elfedit,
039e63e471e1 8198859: Use elfedit to silence linker warnings on solaris
ihse
parents: 49070
diff changeset
   145
    # after dtrace has generated the .o file.
039e63e471e1 8198859: Use elfedit to silence linker warnings on solaris
ihse
parents: 49070
diff changeset
   146
    JHELPER_DTRACE_SRC := $(TOPDIR)/src/hotspot/os/solaris/dtrace/jhelper.d
039e63e471e1 8198859: Use elfedit to silence linker warnings on solaris
ihse
parents: 49070
diff changeset
   147
49124
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 49078
diff changeset
   148
    GetElfeditCommands = \
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 49078
diff changeset
   149
      $(foreach symbol, \
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 49078
diff changeset
   150
          $(shell $(GREP) ^extern $(JHELPER_DTRACE_SRC) | $(AWK) '{ gsub(";","") ; print $$3 }'), \
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 49078
diff changeset
   151
          -e 'sym:st_type $(symbol) 1')
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 49078
diff changeset
   152
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 49078
diff changeset
   153
    # Make sure we run our selected compiler for preprocessing instead of letting
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 49078
diff changeset
   154
    # the dtrace tool pick it on it's own.
49078
039e63e471e1 8198859: Use elfedit to silence linker warnings on solaris
ihse
parents: 49070
diff changeset
   155
    $(DTRACE_JHELPER_OBJ): $(JHELPER_DTRACE_SRC) $(JVM_OFFSETS_INDEX_H)
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   156
	$(call LogInfo, Running dtrace for $(<F))
49124
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 49078
diff changeset
   157
	$(call MakeDir, $(DTRACE_SUPPORT_DIR))
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 49078
diff changeset
   158
	$(call ExecuteWithLog, $(DTRACE_SUPPORT_DIR)/$(@F).d, \
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 49078
diff changeset
   159
	    ($(CPP) $(DTRACE_CPP_FLAGS) -I$(DTRACE_SUPPORT_DIR) $^ \
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 49078
diff changeset
   160
	    > $(DTRACE_SUPPORT_DIR)/$(@F).d))
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 49078
diff changeset
   161
	$(call ExecuteWithLog, $@, $(DTRACE) $(DTRACE_FLAGS) -o $@ \
6abbc1f5c2a1 8198862: Stop doing funky compilation stuff for dtrace
ihse
parents: 49078
diff changeset
   162
	    -s $(DTRACE_SUPPORT_DIR)/$(@F).d)
49157
2478f56cf409 8199339: JDK-8198859 broke solaris x64
erikj
parents: 49124
diff changeset
   163
        ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
2478f56cf409 8199339: JDK-8198859 broke solaris x64
erikj
parents: 49124
diff changeset
   164
	  $(call ExecuteWithLog, $@.elfedit, $(ELFEDIT) $(call GetElfeditCommands) $@)
2478f56cf409 8199339: JDK-8198859 broke solaris x64
erikj
parents: 49124
diff changeset
   165
        endif
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   166
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   167
    ############################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   168
    # Build the stand-alone dtrace libraries
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   169
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   170
    LIBJVM_DTRACE_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/libjvm_dtrace
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   171
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   172
    $(eval $(call SetupNativeCompilation, BUILD_LIBJVM_DTRACE, \
49070
d7859531621b 8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents: 47217
diff changeset
   173
        NAME := jvm_dtrace, \
41277
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 39622
diff changeset
   174
        OUTPUT_DIR := $(JVM_LIB_OUTPUTDIR), \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   175
        SRC := $(TOPDIR)/src/java.base/solaris/native/libjvm_dtrace, \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   176
        CFLAGS := -m64 -G -mt -KPIC, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   177
        LDFLAGS := -m64 -mt -xnolib $(SHARED_LIBRARY_FLAGS), \
49241
de4b3a04feae 8199606: Set -lc as global LIBS on solstudio
ihse
parents: 49157
diff changeset
   178
        LIBS := $(LIBDL) -lthread -ldoor, \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   179
        MAPFILE := $(TOPDIR)/make/mapfiles/libjvm_dtrace/mapfile-vers, \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   180
        OBJECT_DIR := $(LIBJVM_DTRACE_OUTPUTDIR)/objs, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   181
    ))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   182
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   183
    LIBJVM_DB_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/libjvm_db
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   184
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   185
    # 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
   186
    # the old build.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   187
    $(eval $(call SetupNativeCompilation, BUILD_LIBJVM_DB, \
49070
d7859531621b 8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents: 47217
diff changeset
   188
        NAME := jvm_db, \
41277
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 39622
diff changeset
   189
        OUTPUT_DIR := $(JVM_LIB_OUTPUTDIR), \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   190
        SRC := $(TOPDIR)/src/java.base/solaris/native/libjvm_db, \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   191
        CFLAGS := -I$(JVM_VARIANT_OUTPUTDIR)/gensrc -I$(DTRACE_SUPPORT_DIR) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   192
            -m64 -G -mt -KPIC, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   193
        LDFLAGS := -m64 -mt -xnolib $(SHARED_LIBRARY_FLAGS), \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   194
        MAPFILE := $(TOPDIR)/make/mapfiles/libjvm_db/mapfile-vers, \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   195
        OBJECT_DIR := $(LIBJVM_DB_OUTPUTDIR)/objs, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   196
    ))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   197
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   198
    # 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
   199
    $(BUILD_LIBJVM_DB_ALL_OBJS): $(JVM_OFFSETS_H)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   200
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   201
    TARGETS += $(BUILD_LIBJVM_DTRACE) $(BUILD_LIBJVM_DB)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   202
  endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   203
endif