JLI_Launch has mangled name in jli.dll when building for win32

Robert Lichtenberger r.lichtenberger at synedra.com
Mon Jul 15 14:59:36 UTC 2019

Thanks for pointing me into the right direction.

So it looks as if this kind of mangling is to be expected on win32,
which is also shown by the fact that multiple JDK-builds for win32, eg
AdoptOpenJDK or Liberica JDK have their jli.dll that way.

But that in turn means that jpackage should be prepared to handle this

To that end I've created
https://bugs.openjdk.java.net/browse/JDK-8227684 together with a patch
that would fix jpackage for win32.

Am 11.07.19 um 16:06 schrieb Thomas Stüfe:
> Hi Robert,
> This means that the function is using the __stdcall calling
> convention. I do not know whether this is correct or not, but caller
> and callee have to agree on the calling convention used, so the
> prototype for that function used when compiling the caller code must
> have been declared with __stdcall too for this to work.
> This is a 32bit Windows specialty. No other platform, including 64 bit
> Windows, has different calling conventions.
> Hope that helps,
> Cheers, Thomas
> On Thu, Jul 11, 2019, 09:34 Robert Lichtenberger
> <r.lichtenberger at synedra.com <mailto:r.lichtenberger at synedra.com>> wrote:
>     I have tried to use the jpackage EA version in combination with the
>     win32-build of Java 12 from AdoptOpenJDK.
>     I was able to build the jpackage EA from the sandbox and built an
>     image
>     from the win32 Java 12 build, which then was successfully combined
>     using
>     jpackage's --runtime-image option. (BTW I was able to produce working
>     packages for win64, mac and linux in that way).
>     Now when I tried to start the win32 package I get an error message:
>     Failed to locate JLI_Launch.
>     I digged into the jpackage/launcher code and found out that
>     runtime/bin/jli.dll is loaded and the function JLI_Launch is called.
>     But the jli.dll in the win32-build of Java 12 from AdoptOpenJDK has a
>     name mangled version  of JLI_Launch in it (_JLI_Launch at 56) which
>     is (I
>     think) the reason that the JVM cannot be started.
>     I've since tried to build Java 12 myself and the effect is
>     reproducible.
>     When I build for win64, the jli.dll is correct, when I build
>     --with-target-bits=32 from the exact same sources the jli.dll has the
>     mangled name.
>     Other pre-built JDKs (e.g. Liberica JDK) have the same "problem".
>     Any ideas/hints as to what could cause the problem would be most
>     welcome
>     :-).

More information about the build-dev mailing list