winlibs_mingw icon indicating copy to clipboard operation
winlibs_mingw copied to clipboard

gdb 32-bit does not run on Windows 7

Open neolib opened this issue 3 years ago • 9 comments

When I run 32-bit gdb, I get a message that says GetSystemTimePreciseAsFileTime is missing in kernel32.dll.

However, 64-bit gdb works.

neolib avatar Jun 01 '21 16:06 neolib

Where both cases on the same Windows 7 64-bit system?

brechtsanders avatar Jun 02 '21 08:06 brechtsanders

Yes, it's a Windows 7 guest VM.

neolib avatar Jun 02 '21 12:06 neolib

Can confirm the problem in the gcc 8.5.0 release. As a temporary fix, I've changed the import table directly in gdb.exe via hex-editing. Basically you can duplicate the entry GetSystemTimeAsFileTime, since it has the same signature of the missing function. I've tried debugging a simple program and it seems to work.

I don't know how you build gdb, but if you could set Win7 as the target, instead of Win8+ ... and maybe release the new exe ... :O)

edit: The problem seems to be gettimeofday.c from gnulib (which is used by GDB). It looks like it tries to load the Win8 API even on older OSes. Anyway, I think that for 32bit packages Win7 is a better target than newer Windows. For 64bit I don't know.

byteblob avatar Aug 17 '21 22:08 byteblob

Windows 7 is quite old and no longer supported by Microsoft. I try to build the compiler suite for optimal performance, not for compatibility with obsolete operating systems.

You can still use the compiler to generate binaries that run on Windows 7 if you like though.

brechtsanders avatar Aug 20 '21 20:08 brechtsanders

Ok, but then write on the download page that only Win8/10 or whatever is supported. I personally don't use newer Windows because they are spyware.

byteblob avatar Aug 21 '21 16:08 byteblob

GCC 8.5.0 release is built with mingw64-9.0.0. In line 233 of x86_64-w64-mingw32/include/_mingw.h, _WIN32_WINNT is defined as 0xa00, which may use api from Windows 10 by default. I want to use gcc-8.5.0 on Windows 7. I think gcc-8.5.0 built with mingw64-7.0.0 is available.

WennerChen avatar May 05 '22 14:05 WennerChen

Why should I put any efforts in such an old version of GCC? GCC 12 is about to be released, that is where my focus will be. But maybe I should make the 32-bit version default to Windows 7. Would you consider a newer GCC/MinGW-w64 if it runs on Windows 7?

brechtsanders avatar May 05 '22 18:05 brechtsanders

I would very appreciate of a newer GCC/MinGW-w64 if it runs on Windows 7.

WennerChen avatar May 06 '22 01:05 WennerChen

Would you consider a newer GCC/MinGW-w64 if it runs on Windows 7?

I would. Anyway, if you think too few people are getting that version and it's not worth the effort, it's up to you in the end :)

byteblob avatar Jun 07 '22 22:06 byteblob