Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gdb depends on libpython3.8 #51

Closed
JeremyGrosser opened this issue Aug 10, 2023 · 7 comments
Closed

gdb depends on libpython3.8 #51

JeremyGrosser opened this issue Aug 10, 2023 · 7 comments

Comments

@JeremyGrosser
Copy link

After switching to the gnat-fsf-13.1.0 toolchain, arm-eabi-gdb stops working on Debian bookworm, because libpython3.8.so.1.0 is unavailable. Python 3.11 is the release included with Debian stable.

synack@polar ~/src/rp2040_hal/tests(master) $ eval $(alr printenv)
synack@polar ~/src/rp2040_hal/tests(master) $ arm-eabi-gdb
arm-eabi-gdb: error while loading shared libraries: libpython3.8.so.1.0: cannot open shared object file: No such file or directory
@JeremyGrosser
Copy link
Author

I've confirmed that adding --without-python to the gdb configure flags removes the dependency on libpython3.8. I was unable to find an option for static linking.
main...JeremyGrosser:GNAT-FSF-builds:gdb-without-python

@Fabien-Chouteau
Copy link
Member

Thanks for the report @JeremyGrosser.

I don't think I want to disable python for the builds as it brings many useful features. Maybe there's a way to disable it at run-time?

@reznikmm
Copy link
Contributor

Workaround 🔧

To make gdb from gnat_native_13.2.0_788a01f9 work I've rebuilt libpython3.8 for my Ubuntu 22.04. This is rather simple (I used a docker to have a clean build env).

  • Download sources from Ubuntu and my patch
  • Run
tar xaf python3.8_3.8.10.orig.tar.xz 
cd Python-3.8.10
tar xaf ../python3.8_3.8.10-0ubuntu1~20.04.8.debian.tar.xz
patch -p1 < ../python-3.8.patch
sudo apt install build-essential
sudo apt-get build-dep .
sudo ln -s /usr/lib/x86_64-linux-gnu/libmpdec.so.2.5.1 /usr/lib/x86_64-linux-gnu/libmpdec.so.2
dpkg-buildpackage -b
  • Now you have needed packages, install them
apt install ./libpython3.8_3.8.10-0ubuntu1~20.04.8_amd64.deb ./libpython3.8-stdlib_3.8.10-0ubuntu1~20.04.8_amd64.deb ./libpython3.8-minimal_3.8.10-0ubuntu1~20.04.8_amd64.deb

@reznikmm
Copy link
Contributor

python-3.8.patch

@godunko
Copy link

godunko commented Nov 27, 2023

Another workaround for Ububtu 22.04 is to add external repository and to install libpython3.8 package.

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install libpython3.8

@yrashk
Copy link

yrashk commented Apr 15, 2024

I want to add a suggestion here. It's possible to use RPATH with ($ORIGIN on Linux and @loader_path on macOS) to ship a shared library side-by-side.

@Fabien-Chouteau
Copy link
Member

Hello here, so I decided to disable python support in the next builds (14.1.3). I don't see a good way to provide python and it was never enabled for our Windows builds anyway.

The workaround, if Python support is really important for you, will be to use the distrib GDB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants