title: Cannot find crtn.o, linking 32 bit code on 64 bit system
body: <p>I'm attempting to assemble some 32-bit code using NASM and GCC on a 64-bit system. I use the following two commands</p>
  
  <pre><code>nasm -f elf32 -g -F stabs coc.asm
  gcc -m32 -o coc coc.o
  </code></pre>
  
  <p>NASM appears to do fine, but LD complains:</p>
  
  <pre><code>/usr/bin/ld: cannot find crt1.o: No such file or directory
  /usr/bin/ld: cannot find crti.o: No such file or directory
  /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6.1/libgcc.a when searching for -lgcc
  /usr/bin/ld: cannot find -lgcc
  /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6.1/libgcc_s.so when searching for -lgcc_s
  /usr/bin/ld: cannot find -lgcc_s
  /usr/bin/ld: cannot find -lc
  /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6.1/libgcc.a when searching for -lgcc
  /usr/bin/ld: cannot find -lgcc
  /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6.1/libgcc_s.so when searching for -lgcc_s
  /usr/bin/ld: cannot find -lgcc_s
  /usr/bin/ld: cannot find crtn.o: No such file or directory
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>I'm running Ubuntu 11.10, and I checked and I'm pretty sure libc is installed.</p>