Skip to content

Guest Additions fail to compile on CentOS9/Alma9/etc, struct drm_driver̉ has no member named ‘lastclose' #12

@psmears

Description

@psmears

As reported in this thread (although several different issues are reported in that thread), VirtualBox Guest Additions fail to compile on CentOS9/Alma9 (and presumably also RHEL9).

This is still seen with VirtualBox 7.1.8.

The compile error is as follows:

/tmp/vbox.0/vbox_drv.c:372:10: error: ‘struct drm_driver̉ has no member named ‘lastclosẻ; did you mean ‘postclosẻ?
  372 |         .master_drop = vbox_master_drop,
      |          ^~~~~~~~~
      |          postclose
/tmp/vbox.0/vbox_drv.c:372:22: error: initialization of ‘const struct drm_ioctl_desc *̉ from incompatible pointer type ‘void (*)(struct drm_device *)̉ [-Werror=incompatible-pointer-types]
  372 |         .master_drop = vbox_master_drop,
      |                      ^~~~~~~~~~~~~~~~~~~
/tmp/vbox.0/vbox_drv.c:372:22: note: (near initialization for ‘driver.ioctls̉)
cc1: some warnings being treated as errors

The error (at least, the lastclose part) seems to be because RedHat have backported some DRM changes from later kernels to this version: the affected lines of vbox_drv.c look like this:

#if RTLNX_VER_MAX(6,12,0)
        .lastclose = vbox_driver_lastclose,
#endif

... and indeed, in kernel.org kernels lastclose wasn't removed until kernel version 6.12 - but CentOS9 etc have 5.14.0 but with the later DRM changes backported, so the #if takes a path that doesn't match the kernel source.

This seems to be similar to VirtualBox issue 19391, where backported DRM changes caused the guest additions to fail to compile on RedHat-flavour kernels; perhaps a similar workaround can be used in this case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions