Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8198859

Use elfedit to silence linker warnings on solaris

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 11
    • 11
    • infrastructure
    • None
    • b04

      Solaris builds have always produced a lot of warnings when linking, like this:
      ld: fatal: symbol '__JvmOffsets' has differing types:
      (file /export/home/magnusi/hg/sandbox-cflags/build/solaris-sparcv9/hotspot/variant-server/libjvm/objs/JvmOffsets.o type=OBJT; file /export/home/magnusi/hg/sandbox-cflags/build/solaris-sparcv9/hotspot/variant-server/libjvm/objs/dtrace_jhelper.o type=FUNC);

      This is due to an unresolved bug in dtrace. However, I just discovered that we can actually use elfedit to fix the type of the fields that the linker is complaining about, like this:

      $(call ExecuteWithLog, $@, elfedit -e 'sym:st_type __JvmOffsets 1' \
      -e 'sym:st_type __1cHnmethodG__vtbl_ 1' -e 'sym:st_type __1cIUniverseO_collectedHeap_ 1' \
      -e 'sym:st_type __1cJCodeCacheG_heaps_ 1' -e 'sym:st_type __1cKBufferBlobG__vtbl_ 1' \
      -e 'sym:st_type __1cGMethodG__vtbl_ 1' $@)

      on $(DTRACE_JHELPER_OBJ).

      That will make the linker quiet. (And might even allow us to add -Wl,-z,fatal-warnings to the linker, unless running with warnings-as-errors disabled)

            ihse Magnus Ihse Bursie
            ihse Magnus Ihse Bursie
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: