[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: Grégory Pakosz
Subject: Re: cross-compiling on 64 to 32-bit Linuxlocalhost/
Date: Wed, 3 Mar 2010 10:09:57 +0100

> 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=.

Thanks for your answer John,

In fact I believed autoconf could have done all the job for me: that
is invoking 64bit gcc with -m32 after having detected there is no
i686-pc-linux-gnu compiler available :)

But maybe it's rare to be in this situation? I'm building a closed
source shared library that only depends on libc which is why I don't
really need a chroot environment. For now, to ease my coworkers life,
I came up with a shell script that does a little analysis before
invoking configure: based on uname and gcc --print-multi-lib, it
creates several build directories like build/linux/i386 and/or
build/linux/x86_64 and invokes configure from there with proper CC


reply via email to

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