expr 1 + 1 fails with "Illegal instruction" on old CPUs

by Michael Brunnbauer, 2013-01-30

I recently upgraded to GNU coreutils 8.20 and everything went fine until I installed those binaries on older machines with Pentium II, Pentium III or Celeron CPUs. Those machines would not reboot because the command expr was used in some startup script and now failed with "Illegal instruction".

It turns out that expr is now dynamically linked with the GNU Multiple Precision Arithmetic Library (GMP, installed as libgmp) and that the configure-script for GMP chose "pentium4-pc-linux-gnu" as system type instead of my compilers default "i686-pc-linux-gnu". The former works on my build machine with a Xeon CPU but not on those older machines. The latter works on both.

So if you have the same problem, it may help to rebuild GMP using the command line switch "--build" to indicate the correct target system type, for example "--build=i686-linux-gnu".