-
Bug
-
Resolution: Fixed
-
P4
-
None
-
None
-
b24
Multiple definition of 'JNI_OnLoad_jsound' linker error is observed when partially linking (using '-r' linking option, e.g. see https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html) 'libjsound' natives. See JDK-8307858 comments for related information. The same linking error is also observable when statically linking with a libjsound.a created without partially linking.
/usr/bin/ld: /.../github/JDK-8307858/build/linux-x86_64-server-release/support/native/java.desktop/libjsound/static/Platform.o: in function `JNI_OnLoad_jsound':
Platform.c:(.text.JNI_OnLoad_jsound+0x0): multiple definition of `JNI_OnLoad_jsound'; /.../github/JDK-8307858/build/linux-x86_64-server-release/support/native/java.desktop/libjsound/static/PLATFORM_API_LinuxOS_ALSA_CommonUtils.o:PLATFORM_API_LinuxOS_ALSA_CommonUtils.c:(.text.JNI_OnLoad_jsound+0x0): first defined here
collect2: error: ld returned 1 exit status
The multiple definition of 'JNI_OnLoad_jsound' issue is because both src/java.desktop/linux/native/libjsound/PLATFORM_API_LinuxOS_ALSA_CommonUtils.c and src/java.desktop/share/native/libjsound/Platform.c have 'DEF_STATIC_JNI_OnLoad'.
/usr/bin/ld: /.../github/
Platform.c:(.text.JNI_OnLoad_jsound+0x0): multiple definition of `JNI_OnLoad_jsound'; /.../github/
collect2: error: ld returned 1 exit status
The multiple definition of 'JNI_OnLoad_jsound' issue is because both src/java.desktop/linux/native/libjsound/PLATFORM_API_LinuxOS_ALSA_CommonUtils.c and src/java.desktop/share/native/libjsound/Platform.c have 'DEF_STATIC_JNI_OnLoad'.
- relates to
-
JDK-8303796 Optionally build fully statically linked JDK image
-
- Open
-
-
JDK-8307858 [REDO] JDK-8307194 Add make target for optionally building a complete set of all JDK and hotspot libjvm static libraries
-
- Resolved
-