Mon 26 Oct 2015 11:05:36 PM UTC, original submission:
Hello,
Somewhere between 3.81.90 and 3.99.90 the built-in rule for .c files got changed to call `g++` instead of `cc`, when using ./configure option `--enable-case-insensitive-file-system` or the corresponding build-time macro `HAVE_CASE_INSENSITIVE_FS`. This is the recommended way to build under Windows, as per README.w32. The problem is still present in latest version 4.1 and even in the Git master repository.
The problem is likely caused by internal confusion about .C and .c extensions differing only in casing, where the former implies C++, while the latter is expected to imply plain C - even on Windows - but it implies C++ instead.
The end result is that certain plain C sources cannot be compiled, as it is being fed to the C++ compiler, which is much more picky about the language and might also generate incompatible object files.
Reproducible using a zero-length `test.c` file and following `Makefile` in the same directory:
```
test:
```
Running `mingw-make.exe` results in:
3.81.90 (ok):
```
cc test.c -o test
```
3.99.90 (not OK):
```
g++ test.c -o test
```
Also apparent by listing built-in rules using -p option:
`mingw32-make.exe -p`
3.81.90 (ok):
```
%.o: %.c
# recipe to execute (built-in):
$(COMPILE.c) $(OUTPUT_OPTION) $<
```
3.99.90 (not OK):
```
%.o: %.c
# recipe to execute (built-in):
$(COMPILE.C) $(OUTPUT_OPTION) $<
```
Example Windows binary that
- exhibit the problem (= built with the HAVE_CASE_INSENSITIVE_FS option):
https://www.mirrorservice.org/sites/dl.sourceforge.net/pub/sourceforge/m/mi/mingw-w64/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/5.1.0/threads-win32/sjlj/x86_64-5.1.0-release-win32-sjlj-rt_v4-rev0.7z
- is working correctly (= built without the HAVE_CASE_INSENSITIVE_FS option):
https://www.mirrorservice.org/sites/dl.sourceforge.net/pub/sourceforge/m/mi/mingw-w64-dgn/mingw-w64/mingw-w64-bin-x86_64-20150611.7z
Additional information on this URL:
https://github.com/niXman/mingw-builds/issues/413
-Viktor
|