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]: libglvnd: SONAME conflict of libEGL.so with system one #16548

Closed
xtkoba opened this issue May 3, 2023 · 6 comments · Fixed by #16547
Closed

[Bug]: libglvnd: SONAME conflict of libEGL.so with system one #16548

xtkoba opened this issue May 3, 2023 · 6 comments · Fixed by #16547
Labels
bug report Something is not working properly

Comments

@xtkoba
Copy link
Contributor

xtkoba commented May 3, 2023

Problem description

libEGL.so from libglvnd package and libOpenSLES.so (under /system/lib*) cannot be loaded together. The dynamic linker complains that it cannot locate symbol "eglDestroySyncKHR" referenced by "/system/lib64/libgui.so".

PR #16547 (enabling SOVERSION suffix for shared libs in libglvnd package) solves this issue.

What steps will reproduce the bug?

echo 'int main(int argc, char **argv){ return 0; }' | clang -x c - -o a.out -Wl,--no-as-needed -lOpenSLES -lEGL && ./a.out

produces the error

CANNOT LINK EXECUTABLE "./a.out": cannot locate symbol "eglDestroySyncKHR" referenced by "/system/lib64/libgui.so"...

What is the expected behavior?

The program should exit successfully.

System information

termux-info:

Termux Variables:
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=5210
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://packages-cf.termux.dev/apt/termux-main/ stable main
# x11-repo (sources.list.d/x11.list)
deb https://packages-cf.termux.dev/apt/termux-x11/ x11 main
Updatable packages:
All packages up to date
termux-tools version:
1.38.1
Android version:
12
Kernel build information:
Linux localhost 4.19.191-g234d1747e22a #1 SMP PREEMPT Sat Mar 25 18:12:54 CST 2023 aarch64 Android
Device manufacturer:
motorola
Device model:
moto e32(s)
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
@xtkoba xtkoba added the bug report Something is not working properly label May 3, 2023
@xtkoba xtkoba linked a pull request May 3, 2023 that will close this issue
@tareksander
Copy link
Member

I tried to compile a program that should use the system EGL while having libglvnd installed. The compiler automatically used libEGL.so.1 with -lEGL, so setting LD_LIBRARY_PATH to force the system EGL didn't work anymore. I had to uninstall libglvnd so the compiler picked up on the system EGL. Is there another way to compile for the system libraries? Would this also happen if libglvnd is installed in the build prefix in termux-packages?

@truboxl
Copy link
Contributor

truboxl commented May 7, 2023

Pass -L/system/lib64 -lEGL when compiling
LD_LIBRARY_PATH is never used during compiling

@tareksander
Copy link
Member

LD_LIBRARY_PATH is never used during compiling

I used that when running the compiled program.

Pass -L/system/lib64 -lEGL when compiling

That won't work when the program is build with termux-packages, right?

@truboxl
Copy link
Contributor

truboxl commented May 7, 2023

That won't work when the program is build with termux-packages, right?

There is no /system/lib64/libEGL.so in the builder docker image so no...

@sylirre
Copy link
Member

sylirre commented May 7, 2023

It is available as stub library in NDK toolchain:

builder@b562e3eab757:~/termux-packages$ find ~/lib/android-ndk-r25c/ -name "libEGL.so" | grep 24
/home/builder/lib/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/arm-linux-androideabi/24/libEGL.so
/home/builder/lib/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/24/libEGL.so
/home/builder/lib/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android/24/libEGL.so
/home/builder/lib/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/i686-linux-android/24/libEGL.so

@EDLLT
Copy link
Contributor

EDLLT commented Sep 13, 2024

Pass -L/system/lib64 -lEGL when compiling LD_LIBRARY_PATH is never used during compiling

I am facing the exact same error when trying to run RNote
CANNOT LINK EXECUTABLE "./rnote": cannot locate symbol "eglDestroySyncKHR" referenced by "/system/lib64/libgui.so"...
#17655 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Something is not working properly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
@truboxl @EDLLT @tareksander @xtkoba @sylirre and others