Issue Building Kernel Modules on OEL 8.7

Discussions related to using VirtualBox on Linux hosts.
Post Reply
BDub122
Posts: 7
Joined: 11. Oct 2014, 15:30

Issue Building Kernel Modules on OEL 8.7

Post by BDub122 »

I can't get the VirtualBox kernel modules to build OEL 8.7 with the 5.15.0-5.76.5.1-el8uek.x86_64 kernel.

This is a fresh install of VirtualBox 7.

I installed pre-requs:

Code: Select all

dnf install kernel-uek-devel-$(uname -r)
dnf install gcc make bzip2 perl dkms
Building kernel modules fails. /var/log/vbox-setup.log shows at the top that the kernel was built with gc 11.2.1 and I was using gcc 8.5.0. I worked around that issue with these commands:

Code: Select all

mv /usr/bin/gcc /tmp
(so that I can put it back after getting the kernel modules to build)

Code: Select all

ln -s /opt/rh/gcc-toolset-11/root/usr/bin/gcc /usr/bin/gcc
Now when I run rcvboxdrv setup the /var/log/vbox-setup.log file is flagging a different issue. An unrecognized option: --gdwarf-4 is being called out in the build process like this:
as: unrecognized option '--gdwarf-4'

Has anyone seen this particular issue?

Thank you. I've been working on this for a day so I figured it was time to ask for help.

Here's an image showing the errors:
Attachments
VBox Kernel Module Build Issue.jpg
VBox Kernel Module Build Issue.jpg (99.33 KiB) Viewed 622 times
BDub122
Posts: 7
Joined: 11. Oct 2014, 15:30

Re: Issue Building Kernel Modules on OEL 8.7

Post by BDub122 »

I resolved this by using the gcc-toolset-12 instead of the gcc-toolset-11. Toolset 12 includes gcc version 12.1.1 which seemed to be the trick.

Code: Select all

dnf install gcc-toolset-12
ln -s /opt/rh/gcc-toolset-12/root/usr/bin/gcc /usr/bin/gcc
Then: rcvboxdr setup worked.
Post Reply