# HG changeset patch # User ihse # Date 1519898560 -3600 # Node ID 1c5a3127046f921c96c08932b7e6beaddb1113b4 # Parent 0544ba555e671531d1c02df1eecc632b1e2d7d61 Use elfedit to silence linker warnings on solaris diff -r 0544ba555e67 -r 1c5a3127046f make/autoconf/basics.m4 --- a/make/autoconf/basics.m4 Thu Mar 01 01:35:46 2018 +0100 +++ b/make/autoconf/basics.m4 Thu Mar 01 11:02:40 2018 +0100 @@ -1127,6 +1127,8 @@ fi fi BASIC_REQUIRE_PROGS(SETFILE, SetFile) + elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then + BASIC_REQUIRE_PROGS(ELFEDIT, elfedit) fi ]) diff -r 0544ba555e67 -r 1c5a3127046f make/autoconf/spec.gmk.in --- a/make/autoconf/spec.gmk.in Thu Mar 01 01:35:46 2018 +0100 +++ b/make/autoconf/spec.gmk.in Thu Mar 01 11:02:40 2018 +0100 @@ -709,6 +709,7 @@ LDD:=@LDD@ OTOOL:=@OTOOL@ READELF:=@READELF@ +ELFEDIT:=@ELFEDIT@ EXPR:=@EXPR@ FILE:=@FILE@ DOT:=@DOT@ diff -r 0544ba555e67 -r 1c5a3127046f make/hotspot/lib/CompileDtracePostJvm.gmk --- a/make/hotspot/lib/CompileDtracePostJvm.gmk Thu Mar 01 01:35:46 2018 +0100 +++ b/make/hotspot/lib/CompileDtracePostJvm.gmk Thu Mar 01 11:02:40 2018 +0100 @@ -140,12 +140,17 @@ # Unfortunately dtrace generates incorrect types for some symbols in # dtrace_jhelper.o, resulting in "warning: symbol X has differing types" - # This is tracked in JDK-6890703. + # 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 + DTRACE_EXTERNAL_SYMBOLS := $(shell $(GREP) ^extern $(JHELPER_DTRACE_SRC) | $(AWK) '{ gsub(";","") ; print $$3 }') + DTRACE_ELFEDIT_COMMANDS := $(foreach symbol, $(DTRACE_EXTERNAL_SYMBOLS), \ + -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): $(TOPDIR)/src/hotspot/os/solaris/dtrace/jhelper.d \ - $(JVM_OFFSETS_INDEX_H) + $(DTRACE_JHELPER_OBJ): $(JHELPER_DTRACE_SRC) $(JVM_OFFSETS_INDEX_H) $(call LogInfo, Running dtrace for $( $(DTRACE_SUPPORT_DIR)/$(@F).d) $(call ExecuteWithLog, $@, $(DTRACE) $(DTRACE_FLAGS) -o $@ \ -s $(DTRACE_SUPPORT_DIR)/$(@F).d) + $(call ExecuteWithLog, $@.elfedit, $(ELFEDIT) $(DTRACE_ELFEDIT_COMMANDS) $@) ############################################################################ # Build the stand-alone dtrace libraries