compiling openJdk 11 on windows 7 32bits fail

Magnus Ihse Bursie magnus.ihse.bursie at
Fri Feb 15 11:05:08 UTC 2019

On 2019-02-12 15:42, Alexey Ivanov wrote:
> On 12/02/2019 14:37, Magnus Ihse Bursie wrote:
>> There has been some fallout due to the mapfile/linking changes made 
>> in JDK 12 that affected JNICALL. However, that should not be 
>> affecting JDK 11.
> Wasn't it done in JDK 11?
> If my memory serves me right, it was done in JDK 11.

You are correct. The major part of the mapfile removal was done in 
JDK-8200358, which was pushed to JDK 11. There were follow up issues 
going on all the way into JDK 12, though.

Anyway, I've now looked more into this issue. And this time map files 
were not really to blame, but JNICALL still is.

First of all, it's important to note that this only shows up when 
compiling a debug build. As a workaround, building a normal release 
build for 32-bit Windows will not trigger this issue. (This is likely 
how it has gotten unnoticed.) To Franco: that means removing 
"--enable-debug" from your configure line.

There core problem seems indeed to be discrepancy whether a function is 
declared JNICALL or not.

In JDK-8214120, DTrace_VPrintln() & co. got JNICALL added in 
src/java.desktop/share/native/common/awt/debug/debug_trace.c and 
debug_trace.h. However, the typedef DTRACE_PRINT_CALLBACK was not 
updated. Since JNICALL is a no-op on all platforms except Windows 32, 
this was not discovered.

However, according to JBS JDK-8214120 was fixed in JDK-12. So why this 
is causing issues in JDK-11, I don't understand. Or maybe the discussion 
drifted from testing JDK 11 to testing JDK 12? In any case, it is likely 
currently broken in JDK 13.

Here is a suggested patch. Hopefully I got the JNICALL modifier in the 
correct place (C function pointer typedefs are the worst!).

diff --git 
--- a/src/java.desktop/share/native/common/awt/debug/debug_trace.h
+++ b/src/java.desktop/share/native/common/awt/debug/debug_trace.h
@@ -48,7 +48,7 @@
  typedef void (*DTRACE_OUTPUT_CALLBACK)(const char * msg);

  /* prototype for client provided print callback function */
-typedef void (*DTRACE_PRINT_CALLBACK)(const char * file, int line, int 
argc, const char * fmt, va_list arglist);
+typedef void (JNICALL *DTRACE_PRINT_CALLBACK)(const char * file, int 
line, int argc, const char * fmt, va_list arglist);

  extern void DTrace_EnableAll(dbool_t enabled);
  extern void DTrace_EnableFile(const char * file, dbool_t enabled);

Please test and let me know if it works. If so it should be pushed to 
JDK 13, and possibly backported.


More information about the build-dev mailing list