roberto@cernvax.UUCP (roberto bagnara) (08/21/89)
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