cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1999/04/04/03:20:47

Date: Sun, 4 Apr 1999 09:16:39 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Gisle Vanem <giva AT bryggen DOT bgnett DOT no>
cc: djgpp AT delorie DOT com
Subject: Re: Empty commands in make 3.77
In-Reply-To: <Pine.UW2.3.95.990402095354.311A-100000@bryggen.bgnett.no>
Message-ID: <Pine.SUN.3.91.990404091455.19395B-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Fri, 2 Apr 1999, Gisle Vanem wrote:

> I've discovered what I regard as a rather serious bug in make 3.77.

It's not a bug in Make, it's a DOS ``feature''.

> $(CP) expands to `' causing `libvgagl.a e:/djgpp/lib' to be executed.
> `CP = cp.exe' was in `makefile.cfg'.
>  
> This "shell command" resulted in crash inside DOS (seg 273h) and some
> lost clusters. No serious harm done (chkdsk fixed it).
>  
> What is make trying to do here?

It tried to invoke libvgagl.a as if it were a .COM-style executable.
The empty string is just a whitespace at the beginning of the
command: Make simply skips it, since valid command lines can have
leading whitespace.

> And how on earth can an archive be executed like this?

That's what DOS does, Make cannot do anything to prevent it.  DOS
first looks for the "MZ" signature in the file, and if it isn't
present, assumes the file is a .COM image and ``runs'' it, with
obvious consequences.

Make cannot avoid this, because otherwise it would need to know about
all possible formats of executable files, including PE/NE executables,
.bat, .btm, Perl and whatever batch files/shell scripts, etc.  It
currently only knows about a handful of these, and leaves the rest to
DOS and the user (you) to figure out.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019