LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices



Reply
 
Search this Thread
Old 10-08-2004, 08:36 AM   #1
MadnessASAP
Member
 
Registered: Oct 2004
Distribution: Gentoo AMD64 2005.0
Posts: 36

Rep: Reputation: 15
Question 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
 
Old 04-30-2006, 10:18 AM   #2
dfaure
LQ Newbie
 
Registered: Apr 2006
Location: France
Posts: 6

Rep: Reputation: 0
Question 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...
 
Old 07-15-2007, 04:29 PM   #3
moeFEAR
Member
 
Registered: Sep 2005
Posts: 49

Rep: Reputation: 15
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.
 
Old 05-01-2009, 03:29 PM   #4
Shingoshi
Member
 
Registered: Oct 2006
Location: Cochise County, Arizona
Distribution: Gentoo-AMD64 / Slackware64-Current
Posts: 474
Blog Entries: 28

Rep: Reputation: 34
Can 64-bit build tools still give 32-bit outputs?

Quote:
Originally Posted by moeFEAR View Post
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
 
Old 05-03-2009, 10:43 PM   #5
Shingoshi
Member
 
Registered: Oct 2006
Location: Cochise County, Arizona
Distribution: Gentoo-AMD64 / Slackware64-Current
Posts: 474
Blog Entries: 28

Rep: Reputation: 34
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
 
Old 05-04-2009, 07:51 AM   #6
johnsfine
Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,142

Rep: Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127
Quote:
Originally Posted by Shingoshi View Post
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.
 
Old 05-04-2009, 12:47 PM   #7
Shingoshi
Member
 
Registered: Oct 2006
Location: Cochise County, Arizona
Distribution: Gentoo-AMD64 / Slackware64-Current
Posts: 474
Blog Entries: 28

Rep: Reputation: 34
Quote:
Originally Posted by johnsfine View Post
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
is there anyway to snapshot whole linux partitions,bit to bit ?? pleasehelpme Linux - General 4 05-14-2005 01:04 AM
Compiling an AMD64 kernel from a 32-bit environment justinmc Linux - General 3 01-16-2005 07:47 PM
Compiling 32-bit binary in a 64-bit environment Kaj Linux - Software 1 12-13-2004 10:43 AM
32 bit kernel on 64 bit AMD machine dipsae Linux - Software 5 10-01-2004 11:03 AM
32-bit or 64-bit linux kernel ??? gsundeep Linux - General 2 04-24-2003 09:43 PM


All times are GMT -5. The time now is 08:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration