< prev index next >

make/hotspot/lib/CompileDtraceLibraries.gmk

Print this page

        

*** 21,176 **** # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA # or visit www.oracle.com if you need additional information or have any # questions. # - ################################################################################ - # Support for dtrace integration with libjvm, and stand-alone dtrace library - # compilation. - ifeq ($(call check-jvm-feature, dtrace), true) - ############################################################################## - ifeq ($(OPENJDK_TARGET_OS), solaris) - ############################################################################ - # Integrate with libjvm. Here we generate three object files which are - # linked with libjvm.so. This step is complicated from a dependency - # perspective, since it needs the rest of the compiled object files from the - # libjvm compilation, but the output is object files that are to be included - # when linking libjvm.so. So this generation must happen as a part of the - # libjvm compilation. - - # First we need to generate the dtraceGenOffsets tool. When run, this will - # produce more header files and a C++ file. - - # Note that generateJvmOffsets.cpp must be compiled as if it were a file - # in the libjvm.so, using JVM_CFLAGS as setup in CompileJvm.gmk. Otherwise - # this would preferrably have been done as a part of GensrcDtrace.gmk. - $(eval $(call SetupNativeCompilation, BUILD_DTRACE_GEN_OFFSETS, \ - NAME := dtraceGenOffsets, \ - TYPE := EXECUTABLE, \ - SRC := $(TOPDIR)/make/hotspot/src/native/dtrace, \ - TOOLCHAIN := $(TOOLCHAIN_BUILD), \ - LDFLAGS := -m64, \ - CFLAGS := -m64 $(JVM_CFLAGS), \ - OBJECT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/dtrace-gen-offsets/objs, \ - OUTPUT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/dtrace-gen-offsets, \ - )) - - DTRACE_GEN_OFFSETS_TOOL := $(BUILD_DTRACE_GEN_OFFSETS_TARGET) - - # Argument 1: Output filename - # Argument 2: dtrace-gen-offset tool command line option - define SetupDtraceOffsetsGeneration - $1: $$(BUILD_DTRACE_GEN_OFFSETS) - $$(call LogInfo, Generating dtrace $2 file $$(@F)) - $$(call MakeDir, $$(@D)) - $$(call ExecuteWithLog, $$@, ( $$(DTRACE_GEN_OFFSETS_TOOL) -$$(strip $2) > $$@ ) ) - - TARGETS += $1 - endef - - JVM_OFFSETS_H := $(DTRACE_SUPPORT_DIR)/JvmOffsets.h - JVM_OFFSETS_CPP := $(DTRACE_SUPPORT_DIR)/JvmOffsets.cpp - JVM_OFFSETS_INDEX_H := $(DTRACE_SUPPORT_DIR)/JvmOffsetsIndex.h - - # Run the dtrace-gen-offset tool to generate these three files. - # The generated JvmOffsets.cpp is compiled with the rest of libjvm. - $(eval $(call SetupDtraceOffsetsGeneration, $(JVM_OFFSETS_H), header)) - $(eval $(call SetupDtraceOffsetsGeneration, $(JVM_OFFSETS_INDEX_H), index)) - $(eval $(call SetupDtraceOffsetsGeneration, $(JVM_OFFSETS_CPP), table)) - - ############################################################################ - # Generate DTRACE_OBJ which is linked with libjvm.so. - - # Concatenate all *.d files into a single file - DTRACE_SOURCE_FILES := $(addprefix $(TOPDIR)/src/hotspot/os/posix/dtrace/, \ - hotspot_jni.d \ - hotspot.d \ - hs_private.d \ - ) - - $(JVM_OUTPUTDIR)/objs/dtrace.d: $(DTRACE_SOURCE_FILES) - $(call LogInfo, Generating $(@F)) - $(call MakeDir, $(@D)) - $(CAT) $^ > $@ - - DTRACE_INSTRUMENTED_OBJS := $(addprefix $(JVM_OUTPUTDIR)/objs/, \ - ciEnv.o \ - classLoadingService.o \ - compileBroker.o \ - hashtable.o \ - instanceKlass.o \ - java.o \ - jni.o \ - jvm.o \ - memoryManager.o \ - nmethod.o \ - objectMonitor.o \ - runtimeService.o \ - sharedRuntime.o \ - synchronizer.o \ - thread.o \ - unsafe.o \ - vmThread.o \ - vmGCOperations.o \ - ) - - ifeq ($(call check-jvm-feature, all-gcs), true) - DTRACE_INSTRUMENTED_OBJS += $(addprefix $(JVM_OUTPUTDIR)/objs/, \ - vmCMSOperations.o \ - vmPSOperations.o \ - ) - endif - - DTRACE_FLAGS := -64 -G - DTRACE_CPP_FLAGS := -D_LP64 - - # Make sure we run our selected compiler for preprocessing instead of letting - # the dtrace tool pick it on it's own. - $(DTRACE_OBJ): $(JVM_OUTPUTDIR)/objs/dtrace.d $(DTRACE_INSTRUMENTED_OBJS) - $(call LogInfo, Generating $(@F) from $(<F) and object files) - $(call MakeDir, $(DTRACE_SUPPORT_DIR)) - $(call ExecuteWithLog, $(DTRACE_SUPPORT_DIR)/$(@F).d, \ - ($(CPP) $(DTRACE_CPP_FLAGS) $< > $(DTRACE_SUPPORT_DIR)/$(@F).d)) - $(call ExecuteWithLog, $@, $(DTRACE) $(DTRACE_FLAGS) -xlazyload -o $@ \ - -s $(DTRACE_SUPPORT_DIR)/$(@F).d $(sort $(DTRACE_INSTRUMENTED_OBJS))) - - ############################################################################ - # Generate DTRACE_JHELPER_OBJ which is linked with libjvm.so. - - # Unfortunately dtrace generates incorrect types for some symbols in - # dtrace_jhelper.o, resulting in "warning: symbol X has differing types" - # See JDK-6890703 for details. - # We work around this by fixing the types for these symbols using elfedit, - # after dtrace has generated the .o file. - JHELPER_DTRACE_SRC := $(TOPDIR)/src/hotspot/os/solaris/dtrace/jhelper.d - - GetElfeditCommands = \ - $(foreach symbol, \ - $(shell $(GREP) ^extern $(JHELPER_DTRACE_SRC) | $(AWK) '{ gsub(";","") ; print $$3 }'), \ - -e 'sym:st_type $(symbol) 1') - - # Make sure we run our selected compiler for preprocessing instead of letting - # the dtrace tool pick it on it's own. - $(DTRACE_JHELPER_OBJ): $(JHELPER_DTRACE_SRC) $(JVM_OFFSETS_INDEX_H) - $(call LogInfo, Running dtrace for $(<F)) - $(call MakeDir, $(DTRACE_SUPPORT_DIR)) - $(call ExecuteWithLog, $(DTRACE_SUPPORT_DIR)/$(@F).d, \ - ($(CPP) $(DTRACE_CPP_FLAGS) -I$(DTRACE_SUPPORT_DIR) $^ \ - > $(DTRACE_SUPPORT_DIR)/$(@F).d)) - $(call ExecuteWithLog, $@, $(DTRACE) $(DTRACE_FLAGS) -o $@ \ - -s $(DTRACE_SUPPORT_DIR)/$(@F).d) - ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc) - $(call ExecuteWithLog, $@.elfedit, $(ELFEDIT) $(call GetElfeditCommands) $@) - endif ############################################################################ ! # Build the stand-alone dtrace libraries LIBJVM_DTRACE_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/libjvm_dtrace - $(eval $(call SetupNativeCompilation, BUILD_LIBJVM_DTRACE, \ NAME := jvm_dtrace, \ OUTPUT_DIR := $(JVM_LIB_OUTPUTDIR), \ SRC := $(TOPDIR)/src/java.base/solaris/native/libjvm_dtrace, \ CFLAGS := -m64 -G -mt -KPIC, \ --- 21,37 ---- # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA # or visit www.oracle.com if you need additional information or have any # questions. # ifeq ($(call check-jvm-feature, dtrace), true) ifeq ($(OPENJDK_TARGET_OS), solaris) ############################################################################ ! # Build the stand-alone dtrace libraries. LIBJVM_DTRACE_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/libjvm_dtrace $(eval $(call SetupNativeCompilation, BUILD_LIBJVM_DTRACE, \ NAME := jvm_dtrace, \ OUTPUT_DIR := $(JVM_LIB_OUTPUTDIR), \ SRC := $(TOPDIR)/src/java.base/solaris/native/libjvm_dtrace, \ CFLAGS := -m64 -G -mt -KPIC, \
*** 178,203 **** LIBS := $(LIBDL) -lthread -ldoor, \ MAPFILE := $(TOPDIR)/make/mapfiles/libjvm_dtrace/mapfile-vers, \ OBJECT_DIR := $(LIBJVM_DTRACE_OUTPUTDIR)/objs, \ )) - LIBJVM_DB_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/libjvm_db - # Note that libjvm_db.c has tests for COMPILER2, but this was never set by # the old build. $(eval $(call SetupNativeCompilation, BUILD_LIBJVM_DB, \ NAME := jvm_db, \ OUTPUT_DIR := $(JVM_LIB_OUTPUTDIR), \ SRC := $(TOPDIR)/src/java.base/solaris/native/libjvm_db, \ ! CFLAGS := -I$(JVM_VARIANT_OUTPUTDIR)/gensrc -I$(DTRACE_SUPPORT_DIR) \ ! -m64 -G -mt -KPIC, \ LDFLAGS := -m64 -mt -xnolib $(SHARED_LIBRARY_FLAGS), \ MAPFILE := $(TOPDIR)/make/mapfiles/libjvm_db/mapfile-vers, \ OBJECT_DIR := $(LIBJVM_DB_OUTPUTDIR)/objs, \ )) - # We need the generated JvmOffsets.h before we can compile the libjvm_db source code. - $(BUILD_LIBJVM_DB_ALL_OBJS): $(JVM_OFFSETS_H) - TARGETS += $(BUILD_LIBJVM_DTRACE) $(BUILD_LIBJVM_DB) endif endif --- 39,60 ---- LIBS := $(LIBDL) -lthread -ldoor, \ MAPFILE := $(TOPDIR)/make/mapfiles/libjvm_dtrace/mapfile-vers, \ OBJECT_DIR := $(LIBJVM_DTRACE_OUTPUTDIR)/objs, \ )) # Note that libjvm_db.c has tests for COMPILER2, but this was never set by # the old build. + LIBJVM_DB_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/libjvm_db $(eval $(call SetupNativeCompilation, BUILD_LIBJVM_DB, \ NAME := jvm_db, \ OUTPUT_DIR := $(JVM_LIB_OUTPUTDIR), \ SRC := $(TOPDIR)/src/java.base/solaris/native/libjvm_db, \ ! CFLAGS := -I$(DTRACE_GENSRC_DIR) -m64 -G -mt -KPIC, \ LDFLAGS := -m64 -mt -xnolib $(SHARED_LIBRARY_FLAGS), \ MAPFILE := $(TOPDIR)/make/mapfiles/libjvm_db/mapfile-vers, \ OBJECT_DIR := $(LIBJVM_DB_OUTPUTDIR)/objs, \ )) TARGETS += $(BUILD_LIBJVM_DTRACE) $(BUILD_LIBJVM_DB) + endif endif
< prev index next >