LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Host x86_64, Can I compile for x86_32??? (https://www.linuxquestions.org/questions/linux-newbie-8/host-x86_64-can-i-compile-for-x86_32-a-686325/)

webquinty 11-26-2008 07:56 AM

Host x86_64, Can I compile for x86_32???
 
Hello,

I have a laptop with dual core, and OS Suse 11.0 x86_64.

My question is, Can I compile programs and kernel for x86_32 ???

Before this question, I have looked for information in google and for example I can configure gcc for 32 bits:

./configure --host=x86_64-pc-linux --build=x86_64-pc-linux --target=i386_pc-linux-gnu

Best reagards

Acron_0248 11-26-2008 08:42 AM

Yes, cross compile is possible, as far as I know, the only thing to remember is that you need a copy of binutils for the target system you intend to compile to, so both, binutils and gcc should be configured to use the --target option

Agrouf 11-26-2008 09:59 AM

Or you can just install multilibs, chroot to a 32bit environment and use 32bit gcc

webquinty 11-26-2008 10:17 AM

Quote:

Originally Posted by Agrouf (Post 3355404)
Or you can just install multilibs, chroot to a 32bit environment and use 32bit gcc

Hello,

other question, I have x86_64 host and I would like to compile a new kernel for my target x86_32. is it necessaty to compile this kernel with 32bit gcc???
Perhaps is a stupid question but I confuse.

Thanks a lot

estabroo 11-26-2008 10:25 AM

Or you could run a 32bit virtual machine for my 32bit development, it seems like its a hassle but you don't have to futz with anything once its setup and you can compile it in the environment/os you want.

Agrouf 11-26-2008 12:14 PM

Quote:

Originally Posted by webquinty (Post 3355440)
Hello,

other question, I have x86_64 host and I would like to compile a new kernel for my target x86_32. is it necessaty to compile this kernel with 32bit gcc???
Perhaps is a stupid question but I confuse.

Thanks a lot

No it is not necessary, but then you have to cross compile.


All times are GMT -5. The time now is 12:54 AM.