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

Resolve duplicate symbol of StringTable::StringTable with JDK static linking

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 22
    • hotspot
    • None

      'StringTable::StringTable' appears to be a more commonly used symbol. When statically linking JDK and hotspot native libraries with application's native and dependencies, we observed symbol issues like the following when the symbol is also defined by application native or other native libraries.

      ```
      ld: error: duplicate symbol: StringTable::StringTable()
      >>> defined at stringTable.cpp:198 (/.../src/hotspot/share/classfile/stringTable.cpp:198)
      >>> libjvm_relocatable.o:(StringTable::StringTable()) in archive .../java/jdk/jdk11-k8/lib_static/libjvm.a
      >>> defined at ...
      ```
      One solution is to move hotspot StringTable to an unique namespace, such as 'JavaClassFile'. That avoids having to fix the application or libraries code, which may not be practical. We've tested the namespace solution in prototype, which worked out well.

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

              Created:
              Updated: