Skip to content

Commit 7b0d9ad

Browse files
alisanikiforovazibaiwan
authored andcommitted
Load libz.so.1 alongside libz.so
Some supported OSs only contain libz.so.1, which dlopen fails to find causing our compiles to fail because the packager editor library is used during compile. This change ensures ew check for botrh libz.so.1 and libz.so beofre freaking out and saying libz isn't installed.
1 parent 2391f54 commit 7b0d9ad

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/pkg_editor/src/zlib.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ static void *zlib_load_library() {
8686
void *const library = (void *)LoadLibraryA(WINDOWS_ZLIB_PATH);
8787
return library;
8888
#else
89+
void *const dlopen_handle = dlopen("libz.so.1", RTLD_NOW);
90+
if (dlopen_handle) {
91+
return dlopen_handle;
92+
}
8993
return dlopen("libz.so", RTLD_NOW);
9094
#endif
9195
}

0 commit comments

Comments
 (0)