I am building the older grub2-1.98+20100804 under the similarly old Debian 'squeeze' distribution. However, I bet the error persists with newer version. This is because I am building it on a true Intel 80486 and I don't thing the compiler is building for the correct architecture. Here is the output:
./config.status --file=-:tests/
grub_script_dollar.in | sed -e 's,@pkglib_DATA@,efiemu32.o efiemu64.o moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst vi\
deo.lst crypto.lst terminal.lst,g' > grub_script_dollar
chmod +x grub_script_dollar
./config.status --file=-:tests/
grub_script_comments.in | sed -e 's,@pkglib_DATA@,efiemu32.o efiemu64.o moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst \
video.lst crypto.lst terminal.lst,g' > grub_script_comments
chmod +x grub_script_comments
Illegal instruction
./grub_script_echo1: GRUB and BASH outputs did not match (see diff -u /tmp/tmp.tP7l8uR3SD /tmp/tmp.wYCFOK2zor)
make[2]: *** [check] Error 1
make[2]: Leaving directory `/root/grub2-1.98+20100804/build/grub-pc'
dh_auto_test: make -j1 check returned exit code 2
make[1]: *** [build/stamps/build-grub-pc] Error 29
make[1]: Leaving directory `/root/grub2-1.98+20100804'
make: *** [build] Error 2