We don't use strings.h in Wine. Other places use \__builtin_ffs which is probably what we want here.
I can make the patch for this, but I am not sure I can properly test it. But I think CI should catch any related regression. Not sure about MacOS related builds. Do you want me to make a separate MR for this?
There's nothing Android-specific about this. It should check for the availability of the corresponding function or define (assuming we really need a robust mutex here, I'm not sure that's the case).
On Android the check will report that the mutex attribute and defines are available, but the code will fail in runtime. Or probably the runtime linker will report missing function during application startup. It only means NDK contains required exports, but device's bionic libc (on old devices) may not contain them or can not handled them properly.
Please explain in more details what's happening here.
I thought it was r22 change but seems like I am wrong. Or at least it is stated in https://github.com/android/ndk/wiki/Changelog-r22 but we've got this problem only when switched to the new NDK release.
Issue 1196: Backtraces for crashes on devices older than API 29 are now correct when using LLD if using ndk-build or the CMake toolchain file. If using a different system and targeting devices older than API 29, use -Wl,--no-rosegment when linking. See the Build System Maintainers Guide for more information.
Termux maintainers found out that NDK (starting with r29) implicitly passes `-Wl,--no-rosegment` to the linker (or probably they make it the new default?) and we are required to push that into our `LDFLAGS` (at least in our build configuration). -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9977#note_128852