< prev index next >

make/lib/CompileDtracePostJvm.gmk

Print this page
rev 13049 : imported patch cflags_dtrace


  35     # Integrate with libjvm. Here we generate three object files which are
  36     # linked with libjvm.so. This step is complicated from a dependency
  37     # perspective, since it needs the rest of the compiled object files from the
  38     # libjvm compilation, but the output is object files that are to be included
  39     # when linking libjvm.so. So this generation must happen as a part of the
  40     # libjvm compilation.
  41 
  42     # First we need to generate the dtraceGenOffsets tool. When run, this will
  43     # produce more header files and a C++ file.
  44 
  45     # Note that generateJvmOffsets.cpp must be compiled as if it were a file
  46     # in the libjvm.so, using JVM_CFLAGS as setup in CompileJvm.gmk. Otherwise
  47     # this would preferrably have been done as a part of GensrcDtrace.gmk.
  48     $(eval $(call SetupNativeCompilation, BUILD_DTRACE_GEN_OFFSETS, \
  49         SRC := $(HOTSPOT_TOPDIR)/src/os/$(OPENJDK_TARGET_OS)/dtrace, \
  50         INCLUDE_FILES := generateJvmOffsets.cpp generateJvmOffsetsMain.c, \
  51         CC := $(BUILD_CXX), \
  52         CXX := $(BUILD_CXX), \
  53         LDEXE := $(BUILD_CXX), \
  54         generateJvmOffsets.cpp_CXXFLAGS := $(JVM_CFLAGS) -mt -xnolib -norunpath, \
  55         generateJvmOffsetsMain.c_CFLAGS := -library=%none -mt -m64 -norunpath -z nodefs, \
  56         LDFLAGS := -m64, \
  57         LIBS := -lc, \
  58         OBJECT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/dtrace-gen-offsets/objs, \
  59         OUTPUT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/dtrace-gen-offsets, \
  60         PROGRAM := dtraceGenOffsets, \
  61     ))
  62 
  63     DTRACE_GEN_OFFSETS_TOOL := $(BUILD_DTRACE_GEN_OFFSETS_TARGET)
  64 
  65     # Argument 1: Output filename
  66     # Argument 2: dtrace-gen-offset tool command line option
  67     define SetupDtraceOffsetsGeneration
  68       $1: $$(BUILD_DTRACE_GEN_OFFSETS)
  69         $$(call LogInfo, Generating dtrace $2 file $$(@F))
  70         $$(call MakeDir, $$(@D))
  71         $$(call ExecuteWithLog, $$@, ( $$(DTRACE_GEN_OFFSETS_TOOL) -$$(strip $2) > $$@ ) )
  72 
  73       TARGETS += $1
  74     endef
  75 




  35     # Integrate with libjvm. Here we generate three object files which are
  36     # linked with libjvm.so. This step is complicated from a dependency
  37     # perspective, since it needs the rest of the compiled object files from the
  38     # libjvm compilation, but the output is object files that are to be included
  39     # when linking libjvm.so. So this generation must happen as a part of the
  40     # libjvm compilation.
  41 
  42     # First we need to generate the dtraceGenOffsets tool. When run, this will
  43     # produce more header files and a C++ file.
  44 
  45     # Note that generateJvmOffsets.cpp must be compiled as if it were a file
  46     # in the libjvm.so, using JVM_CFLAGS as setup in CompileJvm.gmk. Otherwise
  47     # this would preferrably have been done as a part of GensrcDtrace.gmk.
  48     $(eval $(call SetupNativeCompilation, BUILD_DTRACE_GEN_OFFSETS, \
  49         SRC := $(HOTSPOT_TOPDIR)/src/os/$(OPENJDK_TARGET_OS)/dtrace, \
  50         INCLUDE_FILES := generateJvmOffsets.cpp generateJvmOffsetsMain.c, \
  51         CC := $(BUILD_CXX), \
  52         CXX := $(BUILD_CXX), \
  53         LDEXE := $(BUILD_CXX), \
  54         generateJvmOffsets.cpp_CXXFLAGS := $(JVM_CFLAGS) -mt -xnolib -norunpath, \
  55         generateJvmOffsetsMain.c_CFLAGS := -mt -m64 -norunpath -z nodefs, \
  56         LDFLAGS := -m64, \
  57         LIBS := -lc, \
  58         OBJECT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/dtrace-gen-offsets/objs, \
  59         OUTPUT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/dtrace-gen-offsets, \
  60         PROGRAM := dtraceGenOffsets, \
  61     ))
  62 
  63     DTRACE_GEN_OFFSETS_TOOL := $(BUILD_DTRACE_GEN_OFFSETS_TARGET)
  64 
  65     # Argument 1: Output filename
  66     # Argument 2: dtrace-gen-offset tool command line option
  67     define SetupDtraceOffsetsGeneration
  68       $1: $$(BUILD_DTRACE_GEN_OFFSETS)
  69         $$(call LogInfo, Generating dtrace $2 file $$(@F))
  70         $$(call MakeDir, $$(@D))
  71         $$(call ExecuteWithLog, $$@, ( $$(DTRACE_GEN_OFFSETS_TOOL) -$$(strip $2) > $$@ ) )
  72 
  73       TARGETS += $1
  74     endef
  75 


< prev index next >