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

时间:2020-11-11 20:35:56

标签: ubuntu debian gmp binutils nm

我正在尝试从源代码构建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 $1,@$2
checking for assembler .size directive... .size $1,$2
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命令找到它。如果还有其他信息需要解决此问题,请告诉我。

谢谢您的帮助。

1 个答案:

答案 0 :(得分:0)

sudo apt-get install --reinstall binutils解决了这个问题。