title: how to build gcc cross compiler with --disable-multilib
body: <p>Anyone can help how to build the gcc cross compiler with multilib support for x86_64 architecture? That is to build it from source code for m32 and m64 lib support.  </p>
  
  <p>There is a good article showing how to build a gcc cross compiler:
  <a href="http://preshing.com/20141119/how-to-build-a-gcc-cross-compiler/" rel="nofollow">http://preshing.com/20141119/how-to-build-a-gcc-cross-compiler/</a>
  , but it only demonstrates the case with --disable-multilib. </p>
  
  <p>I am trying to build x86_64 gcc cross compiler with --enable-multilib option ( for both m32 and m64), instead of --disable-mutlilib. </p>
  
  <p>I follow that except using arch=x86_64*-* and --enable-multilib
  The problem I am facing is at step 4. Standard C Library Headers and Startup Files</p>
  
  <pre><code>$ make install-bootstrap-headers=yes install-headers
  </code></pre>
  
  <p>It comes out the following errors:</p>
  
  <pre><code>/opt/cross/lib/gcc/x86_64-linux/4.9.2/../../../../x86_64-linux/bin/ld: cannot find crtbegin.o: No such file or directory
  /opt/cross/lib/gcc/x86_64-linux/4.9.2/../../../../x86_64-linux/bin/ld: cannot find -lgcc
  /opt/cross/lib/gcc/x86_64-linux/4.9.2/../../../../x86_64-linux/bin/ld: cannot find -lgcc_s
  /opt/cross/lib/gcc/x86_64-linux/4.9.2/../../../../x86_64-linux/bin/ld: cannot find -lgcc
  /opt/cross/lib/gcc/x86_64-linux/4.9.2/../../../../x86_64-linux/bin/ld: cannot find -lgcc_s
  /opt/cross/lib/gcc/x86_64-linux/4.9.2/../../../../x86_64-linux/bin/ld: cannot find crtend.o: No such file or director
  </code></pre>
  
  <p>Any idea?</p>
  
  <p>And I have multilib installed as:</p>
  
  <pre><code>james@james-Aspire-E5-472G:/usr$ find -name libgcc*.*
  ./lib32/libgcc_s.so.1
  ./lib/ure/lib/libgcc3_uno.so
  ./lib/x86_64-linux-gnu/libgccpp.so.1.0.3
  ./lib/x86_64-linux-gnu/libgccpp.so.1
  ./lib/gcc/x86_64-linux-gnu/4.9/libgcc_s.so
  ./lib/gcc/x86_64-linux-gnu/4.9/32/libgcc_s.so
  ./lib/gcc/x86_64-linux-gnu/4.9/32/libgcc_eh.a
  ./lib/gcc/x86_64-linux-gnu/4.9/32/libgcc.a
  ./lib/gcc/x86_64-linux-gnu/4.9/libgcc_eh.a
  ./lib/gcc/x86_64-linux-gnu/4.9/x32/libgcc_s.so
  ./lib/gcc/x86_64-linux-gnu/4.9/x32/libgcc_eh.a
  ./lib/gcc/x86_64-linux-gnu/4.9/x32/libgcc.a
  ./lib/gcc/x86_64-linux-gnu/4.9/libgcc_s_x32.so
  ./lib/gcc/x86_64-linux-gnu/4.9/libgcc_s_32.so
  ./lib/gcc/x86_64-linux-gnu/4.9/libgcc.a
  ./libx32/libgcc_s.so.1
  ./share/doc/libgcc-4.9-dev
  
  james@james-Aspire-E5-472G:/usr$ find -name crtbegin.o
  ./lib/gcc/x86_64-linux-gnu/4.9/crtbegin.o
  ./lib/gcc/x86_64-linux-gnu/4.9/32/crtbegin.o
  ./lib/gcc/x86_64-linux-gnu/4.9/x32/crtbegin.o
  </code></pre>