dosemu2 / comcom64

64bit command.com
https://github.com/dosemu2/comcom32/
GNU General Public License v3.0
32 stars 5 forks source link

Microsoft C 5.10 odd error when run from Gnu Make #41

Closed andrewbird closed 4 years ago

andrewbird commented 4 years ago

Describe the bug When running Microsoft C 5.10 from gmake it fails

compiler with loadfix
C:\MYTEST>
C:\MYTEST>rem compiler with loadfix
C:\MYTEST>gmake test2
loadfix cl /c import.c
gmake.exe: *** [Makefile:7: test2] Error -1
loadfixed compiler without gmake
C:\MYTEST>
C:\MYTEST>rem loadfixed compiler without gmake
C:\MYTEST>loadfix cl /c import.c
Microsoft (R) C Optimizing Compiler Version 5.10
Copyright (c) Microsoft Corp 1984, 1985, 1986, 1987, 1988. All rights reserved.

import.c

To Reproduce 1/ use FDPP, comcom32 and dosemu2 2/ unpack the tar file supplied into the c: drive 3/ change directory to mytest 4/ edit the path in testit.bat to suit your DOS environment 5/ run the testit batch file.

Attach program/game binaries or provide an URL msctest02.tar.gz

Attach the log boot.log

A regression? No idea, I'm afraid.

Additional info I also note that return code shown from gmake is -1, that doesn't get caught by if errorlevel 1 then exit 1 etc, but not sure if that's a comcom32, or gmake problem?

andrewbird commented 4 years ago

I tried a couple of things 1/ Switched to Freecom and FDPP, same issue 2/ Switched to Freecom and FreeDOS 1.20 seems better for case without loadfix, but with loadfix the problem remains

C:\mytest>gmake clean
del *.obj
one file removed.

C:\mytest>rem just compiler
C:\mytest>gmake test1
cl /c import.c
Microsoft (R) C Optimizing Compiler Version 5.10
Copyright (c) Microsoft Corp 1984, 1985, 1986, 1987, 1988. All rights reserved.

import.c

C:\mytest>rem compiler with loadfix
C:\mytest>gmake test2
loadfix cl /c import.c
gmake.exe: *** [Makefile:7: test2] Error -1

C:\mytest>rem just echo
C:\mytest>gmake test3
echo hello import.c > import.obj

C:\mytest>rem loadfixed compiler without gmake
C:\mytest>loadfix cl /c import.c
Microsoft (R) C Optimizing Compiler Version 5.10
Copyright (c) Microsoft Corp 1984, 1985, 1986, 1987, 1988. All rights reserved.

import.c
stsp commented 4 years ago

The bugs are all in your test case. First, you screw up PATH variable, excluding the path to command.com from it. If you didn't, you could write in a makefile: command /c loadfix cl /c $< because loadfix is not an external cmd.

Note that gmake adds an additional confusion here. It seems to have the table of command.com commands, which it would exec via command.com (like echo), but loadfix/loadhigh are not among those, otherwise things would work for you as-is.

andrewbird commented 4 years ago

Ah, okay, thanks! It's the first time I used gmake in DOS, I assumed each line was run in a shell and that COMSPEC would locate that.

stsp commented 4 years ago

I assumed each line was run in a shell and that COMSPEC would locate that.

As I said, gmake seems to be doing that for the commands that it knows to come from a shell. You can find the list of such commands in a gmake binary, but loadfix/loadhigh are not there.