delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/05/02/10:16:44

From: softbrek AT POOL DOT Informatik DOT RWTH-Aachen DOT DE
Subject: Re: ld and GCC-RM
To: djgpp AT sun DOT soe DOT clarkson DOT edu (djgpp)
Date: Mon, 2 May 1994 15:42:54 +0200 (MET DST)

> 
> GCC-RM is just a real-mode version of GCC.  This is not likely to help
[...]
>     What seems to be happening is that your command line is getting
> truncated somehow.  This is presumably due to some problem in passing
> long arguments between GCC and the loader.  Why this should happen I'm
> not sure; I know that I've had problems although everybody tells me I
> shouldn't.  I think it may be that although *GCC* knows how to pass
> those args to DJGPP compiler suite programs, *Make* doesn't.  (A
[...]

One additional bit of information I had to painfully find out about
the interaction of gcc, gcc-rm, and make (DJ's 3.69 version): make
*can* pass long command lines, like the ones used to link together
large programs consisting of tons of *.o and *.a files, to gcc (the
normal version), but it *can't* pass these to gcc-rm, it seems. This
typically results in messages from the linker (ld.exe) like 'Can't
find file <partial filename>', where the filename`s end has been cut
off by the end of DOS's 128 (?)  character-limit on
commandlines. (<partial filename> will change if you delete some of
the first files from the linker-command.)

I`m even quite sure why this is happening: DJ's make has a method
built in to recognize if the program it invokes is a DJGPP-compiled
one (this method is in the normal libc.a-implementation of system(),
if I remember correctly).  If a DJGPP-program is started, make uses a
special algorithm DJ refers to as 'the PROXY method' (or the like) to
pass the command-line arguments to the program. (DJ, please tell
everyone in case I'm wrong here). Now, gcc-rm is a turbo-c compiled
program...  Consequently, make doesn't recognize it and calls it with
a plain vanilla DOS command-line, limited to 128 characters in
length. And gone is the rest of the command line :-(

The fix I use for this:

* use gcc-rm.exe for *compiles* only, as it tends to be a bit faster
due to not paging out before calling each of cpp, cc1 and as, and
compile-lines normally aren't too long to be passed by DOS (but watch
out for long ones anyway, as some autoconfig-scripts use tons of
-DWHATEVER's on the compiling line if don't prevent them by force from
doing this).

* use gcc.exe for the final linking command, which is typically the
only one that really needs to be that long. (or use a response file
for the linking step, in which case you may use gcc-rm.exe for this
one as well)

Beware: Someone, I think it was Christoph (kuku AT acds DOT physik DOT rwth-aachen DOT de),
did report problems accessing networked files using gcc-rm.exe in earlier
versions, so watch out if this may be your problem if you still run into one
after obeying the tips I wrote down up there.

Happy hacking :-)

Hans-Bernhard

- Raw text -


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