Building 32 bit (Intel X86) kernel module on a 64 bit (Intel x86_64) machine

Building 32 bit (Intel X86) kernel module on a 64 bit (Intel x86_64) machine

Gilad Ben-Yossef gilad at codefidence.com
Tue Jul 14 17:15:21 IDT 2009


Dan Shimshoni wrote:

>
> For that I need to build a 32 bit gcc compiler on the x86_64 machine
> (cross compiler).
> There are various tools for buildings such a cross compiler. One is
> Dan Kegel tool:  http://kegel.com/crosstool/
>
> Another tool is Cross-Compiled Linux From Scratch:
> http://cross-lfs.org/view/1.1.0/x86_64/introduction/chapter.html
>
> I want to add that "make ARCH=i686" (on the 64 bit machine) gave me errors
> (and also trying to passing various gcc 32 bit arch flags ).
>
> It seems to me that both these tools are more complicated then needed.
>   
That's because you don't appreciate the complexity of the task :-)

But you are right, there is a better way to build cross compilers - 
crosstool-ng (http://ymorin.is-a-geek.org/dokuwiki/projects/crosstool)

Using it building a cross compiler is simple as:

hg clone http://ymorin.is-a-geek.org/hg/crosstool-ng
./configure 
make
make install
cd /your/development/directory
ct-ng help
ct-ng menuconfig
ct-ng build


Gilad



-- 
Gilad Ben-Yossef
Chief Coffee Drinker & CTO
Codefidence Ltd.

Web: http://codefidence.com
Cell: +972-52-8260388
Tel: +972-8-9316883 ext. 201
Fax: +972-8-9316884
Email: gilad at codefidence.com

Check out our Open Source technology and training blog - http://tuxology.net

	"Now the world has gone to bed
	 Darkness won't engulf my head
	 I can see by infra-red
	 How I hate the night."

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20090714/3bbe28ab/attachment.html>


More information about the Linux-il mailing list