4

I recently installed the ARM GCC toolchain on Ubuntu 18.10 (Cosmic Cuttlefish) using sudo apt-get install gcc-arm-none-eabi and am trying to run arm-none-eabi-gdb.

Whenever I try to run it I get the following error:

arm-none-eabi-gdb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory

I have tried to install libncurses using sudo apt-get install libncurses5-dev libncursesw5-dev- the libraries installed successfully, but I still have the same issue.

I also checked to make sure the file was 64 bit: arm-none-eabi-gdb: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.24, BuildID[sha1]=340c78388950836989ecda5c89474e1bf7b03820, stripped

What can I try from here?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
user2828776
  • 43
  • 1
  • 1
  • 3
  • [Using the latest direct from arm.com](https://kb.zubax.com/display/MAINKB/GNU+ARM+embedded+toolchain), I got the same problem on Ubuntu 19.10 64-bit (likely also on Ubuntu 19.04 64-bit), whereas it worked on Ubuntu 18.04 (32 bit) and Ubuntu 16.04 (64 bit) – Peter Mortensen Dec 05 '19 at 20:55
  • I found a solution, and I have covered it in [this blog post](https://pmortensen.eu/world2/2019/12/08/arm-toolchain-ubuntu-19-04-black-magic-probe/) - a fix is to make a symbolic link from the *installed* versions of *libncurses* and *libtinfo* to version 5 of *libncurses* and *libtinfo* that GDB expects. – Peter Mortensen Jan 19 '21 at 13:20

4 Answers4

9

I got it working on Kubuntu 19.10 installing:

apt install libncurses5

Not installing the "-dev", development or ":i386", 32-bit versions of the library.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
James
  • 91
  • 1
  • 3
0

I installed Ubuntu 18.10 desktop (Cosmic Cuttlefish) from here, but I was unable to install gcc-arm-none-eabi:

ubuntu@ubuntu:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.10
Release:        18.10
Codename:       cosmic

ubuntu@ubuntu:~$ sudo apt-get install gcc-arm-none-eabi
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package gcc-arm-none-eabi

I then installed libncurses5-dev and gcc-linaro-7.3.1-2018.05-x86_64_arm and got the same .so-related error you got.

Since I don't have this issue with 16.04 nor with 18.04, I would suggest you compile the latest GDB from source in order to avoid what may be a package/dynamic link library mismatch issue in Ubuntu 18.10:

sudo apt-get install build-essential libncurses5-dev libexpat1-dev texinfo-doc-nonfree
pushd /tmp
wget -qO- ftp://ftp.gnu.org/gnu/gdb/gdb-8.2.tar.xz | tar Jxv
mkdir gdb
cd gdb
../gdb-8.2/configure  --enable-tui --with-expat --prefix=/usr/local  --target=arm-eabi --program-prefix=arm-eabi-
make all
sudo make  install
popd

Install will fail because makeinfo is missing, even though I installed texinfo-doc-nonfree, but binaries will be installed:

ls /usr/local/bin
arm-eabi-gdb  arm-eabi-gdb-add-index  arm-eabi-run

And arm-eabi-gdb will launch properly this time:

arm-eabi-gdb --version
GNU gdb (GDB) 8.2
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

arm-eabi-gdb -tui will work as well - I encourage you to use the TUI mode. You should like it as much as I do - I guess.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Frant
  • 5,382
  • 1
  • 16
  • 22
  • [gcc-arm-none-eabi can be installed](https://kb.zubax.com/display/MAINKB/GNU+ARM+embedded+toolchain) by downloading the tar ball from arm.com, extracting and adding the /bin folder in the extracted folder to the path (environment variable PATH). – Peter Mortensen Dec 05 '19 at 20:58
0

I got it working on Kubuntu 19.10 by downloading the 2019 version from arm.com instead the 2015 version from Launchpad.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
0

stm 32 ide 1.5 version, using the st-link debug, tried loading all the dev and i386, no luck, then

sudo apt install libncurses5*

This fixed it.

user50619
  • 325
  • 5
  • 14