This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


 > From: Zack Weinberg <zack@bitmover.com>
 > 
 > "Kaveh R. Ghazi" wrote:
 > >  > From: Zack Weinberg <zack@bitmover.com>
 > >  > 
 > >  > This patch creates a pair of files, errors.c and errors.h, which
 > >  > define the error-reporting functions used by gen*.c.  Formerly each
 > >  > one had its own copy.  The compiler proper still uses the
 > >  > definitions in toplev.c.
 > >
 > > 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.


	Okay.  I'm looking at copy in the web archive.  Maybe you
posted an older copy of the patch?


 > > 3.  Why are you building error.o with $(HOST_PREFIX) ?
 > > 
 > > 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.


Actually, the host compiler is chosen by the fact that you used
$(HOST_CC) as the compiler in the Makefile rule you wrote.  Note that
the gen*.c files don't use HOST_PREFIX.  You only need $(HOST_PREFIX)
if you plan to build the file twice (like is done for rtl.c) and you
don't want to overwrite the first .o file.  Since you confirmed that
we'll eventually one day compile it twice, it makes sense the way you
wrote it.


 > It shouldn't actually compile it twice because there are only
 > references to one form.
 > zw

	Yup.  
		--Kaveh
--
Kaveh R. Ghazi			Engagement Manager / Project Services
ghazi@caip.rutgers.edu		Qwest Internet Solutions


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]