RFR: 8305935: Resolve multiple definition of 'jmm_<interface|version>' when statically linking with JDK native libraries

David Holmes dholmes at openjdk.org
Fri Apr 14 05:23:33 UTC 2023


On Wed, 12 Apr 2023 23:35:02 GMT, Jiangli Zhou <jiangli at openjdk.org> wrote:

> Rename 'jmm_<interface|version>' to 'jmm_<interface|version>_management_ext' in libmanagement_ext to resolve related linker errors when statically linking with both libmanagement and libmanagement_ext.

One small request but otherwise okay.

In wonder if @magicus or @erikj79 have anything to add from a build perspective?

Thanks for the extended discussion on the potential options here.

src/jdk.management/share/native/libmanagement_ext/management_ext.c line 34:

> 32: #define ERR_MSG_SIZE 128
> 33: 
> 34: const JmmInterface* jmm_interface_management_ext = NULL;

Can you add a comment before declaring the two "exported" symbols together:

// These symbols are global in this library but need to be uniquely named to avoid conflicts
// with same-named symbols in other libraries, when statically linking.

Thanks.

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

Marked as reviewed by dholmes (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/13451#pullrequestreview-1384611991
PR Review Comment: https://git.openjdk.org/jdk/pull/13451#discussion_r1166286584


More information about the serviceability-dev mailing list