Search code examples
macosgmpmacos-mojavenm

gmp error: cannot determine how to define a 32-bit word


I'm trying to build the recent version of GMP 6.1.2 on macOS Mojave, but during ./configure I get this:

$ ../configure --prefix=/usr/local/gcc-8.2 --enable-cxx gmp_cv_asm_underscore=yes
...
checking how to define a 32-bit word... /usr/local/bin/nm: conftest.o: unknown load command 0x32
/usr/local/bin/nm: conftest.o: unknown load command 0x32
/usr/local/bin/nm: conftest.o: file format not recognized
/usr/local/bin/nm: conftest.o: unknown load command 0x32
/usr/local/bin/nm: conftest.o: unknown load command 0x32
/usr/local/bin/nm: conftest.o: file format not recognized
configure: error: cannot determine how to define a 32-bit word

On the previous version of macOS GMP 6.1.0 built just fine. I freshly reinstalled developer tools via xcode-select --install and Xcode itself.


Solution

  • The problem lies in faulty nm. It has a bug in the current version on macOS Mojave.