2019-11-21, kt, 01:16 Bernhard Übelacker <bernha...@mailbox.org> rašė:
> Hello Marius Mikucionis, > I am not anyhow involved in maintaining mingw-w64. > But I guess I found something. > > First I fear that mingw-w64 does not link as much static > as you expect it to. > All crossbuilt executables still dynamically link to msvcrt.dll. > > $ i686-w64-mingw32-objdump -p strftime-6.exe | grep 'DLL Name:' > DLL Name: KERNEL32.dll > DLL Name: msvcrt.dll > Interesting. I get exactly the same. > And the Microsoft page might just be right for later versions > of c runtimes they provide. > > Further I found this information [2], which is as far as > I understand about recompiling mingw. > But I tried just to modify the compile/link command, > which I guess is kind of the expected output? > > $ i686-w64-mingw32-gcc -static -O3 -Wall -o strftime-ucrt-7.exe > strftime.c -lucrt > $ i686-w64-mingw32-objdump -p strftime-ucrt-7.exe | grep 'DLL Name:' > DLL Name: KERNEL32.dll > DLL Name: msvcrt.dll > DLL Name: api-ms-win-crt-environment-l1-1-0.dll > DLL Name: api-ms-win-crt-heap-l1-1-0.dll > DLL Name: api-ms-win-crt-private-l1-1-0.dll > DLL Name: api-ms-win-crt-runtime-l1-1-0.dll > DLL Name: api-ms-win-crt-stdio-l1-1-0.dll > DLL Name: api-ms-win-crt-string-l1-1-0.dll > DLL Name: api-ms-win-crt-time-l1-1-0.dll > I can reproduce this too. > > $ wine strftime-ucrt-7.exe > [%a]: [Tue] > [%e]: [ 5] > [%d]: [05] > [%-d]: (empty) errno=22 > [%#d]: [5] > [%b]: [Nov] > [%Y]: [2019] > [%H]: [03] > [%M]: [02] > [%S]: [01] > [%z]: [+0100] > [%Z]: [Mitteleuropõische Zeit] > [%b%e, %Y, %H:%M:%S %z]: [Nov 5, 2019, 03:02:01 +0100] > > (msvcrt.dll still appears; the same result for 7.0.0-2 and 6.0.0-3.) > Your output is correct, but I am not getting that, very strange. > So maybe you could examine this binaries from 2014 if they > need also some Dlls? > Yes, they have those dependencies and more (like WS2_32.DLL and IPHLPAPI.DLL, but they are unrelated). > > At least the binaries produced in my tests behave the same > in Wine and Windows. > Even without -lucrt ? The ucrt adds those api-ms-win-crt-* dependencies, which do not seem to be necessary. Thank you for the effort, perhaps something strange is happening with my setup, I could not find anyone else on internet with this issue. -- Marius