title: GCC: sorry, unimplemented: 64-bit mode not compiled in
body: <p>I have built GCC 4.7 on my x86 32-bit linux system. When I try to cross-compile with the -m64 flag I get the following:</p>
  
  <blockquote>
    <p>sorry, unimplemented: 64-bit mode not compiled in</p>
  </blockquote>
  
  <p>while the compiler provided by default by my Linux distribution can cross-compile with -m64.</p>
  
  <p>What do I have to pass to ./configure to enable the 64bit mode in GCC? These are the options I used to build GCC 4.7:</p>
  
  <pre><code>$ /usr/local/bin/g++ -v Using built-in specs.
  COLLECT_GCC=/usr/local/bin/g++
  COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/i686-pc-linux-gnu/4.7.0/lto-wrapper
  Target: i686-pc-linux-gnu
  Configured with: ./configure --enable-multiarch --with-cloog=/usr/local/ --with-mpfr=/usr/local/ --with-ppl=/usr/local/ --verbose --enable-languages=c,c++
  Thread model: posix gcc version 4.7.0 20120113 (experimental) (GCC)
  </code></pre>
  
  <p>EDIT: </p>
  
  <blockquote>
    <p>--enable-multilib and --enable-targets=i686-pc-linux-gnu,x86_64-pc-linux-gnu</p>
  </blockquote>
  
  <p>do not change the situation. The compiler still complains about 64 bit mode not compiled in:</p>
  
  <blockquote>
    <p>$ g++ -v Using built-in specs. COLLECT_GCC=g++
    COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/i686-pc-linux-gnu/4.7.0/lto-wrapper
    Target: i686-pc-linux-gnu Configured with: ./configure
    --enable-multiarch --with-cloog=/usr/local/ --with-mpfr=/usr/local/ --with-ppl=/usr/local/ --verbose --enable-languages=c,c++ --enable-multilib --enable-targets=i686-pc-linux-gnu,x86_64-pc-linux-gnu Thread model: posix gcc version 4.7.0 20120113 (experimental) (GCC)</p>
    
    <p>$ g++ -m64 c.cpp  c.cpp:1:0: sorry, unimplemented: 64-bit mode not
    compiled in</p>
  </blockquote>