Description
When statically link both libmanagement and libmanagement_ext (see JDK-8303796 for more details), the linker reports failures due to multiple definitions of 'jmm_interface' and 'jmm_version', e.g.:
/.../lib/libmanagement_ext.a(management_ext.o):/.../src/jdk.management/share/native/libmanagement_ext/management_ext.c:34: multiple definition of `jmm_interface'; /.../build/linux-x86_64-server-slowdebug/images/static-libs/lib/libmanagement.a(management.o):/.../src/java.management/share/native/libmanagement/management.c:34: first defined here
/usr/bin/ld: /.../build/linux-x86_64-server-slowdebug/images/static-libs/lib/libmanagement_ext.a(management_ext.o):/.../src/jdk.management/share/native/libmanagement_ext/management_ext.c:36: multiple definition of `jmm_version'; /.../build/linux-x86_64-server-slowdebug/images/static-libs/lib/libmanagement.a(management.o):/.../src/java.management/share/native/libmanagement/management.c:36: first defined here
collect2: error: ld returned 1 exit status
/.../lib/libmanagement_ext.a(management_ext.o):/.../src/jdk.management/share/native/libmanagement_ext/management_ext.c:34: multiple definition of `jmm_interface'; /.../build/linux-x86_64-server-slowdebug/images/static-libs/lib/libmanagement.a(management.o):/.../src/java.management/share/native/libmanagement/management.c:34: first defined here
/usr/bin/ld: /.../build/linux-x86_64-server-slowdebug/images/static-libs/lib/libmanagement_ext.a(management_ext.o):/.../src/jdk.management/share/native/libmanagement_ext/management_ext.c:36: multiple definition of `jmm_version'; /.../build/linux-x86_64-server-slowdebug/images/static-libs/lib/libmanagement.a(management.o):/.../src/java.management/share/native/libmanagement/management.c:36: first defined here
collect2: error: ld returned 1 exit status
Attachments
Issue Links
- relates to
-
JDK-8303796 Optionally build fully statically linked JDK image
-
- Open
-