diff options
author | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-06-05 15:57:11 +0000 |
---|---|---|
committer | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-06-05 15:57:11 +0000 |
commit | f9b7c0b9c2577939361732a3afab1c2553aa855a (patch) | |
tree | a6c36dde47246a4a92f288f42e07af5503e92290 /gcc/gcc.c | |
parent | 6767380fa85e8f6401b0f237a6cc5da48bd85f9a (diff) | |
download | gcc-f9b7c0b9c2577939361732a3afab1c2553aa855a.tar.gz |
`
* gcc.c (lang_specific_pre_link): New LANG_SPECIFIC_DRIVER function.
(lang_specific_extra_outfiles): New LANG_SPECIFIC_DRIVER variable.
(do_spec, input_filename, input_filename_length): Make public.
(main): Adjust outfiles allocation by lang_specific_extra_outfiles.
Call lang_specific_pre_link befor elinking.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@20250 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r-- | gcc/gcc.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c index c2c1af62809..dec6acc65f2 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -232,7 +232,7 @@ static int check_live_switch PROTO((int, int)); static char *handle_braces PROTO((char *)); static char *save_string PROTO((char *, int)); static char *concat PVPROTO((char *, ...)); -static int do_spec PROTO((char *)); +extern int do_spec PROTO((char *)); static int do_spec_1 PROTO((char *, int, char *)); static char *find_file PROTO((char *)); static int is_directory PROTO((char *, char *, int)); @@ -254,7 +254,14 @@ char *xmalloc (); char *xrealloc (); #ifdef LANG_SPECIFIC_DRIVER +/* Called before processing to change/add/remove arguments. */ extern void lang_specific_driver PROTO ((void (*) PVPROTO((char *, ...)), int *, char ***, int *)); + +/* Called before linking. Returns 0 on success and -1 on failure. */ +extern int lang_specific_pre_link (); + +/* Number of extra output files that lang_specific_pre_link may generate. */ +extern int lang_specific_extra_ofiles; #endif /* Specs are strings containing lines, each of which (if not blank) @@ -3111,9 +3118,9 @@ process_command (argc, argv) sans all directory names, and basename_length is the number of characters starting there excluding the suffix .c or whatever. */ -static char *input_filename; +char *input_filename; static int input_file_number; -static size_t input_filename_length; +size_t input_filename_length; static int basename_length; static char *input_basename; static char *input_suffix; @@ -3143,7 +3150,7 @@ static int input_from_pipe; /* Process the spec SPEC and run the commands specified therein. Returns 0 if the spec is successfully processed; -1 if failed. */ -static int +int do_spec (spec) char *spec; { @@ -4739,7 +4746,11 @@ main (argc, argv) /* Make a place to record the compiler output file names that correspond to the input files. */ - outfiles = (char **) xmalloc (n_infiles * sizeof (char *)); + i = n_infiles; +#ifdef LANG_SPECIFIC_DRIVER + i += lang_specific_extra_ofiles; +#endif + outfiles = (char **) xmalloc (i * sizeof (char *)); bzero ((char *) outfiles, n_infiles * sizeof (char *)); /* Record which files were specified explicitly as link input. */ @@ -4835,6 +4846,12 @@ main (argc, argv) clear_failure_queue (); } +#ifdef LANG_SPECIFIC_DRIVER + if (error_count == 0 + && lang_specific_pre_link ()) + error_count++; +#endif + /* Run ld to link all the compiler output files. */ if (error_count == 0) |