JDK-8341644 : Compile error in cgroup coding when using toolchain clang
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 24
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: generic
  • Submitted: 2024-10-07
  • Updated: 2025-07-04
  • Resolved: 2024-10-08
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 21 JDK 24
21.0.9Fixed 24 b19Fixed
Related Reports
Causes :  
Relates :  
Description
When building on Linux but with toolchain-type clang , I run into this error :

=== Output from failing command(s) repeated here ===
* For target hotspot_variant-server_libjvm_objs_cgroupSubsystem_linux.o:
In file included from /jdk/src/hotspot/os/linux/cgroupSubsystem_linux.cpp:30:
/jdk/src/hotspot/os/linux/cgroupV2Subsystem_linux.hpp:67:17: error: 'subsystem_path' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
    const char* subsystem_path() {
                ^
/jdk/src/hotspot/os/linux/cgroupSubsystem_linux.hpp:213:25: note: overridden virtual function is here
    virtual const char* subsystem_path() = 0;
                        ^
In file included from /jdk/src/hotspot/os/linux/cgroupSubsystem_linux.cpp:30:
/jdk/src/hotspot/os/linux/cgroupV2Subsystem_linux.hpp:73:10: error: 'set_subsystem_path' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
    void set_subsystem_path(const char* cgroup_path) {
         ^
/jdk/src/hotspot/os/linux/cgroupSubsystem_linux.hpp:214:18: note: overridden virtual function is here
    virtual void set_subsystem_path(const char* cgroup_path) = 0;
                 ^
In file included from /jdk/src/hotspot/os/linux/cgroupSubsystem_linux.cpp:30:
   ... (rest of output omitted)
* For target hotspot_variant-server_libjvm_objs_cgroupV2Subsystem_linux.o:
In file included from /jdk/src/hotspot/os/linux/cgroupV2Subsystem_linux.cpp:25:
/jdk/src/hotspot/os/linux/cgroupV2Subsystem_linux.hpp:67:17: error: 'subsystem_path' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
    const char* subsystem_path() {
                ^
/jdk/src/hotspot/os/linux/cgroupSubsystem_linux.hpp:213:25: note: overridden virtual function is here
    virtual const char* subsystem_path() = 0;
                        ^
In file included from /jdk/src/hotspot/os/linux/cgroupV2Subsystem_linux.cpp:25:
/jdk/src/hotspot/os/linux/cgroupV2Subsystem_linux.hpp:73:10: error: 'set_subsystem_path' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
    void set_subsystem_path(const char* cgroup_path) {
         ^
/jdk/src/hotspot/os/linux/cgroupSubsystem_linux.hpp:214:18: note: overridden virtual function is here
    virtual void set_subsystem_path(const char* cgroup_path) = 0;
                 ^
In file included from /jdk/src/hotspot/os/linux/cgroupV2Subsystem_linux.cpp:25:
   ... (rest of output omitted)


We use this clang on the build machine
clang --version
clang version 15.0.7
Target: x86_64-suse-linux


Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk21u-dev/pull/1934 Date: 2025-07-02 16:33:39 +0000
03-07-2025

[jdk21u-fix-request] Approval Request from Jan Kratochvil There is needed a backport for 21u to fix clang compilation after https://github.com/openjdk/jdk21u-dev/pull/1664 gets checked in. It is a clean backport.
03-07-2025

Changeset: 6e486181 Branch: master Author: Matthias Baesken <mbaesken@openjdk.org> Date: 2024-10-08 12:36:31 +0000 URL: https://git.openjdk.org/jdk/commit/6e486181613bde8da6874eeed680c7136e8d778a
08-10-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/21391 Date: 2024-10-07 15:23:09 +0000
07-10-2024