I'm trying to compile some code statically (dosfstools) with GCC for i386, using
-march=i386, but the libraries, for example /usr/lib/i386-linux-gnu/libc.a, are not i386 despite the name. I tried compiling it under "debian-10.7.0-i386-netinst.iso" and "Fedora-14-i386-netinst.iso" but neither are i386 despite the name. How can I get true i386 libraries?
The resulting binary compiled with
make CFLAGS="-march=i386" LDFLAGS="-march=i386 -static" doesn't run on an i586 machine, giving error 'Illegal instruction'.
objdump mkfs.fat -D | grep cmove shows that the binary has cmove instructions, those instructions were not introduced until i686 so it's not an i386 binary that's being generated. The same thing can be seen running the command against /usr/lib/i386-linux-gnu/libc.a.