On 03/18/2015 11:44 AM, Andrew Haley wrote: > On 03/18/2015 11:11 AM, Alex Blekhman wrote: >> Andrew Haley writes: >>> On 18/03/15 06:37, Alex Blekhman wrote: >>>> My goal is to be able to compile both i686 and x86_64 binaries on >> the >>>> same Debian 6.0 i686 machine. Default compilation target should be >> i686, >>>> and x86_64 should be available via switch -m64. >>> >>> That's the usual default. >> >> Thank you for answering. Are you saying that if I just compile GCC with >> all default settings, then it will be capable of >> building x86_64 binaries out of the box? I think I have to specify >> x86_64 as an additional target somewhere. >> >>> Do you really want i686-elf? >> >> I'm not sure which target name to use. I've never built GCC before, so >> I'm trying to make sense out of parameters. `uname' >> reports that the system is "i686 GNU/Linux", so I thought that "i686- >> elf" would be the most generic target I can specify. > > If you're not cross-compiling you should never set the target. The > same for sysroot. GCC has sensible defaults for everything, and > unless you know exactly what you're doing overriding them is only > likely to break things. > >> All I want to do is to have 32-bit compiler (and linker, of course), >> which is able to produce both 32- and 64-bit binaries. I am very sorry. I have told you an untruth. I didn't read what you wrote. Cross-compiling from 32- to 64-bit hosts is notoriously tricky. People almost always go in the opposite direction. I don't even know if it can be done. Andrew.