delorie.com is funded by banner ads.
  www.delorie.com/djgpp/v2faq/faq133.html   search  

| Previous | Up | Top |

16.6 Why Make passes only 126 characters to programs?

Q: I use Make to compile with GCC, but GCC gets only the first 126 characters of its command line. Didn't you just explain in so many words that invoking a DJGPP program (GCC) from another DJGPP program (Make) can safely pass up to 13K characters of command-line arguments using the !proxy method?

Q: I use RHIDE, but it only passes the first 126 characters of my long command lines to the compiler!


A: If you use Make 3.73, check your Makefile for SHELL = command.com statements, or for commands which include pipe or redirection characters like >, |, etc. If Make sees any such statements, it will invoke COMMAND.COM to run GCC, and COMMAND.COM can't pass more than 126 characters to GCC. To work around, comment-out the SHELL= line, and change your commands to work without redirection/pipe characters. One easy way to get rid of redirection characters without losing their effect is to use the redir program which comes with DJGPP. For example, the following command:
       frobnicate foo.bar > myfile.tmp

can be re-written instead like this:
       redir -o myfile.tmp frobnicate foo.bar

The ports of Make 3.75 and later doesn't call COMMAND.COM in the above cases, but rather emulates pipes and redirection internally, so upgrading to the latest version of Make will solve such problems. If you think about using Make 3.75 with DJGPP v2.0, don't: invoking v2.0 programs from v2.01 programs will cause subtle and hard-to-debug problems due to incompatibilities between these two versions regarding the methods of invoking child programs (in particular, v2.0 doesn't support the environment method of passing long command lines described above).

Problems with passing long commands from RHIDE are usually caused by invoking old programs compiled with DJGPP v2.0. Upgrade to the latest binaries.


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright ⌐ 1998   by Eli Zaretskii     Updated Sep 1998  

Powered by Apache!

You can help support this site by visiting the advertisers that sponsor it! (only once each, though)