LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   possible to compile a 32bit kernel on a 64bit os? (http://www.linuxquestions.org/questions/linux-general-1/possible-to-compile-a-32bit-kernel-on-a-64bit-os-673422/)

Shadowmeph 09-30-2008 08:37 PM

possible to compile a 32bit kernel on a 64bit os?
 
what I am wanting to do is build Smoothwall3 on a Full Distro instructions are here http://community.smoothwall.org/foru...p?f=22&t=23847 .
the thing is I want to try and avoid having to install a full 32bit distro on my smoothwall3 box if I don't need to. this is why I am wondering if it is possible to do this on a 64bit OS like Fedora 8

darthaxul 09-30-2008 10:03 PM

Ya, just make sure you copy the x86 bzimage.

H_TeXMeX_H 10-01-2008 02:16 AM

I don't see how the question stated as the topic of this thread has anything to do with this. I would have to say that yes you can install smoothwall on 64-bit, but no you cannot run a 32-bit kernel on a 64-bit OS.

pinniped 10-01-2008 03:18 AM

Well, from the link you provided:

Quote:

At the end of that process, you should have 2 ISO's located in this directory: (one each of the standard distro, and one devel edition, of either a 32-bit or 64-bit flavor depending on the host environment).
What you want to do is not so clear - are you compiling on a 64-bit machine but have a 3-bit machine set aside for smoothwall?

You can check if your compiler is multi-targeted - for example, compile a "hello_world.c" file using the compiler and "-m32" switch. You may need to install the 32-bit libs to be able to successfully link the program. Since the kernel does not link to any libraries, you can try to compile - not quite as normal, you need to make sure -m32 is supplied.

However, to make sure the binary is compatible with your intended system, it is best to set up a cross-compiler for the job - you need to put the 32-bit libs for your target system somewhere and set up the cross-compiler environment to use/link to them.

Shadowmeph 10-01-2008 11:23 AM

Quote:

Originally Posted by pinniped (Post 3296783)
Well, from the link you provided:



What you want to do is not so clear - are you compiling on a 64-bit machine but have a 3-bit machine set aside for smoothwall?

You can check if your compiler is multi-targeted - for example, compile a "hello_world.c" file using the compiler and "-m32" switch. You may need to install the 32-bit libs to be able to successfully link the program. Since the kernel does not link to any libraries, you can try to compile - not quite as normal, you need to make sure -m32 is supplied.

However, to make sure the binary is compatible with your intended system, it is best to set up a cross-compiler for the job - you need to put the 32-bit libs for your target system somewhere and set up the cross-compiler environment to use/link to them.

yes this is what I wanted to do make the 32bit on the 64 bit machine, and the reason is because my 64 bit machine is allot faster then my 32 bit machine so the time it would take would be allot less .
now how do I find out which 32 bit libs I need to do this? I am new to this but I am totally willing to try it

pinniped 10-02-2008 06:07 AM

For building the kernel it should only be a matter of making sure "-m32" is specified and that the kernel configuration file is good for the target computer.

For anything else involving libraries, you need the headers and the 32-bit libs (so you can link); you also need to tell the compiler to ignore the usual search paths and point it to your headers and libs for the 32-bit system.

The libs and headers that you should use are the ones which will be installed on the target machine.


All times are GMT -5. The time now is 09:26 AM.