Commit 9257393c by Kaveh R. Ghazi Committed by Kaveh Ghazi

Makefile.in (gcc.o, [...]): Depend on gcc.h.

	* Makefile.in (gcc.o, gccspec.o, cppspec.o): Depend on gcc.h.

	* gcc.h: New file.
	(lang_specific_driver): Don't take a function pointer parameter.
	All callers changed.

	* gcc.c: Include gcc.h.
	(do_spec, fancy_abort,lang_specific_driver,lang_specific_pre_link,
	lang_specific_extra_outfiles, fatal): Don't declare.
	(multilib_defaults_raw): Constify.
	(read_specs): Call memset, rather than bzero.
	(main): Call return, not exit.
	(lookup_compiler): Call memcpy, not bcopy.
	(fatal): Make extern.

	* cppspec.c: Include gcc.h.
	(lang_specific_driver): Initialize variable `quote'.  Constify a
	char*.  All calls to the function pointer parameter now
	explicitly call `fatal'.

	* gccspec.c (lang_specific_driver): Include gcc.h.

cp:

	* Make-lang.in (g++spec.o): Depend on system.h and gcc.h.

	* g++spec.c: Include gcc.h.
	(lang_specific_driver): Constify a char*.  Call xcalloc, not
 	xmalloc/bzero.  All calls to the function pointer parameter now
 	explicitly call `fatal'.

f:

	* Make-lang.in (g77spec.o): Depend on system.h and gcc.h.

	* g77spec.c: Include gcc.h.
	(g77_xargv): Constify.
	(g77_fn): Add parameter prototypes.
	(lookup_option, append_arg): Add static prototypes.
	(g77_newargv): Constify.
	(lookup_option, append_arg, lang_specific_driver): Constify a char*.
	(lang_specific_driver): All calls to the function pointer
 	parameter now explicitly call `fatal'.

