ubuntu 22.04 - arm-none-eabi GDB complains about missing library

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?

3

1 Answer

  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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like