Building Wine stable - undefined symbol posix_spawn

Hey, Tried building wine-stable via the packages.yml github workflow, and getting this error:
2025-07-19T17:16:54.1889677Z /home/builder/.termux-build/wine-stable/host-build/tools/winegcc/winegcc -o dlls/avicap32/i386-windows/avicap32.dll --wine-objdir . \
2025-07-19T17:16:54.1897592Z --winebuild /home/builder/.termux-build/wine-stable/host-build/tools/winebuild/winebuild -b \
2025-07-19T17:16:54.1898361Z i686-w64-mingw32 -Wl,--wine-builtin -shared \
2025-07-19T17:16:54.1899165Z /home/builder/.termux-build/wine-stable/src/dlls/avicap32/avicap32.spec \
2025-07-19T17:16:54.1899983Z dlls/avicap32/i386-windows/avicap32_main.o dlls/user32/i386-windows/libuser32.a \
2025-07-19T17:16:54.1900843Z dlls/winecrt0/i386-windows/libwinecrt0.a dlls/ucrtbase/i386-windows/libucrtbase.a \
2025-07-19T17:16:54.1901897Z dlls/kernel32/i386-windows/libkernel32.a dlls/ntdll/i386-windows/libntdll.a --no-default-config -Wl,--disable-stdcall-fixup
2025-07-19T17:16:54.2093986Z ld.lld: error: undefined symbol: posix_spawn
2025-07-19T17:16:54.2097045Z >>> referenced by loader.c
2025-07-19T17:16:54.2097507Z >>> dlls/ntdll/unix/loader.o:(build_path_and_exec)
2025-07-19T17:16:54.2122044Z clang: error: linker command failed with exit code 1 (use -v to see invocation)
2025-07-19T17:16:54.2148339Z make: *** [Makefile:279117: dlls/ntdll/ntdll.so] Error 1
2025-07-19T17:16:54.2158144Z make: *** Waiting for unfinished jobs....
2025-07-19T17:16:54.3939471Z ##[error]Process completed with exit code 2.
2025-07-19T17:16:54.1889677Z /home/builder/.termux-build/wine-stable/host-build/tools/winegcc/winegcc -o dlls/avicap32/i386-windows/avicap32.dll --wine-objdir . \
2025-07-19T17:16:54.1897592Z --winebuild /home/builder/.termux-build/wine-stable/host-build/tools/winebuild/winebuild -b \
2025-07-19T17:16:54.1898361Z i686-w64-mingw32 -Wl,--wine-builtin -shared \
2025-07-19T17:16:54.1899165Z /home/builder/.termux-build/wine-stable/src/dlls/avicap32/avicap32.spec \
2025-07-19T17:16:54.1899983Z dlls/avicap32/i386-windows/avicap32_main.o dlls/user32/i386-windows/libuser32.a \
2025-07-19T17:16:54.1900843Z dlls/winecrt0/i386-windows/libwinecrt0.a dlls/ucrtbase/i386-windows/libucrtbase.a \
2025-07-19T17:16:54.1901897Z dlls/kernel32/i386-windows/libkernel32.a dlls/ntdll/i386-windows/libntdll.a --no-default-config -Wl,--disable-stdcall-fixup
2025-07-19T17:16:54.2093986Z ld.lld: error: undefined symbol: posix_spawn
2025-07-19T17:16:54.2097045Z >>> referenced by loader.c
2025-07-19T17:16:54.2097507Z >>> dlls/ntdll/unix/loader.o:(build_path_and_exec)
2025-07-19T17:16:54.2122044Z clang: error: linker command failed with exit code 1 (use -v to see invocation)
2025-07-19T17:16:54.2148339Z make: *** [Makefile:279117: dlls/ntdll/ntdll.so] Error 1
2025-07-19T17:16:54.2158144Z make: *** Waiting for unfinished jobs....
2025-07-19T17:16:54.3939471Z ##[error]Process completed with exit code 2.
Has anyone seen this or know what the cause could be? libandroid_spawn is of course included in the TERMUX_PKG_DEPENDS, I haven't changed that.
5 Replies
Biswa96
Biswa962mo ago
Are you building wine-stable using termux-packages repository without any modifications?
Utkarsh Dalal
Utkarsh DalalOP2mo ago
I've made some small modifications to the build flags - https://github.com/utkarshdalal/termux-packages/blob/wine/x11-packages/wine-stable/build.sh Specifically, added --with-alsa, --with-gstreamer, --with-opencl, --with-x and --with-xxf86vm Accordingly, I also added gst-plugins-base, gstreamer,, libandroid-shmem,, libx11 libxi, libxrandr, libxxf86vm, ocl-icd, opencl-headers to the TERMUX_PACKAGE_DEPENDS
GitHub
termux-packages/x11-packages/wine-stable/build.sh at wine · utkars...
A build system and primary set of packages in format pacman for Termux. - utkarshdalal/termux-packages
Utkarsh Dalal
Utkarsh DalalOP2mo ago
I'll try with the original build.sh now too. It'll take about 30 minutes to run, I'll let you know if that works
Biswa96
Biswa962mo ago
uncomment the LDFLAGS+=" -landroid-spawn" line
Utkarsh Dalal
Utkarsh DalalOP2mo ago
Ok, I'll try that too. I actually added it in because I was getting this error, but lemme build and report back. ah wait, sorry - i see what you're saying. Silly me. Trying that now. I had added that because my x86 build was failing immediately with it, but just undid that and trying again This built fine. Apologies, this one is on me. Thanks for the help regardless.

Did you find this page helpful?