RFR: 8311661: Resolve duplicate symbol of StringTable::StringTable with JDK static linking [v2]

Thomas Stuefe stuefe at openjdk.org
Tue Jul 11 15:47:04 UTC 2023


On Mon, 10 Jul 2023 16:40:06 GMT, Jiangli Zhou <jiangli at openjdk.org> wrote:

>> Move StringTable to JavaClassFile namespace.
>
> Jiangli Zhou has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
> 
>  - Merge branch 'master' into JDK-8311661
>  - Move  '} // namespace JavaClassFile' to after '#endif //INCLUDE_CDS_JAVA_HEAP'.
>  - 8311661: Resolve duplicate symbol of StringTable::StringTable with JDK static linking

Hi,

to prevent clashes like this, libraries that support static linking tend to define a global namespace or a common prefix, usually switchable via defines. IIRC sqlite does this, zlib, jemalloc... If we could pull such a thing off with a minimum of invasiveness, it would be a much more robust solution.

If we introduce such a namespace, the name could be very short and non-descriptive, and then be defined (or completely switched off by default) via compile option. That way one could even link two hotspots if one wanted (only one usuable at a time for other reasons).

If combined with "using" somewhere, maybe in precompiled.hpp, this solution may not be that invasive.

Cheers, Thomas

-------------

PR Comment: https://git.openjdk.org/jdk/pull/14808#issuecomment-1631065356


More information about the graal-dev mailing list