delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/03/10/13:07:25

Date: Wed, 10 Mar 1999 19:03:40 +0100
From: Frank Heckenbach <frank AT tim DOT gerwinski DOT de>
Message-Id: <658F56E5.19990310190340.FOO-61CD.frank@goedel.fjf.gnu.de>
X-Mailer: smtphack 0.3.3 by Jan Andres
To: pavenis AT lanet DOT lv, peter AT gerwinski DOT de, djgpp-workers AT delorie DOT com
Subject: Re: DJGPP preprocessor and link command specs
X-Counter: 895 peter AT gerwinski DOT de
Reply-To: djgpp-workers AT delorie DOT com

> On 10 Mar 99, at 1:13, Peter Gerwinski wrote:
> 
> > Hello again, DJGPP workers!
> > 
> > DJGPP requries some hacks on the preprocessor and link command
> > specs.  However while building the compiler itself, `xgcc' dumps
> > specs that do not contain the DJGPP specifica, and it is just by
> > chance that the compilation works.  The differences are as
> > follows:
> > 
> 
> Which version of egcs and DJGPP did You use. Did You take sources from
> DJGPP distribution or You used unmodified sources. With sources from
> DJGPP distribution (see v2gnu/beta/egcs111s.zip) there is no need to change
> dumped specs at all. For example I'm getting for egcs-1.1.2-pre3
> 
> *predefines:
> -Dunix -Di386 -DGO32 -DMSDOS -DDJGPP=2   -Asystem(unix) -Asystem(msdos) 
> -Acpu(i386) -Amachine(i386)

I'm (still) using GCC-2.8.1, and -DDJGPP=2 isn't defined there (in
config/i386/go32.h). What Peter uses is I think egcs-2.91.60, and it
doesn't seem to be defined there, either. So I assume it's OK if we
add it there?

> LINK_COMMAND_SPEC is defined but not dumped of course.

Of course? Well, I don't know the reasons behind that, but I know
that there's a problem currently with regard to GPC.

GPC comes with a runtime library (libgpc.a) -- a bit like libgcc.a,
however it requires some configure checks. The configure script for
that library, has to be run with the xgcc just built (rather than
the cc used to build the compiler, because that's a compiler for
host, and we need one for target here).

Unfortunately, somewhere in the Makefile, xgcc is made to dump its
specs, and if this happens before libgpc is configured, it will use
those dumped specs instead of the built in ones, so it will miss the
link command, and produce the error:

configure: error: installation or configuration problem: C compiler
cannot create executables.

For the first make, it works by chance as Peter said, i.e. the
libgpc configure happens before the dumpspecs (but since the order
of make rules evaluation is partly undeterministic, this is not
guaranteed to work, consider e.g. make -j). However, when we change
a Makefile.in later, make will run the libgpc configure again, and
this time the dumped specs are already there, and the error occurs.

I don't know what is supposed to be the right solution, but to me it
would seem most natural if the DJGPP compiler would dump exactly
those specs that it needs.

> So
> DJGPP is defined. DJGPP_MINOR is defined for DJGPP-2.02 in 
> sys/version.h included from stdio.h. I dont think we should define it
> in specs.

I think that's alright for GPC.

Frank

--
Frank Heckenbach, frank AT fjf DOT gnu DOT de
http://fjf.gnu.de/
PGP and GPG keys: http://fjf.gnu.de/plan

- Raw text -


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