Repository navigation
Link nativewindow instead of android on Android - #9
Merged
Merged
Conversation
libandroid.so pulls in ~200 system libraries, and inside a Wine guest they resolve their own dependencies through LD_LIBRARY_PATH, so they bind to imagefs libraries of the same name. On Samsung and Xiaomi HyperOS that fails to link, and the Vulkan loader then cannot load the layer at all. The layer only needs AHardwareBuffer from the Android libraries, which libnativewindow.so exports, and its dependencies share no names with imagefs.
utkarshdalal
pushed a commit
to utkarshdalal/GameNative
that referenced
this pull request
Oct 23, 2026
Built from GameNative/lsfg-vk-android#9 (release + link nativewindow instead of android) instead of patching the old binary.
4 of 8 tasks
utkarshdalal
added a commit
to utkarshdalal/GameNative
that referenced
this pull request
Oct 23, 2026
* Stop the DNS shim and LSFG layer from loading libandroid.so libandroid.so pulls in ~200 system libraries that look up their own dependencies through the guest's LD_LIBRARY_PATH, so they bind to imagefs libraries of the same name and fail to link on Samsung (libsqlite needs BoringSSL's libcrypto) and Xiaomi HyperOS (libjpeg-hyper needs the system libjpeg). DNS shim: res_query() returned ENOSYS for every query when that dlopen failed, and Wine's Android dnsapi, which dlsyms android_res_nquery from its own failed libandroid handle, called a NULL pointer. Call resNetworkQuery and resNetworkResult from libnetd_client.so (what libandroid's wrappers do) and export android_res_nquery/android_res_nresult with libandroid's behaviour so dnsapi finds them through RTLD_DEFAULT. android_getaddrinfofornetwork(0, ...) is the same call as getaddrinfo(), so use that. LSFG layer: drop its unused DT_NEEDED on libandroid.so (it only imports __android_log_print from liblog) and bump the runtime version so containers reinstall it. * Rebuild the LSFG layer from source against libnativewindow Built from GameNative/lsfg-vk-android#9 (release + link nativewindow instead of android) instead of patching the old binary. --------- Co-authored-by: Utkarsh Dalal <utkarsh.dalal@toptal.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The layer links
libandroid.sobut uses nothing from it onrelease(its only Android import is__android_log_print, from liblog). Inside a Wine guest, libandroid's ~200 system dependencies look up their own libraries throughLD_LIBRARY_PATH, so they bind to imagefs libraries with the same name. On Samsung (libsqlite needs BoringSSL's libcrypto) and Xiaomi HyperOS (libjpeg-hyper needs the system libjpeg) that fails to link, the Vulkan loader cannot load the layer, and LSFG silently does nothing.This links
nativewindowinstead. It has no effect onrelease, which needs neither, butandroid-gen8-fixescallsAHardwareBuffer_allocate/AHardwareBuffer_release, and those live in libnativewindow.so. Its 31-library tree shares no names with imagefs.Tested on a POCO F6 with libandroid forced to fail the way it does on Samsung (stub
libsqlite.sofirst onLD_LIBRARY_PATH), Blazing Chrome with LSFG armed:dlopenfails (cannot locate symbol "sqlite3_extended_errcode" referenced by libandroid_runtime.so) and the layer never runsBuilt with
scripts/build/android.sh's flags (NDK r27d) plus-ffile-prefix-mapfor the source path. Dynamic exports are identical to the layer currently shipped in GameNative.