[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cross-compiling on 64 to 32-bit Linuxlocalhost/

From: John Calcote
Subject: Re: cross-compiling on 64 to 32-bit Linuxlocalhost/
Date: Tue, 02 Mar 2010 16:28:49 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv: Gecko/20100216 Thunderbird/3.0.2

Hi Gregory,

On 3/2/2010 4:14 PM, Grégory Pakosz wrote:
  ./configure --host=i686-pc-linux-gnu \
               --prefix=/arch/x86-linux/gnu \
               CC="gcc -m32 -march=i586" \
               CXX="g++ -m32 -march=i586" \
I'm curious about why setting "--host=i686-pc-linux-gnu" is not enough
to achieve cross compiling and why in that case it's not up to
autoconf to add "-m32" to CC.

You don't need to specify -m32 if you have a tool set prefixed with the cross tag. The reason for using -m32 is because the user wants to use his 64-bit gcc to compile 32-bit code, so he has to tell the compiler to switch to 32-bit mode also. (Incidentally, if you're running on Linux, might also be a good idea to tell the compiler you're running in a 32-bit environment by executing gcc with linux32).

Another way to use your 64-bit gcc without special compiler flags is to create scripts, named with the cross prefix, in your bin directory that execute the compiler in 32-bit mode (and perhaps also executed by linux32). Then these tools will be preferred by Autoconf when you use --host=.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]