LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   compiling 64 bit kernel in 32 bit linux (https://www.linuxquestions.org/questions/linux-hardware-18/compiling-64-bit-kernel-in-32-bit-linux-240183/)

MadnessASAP 10-08-2004 07:36 AM

compiling 64 bit kernel in 32 bit linux
 
I have been for the past couple days attempting to put together a 64 bit kernel on my computer but keep on getting the following error message

CC scripts/mod/empty.o
cc1: error: code model `kernel' not supported in the 32 bit mode
make[2]: *** [scripts/mod/empty.o] Error 1
make[1]: *** [scripts/mod] Error 2
make: *** [scripts] Error 2

anybody seen this before? below is my system information

proc: AMD Athlon 64 3000
mobo: asus k8v-x
kernel: 2.6.8
distro slack 10.0

dfaure 04-30-2006 09:18 AM

Same error (1.5 years later)
 
Same message here on AMD Athlon 64 (dual core), booting with kernel 2.6.15-21.amd64-generic from kubuntu and trying to recompile that same kernel from source, using gcc-4.0.1.

Did anyone find how to solve the error from -mcmodel=kernel meanwhile?

Looks like I can compile that kernel on a good old x86 machine with the same options, but that's a bit of a workaround...

moeFEAR 07-15-2007 03:29 PM

you won't be able to produce a 64 bit kernel unless the compile tools are already designed to output 64bit programs.

either rebuild the compile tools, configuring them for 64 bit system, then use them to compile the kernel, or download a 64bit live cd, and compile from it.

Shingoshi 05-01-2009 02:29 PM

Can 64-bit build tools still give 32-bit outputs?
 
Quote:

Originally Posted by moeFEAR (Post 2824298)
you won't be able to produce a 64 bit kernel unless the compile tools are already designed to output 64bit programs.

either rebuild the compile tools, configuring them for 64 bit system, then use them to compile the kernel, or download a 64bit live cd, and compile from it.

Would having tools capable of 64-bit compiles, prevent proper operation on 32-bit systems? If you rebuild the compile tools for a 64-bit system, can you still build 32-bit packages without trouble?

How easy is it to do this?

Shingoshi

Shingoshi 05-03-2009 09:43 PM

Someone please answer this question...
 
It seems I have a few alternatives to select from.
1. I can install a full 64-bit system with all of it's libraries included.
xx: This is just too easy!
2. I can keep my 64-bit kernel and recompile gcc to build 64-bit packages.
xx: This is more of a challenge.

But now, if I choose the second option and rebuild gcc, I need to know something here. I know that I can compile gcc with the ability to create a 64-bit kernel (and likely other packages as well). But I want to know is:
1. Should the gcc package be compiled as a native 32-bit (i686) binary, defaulting to 32-bit builds with the option of 64-bit builds (using "gcc -m64")?
2. Could the gcc package be compiled in 64-bit (x86_64) format (on my 32-bit system), with the option of building 32-bit packages?
a): Is that even possible?
b): Would I need a 64-bit glibc for a 64-bit gcc to be usable on my system? Meaning that I would be required to wind up with a complete 64-bit system.

3. Is there a way to build a 64-bit version of gcc which defaults to 32-bit builds, requiring that gcc -m64 be declared for 64-bit builds?

Shingoshi

johnsfine 05-04-2009 06:51 AM

Quote:

Originally Posted by Shingoshi (Post 3529013)
1. I can install a full 64-bit system with all of it's libraries included.
xx: This is just too easy!

Why don't you want easy? What are you actually trying to accomplish?

Quote:

2. I can keep my 64-bit kernel
You have a 64bit kernel now? Or that was a typo?

Quote:

1. Should the gcc package be compiled as a native 32-bit (i686) binary, defaulting to 32-bit builds with the option of 64-bit builds (using "gcc -m64")?
Sounds reasonable. But what are you actually trying to accomplish?

Quote:

2. Could the gcc package be compiled in 64-bit (x86_64) format (on my 32-bit system), with the option of building 32-bit packages?
Then how would you use it? You can compile a 64-bit native gcc on a 32 bot system, but you couldn't run it there.

Quote:

3. Is there a way to build a 64-bit version of gcc which defaults to 32-bit builds, requiring that gcc -m64 be declared for 64-bit builds?
I'm sure it can be done. I don't know how. If you look at the options for making a gcc cross compiler, you should be able to find what you need.

Shingoshi 05-04-2009 11:47 AM

Quote:

Originally Posted by johnsfine (Post 3529410)
Why don't you want easy? What are you actually trying to accomplish?

Quote:

I need to compile 64-bit kernel modules for my system.
You have a 64bit kernel now? Or that was a typo?

Quote:

Yes! I have a 64-bit Slamd64 kernel now.
Sounds reasonable. But what are you actually trying to accomplish?

Quote:

The topic is compiling 64-bit kernels on a 32-bit system. I have 8 GBs of memory on this system. So I'm using a kernel that supports it. I choose not to use PAE, because it was stated that a 64-bit kernel is more efficient, especially on a 64-bit processor.
Then how would you use it? You can compile a 64-bit native gcc on a 32 bot system, but you couldn't run it there.

Quote:

Yeah. I realize that now.
I'm sure it can be done. I don't know how. If you look at the options for making a gcc cross compiler, you should be able to find what you need.

I think I'm going to settle on recompiling the present compiler to allow 64-bit compiles. I don't want to run 64-bit applications. So that's not a problem.

Shingoshi


All times are GMT -5. The time now is 01:14 AM.