-
Notifications
You must be signed in to change notification settings - Fork 299
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
Unable to run on Musl libc, "can't get libdl.so" #601
Comments
Yes I believe it's part of libc. We (at least partly) use it for dlopen so we can load libraries at runtime From the musl manual |
Shit, so I guess that means it won't work. At least till they actually implement it rather than just being empty files... |
How about just replacing EDIT: As alternative a symlink to |
Well, indirectly it can. #if defined(__LINUX__) && !defined(__GLIBC_)
That basically comes down to Musl. Well and I suppose uclibc, but who uses that on a platform where they would want to use MangoHud? 🤔 |
glibc 2.34+ also moved dlopen and dlsym to libc.so, so I'd imagine the solution would be something like this: --- a/src/real_dlsym.cpp
+++ b/src/real_dlsym.cpp
@@ -19,10 +19,17 @@ void get_real_functions()
{
eh_obj_t libdl;
+#if !defined(__GLIBC_) || __GLIBC_PREREQ(2, 34)
+ if (eh_find_obj(&libdl, "*libc.so*")) {
+ fprintf(stderr, "can't get libc.so\n");
+ exit(1);
+ }
+#else
if (eh_find_obj(&libdl, "*libdl.so*")) {
fprintf(stderr, "can't get libdl.so\n");
exit(1);
}
+#endif
if (eh_find_sym(&libdl, "dlopen", (void **) &__dlopen)) {
fprintf(stderr, "can't get dlopen()\n"); |
I think it still needs libdl path for compatibility. Does ced84ec help? |
It sadly does not. > mangohud --dlsym target/release/leafish
MANGOHUD: Cannot find libdl.so and libc.so However EDIT: Oh wait, it searches for |
😩 Ah yes, but probably |
I just modified your commit to do just that and I get the same result sadly. However checking
So I assume this will never work on Musl? |
Try 2: https://github.com/flightlessmango/MangoHud/tree/dlsym_fs e: dl_iterate_phdr probably still blocks? |
Hi, I'm on openSUSE Tumbleweed (2.34-1.2 currently) and I was getting |
@jackun I'd love to try but sadly that branch fails to compile for me (before I only compiled latest release, 2.6.5):
|
For some reason it is using system |
This is spdlog 1.9.2 from the system, which pulls in it's own fmt. Is that too new for mangohud? |
Ah, nevermind. It's my own function, try changing |
That worked, getting close.
|
Pull again but |
|
See #693. I had the same issue with mangohud |
yeah v0.6.6-1 Fix it. |
This problem exists in Ubuntu 22.04 (jammy jellyfish). This bug is probably related: https://bugs.launchpad.net/ubuntu/+source/mangohud/+bug/1993862 |
In https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/46458 I'm trying to package this for Alpine. With the following patch applied, it almost works: --- a/src/meson.build
+++ b/src/meson.build
@@ -3,10 +3,10 @@
# Needs prefix for configure_file()
if get_option('append_libdir_mangohud')
libdir_mangohud = join_paths(get_option('prefix'), get_option('libdir'), 'mangohud')
- ld_libdir_mangohud = get_option('prefix') + '/\$LIB/mangohud/'
+ ld_libdir_mangohud = join_paths(get_option('prefix'), get_option('libdir'), 'mangohud') + '/'
else
libdir_mangohud = join_paths(get_option('prefix'), get_option('libdir'))
- ld_libdir_mangohud = get_option('prefix') + '/\$LIB/'
+ ld_libdir_mangohud = join_paths(get_option('prefix'), get_option('libdir')) + '/'
endif
conf_data = configuration_data()
--- a/src/real_dlsym.cpp
+++ b/src/real_dlsym.cpp
@@ -26,6 +26,7 @@
#endif
"*libc.so*",
"*libc.*.so*",
+ "*ld-musl-*.so*",
};
for (size_t i = 0; i < sizeof(libs) / sizeof(*libs); i++) However, this check fails (for both /* This is here to catch b0rken headers (vdso) */
if ((eh_check_addr(obj, (const void *) obj->strtab)) |
(eh_check_addr(obj, (const void *) obj->symtab)))
return ENOTSUP; So, for OpenGL no luck yet, but with Vulkan it works fine with Alpine/musl. Has anyone an idea why |
I was looking to use MangoHud on Alpine, but unfortunately this is still a problem, even on 0.6.9. Void Linux has MangoHud packaged for musl, maybe it works for them as they dont include such a patch for dlsym. |
elf(5) documents it this way, GLIBC diverts from this documentation partial fix for flightlessmango#601
See
The way I'm reading this, is that Fix for this is available in #1133 |
elf(5) documents it this way, GLIBC diverts from this documentation partial fix for flightlessmango#601
elf(5) documents it this way, GLIBC diverts from this documentation partial fix for #601
I've been trying to get MangoHud to run on Musl libc systems to use with FOSS games compiled for this libc, but so far I've been unable to do so.
I'm not sure what this "libdl.so" is, but I'm assuming it's a glibc thing? MangoHud compiles fine with Musl however, so not sure what's up.
The text was updated successfully, but these errors were encountered: