155 ############################################################################ |
155 ############################################################################ |
156 # Generate DTRACE_JHELPER_OBJ which is linked with libjvm.so. |
156 # Generate DTRACE_JHELPER_OBJ which is linked with libjvm.so. |
157 |
157 |
158 # Unfortunately dtrace generates incorrect types for some symbols in |
158 # Unfortunately dtrace generates incorrect types for some symbols in |
159 # dtrace_jhelper.o, resulting in "warning: symbol X has differing types" |
159 # dtrace_jhelper.o, resulting in "warning: symbol X has differing types" |
160 # This is tracked in JDK-6890703. |
160 # See JDK-6890703 for details. |
161 $(DTRACE_JHELPER_OBJ): $(TOPDIR)/src/hotspot/os/solaris/dtrace/jhelper.d \ |
161 # We work around this by fixing the types for these symbols using elfedit, |
162 $(JVM_OFFSETS_INDEX_H) |
162 # after dtrace has generated the .o file. |
|
163 JHELPER_DTRACE_SRC := $(TOPDIR)/src/hotspot/os/solaris/dtrace/jhelper.d |
|
164 DTRACE_EXTERNAL_SYMBOLS := $(shell $(GREP) ^extern $(JHELPER_DTRACE_SRC) | $(AWK) '{ gsub(";","") ; print $$3 }') |
|
165 DTRACE_ELFEDIT_COMMANDS := $(foreach symbol, $(DTRACE_EXTERNAL_SYMBOLS), \ |
|
166 -e 'sym:st_type $(symbol) 1') |
|
167 |
|
168 $(DTRACE_JHELPER_OBJ): $(JHELPER_DTRACE_SRC) $(JVM_OFFSETS_INDEX_H) |
163 $(call LogInfo, Running dtrace for $(<F)) |
169 $(call LogInfo, Running dtrace for $(<F)) |
164 $(call ExecuteWithLog, $@, $(DTRACE) $(DTRACE_FLAGS) $(DTRACE_CPP_FLAGS) -C \ |
170 $(call ExecuteWithLog, $@, $(DTRACE) $(DTRACE_FLAGS) $(DTRACE_CPP_FLAGS) -C \ |
165 -I$(DTRACE_SUPPORT_DIR) -o $@ -s $<) |
171 -I$(DTRACE_SUPPORT_DIR) -o $@ -s $<) |
166 |
172 $(call ExecuteWithLog, $@.elfedit, $(ELFEDIT) $(DTRACE_ELFEDIT_COMMANDS) $@) |
167 # NOTE: We should really do something like this, but unfortunately this |
|
168 # results in a compilation error. :-( |
|
169 # $(call MakeDir, $(DTRACE_SUPPORT_DIR)) |
|
170 # $(call ExecuteWithLog, $(DTRACE_SUPPORT_DIR)/$(@F).d, $(CC) -E \ |
|
171 # $(DTRACE_CPP_FLAGS) -I$(DTRACE_SUPPORT_DIR) $^ \ |
|
172 # > $(DTRACE_SUPPORT_DIR)/$(@F).d) |
|
173 # $(call ExecuteWithLog, $@, $(DTRACE) $(DTRACE_FLAGS) -o $@ \ |
|
174 # -s $(DTRACE_SUPPORT_DIR)/$(@F).d) |
|
175 |
173 |
176 ############################################################################ |
174 ############################################################################ |
177 # Build the stand-alone dtrace libraries |
175 # Build the stand-alone dtrace libraries |
178 |
176 |
179 LIBJVM_DTRACE_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/libjvm_dtrace |
177 LIBJVM_DTRACE_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/libjvm_dtrace |