JDK-8295395 : Linux Alpha Zero builds fail after JDK-8292591
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 20
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-10-17
  • Updated: 2024-05-14
  • Resolved: 2022-10-17
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 b20Fixed
Related Reports
Relates :  
Relates :  
Description
```
* For target hotspot_variant-zero_libjvm_objs_systemMemoryBarrier_linux.o:
cc1plus: warning: -fstack-protector not supported for this target
src/hotspot/os/linux/systemMemoryBarrier_linux.cpp:43:4: error: #error define SYS_membarrier for the arch
   #error define SYS_membarrier for the arch
    ^~~~~
src/hotspot/os/linux/systemMemoryBarrier_linux.cpp: In function 'int membarrier(int, unsigned int, int)':
src/hotspot/os/linux/systemMemoryBarrier_linux.cpp:65:18: error: 'SYS_membarrier' was not declared in this scope
   return syscall(SYS_membarrier, cmd, flags, cpu_id); // cpu_id only on >= 5.10
                  ^~~~~~~~~~~~~~
At global scope:
```

This only fails with Debian 9 (GCC 6, GLIBC 2.24, Linux 4.9), more recent versions have the definition.

There:

```
/usr/alpha-linux-gnu/include/bits/syscall.h
898:#ifdef __NR_membarrier
899:# define SYS_membarrier __NR_membarrier

/usr/alpha-linux-gnu/include/asm-generic/unistd.h
755:#define __NR_membarrier 283
756:__SYSCALL(__NR_membarrier, sys_membarrier)
```

We can just add the fallback definition in the relevant block.
Comments
Changeset: b269c51d Author: Aleksey Shipilev <shade@openjdk.org> Date: 2022-10-17 17:56:49 +0000 URL: https://git.openjdk.org/jdk/commit/b269c51d10c353d9b7143b2239beb23c01352182
17-10-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/10721 Date: 2022-10-17 07:44:55 +0000
17-10-2022