patch: kill N copies of fatal() in gen*.c

Jeffrey A Law law@cygnus.com
Thu Aug 26 22:32:00 GMT 1999


  In message < 199908261755.KAA08720@zack.bitmover.com >you write:
  > > 1.  Would you please make progname "const char *" in both error.c and
  > > error.h?  (Its "extern char *" in errors.h in your patch.  Does it
  > > bootstrap this way? )
  > 
  > That's weird, it's const char * in both files on my box.
Perhaps you sent the wrong version of the patch or something similar.

  > Maybe later when errors.c is more widely used.  For the moment I would
  > rather stick to the simple approach of using an explicit string.
I can live with that.

  > It would be Really Nice if someone would fix it so libiberty could be
  > used in the generator programs - they have their own copies of xmalloc
  > et al, too.  I don't know enough about the build framework to do this.
It's in the queue.  I approved a couple of what I thought were infrastructure
patches that we needed first a few days ago.  Once those are in I'll review
the patch which actually builds host & build copies of libiberty.

  > > I thought that was only necessary when a module needs to be compiled
  > > on *both* host and build systems in a canadian-cross.  Since you are
  > > only linking errors.o with gen*, I don't think you need to compile it
  > > twice any more than say genattr.c needs it.  (Unless you plan to
  > > convert all of the source code to use errors.c?)
  > 
  > The eventual plan is to convert all of the source code, but this
  > requires more design and thought.  But I wish to be forward-looking.
  > That and I believe you need a $(HOST_PREFIX) rule to get the host
  > compiler used.
  > 
  > It shouldn't actually compile it twice because there are only
  > references to one form.
You need to use HOST_PREFIX when the same file is going to be compiled
multiple times.  An example would be rtl.o.  It gets compiled for both the
gen* programs and for cc1 itself.  As an aside HOST_PREFIX is poorly named,
it should probably be BUILD_PREFIX.

Anyway, you use HOST_CC to get the host compiler (again, it should really be
BUILD_CC).

If we are planning to link errors.o into the gen* programs and into stuff like
cc1, when we ought to go ahead and use HOST_PREFIX.

jeff



More information about the Gcc-patches mailing list