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.
📋 Table of Contents
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
- 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.
- Step 2: Search for the 'CONFIG_X86_64' option and set it to 'y' (yes). This will enable 64-bit mode during compilation.
- Step 3: Save the changes to the kernel.config file and proceed with the rpmbuild command.
Checking CPU Architecture
- 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).
- 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.
❓ Frequently Asked Questions
🛠️ Related Fixes
How to Fix: Pc crashes shortly after launching game (rainbow
Fix Pc crashes shortly after launching game (rainbow six siege). Compl
How to Fix: Installing an APK on a locked down phone
Installing an APK on a locked down phone: Try using a rooted device, e
How to Fix: New PC build- no signal and no clue
Fix New PC build- no signal and no clue. Complete troubleshooting guid