This series addresses several Android-specific build failures and toolchain interactions observed when building Wine with recent Android NDK versions. Some of these changes were previously proposed but not accepted due to insufficient explanation of the underlying behavior. This submission reintroduces those fixes with more detailed technical justification and adds a few additional related corrections discovered during further testing. The changes include: - Replace `ffs()` with `__builtin_ffs()` in ntdll. Android builds fail due to ffs() being used without `<strings.h>`, which Wine does not include. Using `__builtin_ffs()` avoids implicit declaration errors under C99 and matches existing usage elsewhere in the tree while preserving semantics. - Avoid pthread mutex attributes in winepulse on Android. `pthread_mutexattr_setprotocol()` may be exposed at configure time depending on the selected API level, but actual availability depends on the device's bionic libc. Robust mutex support is not provided by bionic. Configure-time detection can therefore select a code path that is not reliably supported at runtime. Use plain `pthread_mutex_init()` on Android and retain the existing attribute-based initialization on other platforms. - Force `--rosegment` for `wine-preloader` on Android (API < 29, NDK r22+). Since NDK r22, clang implicitly passes `-Wl,--no-rosegment` when targeting API levels below 29 ([NDK changelog](https://github.com/android/ndk/wiki/Changelog-r22) Issue 1196). Because wine-preloader links with `-Wl,-Ttext=0x7d400000`, this results in a `PT_LOAD` segment with a very large file offset to preserve the VMA-to-file-offset relationship, creating a sparse gap (`~0x7d400000`) and inflating the apparent ELF size to `~2GB`. `wine-preloader` is a static binary and does not depend on unwind/backtrace correctness, so inheriting `--no-rosegment` provides no benefit. Force `-Wl,--rosegment` when supported to keep the segment layout reasonable, without affecting other binaries. Overall, this series improves Android NDK compatibility, prevents false feature detection based on header exposure or API-level-dependent behavior, and fixes ARM assembler incompatibilities, while keeping the changes restricted to Android-specific paths. -- v4: wineandroid: force --rosegment for wine-preloader on Android (API < 29, NDK r22+) winepulse: avoid pthread mutex attributes on Android due to unreliable availability ntdll/unix: use __builtin_ffs instead of ffs in ldt_alloc_entry https://gitlab.winehq.org/wine/wine/-/merge_requests/10067