Hello,
Using msys64 on Windows 7 x64 and Windows 10 x64, the ouput of the ldd command is bad for mingw32 binaries:
$ ldd /mingw32/bin/gcc.exe
gcc.exe: fatal error: no input files
compilation terminated.
ntdll.dll => /c/windows/SYSTEM32/ntdll.dll (0x77c50000)
ntdll.dll => /c/windows/SysWOW64/ntdll.dll (0x77e30000)
wow64.dll => /c/windows/SYSTEM32/wow64.dll (0x753d0000)
wow64win.dll => /c/windows/SYSTEM32/wow64win.dll (0x75370000)
wow64cpu.dll => /c/windows/SYSTEM32/wow64cpu.dll (0x75360000)
??? => ??? (0x776b0000)
kernel32.dll => /c/windows/syswow64/kernel32.dll (0x75fb0000)
??? => ??? (0x776b0000)
??? => ??? (0x77b50000)
kernel32.dll => /c/windows/syswow64/kernel32.dll (0x75fb0000)
KERNELBASE.dll => /c/windows/syswow64/KERNELBASE.dll (0x762a0000)
SYSFER.DLL => /c/windows/SysWOW64/SYSFER.DLL (0x752f0000)
msvcrt.dll => /c/windows/syswow64/msvcrt.dll (0x763a0000)
libwinpthread-1.dll => /mingw32/bin/libwinpthread-1.dll (0x64b40000)
For mingw64 binaries the output is correct:
$ ldd /mingw64/bin/gcc.exe
ntdll.dll => /c/windows/SYSTEM32/ntdll.dll (0x77c50000)
kernel32.dll => /c/windows/system32/kernel32.dll (0x776b0000)
KERNELBASE.dll => /c/windows/system32/KERNELBASE.dll (0x7fefe160000)
SYSFER.DLL => /c/windows/System32/SYSFER.DLL (0x75430000)
msvcrt.dll => /c/windows/system32/msvcrt.dll (0x7feffe70000)
libwinpthread-1.dll => /mingw64/bin/libwinpthread-1.dll (0x64940000)
With msys32 the output is correct:
$ ldd /mingw32/bin/gcc.exe
ntdll.dll => /c/windows/SysWOW64/ntdll.dll (0x77e30000)
kernel32.dll => /c/windows/syswow64/kernel32.dll (0x75fb0000)
KERNELBASE.dll => /c/windows/syswow64/KERNELBASE.dll (0x762a0000)
SYSFER.DLL => /c/windows/SysWOW64/SYSFER.DLL (0x752f0000)
msvcrt.dll => /c/windows/syswow64/msvcrt.dll (0x763a0000)
libwinpthread-1.dll => /mingw32/bin/libwinpthread-1.dll (0x64b40000)
Yes, there's no WoW-redirection support in
ldd. You could report this to the Cygwin project (check for existing reports first), but honestly, I don't think there will be enough motivation for anyone to implement such a thing.You could also try the
mingw-w64-i686-ntlddpackage, maybe it will suit your purpose.I was under the impression that it worked at some point.
I've been using ldd for almost a year to automatically add libraries into an installer.
Maybe I've been lucky until now...
Thanks for pointing out ntldd, it looks like it will handle the task.
Would you be willing to share your scripts? Distributing dynamically-linked software built with mingw-w64 is not exactly easy, as you probably agree, and it'd be nice to have some ready-to-use solution to point people to.
It's very rough. I wrote a specific install rule for windows that installs the binaries and the resources including dlls into a setup/ folder. This folder is then given to inno setup.
https://github.com/matlo/GIMX/blob/e461c6ed3650b3707c17252a367413b36d1d1d0e/Makefile#L26
https://github.com/matlo/GIMX-build/blob/85b7d461f1ffae6e171a1cc9137b3f771ec5754d/windows/build.sh
https://github.com/matlo/GIMX-build/blob/85b7d461f1ffae6e171a1cc9137b3f771ec5754d/windows/inno.iss
Closing. New tickets can be filed at GitHub.