I compiled a Linux software in MinGW64 (MSYS2) on Windows with gcc-6.3.0 and gcc-gnat-6.3.0. I would like to assemble an installer package or zip file, that contains all necessary files. What parts of MinGW are required at a destination machine?
I don't want to ship a complete MSYS2/MinGW64, because it has 3 GiB! The executable has only 10 MiB.
I also won't demand a user to install MSYS2 and MinGW64, because it's a nightmare to install it on a Windows machine. The package manager (pacman) is not user friendly / usable for normal users.
Edit 1:
Normally, MinGW64 is not in my PATH. I have a script to add it depending on the selected MinGW version 32 vs. 64. The GCC used to compile the program is from the mingw32 or mingw64 directory.
I copied the binary to a separate directory: C:\Tools\GHDL\0.34dev-mingw64-llvm\bin
I used ldd.exe
to inspect the executables:
C:\msys64\usr\bin\ldd.exe C:\Tools\GHDL\0.34dev-mingw64-llvm\bin\ghdl.exe
ntdll.dll => /c/Windows/SYSTEM32/ntdll.dll (0x77020000)
kernel32.dll => /c/Windows/system32/kernel32.dll (0x76f00000)
KERNELBASE.dll => /c/Windows/system32/KERNELBASE.dll (0x7fefcf20000)
ADVAPI32.dll => /c/Windows/system32/ADVAPI32.dll (0x7fefd6a0000)
msvcrt.dll => /c/Windows/system32/msvcrt.dll (0x7fefd130000)
sechost.dll => /c/Windows/SYSTEM32/sechost.dll (0x7feff310000)
RPCRT4.dll => /c/Windows/system32/RPCRT4.dll (0x7fefe450000)
SHELL32.dll => /c/Windows/system32/SHELL32.dll (0x7fefe580000)
SHLWAPI.dll => /c/Windows/system32/SHLWAPI.dll (0x7fefe120000)
GDI32.dll => /c/Windows/system32/GDI32.dll (0x7fefda60000)
USER32.dll => /c/Windows/system32/USER32.dll (0x76e00000)
LPK.dll => /c/Windows/system32/LPK.dll (0x7fefd110000)
USP10.dll => /c/Windows/system32/USP10.dll (0x7fefd5d0000)
C:\msys64\usr\bin\ldd.exe C:\Tools\GHDL\0.34dev-mingw64-llvm\bin\ghdl1-llvm.exe
ntdll.dll => /c/Windows/SYSTEM32/ntdll.dll (0x77020000)
kernel32.dll => /c/Windows/system32/kernel32.dll (0x76f00000)
KERNELBASE.dll => /c/Windows/system32/KERNELBASE.dll (0x7fefcf20000)
??? => ??? (0x6fe40000)
libstdc++-6.dll => /c/Program Files/gettext-iconv/libstdc++-6.dll (0x6fc40000)
libgcc_s_sjlj-1.dll => /c/Program Files/gettext-iconv/libgcc_s_sjlj-1.dll (0x6cec0000)
msvcrt.dll => /c/Windows/system32/msvcrt.dll (0x7fefd130000)
libwinpthread-1.dll => /c/Program Files/gettext-iconv/libwinpthread-1.dll (0x64940000)
USER32.dll => /c/Windows/system32/USER32.dll (0x76e00000)
GDI32.dll => /c/Windows/system32/GDI32.dll (0x7fefda60000)
LPK.dll => /c/Windows/system32/LPK.dll (0x7fefd110000)
USP10.dll => /c/Windows/system32/USP10.dll (0x7fefd5d0000)
I assume, the first executable ghdl.exe
is OK, because it references only Windows DLLs. The second executable ghdl1-llvm.exe
has four special entries:
libstdc++-6.dll => /c/Program Files/gettext-iconv/libstdc++-6.dll
libgcc_s_sjlj-1.dll => /c/Program Files/gettext-iconv/libgcc_s_sjlj-1.dll
libwinpthread-1.dll => /c/Program Files/gettext-iconv/libwinpthread-1.dll
??? => ???
Questions:
- Does the first mean, a user needs a C++ package? Is this VC++ 6.0 redistributable?
Otherwise, there is a gettext package on Linux ... I compiled ghdl, which is written in Ada, with llvm backend. I would expect two more dependencies like on Linux:
- llvm 3.8
- libgnat 6.3.0
OTOH, GHDL also has a
libgrt.a
file. How can I read the dependencies from that file?
Edit 2:
Oh, I think there are binding errors in the edit 1.
If I run ldd
from within MinGW64 console, I see gettext bound to other files ...
E.g. libstdc++-6.dll => /mingw64/bin/libstdc++-6.dll (0x6fc40000)