JDK-8215009 : GCC 8 compilation error in libjli
  • Type: Bug
  • Component: tools
  • Sub-Component: launcher
  • Affected Version: 11,13
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-12-07
  • Updated: 2021-05-07
  • Resolved: 2019-02-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13
11.0.12Fixed 13 b10Fixed
Related Reports
Relates :  
Description
GCC 8 reports an error:

* For target support_native_java.base_libjli_java_md_solinux.o:
src/java.base/unix/native/libjli/java_md_solinux.c: In function 'ContinueInNewThread0':
src/java.base/unix/native/libjli/java_md_solinux.c:747:37: error: cast between incompatible function types from 'int (*)(void *)' to 'void * (*)(void *)' [-Werror=cast-function-type]
     if (pthread_create(&tid, &attr, (void *(*)(void*))continuation, (void*)args) == 0) {
                                     ^

It can be silenced by explicit intermediate cast of continuation to void*.
Comments
jdk11 backport request I would like to have the patch in jdk11 as well, because the issue (especially gcc8 build problems) is present there too. The patch mostly applies, except copyright headers + java_md_macosx.c (which is part of the patch) was renamed by "8210931: JLI and launchers normalization and cleanup" to java_md_macosx.m . RFR for jdk11 : https://mail.openjdk.java.net/pipermail/jdk-updates-dev/2021-May/006061.html .
05-05-2021

Wrapper function solution: http://cr.openjdk.java.net/~dchuyko/8215009/webrev.01/ Variant JavaMain return type solution: http://cr.openjdk.java.net/~dchuyko/8215009/webrev.02/
22-02-2019

The one I tried is Linux (x86 and aarch64). But in fact signature is different from what system expects also on MacOS, Windows and Solaris.
22-02-2019

What platform produces this warning?
22-02-2019

http://cr.openjdk.java.net/~dchuyko/8215009/webrev.00/
10-12-2018