JDK-8203301 : Linux-sparc fails to build after JDK-8199712 (Flight Recorder)
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: sparc
  • Submitted: 2018-05-16
  • Updated: 2018-06-26
  • Resolved: 2018-06-13
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
11 b19Fixed
Related Reports
Relates :  
Description
Hotspot no longer builds on linux-sparc after 8199712:

=== Output from failing command(s) repeated here ===
/usr/bin/printf "* For target hotspot_variant-server_libjvm_objs_os_perf_linux.o:\n" 
* For target hotspot_variant-server_libjvm_objs_os_perf_linux.o:
(/bin/grep -v -e "^Note: including file:" <  /srv/glaubitz/jdk/build/linux-sparcv9-normal-server-release/make-support/failure-logs/hotspot_variant-server_libjvm_objs_os_perf_linux.o.log || true) | /usr/bin/head -n 12 
/srv/glaubitz/jdk/src/hotspot/os/linux/os_perf_linux.cpp: In member function ���bool CPUInformationInterface::initialize()���:
/srv/glaubitz/jdk/src/hotspot/os/linux/os_perf_linux.cpp:1028:45: error: ���VM_Version_Ext��� has not been declared
   _cpu_info->set_number_of_hardware_threads(VM_Version_Ext::number_of_threads());
                                             ^~~~~~~~~~~~~~
/srv/glaubitz/jdk/src/hotspot/os/linux/os_perf_linux.cpp:1029:34: error: ���VM_Version_Ext��� has not been declared
   _cpu_info->set_number_of_cores(VM_Version_Ext::number_of_cores());
                                  ^~~~~~~~~~~~~~
/srv/glaubitz/jdk/src/hotspot/os/linux/os_perf_linux.cpp:1030:36: error: ���VM_Version_Ext��� has not been declared
   _cpu_info->set_number_of_sockets(VM_Version_Ext::number_of_sockets());
                                    ^~~~~~~~~~~~~~
/srv/glaubitz/jdk/src/hotspot/os/linux/os_perf_linux.cpp:1031:27: error: ���VM_Version_Ext��� has not been declared
   _cpu_info->set_cpu_name(VM_Version_Ext::cpu_name());
if test `/usr/bin/wc -l < /srv/glaubitz/jdk/build/linux-sparcv9-normal-server-release/make-support/failure-logs/hotspot_variant-server_libjvm_objs_os_perf_linux.o.log` -gt 12; then /bin/echo "   ... (rest of output omitted)" ; fi 
   ... (rest of output omitted)
/usr/bin/printf "\n* All command lines available in /srv/glaubitz/jdk/build/linux-sparcv9-normal-server-release/make-support/failure-logs.\n" 

* All command lines available in /srv/glaubitz/jdk/build/linux-sparcv9-normal-server-release/make-support/failure-logs.
/usr/bin/printf "=== End of repeated output ===\n"  
=== End of repeated output ===

A first step to fix the problem is adding the missing include for linux-sparc:

diff -r 781f36c0831e src/hotspot/os/linux/os_perf_linux.cpp
--- a/src/hotspot/os/linux/os_perf_linux.cpp	Wed May 16 13:14:58 2018 +0200
+++ b/src/hotspot/os/linux/os_perf_linux.cpp	Wed May 16 15:39:14 2018 +0200
@@ -40,6 +40,9 @@
 #include "vm_version_ext_aarch64.hpp"
 #endif
 #endif
+#ifdef SPARC
+#include "vm_version_ext_sparc.hpp"
+#endif

 #include <stdio.h>
 #include <stdarg.h>

However, the build still fails as vm_ext_version_sparc.{hpp,cpp} was written with Solaris in mind only:

=== Output from failing command(s) repeated here ===
/usr/bin/printf "* For target hotspot_variant-server_libjvm_objs_os_perf_linux.o:\n" 
* For target hotspot_variant-server_libjvm_objs_os_perf_linux.o:
(/bin/grep -v -e "^Note: including file:" <  /srv/glaubitz/jdk/build/linux-sparcv9-normal-server-release/make-support/failure-logs/hotspot_variant-server_libjvm_objs_os_perf_linux.o.log || true) | /usr/bin/head -n 12 
In file included from /srv/glaubitz/jdk/src/hotspot/os/linux/os_perf_linux.cpp:43:0:
/srv/glaubitz/jdk/src/hotspot/cpu/sparc/vm_version_ext_sparc.hpp:30:10: fatal error: kstat.h: No such file or directory
 #include <kstat.h>
          ^~~~~~~~~
compilation terminated.
if test `/usr/bin/wc -l < /srv/glaubitz/jdk/build/linux-sparcv9-normal-server-release/make-support/failure-logs/hotspot_variant-server_libjvm_objs_os_perf_linux.o.log` -gt 12; then /bin/echo "   ... (rest of output omitted)" ; fi 
/usr/bin/printf "\n* All command lines available in /srv/glaubitz/jdk/build/linux-sparcv9-normal-server-release/make-support/failure-logs.\n" 

* All command lines available in /srv/glaubitz/jdk/build/linux-sparcv9-normal-server-release/make-support/failure-logs.
/usr/bin/printf "=== End of repeated output ===\n"  
=== End of repeated output ===