Software⏱️ 3 min read📅 2026-06-19

How to Fix: "64-bit mode not compiled in" error while compiling Linux kernel

Error message when building a custom Linux kernel on CentOS, with instructions on how to fix the issue.

Quick Answer: The issue is caused by the -m64 flag being used without enabling 64-bit mode in the kernel configuration. To fix this, add the 'CONFIG_X86_64' option to the kernel configuration file (kernel.spec) and rebuild the kernel.

The '64-bit mode not compiled in' error is a common issue encountered whilecompiling Linux kernel on 64-bit systems. This error affects users who are building custom kernels from source code, particularly those using CentOS as their operating system.

This error can be frustrating for developers and users alike, as it prevents the compilation of the kernel and generates no useful error messages. However, by following a step-by-step guide, you can resolve this issue and successfully build your custom kernel.

⚠️ Common Causes

  • The primary reason for this error is that the '64-bit mode' option is not enabled during the compilation process. This can occur when the `CONFIG_X86_64` configuration option is not set to 'y' (yes) in the kernel configuration file ( kernel.config ).
  • An alternative reason for this error could be that the system's CPU architecture does not support 64-bit mode. In such cases, the compilation process will fail and produce an error message indicating that the '64-bit mode' option is not compiled.

✅ Best Solutions to Fix It

Enabling 64-bit Mode in kernel.config

  1. Step 1: Open the kernel configuration file (kernel.config) using a text editor. You can find this file in the ~/rpmbuild/SPECs/kernel-2.6.18/x86_32 directory.
  2. Step 2: Search for the 'CONFIG_X86_64' option and set it to 'y' (yes). This will enable 64-bit mode during compilation.
  3. Step 3: Save the changes to the kernel.config file and proceed with the rpmbuild command.

Checking CPU Architecture

  1. Step 1: Check your system's CPU architecture using the 'uname -m' command. If your system does not support 64-bit mode, you will see a different architecture (e.g., i386).
  2. Step 2: If your system supports 64-bit mode, proceed with enabling 64-bit mode in kernel.config as described in Method 1.

✨ Wrapping Up

To resolve the '64-bit mode not compiled in' error, enable 64-bit mode in kernel.config by setting CONFIG_X86_64 to 'y'. If your system's CPU architecture does not support 64-bit mode, check your system's architecture and proceed accordingly. By following these steps, you should be able to successfully build your custom kernel.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions