Closed matsobdev closed 1 year ago
In all cases CMake is running the "alias" commands (cc, c++, mingw32-make) rather than the tools themselves (gcc, g++, make), and these are failing with "Access violation". The source for these commands is "alias.c" and the access violation likely signifies HeapAlloc() is failing to make the single, tiny (hundreds of bytes) allocation. You said "gcc" works fine when run manually, but what about "cc" or "c++"? Perhaps Windows 7 can get into a state where the Win32 heap functions always fail?
After first successful (after Windows restart) compile using CMake cc
and c++
ends compiling - faster than when works, simple printf()
loop code with no output .exe
and no error. gcc
still works. Restarting Windows, I can call cc
and c++
multiple times with success and after using CMake, it breaks again like before.
I updated alias.c with better error messages (98a7d85), so at least after the next w64devkit release you'll get a more informative error message when this occurs. It also allocates at a lower level, so maybe the error won't occur at all. I can't imagine how CMake could do anything that would cause HeapAlloc to always fail in other processes.
If you're feeling bold enough to test this new alias.c in your situation, build it like so (in the environment of w64devkit.exe):
$ gcc -g3 -DEXE=gcc.exe -DCMD=gcc -nostartfiles -o $W64DEVKIT_HOME/bin/example alias.c
Then you can invoke GCC via the name "example" just as you can "cc". When "cc" stops working, try compiling something using "example". If that still doesn't work hopefully you'll learn why. Also, this example.exe will be debuggable using the included GDB, so you can at least get a backtrace for me.
Funny thing. Just created fresh copy of w64devkit
to compile at RAM disk, but doesn't matter I guess other than it is other than system drive/partition. RAM drive w64devkit
copy doesn't fail (regular disk other than system drive as well works - talking unmodified, untouched w64devkit
). And now example
(as well as gcc
but we know that already) on system drive works and compiles just fine when cc
and c++
are broken after CMake
usage.
In the environment of w64devkit.exe
I was having some trouble to locate alias.c
but in regular Windows cmd.exe
with w64devkit
as only native compiler in the neighbourhood (system env vars) just worked.
It might be something with Temp
dir. Moving it to RAM disk just works and removing RAM disk altogether - so no Temp
dir on Windows breaks ARM GCC compiler the same way. So maybe filenames (with paths) too long. That might be an Ninja
issue, but happened even before I started using Ninja
.
No, no improvement, but just deleting and unzipping w64devkit
dir in the same location helps until next one or couple of compiles. Restarting worsk as well as established before.
Unfortunately VirusTotal reports some malicious activity with the original w64devkit
zip. Maybe it is a false alarm, but I don't know. Now is undetected, just reissued scan, 12 days ago was some ad injection trojan, but i686 is also 'buggy' at VirusTotal. I just read your answer on the virus issue, and it's dynamic at VirusTotal (the same zip
different reports different time), so at least that won't wake me up in the middle of the night.
And finally if example
works so, cc.exe
can be replaced by that. Am I right? What about c++.exe
? Ohhh, I see. Compile option to link it to g++.exe
.
So last update. Compiled and replaced cc
and c++
and mingw32-make
and so far so good. Some Raspberry Pi Pico W project that uses Windows native tools to process output files for microcontroller (could be compiled just once and used later, but now over and over again to test - both Ninja
and make
- by alias command by cmake.exe --build
).
I guess until new release case is closed.
Not using busybox, just a plain winXP cmd, I came across the same issue with cmake not working correctly :/ I changed the install location from C:\w64devkit to C:\mingw32 updated the path environment and it worked fine with: cmake .. -G "MinGW Makefiles"
Strange, but it works :)
I'm on Windows 7 SP1 x64 and something above happens after couple successful compiles from Windows start. Compiling the same again and again and at some point compiler breaks. Or can compile all day and just at the evening it breaks finally. Doesn't matter if using
cmake-G "Ninja"
orcmake-G "CodeBlocks - MinGW Makefiles"
or just configure CLion. Simplegcc
works. Example code, Waveshare LCD display - error:Error logs below. 1.17, 1.18 the same result. CMakeError.log CMakeError.log From CLion settings:
Other from https://www.mingw-w64.org/downloads/ work:
LLVM-MinGW
,MingW-W64-builds
,WinLibs.com
.