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

Resolve multiple definition of 'start_timer' when statically linking JDK native libraries with user code

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 22
    • None
    • client-libs
    • None
    • b09
    • generic
    • generic

    Description

      We ran into following linker error when statically linking JDK/hotspot native libraries with user natives:

      ld: error: duplicate symbol: start_timer
      >>> defined at awt_ImagingLib.c:190 (/t.../src/java.desktop/share/native/libawt/awt/medialib/awt_ImagingLib.c:190)
      >>> libawt_relocatable.o:(start_timer) in archive .../jdk/jdk11-k8/lib_static/libawt.a
      >>> defined at timing.c
      >>> .../timing.o:(.text+0x0)

      https://gitlab.com/graphviz/graphviz/-/blob/main/lib/common/timing.c is an example of the code defines 'start_timer'.

      Attachments

        Issue Links

          Activity

            People

              jiangli Jiangli Zhou
              jiangli Jiangli Zhou
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: