[SOLVED] Why Can't I Generate a 64 Bit Kernel on a 64 Bit Computer?
Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Why Can't I Generate a 64 Bit Kernel on a 64 Bit Computer?
I'm new to Linux and this Forum, but not new to computers. That said I have a lot to learn.
I'm running PCLinuxOS. On an HP p7-1254. The computer has a Pegatron 2ACF Ver 1.03 motherboard, a quad core AMD A6-3620 cpu (Which is a 64 bit processor executing the X86-64 instruction set) and 8GB of memory.
I downloaded the latest Linux Kernel source (4.1.0) and followed the cookbook for generating a new kernel. The generation worked and I'm able to run with the kernel. However, when I checked the config file I found that the kernel was for a 32 bit machine. I then checked all previous kernels as generated by Synaptic and they were also 32 bit kernels. I then went back and in a new directory untared the distro and ran menuconfig. The only item I changed was the first one which was to generate a 64 Bit Kernel. I then tried to make the kernel and got the following:
Simple google found this as first hit. Seems to cover your query.
But things are always changing - if you still have problems after that, run this and post the result
Code:
grep "64" <your-config-file> | grep -vE "(=m|^#)"
Last edited by syg00; 06-29-2015 at 08:04 PM.
Reason: change config file from system
You are currently running a 32-bit Linux, which means you can only use a 32-bit gcc.
There are 32-bit builds of gcc that can be used to compile for 64-bit. But I don't know how you would obtain/install such in PCLinuxOS. (That doesn't mean it is difficult, just that I don't know PCLinuxOS).
I suspect you would be better off starting over with a 64-bit install of Linux before (or instead of) trying to compile your own kernel. That does not mean that is your only choice, just that compiling a 64-bit kernel on a 32-bit Linux is unusual enough that you will find few people here able to guide you through the details.
You mention starting with a 64 bit install of linux. I'm new to the community, but would have thought that the kernels needed to be built to the specific target machines, that's why I tried to compile my own kernel. Better yet do you know where I can obtain a 64 bit install of Linux?
thought that the kernels needed to be built to the specific target machines,
No. There is virtually zero difference between x64 CPUs and the default kernel compile (even if you compile yourself on your target machine) is for the common features of all x64 CPUs.
Quote:
Better yet do you know where I can obtain a 64 bit install of Linux?
Most Linux distributions have either only 64bit or both 32bit and 64bit.
Just pay attention to the details listed on the download page of whatever distribution you choose.
You can create a cross-toolchain from source yourself. First create a cross-binutils targeting x86_64 and then a cross-gcc for x86-64 using the cross-binutils.
Do a websearch for more info. If you can't get it done post the problem here.
If above seems difficult best would be to install a 64bit distro as advised above.
johnsfile and veerain: Like I said at the start, I'm new to Linux and without a lot more research and experience compiling my own kernel with my own tool set seems a far reach.
I'd like to load just the kernel but the distro contains everything. So I'll offload the data acquired and reload everything. That's probably the easiest and best thing I can do.
Thanks to all who provided help. I'm getting what I came for, which was knowledge of Linux. Thanks again.
You might think that. But even after building the kernel, that would have been a much worse can of worms than you imagine. Installing a 64 bit kernel into a 32-bit installed Linux is doable, but not simple.
Quote:
So I'll offload the data acquired and reload everything. That's probably the easiest and best thing I can do.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.