JDK-8293787 : Linux aarch64 build fails after 8292591
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 20
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: aarch64
  • Submitted: 2022-09-14
  • Updated: 2022-09-19
  • Resolved: 2022-09-14
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 20
20 b15Fixed
Related Reports
Relates :  
Description
After 8292591 we run into the following build error  on Linux aarch64:

* For target hotspot_variant-server_libjvm_objs_systemMemoryBarrier_linux.o:
/nb/linuxaarch64/jdk/src/hotspot/os/linux/systemMemoryBarrier_linux.cpp:41:4: error: #error define SYS_membarrier for the arch
   #error define SYS_membarrier for the arch
    ^~~~~
/nb/linuxaarch64/jdk/src/hotspot/os/linux/systemMemoryBarrier_linux.cpp: In function 'int membarrier(int, unsigned int, int)':
/nb/linuxaarch64/jdk/src/hotspot/os/linux/systemMemoryBarrier_linux.cpp:63:18: error: 'SYS_membarrier' was not declared in this scope
   return syscall(SYS_membarrier, cmd, flags, cpu_id); // cpu_id only on >= 5.10
                  ^~~~~~~~~~~~~~
/nb/linuxaarch64/jdk/src/hotspot/os/linux/systemMemoryBarrier_linux.cpp:63:18: note: suggested alternative: 'membarrier'
   return syscall(SYS_membarrier, cmd, flags, cpu_id); // cpu_id only on >= 5.10
                  ^~~~~~~~~~~~~~
                  membarrier

This could most likely be solved by adding a definition  for aarch64 to hotspot/os/linux/systemMemoryBarrier_linux.cpp .
On the mentioned linux aarch64 system  (kernel 5.15)  SYS_membarrier  is :  
aarch64-linux-gnu/bits/syscall.h:899:# define SYS_membarrier __NR_membarrier

asm-generic/unistd.h:755:#define __NR_membarrier 283


Comments
Changeset: 7f3250d7 Author: Matthias Baesken <mbaesken@openjdk.org> Date: 2022-09-14 10:29:12 +0000 URL: https://git.openjdk.org/jdk/commit/7f3250d71c4866a64eb73f52140c669fe90f122f
14-09-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/10265 Date: 2022-09-14 09:17:47 +0000
14-09-2022

We should check our devkit. Do we really need to build with such old headers? I guess it is not finally decided which kernel versions are officially supported by JDK 20 (https://wiki.openjdk.org/display/Build/Supported+Build+Platforms ). Maybe it still makes sense to define SYS_membarrier for some platforms which is easy to do.
14-09-2022