nm:尽管安装了最新的 binutils Ubuntu 20.04,但仍未找到命令

nm: command not found despite latest binutils installed Ubuntu 20.04

我正在尝试从源代码构建 GCC,当我尝试使用 ./configure --prefix=/tmp/gcc 配置 gmp 4.3.2 时,我收到以下错误消息

checking if globals are prefixed by underscore... ./configure: line 30083: nm: command not found
unknown
configure: WARNING: +----------------------------------------------------------
configure: WARNING: | Cannot determine global symbol prefix.
configure: WARNING: | nm output doesn't contain a global data symbol.
configure: WARNING: | Will proceed with no underscore.
configure: WARNING: | If this is wrong then you'll get link errors referring
configure: WARNING: | to ___gmpn_add_n (note three underscores).
configure: WARNING: | In this case do a fresh build with an override,
configure: WARNING: |     ./configure gmp_cv_asm_underscore=yes
configure: WARNING: +----------------------------------------------------------
checking how to switch to read-only data section...     .section        .rodata
checking for assembler .type directive... .type ,@
checking for assembler .size directive... .size ,
checking for assembler local label prefix... configure: WARNING: "nm" failure
configure: WARNING: cannot determine local label, using default L
L
checking for assembler byte directive... .byte
checking how to define a 32-bit word... ./configure: line 30423: nm: command not found
./configure: line 30423: nm: command not found
configure: error: cannot determine how to define a 32-bit word

我已经安装了binutils-2.34-6ubuntu1,我在网上找到了nm命令所在的位置,但是通过which命令找不到。如果需要任何其他信息来解决此问题,请告诉我。

提前感谢您的帮助。

执行 sudo apt-get install --reinstall binutils 解决了问题。