JDK-8250612 : jvmciCompilerToVM.cpp declares jio_printf with "void" return type, should be "int"
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11,15,16
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-07-27
  • Updated: 2020-09-01
  • Resolved: 2020-07-29
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 15 JDK 16
15.0.1Fixed 16 b08Fixed
Related Reports
Relates :  
Description
Building hotspot with LTO enabled: 

$ sh ./configure ... --with-extra-cxxflags="-flto -ffat-lto-objects -fcommon" --with-extra-cflags="-flto -ffat-lto-objects -fcommon"

Yields this warning:

/home/shade/trunks/jdk-jdk/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp:1576:17: warning: 'jio_printf' violates the C++ One Definition Rule [-Wodr]
 1576 | extern "C" void jio_printf(const char *fmt, ...);
      |                 ^
/home/shade/trunks/jdk-jdk/src/hotspot/share/prims/jvm.cpp:2961:15: note: return value type mismatch
 2961 | JNIEXPORT int jio_printf(const char *fmt, ...) {
      |               ^

It seems that only jvmciCompilerToVM.cpp declares the "void" return type.
Comments
Fix Request (15u) Fixes a minor issue that improves LTO compilation story. Patch applies cleanly to 15u, passes tier1 tests.
20-08-2020

The method is brought to upstream 13 with JDK-8223332. If JVMCI is updated in 11u, we would need this in 11u as well.
12-08-2020

URL: https://hg.openjdk.java.net/jdk/jdk/rev/f361b26f1a1c User: shade Date: 2020-07-29 07:48:23 +0000
29-07-2020

RFR: https://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2020-July/039223.html
28-07-2020

mach5-one-shade-JDK-8250612-20200727-1114-12962738 passed.
28-07-2020

diff -r cda47533b1ee src/hotspot/share/jvmci/jvmciCompilerToVM.cpp --- a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp Wed Jul 22 07:46:50 2020 -0700 +++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp Mon Jul 27 13:03:07 2020 +0200 @@ -1574,5 +1574,5 @@ // Creates a scope where the current thread is attached and detached // from HotSpot if it wasn't already attached when entering the scope. -extern "C" void jio_printf(const char *fmt, ...); +extern "C" int jio_printf(const char *fmt, ...); class AttachDetach : public StackObj { public:
27-07-2020