www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/01/06/04:57:45

From: Mark Bergman <bergman AT Panix DOT Com>
Subject: Link Woes solved (command line length)
To: djgpp AT sun DOT soe DOT clarkson DOT edu (DJGPP)
Date: Wed, 6 Jan 1993 03:46:06 -0500 (EST)

Well, I've solved the problem that I posted about, after mis-diagnosing
the problem. Many thanks to those of you that answered my original
question.

To summarize:
I was getting errors at link time about certain functions not being
defined. The errors varied depending on the order the modules were
listed in the Makefile.

The real problem was the command line length. In this case there are 13
modules, totalling 121 characters (including white space). Each module
was compiled correctly, and the makefile _echoed_ that the complete
commands were being executed:

	gcc -O -c file1
	gcc -O -c file2
		:
	gcc -O -c file13
	gcc -O -o program file1.o file2.o file3.o ... file13.o

As it turns out (as reported via gcc -v), only some file names (either
11 or 12 of the 13, depending on the length of the names of the last
three files) were being passed to the linker.

I'm used to a Unix environment, and have the MKS Toolkit on my DOS box.
The Kornshell allows command lines up to 8K. I hadn't encountered a
command-line-length problem in ages!

Why do GCC, and I presume the other binaries, have this limitation? If
the "normal" environment (MS-DOS shell) imposes a limit, why not just
take as many characters as you are handed (the GNU way) and let the
shell impose it's own limitation?

I'm aware that other people are using alternate shells (MKS, 4DOS,
OS/2) with GCC. What are your solutions? What is the "GNUISH-DOS"
method for passing long arguments--do I have to stuff the entire
argument list into and environment variable?

-- 
Mark Bergman    (Biker, Stagehand, (former) Unix user support grunt)
718-855-9148

bergman AT panix DOT com
{cmcl2,uunet}!panix!bergman

- Raw text -


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