Open DuilioPerez opened 3 weeks ago
llvm-mingw-w64
will not statically link binaries. This is intended and will not be fixed.wine explorer.exe
in that way. I always start a desktop before using explorer.exe
.
llvm-mingw-w64
will not statically link binaries. This is intended and will not be fixed.
I'm not talking about issues with llvm-mingw-w64. I'm talking about important libraries missing in the package wine now:
~ $ vim helloWorld.cpp
~ $ aarch64-w64-mingw32-clang++ helloWorld.cpp -o helloWorld
~ $ wine helloWorld.exe
0084:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0084:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0084:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0084:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0090:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0090:err:winediag:nodrv_CreateWindow L"The explorer process failed to start."
0090:err:systray:initialize_systray Could not create tray window
0054:err:dnsapi:DllMain No libresolv support, expect problems
0024:err:module:import_dll Library libc++.dll (which is needed by L"Z:\\data\\data\\com.termux\\files\\home\\helloWorld.exe") not found
0024:err:module:import_dll Library libunwind.dll (which is needed by L"Z:\\data\\data\\com.termux\\files\\home\\helloWorld.exe") not found
0024:err:module:loader_init Importing dlls for L"Z:\\data\\data\\com.termux\\files\\home\\helloWorld.exe" failed, status c0000135
~ $ aarch64-w64-mingw32-clang++ helloWorld.cpp -o helloWorld -static-libstdc++ -static-libgcc
~ $ wine helloWorld.exe
0084:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0084:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0084:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0084:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0064:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0064:err:winediag:nodrv_CreateWindow L"The explorer process failed to start."
0064:err:systray:initialize_systray Could not create tray window
0054:err:dnsapi:DllMain No libresolv support, expect problems
Hello world!
~ $
- I haven't started
wine explorer.exe
in that way. I always start a desktop before usingexplorer.exe
.
In the other way should be open until you close it manually.
- Missing fonts may cause issues related to unicode characters rendering. You can try installing these fonts.
This issue isn't caused by missing fonts, maybe it is caused by missing libraries or wrong character decoding:
~ $ cat test.c
#include <stdio.h>
int main(void)
{
puts("áéíóú");
}
~ $ aarch64-w64-mingw32-clang test.c -o test
~ $ wine cmd
0080:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0080:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0080:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0080:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0088:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0088:err:winediag:nodrv_CreateWindow L"The explorer process failed to start."
0088:err:systray:initialize_systray Could not create tray window
0054:err:dnsapi:DllMain No libresolv support, expect problems
Microsoft Windows 10.0.22000
Z:\data\data\com.termux\files\home>echo "áéíóú"
"áéíóú"
Z:\data\data\com.termux\files\home>test
áéÃóú
Z:\data\data\com.termux\files\home>exit
~ $
0024:err:module:import_dll Library libc++.dll (which is needed by L"Z:\data\data\com.termux\files\home\helloWorld.exe") not found 0024:err:module:import_dll Library libunwind.dll (which is needed by L"Z:\data\data\com.termux\files\home\helloWorld.exe") not found
Those can be found in llvm-mingw directory. For example, aarch64-w64-mingw32/bin/libc++.dll
0024:err:module:import_dll Library libc++.dll (which is needed by L"Z:\data\data\com.termux\files\home\helloWorld.exe") not found 0024:err:module:import_dll Library libunwind.dll (which is needed by L"Z:\data\data\com.termux\files\home\helloWorld.exe") not found
Those can be found in llvm-mingw directory. For example,
aarch64-w64-mingw32/bin/libc++.dll
That should be an error with wine configuration. Those warning are from wine, not from llvm-mingw-w64
You have to setup the environment so that the .exe can find those .dll. It is same in Windows also. Try to prepend the bin/ directory in PATH env var.
I'm not familiar with Windows, but I think there should be available some libraries at least, like libc++, wich isn't available in wine for termux. If adding those path is needed, then the package should depend on llvm-mingw-w64
I'm not familiar with Windows, but I think there should be available some libraries at least, like libc++, wich isn't available in wine for termux.
Those are provided in llvm-mingw-w64-ucrt package.
$ apt-file search aarch64-w64-mingw32/bin/libc++.dll
llvm-mingw-w64-ucrt: /data/data/com.termux/files/usr/opt/llvm-mingw-w64/aarch64-w64-mingw32/bin/libc++.dll
I'm not familiar with Windows, but I think there should be available some libraries at least, like libc++, wich isn't available in wine for termux.
Those are provided in llvm-mingw-w64-ucrt package.
$ apt-file search aarch64-w64-mingw32/bin/libc++.dll llvm-mingw-w64-ucrt: /data/data/com.termux/files/usr/opt/llvm-mingw-w64/aarch64-w64-mingw32/bin/libc++.dll
It isn't a dependency of wine:
Package: wine-stable
Version: 9.0
Maintainer: @termux
Installed-Size: 536 MB
Depends: fontconfig, freetype, krb5, libandroid-spawn, libc++, libgmp, libgnutls, libxcb, libxcomposite, libxcursor, libxfixes, libxrender, mesa, opengl, pulseaudio, sdl2, vulkan-loader, xorg-xrandr
Homepage: https://www.winehq.org/
Download-Size: 90.7 MB
APT-Manual-Installed: yes
APT-Sources: https://packages-cf.termux.dev/apt/termux-x11 x11/main aarch64 Packages
Description: A compatibility layer for running Windows programs
I guess support to run C and C programs that only uses the standard library should be fundamental in wine
If adding those path is needed, then the package should depend on llvm-mingw-w64
wine does on depends on those libraries but the cross compiled .exe or .dll do.
wine does on depends on those libraries but the cross compiled .exe or .dll do.
Wine depends on those libraries, but in the linux host platform. Wine doesn't contains those libraroes. In otjer words, wine depends on the shared objects (.so), but doesn't contains the dinamic link libraries (.dll) for the c++ standard amd there are missing other highly used dlls by programs, at least, by C++ programs that uses the C standard, without extensions.
I'm not familiar with Windows, but I think there should be available some libraries at least, like libc++, wich isn't available in wine for termux. If adding those path is needed, then the package should depend on llvm-mingw-w64
Actually I don't think so. Windows executables should bundled these libraries with themselves if they depend them. The behavior in Termux is the same as other distros. Just like the following result on Ubuntu 22.04.
~$ sudo apt install mingw-w64 wine-stable
~$ x86_64-w64-mingw32-g++ main.cpp -o a.exe
~$ wine a.exe
0024:err:module:import_dll Library libgcc_s_seh-1.dll (which is needed by L"Z:\\a.exe") not found
0024:err:module:import_dll Library libstdc++-6.dll (which is needed by L"Z:\\a.exe") not found
0024:err:module:LdrInitializeThunk Importing dlls for L"Z:\\a.exe" failed, status c0000135
The codec issue you encountered is also not specific to Termux either.
~$ x86_64-w64-mingw32-gcc test.c
~$ wine a.exe
it looks like wine32 is missing, you should install it.
multiarch needs to be enabled first. as root, please
execute "dpkg --add-architecture i386 && apt-get update &&
apt-get install wine32"
áéÃóú
Using wine with mingw toolchain is not a common usage, so I still don't think there is any need to make wine-stable
depending on llvm-mingw-w64
in Termux.
Ok, I've made some researchs, and: 1 - Windows (not only wine) have a strange behavior with unicode characters. 2 - Wine needs libraries to run c programs. 3 - Wine desktop crashing is not common, so this is an issue.
I've recently have tried to run clang-20 in wine, but it don't run. It seems it have issues with pathes, because python works right:
~/llvm-mingw-nightly-ucrt-aarch64 $ ls bin/
aarch64-w64-mingw32-addr2line.exe i686-w64-mingw32-ranlib.exe
aarch64-w64-mingw32-ar.exe i686-w64-mingw32-readelf.exe
aarch64-w64-mingw32-as.exe i686-w64-mingw32-size.exe
aarch64-w64-mingw32-c++.exe i686-w64-mingw32-strings.exe aarch64-w64-mingw32-clang++.exe i686-w64-mingw32-strip.exe
aarch64-w64-mingw32-clang-scan-deps.exe i686-w64-mingw32-widl.exe
aarch64-w64-mingw32-clang.exe i686-w64-mingw32-windres.exe
aarch64-w64-mingw32-dlltool.exe i686-w64-mingw32uwp-addr2line.exe
aarch64-w64-mingw32-g++.exe i686-w64-mingw32uwp-ar.exe
aarch64-w64-mingw32-gcc.exe i686-w64-mingw32uwp-as.exe
aarch64-w64-mingw32-ld i686-w64-mingw32uwp-c++.exe
aarch64-w64-mingw32-llvm-ar.exe i686-w64-mingw32uwp-clang++.exe
aarch64-w64-mingw32-llvm-ranlib.exe i686-w64-mingw32uwp-clang-scan-deps.exe
aarch64-w64-mingw32-nm.exe i686-w64-mingw32uwp-clang.exe
aarch64-w64-mingw32-objcopy.exe i686-w64-mingw32uwp-dlltool.exe
aarch64-w64-mingw32-objdump i686-w64-mingw32uwp-g++.exe
aarch64-w64-mingw32-ranlib.exe i686-w64-mingw32uwp-gcc.exe
aarch64-w64-mingw32-readelf.exe i686-w64-mingw32uwp-ld
aarch64-w64-mingw32-size.exe i686-w64-mingw32uwp-llvm-ar.exe
aarch64-w64-mingw32-strings.exe i686-w64-mingw32uwp-llvm-ranlib.exe
aarch64-w64-mingw32-strip.exe i686-w64-mingw32uwp-nm.exe
aarch64-w64-mingw32-widl.exe i686-w64-mingw32uwp-objcopy.exe
aarch64-w64-mingw32-windres.exe i686-w64-mingw32uwp-objdump
aarch64-w64-mingw32uwp-addr2line.exe i686-w64-mingw32uwp-ranlib.exe
aarch64-w64-mingw32uwp-ar.exe i686-w64-mingw32uwp-readelf.exe
aarch64-w64-mingw32uwp-as.exe i686-w64-mingw32uwp-size.exe
aarch64-w64-mingw32uwp-c++.exe i686-w64-mingw32uwp-strings.exe
aarch64-w64-mingw32uwp-clang++.exe i686-w64-mingw32uwp-strip.exe
aarch64-w64-mingw32uwp-clang-scan-deps.exe i686-w64-mingw32uwp-widl.exe
aarch64-w64-mingw32uwp-clang.exe i686-w64-mingw32uwp-windres.exe
aarch64-w64-mingw32uwp-dlltool.exe intercept-build
aarch64-w64-mingw32uwp-g++.exe ld
aarch64-w64-mingw32uwp-gcc.exe ld-wrapper.sh
aarch64-w64-mingw32uwp-ld ld.lld.exe
aarch64-w64-mingw32uwp-llvm-ar.exe libLLVM-20git.dll
aarch64-w64-mingw32uwp-llvm-ranlib.exe libc++.dll
aarch64-w64-mingw32uwp-nm.exe libclang-cpp.dll
aarch64-w64-mingw32uwp-objcopy.exe libffi-8.dll
aarch64-w64-mingw32uwp-objdump liblldb.dll
aarch64-w64-mingw32uwp-ranlib.exe libomp.dll
aarch64-w64-mingw32uwp-readelf.exe libpython3.11.dll
aarch64-w64-mingw32uwp-size.exe libpython3.dll
aarch64-w64-mingw32uwp-strings.exe libunwind.dll
aarch64-w64-mingw32uwp-strip.exe libwinpthread-1.dll
aarch64-w64-mingw32uwp-widl.exe lldb-argdumper.exe
aarch64-w64-mingw32uwp-windres.exe lldb-dap.exe
addr2line.exe lldb-instr.exe
analyze-build lldb-mi.exe
ar.exe lldb-server.exe
armv7-w64-mingw32-addr2line.exe lldb.exe
armv7-w64-mingw32-ar.exe llvm-addr2line.exe
armv7-w64-mingw32-as.exe llvm-ar.exe
armv7-w64-mingw32-c++.exe llvm-cov.exe
armv7-w64-mingw32-clang++.exe llvm-cvtres.exe
armv7-w64-mingw32-clang-scan-deps.exe llvm-cxxfilt.exe
armv7-w64-mingw32-clang.exe llvm-dlltool.exe
armv7-w64-mingw32-dlltool.exe llvm-ml.exe
armv7-w64-mingw32-g++.exe llvm-nm.exe
armv7-w64-mingw32-gcc.exe llvm-objcopy.exe
armv7-w64-mingw32-ld llvm-objdump.exe
armv7-w64-mingw32-llvm-ar.exe llvm-pdbutil.exe
armv7-w64-mingw32-llvm-ranlib.exe llvm-profdata.exe
armv7-w64-mingw32-nm.exe llvm-ranlib.exe
armv7-w64-mingw32-objcopy.exe llvm-rc.exe
armv7-w64-mingw32-objdump llvm-readelf.exe
armv7-w64-mingw32-ranlib.exe llvm-readobj.exe
armv7-w64-mingw32-readelf.exe llvm-size.exe
armv7-w64-mingw32-size.exe llvm-strings.exe
armv7-w64-mingw32-strings.exe llvm-strip.exe
armv7-w64-mingw32-strip.exe llvm-symbolizer.exe
armv7-w64-mingw32-widl.exe llvm-windres.exe
armv7-w64-mingw32-windres.exe llvm-wrapper.exe
armv7-w64-mingw32uwp-addr2line.exe mingw32-make.exe
armv7-w64-mingw32uwp-ar.exe nm.exe
armv7-w64-mingw32uwp-as.exe objcopy.exe
armv7-w64-mingw32uwp-c++.exe objdump
armv7-w64-mingw32uwp-clang++.exe objdump-wrapper.sh
armv7-w64-mingw32uwp-clang-scan-deps.exe ranlib.exe
armv7-w64-mingw32uwp-clang.exe readelf.exe
armv7-w64-mingw32uwp-dlltool.exe run-clang-tidy
armv7-w64-mingw32uwp-g++.exe scan-build-py
armv7-w64-mingw32uwp-gcc.exe size.exe
armv7-w64-mingw32uwp-ld strings.exe
armv7-w64-mingw32uwp-llvm-ar.exe strip.exe
armv7-w64-mingw32uwp-llvm-ranlib.exe widl.exe
armv7-w64-mingw32uwp-nm.exe windres.exe
armv7-w64-mingw32uwp-objcopy.exe x86_64-w64-mingw32-addr2line.exe
armv7-w64-mingw32uwp-objdump x86_64-w64-mingw32-ar.exe
armv7-w64-mingw32uwp-ranlib.exe x86_64-w64-mingw32-as.exe
armv7-w64-mingw32uwp-readelf.exe x86_64-w64-mingw32-c++.exe
armv7-w64-mingw32uwp-size.exe x86_64-w64-mingw32-clang++.exe
armv7-w64-mingw32uwp-strings.exe x86_64-w64-mingw32-clang-scan-deps.exe
armv7-w64-mingw32uwp-strip.exe x86_64-w64-mingw32-clang.exe
armv7-w64-mingw32uwp-widl.exe x86_64-w64-mingw32-dlltool.exe
armv7-w64-mingw32uwp-windres.exe x86_64-w64-mingw32-g++.exe
c++.exe x86_64-w64-mingw32-gcc.exe
c11.exe x86_64-w64-mingw32-ld
c99.exe x86_64-w64-mingw32-llvm-ar.exe
cc.exe x86_64-w64-mingw32-llvm-ranlib.exe
clang++.exe x86_64-w64-mingw32-nm.exe
clang-20.exe x86_64-w64-mingw32-objcopy.exe
clang-format.exe x86_64-w64-mingw32-objdump
clang-scan-deps-real.exe x86_64-w64-mingw32-ranlib.exe
clang-scan-deps-wrapper.exe x86_64-w64-mingw32-readelf.exe
clang-scan-deps-wrapper.sh x86_64-w64-mingw32-size.exe
clang-scan-deps.exe x86_64-w64-mingw32-strings.exe
clang-target-wrapper.exe x86_64-w64-mingw32-strip.exe
clang-target-wrapper.sh x86_64-w64-mingw32-widl.exe
clang-tidy.exe x86_64-w64-mingw32-windres.exe
clang.exe x86_64-w64-mingw32uwp-addr2line.exe
clangd.exe x86_64-w64-mingw32uwp-ar.exe
dlltool.exe x86_64-w64-mingw32uwp-as.exe
g++.exe x86_64-w64-mingw32uwp-c++.exe
gcc.exe x86_64-w64-mingw32uwp-clang++.exe
gendef.exe x86_64-w64-mingw32uwp-clang-scan-deps.exe
git-clang-format x86_64-w64-mingw32uwp-clang.exe
i686-w64-mingw32-addr2line.exe x86_64-w64-mingw32uwp-dlltool.exe
i686-w64-mingw32-ar.exe x86_64-w64-mingw32uwp-g++.exe
i686-w64-mingw32-as.exe x86_64-w64-mingw32uwp-gcc.exe
i686-w64-mingw32-c++.exe x86_64-w64-mingw32uwp-ld
i686-w64-mingw32-clang++.exe x86_64-w64-mingw32uwp-llvm-ar.exe
i686-w64-mingw32-clang-scan-deps.exe x86_64-w64-mingw32uwp-llvm-ranlib.exe
i686-w64-mingw32-clang.exe x86_64-w64-mingw32uwp-nm.exe
i686-w64-mingw32-dlltool.exe x86_64-w64-mingw32uwp-objcopy.exe
i686-w64-mingw32-g++.exe x86_64-w64-mingw32uwp-objdump
i686-w64-mingw32-gcc.exe x86_64-w64-mingw32uwp-ranlib.exe
i686-w64-mingw32-ld x86_64-w64-mingw32uwp-readelf.exe
i686-w64-mingw32-llvm-ar.exe x86_64-w64-mingw32uwp-size.exe
i686-w64-mingw32-llvm-ranlib.exe x86_64-w64-mingw32uwp-strings.exe
i686-w64-mingw32-nm.exe x86_64-w64-mingw32uwp-strip.exe
i686-w64-mingw32-objcopy.exe x86_64-w64-mingw32uwp-widl.exe
i686-w64-mingw32-objdump x86_64-w64-mingw32uwp-windres.exe
~/llvm-mingw-nightly-ucrt-aarch64 $ cat test.c
#include <stdio.h>
int main(void)
{
puts("Hello world!");
}
~/llvm-mingw-nightly-ucrt-aarch64 $ wine bin/clang.exe test.c -o test
007c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
007c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
007c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
007c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0084:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0084:err:winediag:nodrv_CreateWindow L"The explorer process failed to start."
0084:err:systray:initialize_systray Could not create tray window
0054:err:dnsapi:DllMain No libresolv support, expect problems
Z:\data\data\com.termux\files\home\llvm-mingw-nightly-ucrt-aarch64\bin\clang-20: No such file or directory
~/llvm-mingw-nightly-ucrt-aarch64 $ wine bin/clang-20.exe test.c -o test
0088:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0088:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0088:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0088:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0074:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0074:err:winediag:nodrv_CreateWindow L"The explorer process failed to start."
0074:err:systray:initialize_systray Could not create tray window
0054:err:dnsapi:DllMain No libresolv support, expect problems
Z:\data\data\com.termux\files\home\llvm-mingw-nightly-ucrt-aarch64\bin\clang-20.exe: No such file or directory
~/llvm-mingw-nightly-ucrt-aarch64 $ ls
LICENSE.TXT armv7-w64-mingw32 i686-w64-mingw32 lib share versions.txt
aarch64-w64-mingw32 bin include python test.c x86_64-w64-mingw32
~/llvm-mingw-nightly-ucrt-aarch64 $ ls python/
bin include lib share
~/llvm-mingw-nightly-ucrt-aarch64 $ ls python/bin/
2to3 idle3 libffi-8.dll libpython3.dll pydoc3.11 python3-config python3.11.exe python3w.exe
2to3-3.11 idle3.11 libpython3.11.dll pydoc3 python.exe python3.11-config python3.exe
~/llvm-mingw-nightly-ucrt-aarch64 $ wine python/bin/python.exe
008c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
008c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
008c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
008c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
0070:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0070:err:winediag:nodrv_CreateWindow L"The explorer process failed to start."
0070:err:systray:initialize_systray Could not create tray window
0054:err:dnsapi:DllMain No libresolv support, expect problems
Python 3.11.6 (remotes/origin/mingw-v3.11.6-dirty:03d9f3ca48, Aug 20 2024, 08:31:04) [GCC Clang 20.0.0 64 bit (ARM64)]
on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print("Hello world!")
Hello world!
>>> exit()
~/llvm-mingw-nightly-ucrt-aarch64 $
I've made further testing and wine can run most of arm programs i've tried, but there are some strange bugs. CMake can be installed and it seems to work very well, clang doesn't work because executable can't be found and vlc can run, even with translations, wich aren't available in the termux version. But with vlc, only works while the installer is running, and the installation can't complete because it cause a stack overflow.
Here you can see vlc in wine in termux working. I've fixed the issue with the installer adding the path of System32 aarch64-w64-mingw to WINEDLLPATH. In vlc we can get audio working, but for now it can play videos.
So for now the only issues are with desktop autoclosing and file path
Problem description
When a wine launch in desktop mode, for some reason, it automatically closes after some minutes. Also, when compiling with mingw-w64 for aarch64, it can't run C++ code, only C, unless you manually link statically libstdc++ and libgcc, and even in that way, there are problems rendering unicode characters in those programs. Also, if is run just in termux (without GUI), it makes the terminal useless. This is the log of termux for wine desktop:
What steps will reproduce the bug?
Try to run the next command to enter in wine desktop mode:
termux-x11 :1 -xstartup "dbus-launch --exit-with-session wine explorer /desktop=shell,1024x780"
And try to run a simple hello world wrote in C, you'll see it works, then try to run a hello world wrote in C++, it won't work if you don't link libraries mentioned earlier statically.What is the expected behavior?
Wine desktop don't close and wine can run C++ code without static link.
System information