1

Trying to get arm toolchain working on my fresh installed ubuntu 22.04. After fixing some symlinks for libncurses it now complains about missing some shared library for python3.6.

I am sure for regular ubuntu users this is a trivial thing to fix. I am not that person. I already ruined one ubuntu installation by removing and reinstalling python3. So reinstalled everything, and going for take 2

The error message when I try to run the gdb client:

bp@bp-legion:~/Downloads/gcc-arm-11.2-2022.02-x86_64-arm-none-eabi/bin$ ./arm-none-eabi-gdb --version

./arm-none-eabi-gdb: error while loading shared libraries: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory

I have this shared library on my disk here:

/snap/gnome-3-28-1804/161/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0

I tried to symlink that library to /usr/lib, but then it complains about

bp@bp-legion:~/Downloads/gcc-arm-11.2-2022.02-x86_64-arm-none-eabi/bin$ sudo ln -s -f /snap/gnome-3-28-1804/161/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0 /usr/lib/libpython3.6m.so.1.0
[sudo] password for bp: 
bp@bp-legion:~/Downloads/gcc-arm-11.2-2022.02-x86_64-arm-none-eabi/bin$ ./arm-none-eabi-gdb --version
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007f2017abfc00 (most recent call first): Aborted (core dumped)

At this point I reinstalled python3 last time, resulting in wrecking my ubuntu installation.

Is there anybody that can tell me how to get latest (11.20) arm toolchain working on ubuntu 22.04?

bas
  • 151
  • 1
  • 8

3 Answers3

3
  1. Download and extract source code of python 3.6.15 from python website

  2. Prepare necessary dependencies

    sudo apt install -y make build-essential libssl-dev zlib1g-dev \ libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \ libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev \ libgdbm-dev libnss3-dev libedit-dev libc6-dev

  3. From extracted folder do:

    sudo ./configure --enable-optimizations -with-lto --enable-shared
    sudo make sharedinstall
    sudo ln -s /usr/local/lib/libpython3.6m.so.1.0 /usr/lib/x86_64-linux-gnu

1

You need to follow the steps suggested by @Artem Maslov in his previous answer or steps described here and then link PYTHONPATH to the Lib folder of the extracted Python-3.x folder. Before you build your downloaded Python-3.x files, make sure to find the right dependencies for your version.

In my case (my GDB required Python 3.8), the command to set PYTHONPATH looked the following way:

export PYTHONPATH=/usr/share/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi/dependencies/Python-3.8.14/Lib

Then hit

arm-none-eabi-gdb --version

and if the installation went good, GDB should work.

Good luck!!

0

You can use gdb-multiarch as arm-none-eabi-gdb on Ubuntu22.04.

sudo apt install -y gdb-multiarch
sudo ln -s /usr/bin/gdb-multiarch /usr/bin/arm-none-eabi-gdb
arm-none-eabi-gdb --version
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
Copyright (C) 2022 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.

Reference: How can I install "gdb-arm-none-eabi" on Ubuntu 18.04 (Bionic Beaver)?

asukiaaa
  • 111