www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/10/20/15:58:00

Date: Sun, 20 Oct 1996 20:23:59 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: djgpp-announce AT delorie DOT com
Subject: Mixing v2.0 and v2.01 considered harmful
Message-Id: <Pine.SUN.3.91.961020193613.500J-100000@is>
Mime-Version: 1.0

This is a bit longish message, so the main points first:

   1) It is not recommended to mix Make from old v2.0 distribution with
   gcc and Binutils from v2.01, or vice versa.  If you upgrade to v2.01,
   replace all the binaries you have installed from the above packages. 

   2) If you want to try v2.01 but be able to downgrade back to v2.0 in 
   case you have unexpected trouble, back up your v2.0 executables before 
   installing v2.01.

   PLEASE RESTRICT FURTHER DISCUSSIONS ABOUT THIS to djgpp mailing list and 
   comp.os.msdos.djgpp news group.  Do NOT post to djgpp-announce anything 
   about this, please!

Now for the juicy details:

In v2.01, passing command lines to child programs has changed.  The most 
important aspects of the change are:

	1) Arguments passed by `spawnXX' and `execXX' library functions 
aren't globbed by the child; thus spawn(P_NOWAIT, "ls", "ls", "*.c", 0) 
will most probably complain that *.c doesn't exist.  This is so these 
functions work as they do on Unix.  If you need for the child to glob the 
arguments, you should call `system' instead (see below).

	2) Arguments passed by `system' *are* globbed.  In v2.0, `system' 
didn't support command lines longer than 126 characters.  The new 
`system' allows long command lines (when the child is a DJGPP program), 
but this will only work when both the parent and the child were compiled 
with v2.01.  If the child was compiled with v2.0, it will only see the 
first 126 characters of the command line.

The most important case where these considerations apply is when Make 
calls gcc.  DJGPP ports of Make 3.73 and before use `spawn' unless the 
command involves redirection.  If you have a Makefile which says 
something like

	prog: $(OBJS)
		gcc -o prog *.o

this will not work when Make is from v2.0 and gcc from v2.01.  The next
port of Make 3.75 (to be uploaded soon) uses `system' in such cases, but
if gcc is from v2.0, and the command line includes wildcards or quotes and
is longer than 126 characters, that command will mysteriously fail.  To be
sure things work together as you'd expect, use both Make 3.75 (or later)
and gcc/Binutils compiled with v2.01.

The above might sound scary at first, but it really isn't.  Experience 
shows that the absolute majority of Makefiles continue to work.  (I have 
successfully built most of the DJGPP packages with a v2.0 gcc and a v2.01 
Make, and never saw any problem.)  But if you want consistently correct 
behavior, you shouldn't mix Make and gcc from different versions.

Note that after v2.01 was uploaded to SimTel, the old Make 3.73 
distribution was overwritten by the new, compiled with v2.01.  Therefore, 
you should save your previous v2.0 make.exe if you think there's a chance 
you'd want to go back to v2.0.

- Raw text -


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