[WXP]: Help on JNI_CreateJavaVM exported symbol in jvm.dll
Steve Bohne
Stephen.Bohne at Sun.COM
Thu Apr 10 14:49:14 UTC 2008
Francis:
Look in build/windows/makefiles/vm.make:
LINK_FLAGS=$(LINK_FLAGS) $(STACK_SIZE) /subsystem:windows /dll
/base:0x8000000 \
/export:JNI_GetDefaultJavaVMInitArgs /export:JNI_CreateJavaVM \
/export:JNI_GetCreatedJavaVMs /export:jio_snprintf \
/export:jio_printf /export:jio_fprintf \
/export:jio_vfprintf /export:jio_vsnprintf $(AGCT_EXPORT) \
/export:JVM_GetVersionInfo \
/export:JVM_GetThreadStateNames /export:JVM_GetThreadStateValues \
/export:JVM_InitAgentProperties
Are those export directives specified somewhere in your build?
Also, I am not sure of the details of your effort, but the hotspot build
already has some support for creating a VS2003 project and building that
way. See build/windows/create.bat. However, this facility isn't used
much and it's probably bit rotted somewhat, so it may be broken. But
maybe it could help you in what you're trying to do.
Steve
Francis ANDRE wrote:
> Hi All
>
>
> For those interested in, I am building an msvc_2003 solution for the
> Hotspot JVM (compiler2 for now, compiler1 and kernel after) with the
> includes from the windows-i586-debug directory and using at link time
> the vm.def generated by the make debug_build.
>
> At run time, the java.exe fails to execute because the
> bin/server/jvm.dll does not export the JNI_CreateJava &
> JNI_GetDefaultJavaVMInitArgs symbols as expected by
> jdk/src/windows/bin/java_md.c:
>
> jboolean
> LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn)
> ...
> ifn->CreateJavaVM =
> (void *)GetProcAddress(handle, "JNI_CreateJavaVM");
> ifn->GetDefaultJavaVMInitArgs =
> (void *)GetProcAddress(handle, "JNI_GetDefaultJavaVMInitArgs");
> if (ifn->CreateJavaVM == 0 || ifn->GetDefaultJavaVMInitArgs == 0) {
> ReportErrorMessage(JNI_ERROR1, (char *)jvmpath);
> return JNI_FALSE;
> }
>
> As the matter of fact, this is correct because the exported symbols are
> those:
> 2372 943 0001F47E _JNI_CreateJavaVM at 12
> 2373 944 0002D05B _JNI_GetCreatedJavaVMs at 12
> 2374 945 00012382 _JNI_GetDefaultJavaVMInitArgs at 4
>
> while they should be like the one extracted from the build from make:
> 1259 4EA 001B0810 JNI_CreateJavaVM
> 1260 4EB 001B0930 JNI_GetCreatedJavaVMs
> 1261 4EC 001B0770 JNI_GetDefaultJavaVMInitArgs
>
>
> but I did not find how to export those undecorated symbols instead. How
> the build is producing those symbols??
>
> TIA
>
> FA
>
> PS: BTW, why the solaris and linux get a os/java_md.c and not windows??
More information about the build-dev
mailing list