Compile ZFS 2.3.x / 2.4.x on Oracle Linux with UEK8 Kernel (6.12.x)

Compiling ZFS 2.3 / 2.4 on Oracle Linux 9 seems to have some challenges. While ZFS-DKMS works fine with UEK7 (5.14.x) kernels, it will refuse to compile with UEK8 (6.12.x). The build log shows:

checking whether CONFIG_MODULES is defined... no
configure: error:
*** This kernel does not include the required loadable module
*** support!
***
*** To build OpenZFS as a loadable Linux kernel module
*** enable loadable module support by setting
*** `CONFIG_MODULES=y` in the kernel configuration and run
*** `make modules_prepare` in the Linux source tree.

Note this error is misleading and wrong. If you dig deeper, you will find the following (or similar):

warning: the compiler differs from the one used to build the kernel
The kernel was built by: gcc (GCC) 14.2.1 20240801 (Red Hat 14.2.1-1)
You are using: gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-5.0.1)

As of now (February 2026) DKMS does NOT work for UEK8! You either need to use UEK7 for which ZFS-DKMS compiles fine, or you need to compile ZFS yourself.

If you want to compile ZFS yourself, this is the way to go:

Install Toolchain among with other dependencies (see the ZFS build instructions):

dnf install gcc-toolset-14

Compile ZFS:

scl enable gcc-toolset-14 -- ./autogen.sh
scl enable gcc-toolset-14 -- ./configure.sh --prefix=/usr/local
scl enable gcc-toolset-14 -- make all
scl enable gcc-toolset-14 -- make install

Note: If configure misses the libtirpc-devel package, you need to enable the ol9_codeready_builder repository in /etc/yum.repos.d/oracle-linux-ol9.repo.

This entry was posted in Oracle in general. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *