0

I'm trying to build GCC from source, and when I tried to configure gmp 4.3.2 using ./configure --prefix=/tmp/gcc, I get the following error message

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

I have already install binutils-2.34-6ubuntu1, which I found online to be where the command nm is located, but I cannot find it through the which command. If there is any other information necessary to solve this issue, please let me know.

Thank you for your help in advance.

  • How did you install binutils? Can you find the `nm` command in your file system (for example, is it located at `/usr/bin/nm`)? What is the content of the `PATH` variable (i.e. `echo $PATH`)? – f9c69e9781fa194211448473495534 Nov 11 '20 at 20:43
  • in addition to the above, try: `dpkg -L binutils` Which will list the locations of files installed by that package. In good IT fashion, perhaps just try rebooting as these are pretty low level tools... – LT 'syreal' Jones Nov 11 '20 at 20:46
  • I installed binutils through `sudo apt-get install binutils`. My path looks like this `/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` – Arkan Abuyazid Nov 12 '20 at 18:41
  • `dpkg -L binutils` gives me this output `/usr/bin/nm`, and `/usr/bin/` seems to be in my PATH – Arkan Abuyazid Nov 12 '20 at 18:43
  • I looked through `/usr/bin` and I could not find `nm`. – Arkan Abuyazid Nov 12 '20 at 18:48

2 Answers2

2

Doing sudo apt-get install --reinstall binutils solved the problem.

0
sudo apt-get install --reinstall binutils

solved the problem on my side as well.

Fedor
  • 17,146
  • 13
  • 40
  • 131