From:	CRDGW2::CRDGW2::MRGATE::"SMTP::PREP.AI.MIT.EDU::INFO-GCC-REQUEST" 23-AUG-1989 00:06
To:	MRGATE::"ARISIA::EVERHART"
Subj:	cross-gcc: two possible changes

Received: by life.ai.mit.edu (4.1/AI-4.10) id AA05653; Tue, 22 Aug 89 19:53:09 EDT
Return-Path: <info-gcc-request@prep.ai.mit.edu>
Received: from tut.cis.ohio-state.edu by life.ai.mit.edu (4.1/AI-4.10) id AA05592; Tue, 22 Aug 89 19:46:11 EDT
Received: by tut.cis.ohio-state.edu (5.61/4.890725)
	id AA12157; Tue, 22 Aug 89 16:53:10 -0400
Received: from USENET by tut.cis.ohio-state.edu with netnews
	for info-gcc@prep.ai.mit.edu (info-gcc@prep.ai.mit.edu)
	(contact usenet@tut.cis.ohio-state.edu if you have questions)
Date: 21 Aug 89 16:29:42 GMT
From: mcvax!cernvax!roberto@uunet.uu.net  (roberto bagnara)
Organization: CERN, Geneva, Switzerland
Subject: cross-gcc: two possible changes
Message-Id: <1052@cernvax.UUCP>
Sender: info-gcc-request@prep.ai.mit.edu
To: info-gcc@prep.ai.mit.edu



I'm proposing here two little and reasonable modifications to GCC in order
to make life easier when using it as a cross compiler.

I hope RMS will read this.

1) I propose the addition of the macro ASM_FILE_END(stream), it should
   be the symmetric counterpart of ASM_FILE_START(stream), that is

   "A C expression which outputs to the stdio stream 'stream' some
   appropriate text to go at the end of an assembler file."

   Some assemblers that could be used as the last pass for a GCC-based
   cross-compiler might need it. Mine is one of them.
   The place where to expand ASM_FILE_END(stream) should be
   at the bottom of 'end_final', in final.c.
   The only modification to do in final.c would be to add the following
   code fragment:

	#ifdef ASM_FILE_END
	  /* Output anything the assembler may need at the end. */
	  ASM_FILE_END (asm_out_file);
	#endif

2) It would be nice to be able to generate a native version of GCC
   together with several cross versions of it from the same set of sources.
   One of the things that could help in doing so is to provide macros
   for default include directories to be defined in tm-xxxx.h and expanded
   in cccp.c for the initialization of include_defaults[].

   For example, let's say I'm using GCC on a Unix system both as a native
   compiler, and as a cross-compiler producing code for both the m68k
   and the m88k families of microprocessors.
   Now I'm forced to have 3 versions of cccp.c, one for each compiler.
   In the native version I've a declaration like (simplified):

	struct file_name_list include_defaults[] =
	  {
	    { &include_defaults[1], GCC_INCLUDE_DIR },
	    { &include_defaults[2], "/usr/include" },
	    { 0, "/usr/local/include" }
	  };

   In the m68k version this becomes:

	struct file_name_list include_defaults[] =
	  {
	    { &include_defaults[1], GCC68K_INCLUDE_DIR },
	    { 0, "/usr/local/priam/c68k/usr/include" },
	  };

   Similarly for the m88k version.

   Providing appropriate macros in tm-xxxx.h would allow to use just one
   copy of cccp.c.

Thanks for your time

                  Roberto Bagnara
                  Data Handling Division
                  CERN
                  CH-1211 GENEVA 23
