If you see this error when compiling a 32 bit x86 assembly code with the -m32
flag on a 64 bit environment, install gcc-multilib
.
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
collect2: error: ld returned 1 exit status