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

[BUG] LLDB shipped with NDK isn't able to find python 3.9 library #1566

Closed
rprichard opened this issue Aug 20, 2021 · 4 comments
Closed

[BUG] LLDB shipped with NDK isn't able to find python 3.9 library #1566

rprichard opened this issue Aug 20, 2021 · 4 comments
Assignees
Labels

Comments

@rprichard
Copy link
Collaborator

rprichard commented Aug 20, 2021

I haven't tested ndk-gdb, but I suspect it's broken. The python 3.9 dynamic library isn't in the toolchain's lib64 directory, but is instead in its python3/lib64 directory. On Linux and Darwin, there isn't an rpath pointing at the python3 directory.

macOS:

$ /Users/rprichard/android-ndk-r23/toolchains/llvm/prebuilt/darwin-x86_64/bin/lldb 
dyld: Library not loaded: @rpath/libpython3.9.dylib
  Referenced from: /Users/rprichard/android-ndk-r23/toolchains/llvm/prebuilt/darwin-x86_64/lib64/liblldb.12.0.5git.dylib
  Reason: image not found

Linux:

rprichard@cashew:/x/android-ndk-r23$ docker run -it -v$PWD:$PWD ubuntu:20.04 $PWD/toolchains/llvm/prebuilt/linux-x86_64/bin/lldb
/x/android-ndk-r23/toolchains/llvm/prebuilt/linux-x86_64/bin/lldb: error while loading shared libraries: libpython3.9.so.1.0: cannot open shared object file: No such file or directory

Windows:

C:\src>set PATH=C:\Windows\System32;C:\Windows
C:\src>c:\src\android-ndk-r23\toolchains\llvm\prebuilt\windows-x86_64\bin\lldb.exe

A dialog appears: The code execution cannot proceed because python39.dll was not found.

@MlsDmitry
Copy link

MlsDmitry commented Jan 23, 2022

I overcame this issue via appending python library to search path.

export DYLD_LIBRARY_PATH="/Users//Library/Android/sdk/ndk//toolchains/llvm/prebuilt/darwin-x86_64/python3/lib"

Then it failed with another message:
"terminals database is inaccessible"

@DanAlbert DanAlbert moved this to Triaged in NDK r26 Jun 27, 2022
@DanAlbert
Copy link
Member

The lldb.sh script in the same directory solves this issue. Does this bug predate that, or is the question here "why is this necessary?"

@pirama-arumuga-nainar, is the script something we need, or just a workaround while we wait for someone to fix the RPATH?

@pirama-arumuga-nainar
Copy link
Collaborator

We also use the script to set PYTHONHOME - which IIUC can't be eliminated.

I also don't see a build option to set just lldb's linker flags without adding this RPATH to the rest of the tools. So let's continue using the script to set LD_LIBRARY_PATH as well.

@github-project-automation github-project-automation bot moved this from Triaged to Merged in NDK r26 May 15, 2023
@appujee
Copy link
Collaborator

appujee commented May 15, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Merged
Development

No branches or pull requests

5 participants