【问题标题】:nm: command not found despite latest binutils installed Ubuntu 20.04nm:尽管安装了最新的 binutils Ubuntu 20.04,但找不到命令
【发布时间】:2021-02-23 20:36:03
【问题描述】:

我正在尝试从源代码构建 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命令找不到它。如果有解决此问题所需的任何其他信息,请告诉我。

提前感谢您的帮助。

【问题讨论】:

  • 你是如何安装 binutils 的?您能否在您的文件系统中找到nm 命令(例如,它是否位于/usr/bin/nm)? PATH 变量(即echo $PATH)的内容是什么?
  • 除上述之外,尝试:dpkg -L binutils 它将列出该软件包安装的文件的位置。以良好的 IT 方式,也许只是尝试重新启动,因为这些是相当低级的工具......
  • 我通过sudo apt-get install binutils安装了binutils。我的路径看起来像这样/home/"the name of the user"/ARMCompiler6.15/bin /home/"the name of the user"/.local/bin /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /usr/games /usr/local/games
  • dpkg -L binutils 给了我这个输出/usr/bin/nm,而/usr/bin/ 似乎在我的路径中
  • 我浏览了/usr/bin,但找不到nm

标签: ubuntu debian gmp binutils nm


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-06-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-17
    • 1970-01-01
    • 2016-07-05
    • 1970-01-01
    相关资源
    最近更新 更多