termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.33k stars 3.07k forks source link

[Bug]: ncmpcpp not working #14577

Closed dxcvvxd closed 1 year ago

dxcvvxd commented 1 year ago

Problem description

running mpd results in an error CANNOT LINK EXECUTABLE "mpd": cannot locate symbol "eglDestroySyncKHR" referenced by "/system/lib64/libgui.so"... no idea why that happens (especially the egl part, why does it need it?). thanks.

What steps will reproduce the bug?

run mpd get an error

What is the expected behavior?

it should just work

System information

termux-info:

Termux Variables:
TERMUX_API_APP__VERSION_NAME=0.50.1+2c6674f
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP__AM_SOCKET_SERVER_ENABLED=true
TERMUX_APP__APK_PATH=/data/app/~~ab5x9SiJYPo-1vUt46Guxw==/com.termux-etB5XC8Q7uD_n5hFXZ7Gyg==/base.apk
TERMUX_APP__APK_RELEASE=GITHUB
TERMUX_APP__FILES_DIR=/data/user/0/com.termux/files
TERMUX_APP__IS_DEBUGGABLE_BUILD=true
TERMUX_APP__IS_INSTALLED_ON_EXTERNAL_STORAGE=false
TERMUX_APP__PACKAGE_MANAGER=apt
TERMUX_APP__PACKAGE_NAME=com.termux
TERMUX_APP__PACKAGE_VARIANT=apt-android-5
TERMUX_APP__PID=25877
TERMUX_APP__SE_FILE_CONTEXT=u:object_r:app_data_file:s0:c147,c256,c512,c768
TERMUX_APP__SE_INFO=default:targetSdkVersion=28:complete
TERMUX_APP__SE_PROCESS_CONTEXT=u:r:untrusted_app_27:s0:c147,c256,c512,c768
TERMUX_APP__TARGET_SDK=28
TERMUX_APP__UID=10147
TERMUX_APP__USER_ID=0
TERMUX_APP__VERSION_CODE=118
TERMUX_APP__VERSION_NAME=0.118.0+be66cff
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0+be66cff
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://grimler.se/termux/termux-main stable main
# root-repo (sources.list.d/root.list)
deb https://grimler.se/termux/termux-root root stable
# x11-repo (sources.list.d/x11.list)
deb https://grimler.se/termux/termux-x11 x11 main
Updatable packages:
clang/stable 15.0.7 aarch64 [upgradable from: 15.0.6]
command-not-found/stable 2.1.0-6 aarch64 [upgradable from: 2.1.0-3]
ed/stable 1.19 aarch64 [upgradable from: 1.18]
libcompiler-rt/stable 15.0.7 aarch64 [upgradable from: 15.0.6]
libllvm/stable 15.0.7 aarch64 [upgradable from: 15.0.6]
liblzma/stable 5.4.1 aarch64 [upgradable from: 5.4.0]
lld/stable 15.0.7 aarch64 [upgradable from: 15.0.6]
llvm/stable 15.0.7 aarch64 [upgradable from: 15.0.6]
mesa/stable 22.3.3 aarch64 [upgradable from: 22.3.2]
termux-tools/stable 1.36.0 all [upgradable from: 1.35.0]
unbound/stable 1.17.1 aarch64 [upgradable from: 1.17.0-1]
xz-utils/stable 5.4.1 aarch64 [upgradable from: 5.4.0]
termux-tools version:
1.35.0
Android version:
12
Kernel build information:
Linux localhost 4.9.190+ #1 SMP PREEMPT Wed Apr 7 19:02:35 CST 2021 aarch64 Android
Device manufacturer:
Blackview
Device model:
BV5900
xtkoba commented 1 year ago

First make sure that LD_LIBRARY_PATH is unset and LD_PRELOAD is sane.

This could be an instance of the duplicate SONAME issue like #13992. But as of now I doubt it, because $PREFIX/bin/mpd does not depend on $PREFIX/lib/libEGL.so in its DT_NEEDED tree, and IIUC the DT_NEEDED entry libEGL.so in /system/lib64/libgui.so should reference /system/lib64/libEGL.so. In fact this issue does not reproduce on my Android 8.1.0 environment.

xtkoba commented 1 year ago

That said, there could be a dynamic linker that behaves differently. I suggest sharing the strace output of mpd command from which we can guess the actual behavior. (Fake ldd command such as libtree cannot be used in this case.)

dxcvvxd commented 1 year ago

i tried unsetting the ld lib path, and it worked. but do i have to do that everytime now? speaking of strace, can i output it to a file like a logcat? there's too much errors to fit on one screen

xtkoba commented 1 year ago

It is known that LD_LIBRARY_PATH causes troubles when it contains $PREFIX/lib. In the past LD_LIBRARY_PATH seems to have been used in Termux. But it is not needed now, because Android 7.0 (API 24) or later support DT_RUNPATH. LD_LIBRARY_PATH should be unset unless absolutely necessary.

xtkoba commented 1 year ago

Redirect of strace output can be done as:

strace mpd 2>strace.log

But it is no more needed, as this issue has already been resolved.

dxcvvxd commented 1 year ago

thanks

Grimler91 commented 1 year ago

It is known that LD_LIBRARY_PATH causes troubles when it contains $PREFIX/lib. In the past LD_LIBRARY_PATH seems to have been used in Termux. But it is not needed now, because Android 7.0 (API 24) or later support DT_RUNPATH. LD_LIBRARY_PATH should be unset unless absolutely necessary.

Yeah, so issue here is that app variant installed is for android-5 and 6:

TERMUX_APP__PACKAGE_VARIANT=apt-android-5

Install an apt-android-7 variant instead since you are on android-12

0dminnimda commented 2 months ago

What fixed the same error for me (but for ffmpeg) is apt install libandroid-stub