java:

	* Make-lang.in (jvspec.o): Depend on system.h and gcc.h.

	* jvspec.c: Include gcc.h.  Don't include gansidecl.h.
	(do_spec, lang_specific_pre_link, lang_specific_driver,
	input_filename, input_filename_length): Don't declare.
	(main_class_name, jvgenmain_spec, lang_specific_driver):
	Constify a char*.
	(lang_specific_driver): All calls to the function pointer
	parameter now explicitly call `fatal'.

From-SVN: r29367
parent 5d73aa63
Sun Sep 12 23:28:20 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Makefile.in (gcc.o, gccspec.o, cppspec.o): Depend on gcc.h.
* gcc.h: New file.
(lang_specific_driver): Don't take a function pointer parameter.
All callers changed.
* gcc.c: Include gcc.h.
(do_spec, fancy_abort,lang_specific_driver,lang_specific_pre_link,
lang_specific_extra_outfiles, fatal): Don't declare.
(multilib_defaults_raw): Constify.
(read_specs): Call memset, rather than bzero.
(main): Call return, not exit.
(lookup_compiler): Call memcpy, not bcopy.
(fatal): Make extern.
* cppspec.c: Include gcc.h.
(lang_specific_driver): Initialize variable `quote'. Constify a
char*. All calls to the function pointer parameter now
explicitly call `fatal'.
* gccspec.c (lang_specific_driver): Include gcc.h.
Sun Sep 12 19:52:10 1999 Richard Earnshaw <rearnsha@arm.com> Sun Sep 12 19:52:10 1999 Richard Earnshaw <rearnsha@arm.com>
* arm.c (note_invalid_constants): Use recog_data.operand_type * arm.c (note_invalid_constants): Use recog_data.operand_type
......
...@@ -1419,13 +1419,13 @@ DRIVER_DEFINES = \ ...@@ -1419,13 +1419,13 @@ DRIVER_DEFINES = \
-DDEFAULT_TARGET_MACHINE=\"$(target_alias)\" \ -DDEFAULT_TARGET_MACHINE=\"$(target_alias)\" \
-DTOOLDIR_BASE_PREFIX=\"$(exec_prefix)/\" -DTOOLDIR_BASE_PREFIX=\"$(exec_prefix)/\"
gcc.o: gcc.c $(CONFIG_H) system.h intl.h multilib.h \ gcc.o: gcc.c $(CONFIG_H) system.h intl.h multilib.h \
Makefile $(lang_specs_files) prefix.h Makefile $(lang_specs_files) prefix.h gcc.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
$(DRIVER_DEFINES) \ $(DRIVER_DEFINES) \
-c `echo $(srcdir)/gcc.c | sed 's,^\./,,'` -c `echo $(srcdir)/gcc.c | sed 's,^\./,,'`
gccspec.o: gccspec.c $(CONFIG_H) system.h gccspec.o: gccspec.c $(CONFIG_H) system.h gcc.h
cppspec.o: cppspec.c $(CONFIG_H) system.h cppspec.o: cppspec.c $(CONFIG_H) system.h gcc.h
tree-check.h: s-check ; @true tree-check.h: s-check ; @true
s-check : gencheck $(srcdir)/move-if-change s-check : gencheck $(srcdir)/move-if-change
......
Sun Sep 12 23:29:07 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Make-lang.in (g++spec.o): Depend on system.h and gcc.h.
* g++spec.c: Include gcc.h.
(lang_specific_driver): Constify a char*. Call xcalloc, not
xmalloc/bzero. All calls to the function pointer parameter now
explicitly call `fatal'.
1999-09-12 Mark Mitchell <mark@codesourcery.com> 1999-09-12 Mark Mitchell <mark@codesourcery.com>
* call.c (implicit_conversion): Robustify. Handle OFFSET_REFs. * call.c (implicit_conversion): Robustify. Handle OFFSET_REFs.
......
...@@ -75,7 +75,7 @@ C++ c++: cc1plus$(exeext) ...@@ -75,7 +75,7 @@ C++ c++: cc1plus$(exeext)
# Tell GNU make to ignore these if they exist. # Tell GNU make to ignore these if they exist.
.PHONY: C++ c++ .PHONY: C++ c++
g++spec.o: $(srcdir)/cp/g++spec.c g++spec.o: $(srcdir)/cp/g++spec.c system.h gcc.h
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/cp/g++spec.c $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/cp/g++spec.c
$(INTL_TARGETS): $(srcdir)/cp/parse.c $(INTL_TARGETS): $(srcdir)/cp/parse.c
......
...@@ -20,6 +20,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -20,6 +20,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h" #include "config.h"
#include "system.h" #include "system.h"
#include "gcc.h"
/* This bit is set if we saw a `-xfoo' language specification. */ /* This bit is set if we saw a `-xfoo' language specification. */
#define LANGSPEC (1<<1) #define LANGSPEC (1<<1)
...@@ -37,8 +38,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -37,8 +38,7 @@ Boston, MA 02111-1307, USA. */
#endif #endif
void void
lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) lang_specific_driver (in_argc, in_argv, in_added_libraries)
void (*fn)();
int *in_argc; int *in_argc;
char ***in_argv; char ***in_argv;
int *in_added_libraries; int *in_added_libraries;
...@@ -59,10 +59,11 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) ...@@ -59,10 +59,11 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
/* Used to track options that take arguments, so we don't go wrapping /* Used to track options that take arguments, so we don't go wrapping
those with -xc++/-xnone. */ those with -xc++/-xnone. */
char *quote = NULL; const char *quote = NULL;
/* The new argument list will be contained in this. */ /* The new argument list will be contained in this. */
char **arglist; char **real_arglist;
const char **arglist;
/* Non-zero if we saw a `-xfoo' language specification on the /* Non-zero if we saw a `-xfoo' language specification on the
command line. Used to avoid adding our own -xc++ if the user command line. Used to avoid adding our own -xc++ if the user
...@@ -70,10 +71,10 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) ...@@ -70,10 +71,10 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
int saw_speclang = 0; int saw_speclang = 0;
/* "-lm" or "-lmath" if it appears on the command line. */ /* "-lm" or "-lmath" if it appears on the command line. */
char *saw_math = 0; const char *saw_math = 0;
/* "-lc" if it appears on the command line. */ /* "-lc" if it appears on the command line. */
char *saw_libc = 0; const char *saw_libc = 0;
/* An array used to flag each argument that needs a bit set for /* An array used to flag each argument that needs a bit set for
LANGSPEC, MATHLIB, or WITHLIBC. */ LANGSPEC, MATHLIB, or WITHLIBC. */
...@@ -98,8 +99,7 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) ...@@ -98,8 +99,7 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
argv = *in_argv; argv = *in_argv;
added_libraries = *in_added_libraries; added_libraries = *in_added_libraries;
args = (int *) xmalloc (argc * sizeof (int)); args = (int *) xcalloc (argc, sizeof (int));
bzero ((char *) args, argc * sizeof (int));
for (i = 1; i < argc; i++) for (i = 1; i < argc; i++)
{ {
...@@ -188,7 +188,7 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) ...@@ -188,7 +188,7 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
} }
if (quote) if (quote)
(*fn) ("argument to `%s' missing\n", quote); fatal ("argument to `%s' missing\n", quote);
/* If we know we don't have to do anything, bail now. */ /* If we know we don't have to do anything, bail now. */
if (! added && ! library) if (! added && ! library)
...@@ -199,7 +199,8 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) ...@@ -199,7 +199,8 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
/* Make sure to have room for the trailing NULL argument. */ /* Make sure to have room for the trailing NULL argument. */
num_args = argc + added + need_math + 1; num_args = argc + added + need_math + 1;
arglist = (char **) xmalloc (num_args * sizeof (char *)); real_arglist = (char **) xmalloc (num_args * sizeof (char *));
arglist = (const char **) real_arglist;
/* NOTE: We start at 1 now, not 0. */ /* NOTE: We start at 1 now, not 0. */
for (i = 0, j = 0; i < argc; i++, j++) for (i = 0, j = 0; i < argc; i++, j++)
...@@ -253,7 +254,7 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) ...@@ -253,7 +254,7 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
arglist[j] = NULL; arglist[j] = NULL;
*in_argc = j; *in_argc = j;
*in_argv = arglist; *in_argv = real_arglist;
*in_added_libraries = added_libraries; *in_added_libraries = added_libraries;
} }
......
...@@ -20,6 +20,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -20,6 +20,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h" #include "config.h"
#include "system.h" #include "system.h"
#include "gcc.h"
/* The `cpp' executable installed in $(bindir) and $(cpp_install_dir) /* The `cpp' executable installed in $(bindir) and $(cpp_install_dir)
is a customized version of the gcc driver. It forces -E; -S and -c is a customized version of the gcc driver. It forces -E; -S and -c
...@@ -69,8 +70,7 @@ static const char *const known_suffixes[] = ...@@ -69,8 +70,7 @@ static const char *const known_suffixes[] =
/* Filter argc and argv before processing by the gcc driver proper. */ /* Filter argc and argv before processing by the gcc driver proper. */
void void
lang_specific_driver (errfn, in_argc, in_argv, in_added_libraries) lang_specific_driver (in_argc, in_argv, in_added_libraries)
void (*errfn) PVPROTO((const char *, ...));
int *in_argc; int *in_argc;
char ***in_argv; char ***in_argv;
int *in_added_libraries ATTRIBUTE_UNUSED; int *in_added_libraries ATTRIBUTE_UNUSED;
...@@ -99,8 +99,9 @@ lang_specific_driver (errfn, in_argc, in_argv, in_added_libraries) ...@@ -99,8 +99,9 @@ lang_specific_driver (errfn, in_argc, in_argv, in_added_libraries)
/* Do we need to fix up an input file with an unrecognized suffix? */ /* Do we need to fix up an input file with an unrecognized suffix? */
int need_fixups = 1; int need_fixups = 1;
int i, j, quote; int i, j, quote = 0;
char **new_argv; char **real_new_argv;
const char **new_argv;
int new_argc; int new_argc;
/* First pass. If we see an -S or -c, barf. If we see an input file, /* First pass. If we see an -S or -c, barf. If we see an input file,
...@@ -124,8 +125,8 @@ lang_specific_driver (errfn, in_argc, in_argv, in_added_libraries) ...@@ -124,8 +125,8 @@ lang_specific_driver (errfn, in_argc, in_argv, in_added_libraries)
need_E = 0; need_E = 0;
else if (argv[i][1] == 'S' || argv[i][1] == 'c') else if (argv[i][1] == 'S' || argv[i][1] == 'c')
{ {
(*errfn) ("`%s' is not a legal option to the preprocessor", fatal ("`%s' is not a legal option to the preprocessor",
argv[i]); argv[i]);
return; return;
} }
else if (argv[i][1] == 'x') else if (argv[i][1] == 'x')
...@@ -148,7 +149,7 @@ lang_specific_driver (errfn, in_argc, in_argv, in_added_libraries) ...@@ -148,7 +149,7 @@ lang_specific_driver (errfn, in_argc, in_argv, in_added_libraries)
seen_input++; seen_input++;
if (seen_input == 3) if (seen_input == 3)
{ {
(*errfn) ("too many input files"); fatal ("too many input files");
return; return;
} }
else if (seen_input == 2) else if (seen_input == 2)
...@@ -195,7 +196,8 @@ lang_specific_driver (errfn, in_argc, in_argv, in_added_libraries) ...@@ -195,7 +196,8 @@ lang_specific_driver (errfn, in_argc, in_argv, in_added_libraries)
return; return;
/* One more slot for a terminating null. */ /* One more slot for a terminating null. */
new_argv = (char **) xmalloc ((new_argc + 1) * sizeof(char *)); real_new_argv = (char **) xmalloc ((new_argc + 1) * sizeof(char *));
new_argv = (const char **) real_new_argv.
new_argv[0] = argv[0]; new_argv[0] = argv[0];
j = 1; j = 1;
...@@ -223,7 +225,7 @@ lang_specific_driver (errfn, in_argc, in_argv, in_added_libraries) ...@@ -223,7 +225,7 @@ lang_specific_driver (errfn, in_argc, in_argv, in_added_libraries)
new_argv[j] = NULL; new_argv[j] = NULL;
*in_argc = new_argc; *in_argc = new_argc;
*in_argv = new_argv; *in_argv = real_new_argv;
} }
/* Called before linking. Returns 0 on success and -1 on failure. */ /* Called before linking. Returns 0 on success and -1 on failure. */
......
Sun Sep 12 23:29:47 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Make-lang.in (g77spec.o): Depend on system.h and gcc.h.
* g77spec.c: Include gcc.h.
(g77_xargv): Constify.
(g77_fn): Add parameter prototypes.
(lookup_option, append_arg): Add static prototypes.
(g77_newargv): Constify.
(lookup_option, append_arg, lang_specific_driver): Constify a char*.
(lang_specific_driver): All calls to the function pointer
parameter now explicitly call `fatal'.
Fri Sep 10 10:32:32 1999 Bernd Schmidt <bernds@cygnus.co.uk> Fri Sep 10 10:32:32 1999 Bernd Schmidt <bernds@cygnus.co.uk>
* com.h: Delete declarations for all tree nodes now moved to * com.h: Delete declarations for all tree nodes now moved to
...@@ -494,7 +507,7 @@ Sun Apr 11 21:33:33 1999 Mumit Khan <khan@xraylith.wisc.edu> ...@@ -494,7 +507,7 @@ Sun Apr 11 21:33:33 1999 Mumit Khan <khan@xraylith.wisc.edu>
* g77spec.c (lang_specific_driver): Check whether MATH_LIBRARY is * g77spec.c (lang_specific_driver): Check whether MATH_LIBRARY is
null to decide whether to use it. null to decide whether to use it.
Wed Apr 7 09:47:09 1999 Kaveh R. Ghazi <ghazi@snafu.rutgers.edu> Wed Apr 7 09:47:09 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* ansify.c (die): Specify void argument. * ansify.c (die): Specify void argument.
......
...@@ -59,7 +59,7 @@ F77 f77: f771$(exeext) ...@@ -59,7 +59,7 @@ F77 f77: f771$(exeext)
f77.extraclean f77.maintainer-clean f77.distdir f77.rebuilt \ f77.extraclean f77.maintainer-clean f77.distdir f77.rebuilt \
f77.stage1 f77.stage2 f77.stage3 f77.stage4 f77.stage1 f77.stage2 f77.stage3 f77.stage4
g77spec.o: $(srcdir)/f/g77spec.c $(srcdir)/f/version.h g77spec.o: $(srcdir)/f/g77spec.c $(srcdir)/f/version.h system.h gcc.h
case "$(LANGUAGES)" in \ case "$(LANGUAGES)" in \
*[fF]77*) touch lang-f77;; \ *[fF]77*) touch lang-f77;; \
*) rm -f lang-f77;; \ *) rm -f lang-f77;; \
......
...@@ -46,6 +46,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -46,6 +46,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h" #include "config.h"
#include "system.h" #include "system.h"
#include "gcc.h"
#include <f/version.h> #include <f/version.h>
#ifndef MATH_LIBRARY #ifndef MATH_LIBRARY
...@@ -85,12 +86,15 @@ typedef enum ...@@ -85,12 +86,15 @@ typedef enum
/* The original argument list and related info is copied here. */ /* The original argument list and related info is copied here. */
static int g77_xargc; static int g77_xargc;
static char **g77_xargv; static const char **g77_xargv;
static void (*g77_fn)(); static void lookup_option PARAMS ((Option *, int *, const char **,
const char *));
static void append_arg PARAMS ((const char *));
/* The new argument list will be built here. */ /* The new argument list will be built here. */
static int g77_newargc; static int g77_newargc;
static char **g77_newargv; static char **real_g77_newargv;
static const char **g77_newargv;
extern char *version_string; extern char *version_string;
...@@ -136,12 +140,12 @@ static void ...@@ -136,12 +140,12 @@ static void
lookup_option (xopt, xskip, xarg, text) lookup_option (xopt, xskip, xarg, text)
Option *xopt; Option *xopt;
int *xskip; int *xskip;
char **xarg; const char **xarg;
char *text; const char *text;
{ {
Option opt = OPTION_; Option opt = OPTION_;
int skip; int skip;
char *arg = NULL; const char *arg = NULL;
if ((skip = SWITCH_TAKES_ARG (text[1]))) if ((skip = SWITCH_TAKES_ARG (text[1])))
skip -= (text[2] != '\0'); /* See gcc.c. */ skip -= (text[2] != '\0'); /* See gcc.c. */
...@@ -216,7 +220,7 @@ lookup_option (xopt, xskip, xarg, text) ...@@ -216,7 +220,7 @@ lookup_option (xopt, xskip, xarg, text)
static void static void
append_arg (arg) append_arg (arg)
char *arg; const char *arg;
{ {
static int newargsize; static int newargsize;
...@@ -238,7 +242,8 @@ append_arg (arg) ...@@ -238,7 +242,8 @@ append_arg (arg)
int i; int i;
newargsize = (g77_xargc << 2) + 20; /* This should handle all. */ newargsize = (g77_xargc << 2) + 20; /* This should handle all. */
g77_newargv = (char **) xmalloc (newargsize * sizeof (char *)); real_g77_newargv = (char **) xmalloc (newargsize * sizeof (char *));
g77_newargv = (const char **) real_g77_newargv;
/* Copy what has been done so far. */ /* Copy what has been done so far. */
for (i = 0; i < g77_newargc; ++i) for (i = 0; i < g77_newargc; ++i)
...@@ -246,29 +251,28 @@ append_arg (arg) ...@@ -246,29 +251,28 @@ append_arg (arg)
} }
if (g77_newargc == newargsize) if (g77_newargc == newargsize)
(*g77_fn) ("overflowed output arg list for `%s'", arg); fatal ("overflowed output arg list for `%s'", arg);
g77_newargv[g77_newargc++] = arg; g77_newargv[g77_newargc++] = arg;
} }
void void
lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) lang_specific_driver (in_argc, in_argv, in_added_libraries)
void (*fn)();
int *in_argc; int *in_argc;
char ***in_argv; char ***in_argv;
int *in_added_libraries; int *in_added_libraries ATTRIBUTE_UNUSED;
{ {
int argc = *in_argc; int argc = *in_argc;
char **argv = *in_argv; const char **argv = (const char **) *in_argv;
int i; int i;
int verbose = 0; int verbose = 0;
Option opt; Option opt;
int skip; int skip;
char *arg; const char *arg;
/* This will be NULL if we encounter a situation where we should not /* This will be NULL if we encounter a situation where we should not
link in libf2c. */ link in libf2c. */
char *library = FORTRAN_LIBRARY; const char *library = FORTRAN_LIBRARY;
/* This will become 0 if anything other than -v and kin (like -V) /* This will become 0 if anything other than -v and kin (like -V)
is seen, meaning the user is trying to accomplish something. is seen, meaning the user is trying to accomplish something.
...@@ -304,7 +308,6 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) ...@@ -304,7 +308,6 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
g77_xargv = argv; g77_xargv = argv;
g77_newargc = 0; g77_newargc = 0;
g77_newargv = argv; g77_newargv = argv;
g77_fn = fn;
/* First pass through arglist. /* First pass through arglist.
...@@ -434,7 +437,7 @@ For bug reporting instructions, please see:\n\ ...@@ -434,7 +437,7 @@ For bug reporting instructions, please see:\n\
#endif #endif
case OPTION_driver: case OPTION_driver:
(*fn) ("--driver no longer supported", argv[i]); fatal ("--driver no longer supported", argv[i]);
break; break;
default: default:
...@@ -448,11 +451,11 @@ For bug reporting instructions, please see:\n\ ...@@ -448,11 +451,11 @@ For bug reporting instructions, please see:\n\
if (i + skip < argc) if (i + skip < argc)
i += skip; i += skip;
else else
(*fn) ("argument to `%s' missing", argv[i]); fatal ("argument to `%s' missing", argv[i]);
} }
if ((n_outfiles != 0) && (n_infiles == 0)) if ((n_outfiles != 0) && (n_infiles == 0))
(*fn) ("No input files; unwilling to write output files"); fatal ("No input files; unwilling to write output files");
/* Second pass through arglist, transforming arguments as appropriate. */ /* Second pass through arglist, transforming arguments as appropriate. */
...@@ -486,7 +489,7 @@ For bug reporting instructions, please see:\n\ ...@@ -486,7 +489,7 @@ For bug reporting instructions, please see:\n\
if (opt == OPTION_x) if (opt == OPTION_x)
{ {
/* Track input language. */ /* Track input language. */
char *lang; const char *lang;
if (arg == NULL) if (arg == NULL)
lang = argv[i+1]; lang = argv[i+1];
...@@ -569,7 +572,7 @@ For bug reporting instructions, please see:\n\ ...@@ -569,7 +572,7 @@ For bug reporting instructions, please see:\n\
} }
*in_argc = g77_newargc; *in_argc = g77_newargc;
*in_argv = g77_newargv; *in_argv = real_g77_newargv;
} }
/* Called before linking. Returns 0 on success and -1 on failure. */ /* Called before linking. Returns 0 on success and -1 on failure. */
......
...@@ -38,6 +38,7 @@ compilation is specified by a string called a "spec". */ ...@@ -38,6 +38,7 @@ compilation is specified by a string called a "spec". */
#include "obstack.h" #include "obstack.h"
#include "intl.h" #include "intl.h"
#include "prefix.h" #include "prefix.h"
#include "gcc.h"
#ifdef VMS #ifdef VMS
#define exit __posix_exit #define exit __posix_exit
...@@ -190,7 +191,6 @@ static void clear_failure_queue PROTO((void)); ...@@ -190,7 +191,6 @@ static void clear_failure_queue PROTO((void));
static int check_live_switch PROTO((int, int)); static int check_live_switch PROTO((int, int));
static const char *handle_braces PROTO((const char *)); static const char *handle_braces PROTO((const char *));
static char *save_string PROTO((const char *, int)); static char *save_string PROTO((const char *, int));
extern int do_spec PROTO((const char *));
static int do_spec_1 PROTO((const char *, int, const char *)); static int do_spec_1 PROTO((const char *, int, const char *));
static const char *find_file PROTO((const char *)); static const char *find_file PROTO((const char *));
static int is_directory PROTO((const char *, const char *, int)); static int is_directory PROTO((const char *, const char *, int));
...@@ -205,8 +205,6 @@ static void pfatal_with_name PROTO((const char *)) ATTRIBUTE_NORETURN; ...@@ -205,8 +205,6 @@ static void pfatal_with_name PROTO((const char *)) ATTRIBUTE_NORETURN;
static void perror_with_name PROTO((const char *)); static void perror_with_name PROTO((const char *));
static void pfatal_pexecute PROTO((const char *, const char *)) static void pfatal_pexecute PROTO((const char *, const char *))
ATTRIBUTE_NORETURN; ATTRIBUTE_NORETURN;
static void fatal PVPROTO((const char *, ...))
ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
static void error PVPROTO((const char *, ...)) static void error PVPROTO((const char *, ...))
ATTRIBUTE_PRINTF_1; ATTRIBUTE_PRINTF_1;
static void notice PVPROTO((const char *, ...)) static void notice PVPROTO((const char *, ...))
...@@ -220,18 +218,6 @@ static int execute PROTO ((void)); ...@@ -220,18 +218,6 @@ static int execute PROTO ((void));
static void unused_prefix_warnings PROTO ((struct path_prefix *)); static void unused_prefix_warnings PROTO ((struct path_prefix *));
static void clear_args PROTO ((void)); static void clear_args PROTO ((void));
static void fatal_error PROTO ((int)); static void fatal_error PROTO ((int));
void fancy_abort PROTO((void)) ATTRIBUTE_NORETURN;
/* Called before processing to change/add/remove arguments. */
extern void lang_specific_driver PROTO ((void (*) PVPROTO((const 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_outfiles;
/* Specs are strings containing lines, each of which (if not blank) /* Specs are strings containing lines, each of which (if not blank)
is made up of a program name, and arguments separated by spaces. is made up of a program name, and arguments separated by spaces.
...@@ -503,7 +489,7 @@ static char *multilib_defaults; ...@@ -503,7 +489,7 @@ static char *multilib_defaults;
#define MULTILIB_DEFAULTS { "" } #define MULTILIB_DEFAULTS { "" }
#endif #endif
static char *multilib_defaults_raw[] = MULTILIB_DEFAULTS; static const char *const multilib_defaults_raw[] = MULTILIB_DEFAULTS;
struct user_specs { struct user_specs {
struct user_specs *next; struct user_specs *next;
...@@ -1657,12 +1643,11 @@ read_specs (filename, main_p) ...@@ -1657,12 +1643,11 @@ read_specs (filename, main_p)
(n_compilers + 2) * sizeof (struct compiler))); (n_compilers + 2) * sizeof (struct compiler)));
compilers[n_compilers].suffix = suffix; compilers[n_compilers].suffix = suffix;
bzero ((char *) compilers[n_compilers].spec, memset (compilers[n_compilers].spec, 0,
sizeof compilers[n_compilers].spec); sizeof compilers[n_compilers].spec);
compilers[n_compilers].spec[0] = spec; compilers[n_compilers].spec[0] = spec;
n_compilers++; n_compilers++;
bzero ((char *) &compilers[n_compilers], memset (&compilers[n_compilers], 0, sizeof compilers[n_compilers]);
sizeof compilers[n_compilers]);
} }
if (*suffix == 0) if (*suffix == 0)
...@@ -2714,7 +2699,7 @@ process_command (argc, argv) ...@@ -2714,7 +2699,7 @@ process_command (argc, argv)
translate_options (&argc, &argv); translate_options (&argc, &argv);
/* Do language-specific adjustment/addition of flags. */ /* Do language-specific adjustment/addition of flags. */
lang_specific_driver (fatal, &argc, &argv, &added_libraries); lang_specific_driver (&argc, &argv, &added_libraries);
/* Scan argv twice. Here, the first time, just count how many switches /* Scan argv twice. Here, the first time, just count how many switches
there will be in their vector, and how many input files in theirs. there will be in their vector, and how many input files in theirs.
...@@ -4914,26 +4899,26 @@ main (argc, argv) ...@@ -4914,26 +4899,26 @@ main (argc, argv)
printf ("install: %s%s\n", standard_exec_prefix, machine_suffix); printf ("install: %s%s\n", standard_exec_prefix, machine_suffix);
printf ("programs: %s\n", build_search_list (&exec_prefixes, "", 0)); printf ("programs: %s\n", build_search_list (&exec_prefixes, "", 0));
printf ("libraries: %s\n", build_search_list (&startfile_prefixes, "", 0)); printf ("libraries: %s\n", build_search_list (&startfile_prefixes, "", 0));
exit (0); return (0);
} }
if (print_file_name) if (print_file_name)
{ {
printf ("%s\n", find_file (print_file_name)); printf ("%s\n", find_file (print_file_name));
exit (0); return (0);
} }
if (print_prog_name) if (print_prog_name)
{ {
char *newname = find_a_file (&exec_prefixes, print_prog_name, X_OK); char *newname = find_a_file (&exec_prefixes, print_prog_name, X_OK);
printf ("%s\n", (newname ? newname : print_prog_name)); printf ("%s\n", (newname ? newname : print_prog_name));
exit (0); return (0);
} }
if (print_multi_lib) if (print_multi_lib)
{ {
print_multilib_info (); print_multilib_info ();
exit (0); return (0);
} }
if (print_multi_directory) if (print_multi_directory)
...@@ -4942,7 +4927,7 @@ main (argc, argv) ...@@ -4942,7 +4927,7 @@ main (argc, argv)
printf (".\n"); printf (".\n");
else else
printf ("%s\n", multilib_dir); printf ("%s\n", multilib_dir);
exit (0); return (0);
} }
if (print_help_list) if (print_help_list)
...@@ -4954,7 +4939,7 @@ main (argc, argv) ...@@ -4954,7 +4939,7 @@ main (argc, argv)
printf ("\nFor bug reporting instructions, please see:\n"); printf ("\nFor bug reporting instructions, please see:\n");
printf ("<URL:http://www.gnu.org/software/gcc/faq.html#bugreport>.\n"); printf ("<URL:http://www.gnu.org/software/gcc/faq.html#bugreport>.\n");
exit (0); return (0);
} }
/* We do not exit here. Instead we have created a fake input file /* We do not exit here. Instead we have created a fake input file
...@@ -4981,7 +4966,7 @@ main (argc, argv) ...@@ -4981,7 +4966,7 @@ main (argc, argv)
version_string, compiler_version); version_string, compiler_version);
if (n_infiles == 0) if (n_infiles == 0)
exit (0); return (0);
} }
if (n_infiles == added_libraries) if (n_infiles == added_libraries)
...@@ -5146,9 +5131,7 @@ main (argc, argv) ...@@ -5146,9 +5131,7 @@ main (argc, argv)
printf ("<URL:http://www.gnu.org/software/gcc/faq.html#bugreport>\n"); printf ("<URL:http://www.gnu.org/software/gcc/faq.html#bugreport>\n");
} }
exit (error_count > 0 ? (signal_count ? 2 : 1) : 0); return (error_count > 0 ? (signal_count ? 2 : 1) : 0);
/* NOTREACHED */
return 0;
} }
/* Find the proper compilation spec for the file name NAME, /* Find the proper compilation spec for the file name NAME,
...@@ -5208,8 +5191,9 @@ lookup_compiler (name, length, language) ...@@ -5208,8 +5191,9 @@ lookup_compiler (name, length, language)
language = cp->spec[0] + 1; language = cp->spec[0] + 1;
new = (struct compiler *) xmalloc (sizeof (struct compiler)); new = (struct compiler *) xmalloc (sizeof (struct compiler));
new->suffix = cp->suffix; new->suffix = cp->suffix;
bcopy ((char *) lookup_compiler (NULL_PTR, 0, language)->spec, memcpy (new->spec,
(char *) new->spec, sizeof new->spec); lookup_compiler (NULL_PTR, 0, language)->spec,
sizeof new->spec);
return new; return new;
} }
...@@ -5280,7 +5264,7 @@ fancy_abort () ...@@ -5280,7 +5264,7 @@ fancy_abort ()
/* Output an error message and exit */ /* Output an error message and exit */
static void void
fatal VPROTO((const char *msgid, ...)) fatal VPROTO((const char *msgid, ...))
{ {
#ifndef ANSI_PROTOTYPES #ifndef ANSI_PROTOTYPES
......
/* Header file for modules that link with gcc.c
Copyright (C) 1999 Free Software Foundation, Inc.
This file is part of GNU CC.
GNU CC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU CC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef __GCC_H__
#define __GCC_H__
/* These are exported by gcc.c. */
extern int do_spec PARAMS ((const char *));
extern void fancy_abort PARAMS ((void)) ATTRIBUTE_NORETURN;
extern const char *input_filename;
extern size_t input_filename_length;
extern void fatal PARAMS ((const char *, ...))
ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
/* Spec files linked with gcc.c must provide definitions for these. */
/* Called before processing to change/add/remove arguments. */
extern void lang_specific_driver PARAMS ((int *, char ***, int *));
/* Called before linking. Returns 0 on success and -1 on failure. */
extern int lang_specific_pre_link PARAMS ((void));
/* Number of extra output files that lang_specific_pre_link may generate. */
extern int lang_specific_extra_outfiles;
#endif /* ! __GCC_H__ */
...@@ -20,11 +20,11 @@ Boston, MA 02111-1307, USA. */ ...@@ -20,11 +20,11 @@ Boston, MA 02111-1307, USA. */
#include "config.h" #include "config.h"
#include "system.h" #include "system.h"
#include "gcc.h"
/* Filter argc and argv before processing by the gcc driver proper. */ /* Filter argc and argv before processing by the gcc driver proper. */
void void
lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) lang_specific_driver (in_argc, in_argv, in_added_libraries)
void (*fn)() ATTRIBUTE_UNUSED;
int *in_argc ATTRIBUTE_UNUSED; int *in_argc ATTRIBUTE_UNUSED;
char ***in_argv ATTRIBUTE_UNUSED; char ***in_argv ATTRIBUTE_UNUSED;
int *in_added_libraries ATTRIBUTE_UNUSED; int *in_added_libraries ATTRIBUTE_UNUSED;
......
Sun Sep 12 23:30:09 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Make-lang.in (jvspec.o): Depend on system.h and gcc.h.
* jvspec.c: Include gcc.h. Don't include gansidecl.h.
(do_spec, lang_specific_pre_link, lang_specific_driver,
input_filename, input_filename_length): Don't declare.
(main_class_name, jvgenmain_spec, lang_specific_driver):
Constify a char*.
(lang_specific_driver): All calls to the function pointer
parameter now explicitly call `fatal'.
Sat Sep 11 16:46:44 1999 Alexandre Petit-Bianco <apbianco@cygnus.com> Sat Sep 11 16:46:44 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (find_applicable_accessible_methods_list): Search * parse.y (find_applicable_accessible_methods_list): Search
......
...@@ -80,7 +80,7 @@ JAVA_SRCS = $(srcdir)/java/parse.y $(srcdir)/java/class.c \ ...@@ -80,7 +80,7 @@ JAVA_SRCS = $(srcdir)/java/parse.y $(srcdir)/java/class.c \
jc1$(exeext): $(P) $(JAVA_SRCS) $(LIBDEPS) stamp-objlist ggc-callbacks.o jc1$(exeext): $(P) $(JAVA_SRCS) $(LIBDEPS) stamp-objlist ggc-callbacks.o
cd java; $(MAKE) $(FLAGS_TO_PASS) $(JAVA_FLAGS_TO_PASS) ../jc1$(exeext) cd java; $(MAKE) $(FLAGS_TO_PASS) $(JAVA_FLAGS_TO_PASS) ../jc1$(exeext)
jvspec.o: $(srcdir)/java/jvspec.c jvspec.o: $(srcdir)/java/jvspec.c system.h gcc.h
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
$(INCLUDES) $(srcdir)/java/jvspec.c $(INCLUDES) $(srcdir)/java/jvspec.c
......
...@@ -24,10 +24,8 @@ of Sun Microsystems, Inc. in the United States and other countries. ...@@ -24,10 +24,8 @@ of Sun Microsystems, Inc. in the United States and other countries.
The Free Software Foundation is independent of Sun Microsystems, Inc. */ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "config.h" #include "config.h"
#include "system.h" #include "system.h"
#include "gcc.h"
#include "gansidecl.h"
/* Name of spec file. */ /* Name of spec file. */
#define SPEC_FILE "libgcj.spec" #define SPEC_FILE "libgcj.spec"
...@@ -42,14 +40,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ ...@@ -42,14 +40,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#define CLASS_FILE_ARG (1<<4) #define CLASS_FILE_ARG (1<<4)
static char *find_spec_file PROTO ((const char *)); static char *find_spec_file PROTO ((const char *));
extern int do_spec PROTO((char *));
extern int lang_specific_pre_link PROTO((void)); static const char *main_class_name = NULL;
extern void lang_specific_driver PROTO ((void (*) (const char *, ...),
int *, char ***, int *));
extern char *input_filename;
extern size_t input_filename_length;
char *main_class_name = NULL;
int lang_specific_extra_outfiles = 0; int lang_specific_extra_outfiles = 0;
/* Once we have the proper support in jc1 (and gcc.c) working, /* Once we have the proper support in jc1 (and gcc.c) working,
...@@ -57,7 +49,7 @@ int lang_specific_extra_outfiles = 0; ...@@ -57,7 +49,7 @@ int lang_specific_extra_outfiles = 0;
and *.class input files to be passed to a single jc1 invocation. */ and *.class input files to be passed to a single jc1 invocation. */
#define COMBINE_INPUTS 0 #define COMBINE_INPUTS 0
char jvgenmain_spec[] = const char jvgenmain_spec[] =
"jvgenmain %i %{!pipe:%u.i} |\n\ "jvgenmain %i %{!pipe:%u.i} |\n\
cc1 %{!pipe:%U.i} %1 \ cc1 %{!pipe:%U.i} %1 \
%{!Q:-quiet} -dumpbase %b.c %{d*} %{m*} %{a*}\ %{!Q:-quiet} -dumpbase %b.c %{d*} %{m*} %{a*}\
...@@ -92,8 +84,7 @@ find_spec_file (dir) ...@@ -92,8 +84,7 @@ find_spec_file (dir)
} }
void void
lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) lang_specific_driver (in_argc, in_argv, in_added_libraries)
void (*fn) PROTO ((const char *, ...));
int *in_argc; int *in_argc;
char ***in_argv; char ***in_argv;
int *in_added_libraries; int *in_added_libraries;
...@@ -138,10 +129,11 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) ...@@ -138,10 +129,11 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
/* Used to track options that take arguments, so we don't go wrapping /* Used to track options that take arguments, so we don't go wrapping
those with -xc++/-xnone. */ those with -xc++/-xnone. */
char *quote = NULL; const char *quote = NULL;
/* The new argument list will be contained in this. */ /* The new argument list will be contained in this. */
char **arglist; char **real_arglist;
const char **arglist;
/* Non-zero if we saw a `-xfoo' language specification on the /* Non-zero if we saw a `-xfoo' language specification on the
command line. Used to avoid adding our own -xc++ if the user command line. Used to avoid adding our own -xc++ if the user
...@@ -149,16 +141,16 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) ...@@ -149,16 +141,16 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
int saw_speclang = 0; int saw_speclang = 0;
/* "-lm" or "-lmath" if it appears on the command line. */ /* "-lm" or "-lmath" if it appears on the command line. */
char *saw_math ATTRIBUTE_UNUSED = 0; const char *saw_math ATTRIBUTE_UNUSED = 0;
/* "-lc" if it appears on the command line. */ /* "-lc" if it appears on the command line. */
char *saw_libc ATTRIBUTE_UNUSED = 0; const char *saw_libc ATTRIBUTE_UNUSED = 0;
/* "-lgcjgc" if it appears on the command line. */ /* "-lgcjgc" if it appears on the command line. */
char *saw_gc ATTRIBUTE_UNUSED = 0; const char *saw_gc ATTRIBUTE_UNUSED = 0;
/* Saw `-l' option for the thread library. */ /* Saw `-l' option for the thread library. */
char *saw_threadlib ATTRIBUTE_UNUSED = 0; const char *saw_threadlib ATTRIBUTE_UNUSED = 0;
/* Saw `-lgcj' on command line. */ /* Saw `-lgcj' on command line. */
int saw_libgcj ATTRIBUTE_UNUSED = 0; int saw_libgcj ATTRIBUTE_UNUSED = 0;
...@@ -337,7 +329,7 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) ...@@ -337,7 +329,7 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
} }
if (quote) if (quote)
(*fn) ("argument to `%s' missing\n", quote); fatal ("argument to `%s' missing\n", quote);
num_args = argc + added; num_args = argc + added;
if (saw_C) if (saw_C)
...@@ -349,7 +341,7 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) ...@@ -349,7 +341,7 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
num_args += 2; /* For -o NONE. */ num_args += 2; /* For -o NONE. */
#endif #endif
if (saw_o) if (saw_o)
(*fn) ("cannot specify both -C and -o"); fatal ("cannot specify both -C and -o");
} }
#if COMBINE_INPUTS #if COMBINE_INPUTS
if (saw_o && java_files_count + (saw_C ? 0 : class_files_count) > 1) if (saw_o && java_files_count + (saw_C ? 0 : class_files_count) > 1)
...@@ -385,7 +377,8 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) ...@@ -385,7 +377,8 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
if (saw_g + saw_O == 0) if (saw_g + saw_O == 0)
num_args++; num_args++;
num_args++; num_args++;
arglist = (char **) xmalloc ((num_args + 1) * sizeof (char *)); arglist = (const char **)
(real_arglist = (char **) xmalloc ((num_args + 1) * sizeof (char *)));
for (i = 0, j = 0; i < argc; i++, j++) for (i = 0, j = 0; i < argc; i++, j++)
{ {
...@@ -421,7 +414,7 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) ...@@ -421,7 +414,7 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
if (strncmp (argv[i], "-fmain=", 7) == 0) if (strncmp (argv[i], "-fmain=", 7) == 0)
{ {
if (! will_link) if (! will_link)
(*fn) ("cannot specify `main' class when not linking"); fatal ("cannot specify `main' class when not linking");
--j; --j;
continue; continue;
} }
...@@ -480,7 +473,7 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) ...@@ -480,7 +473,7 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
arglist[j] = NULL; arglist[j] = NULL;
*in_argc = j; *in_argc = j;
*in_argv = arglist; *in_argv = real_arglist;
*in_added_libraries = added_libraries; *in_added_libraries = added_libraries;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment