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]

gcc driver cleanups



I've installed this patch from Zack.


------- Forwarded Message

From:     Zack Weinberg <zack@rabi.columbia.edu>
To:       law@cygnus.com
Date:     Thu, 25 Mar 1999 21:14:56 -0500
Subject:  Re: cpp driver, broken up 

On Thu, 25 Mar 1999 16:44:30 -0700, Jeffrey A Law wrote:
>
>  In message <199903251346.IAA27015@blastula.phys.columbia.edu>you write:
>  > I can't commit things right now, my ssh key went away with the rest of my
>  > disk.
>Ah.  Can you resend the patches then?  I fried my local copy..  Ugh.

I'm gonna have to do them one at a time.  Please commit this, then I'll send
you the other half.

zw

p.s. Would you mind deleting ~zack/.ssh/authorized_keys on egcs?

1999-03-24 11:16 -0500  Zack Weinberg  <zack@rabi.columbia.edu>

	* gcc.c: Compile unconditionally all code formerly dependent
	on #ifdef LANG_SPECIFIC_DRIVER.
	* gccspec.c: New file with stub lang_specific_driver,
	lang_specific_pre_link.
	* Makefile.in: Link gccspec.o into xgcc.  Add rule to compile
	gccspec.c.

	* cp/Make-lang.in: Remove all references to g++.o/g++.c.
	Link g++ from gcc.o.
	* f/Make-lang.in: Remove all references to g77.o/g77.c.
	Link g77 from gcc.o.
	* java/Make-lang.in: Remove all references to gcj.o/gcj.c.
	Link gcj from gcc.o.

===================================================================
Index: gcc.c
- --- gcc.c	1999/03/18 07:29:05	1.95
+++ gcc.c	1999/03/24 16:12:47
@@ -214,16 +214,15 @@
 
 void fancy_abort		PROTO((void)) ATTRIBUTE_NORETURN;
 
- -#ifdef LANG_SPECIFIC_DRIVER
 /* Called before processing to change/add/remove arguments. */
- -extern void lang_specific_driver PROTO ((void (*) PVPROTO((const char *, ...))
, int *, char ***, int *));
+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;
- -#endif
 
 /* Specs are strings containing lines, each of which (if not blank)
 is made up of a program name, and arguments separated by spaces.
@@ -2379,7 +2378,7 @@
 
 static int n_infiles;
 
- -/* This counts the number of libraries added by LANG_SPECIFIC_DRIVER, so that
+/* This counts the number of libraries added by lang_specific_driver, so that
    we can tell if there were any user supplied any files or libraries.  */
 
 static int added_libraries;
@@ -2719,10 +2718,8 @@
   /* Convert new-style -- options to old-style.  */
   translate_options (&argc, &argv);
 
- -#ifdef LANG_SPECIFIC_DRIVER
   /* Do language-specific adjustment/addition of flags.  */
   lang_specific_driver (fatal, &argc, &argv, &added_libraries);
- -#endif
 
   /* 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.
@@ -3747,9 +3744,8 @@
 	  case 'o':
 	    {
 	      int max = n_infiles;
- -#ifdef LANG_SPECIFIC_DRIVER
 	      max += lang_specific_extra_outfiles;
- -#endif
+
 	      for (i = 0; i < max; i++)
 		if (outfiles[i])
 		  store_arg (outfiles[i], 0, 0);
@@ -5008,9 +5004,7 @@
      that correspond to the input files.  */
 
   i = n_infiles;
- -#ifdef LANG_SPECIFIC_DRIVER
   i += lang_specific_extra_outfiles;
- -#endif
   outfiles = (const char **) xmalloc (i * sizeof (char *));
   bzero ((char *) outfiles, i * sizeof (char *));
 
@@ -5109,7 +5103,6 @@
       clear_failure_queue ();
     }
 
- -#ifdef LANG_SPECIFIC_DRIVER
   if (error_count == 0)
     {
       /* Make sure INPUT_FILE_NUMBER points to first available open
@@ -5118,7 +5111,6 @@
       if (lang_specific_pre_link ())
 	error_count++;
     }
- -#endif
 
   /* Run ld to link all the compiler output files.  */
 
===================================================================
Index: Makefile.in
- --- Makefile.in	1999/03/23 07:51:02	1.245
+++ Makefile.in	1999/03/24 16:12:48
@@ -879,10 +879,10 @@
 # We call this executable `xgcc' rather than `gcc'
 # to avoid confusion if the current directory is in the path
 # and CC is `gcc'.  It is renamed to `gcc' when it is installed.
- -xgcc$(exeext): gcc.o version.o intl.o prefix.o \
+xgcc$(exeext): gcc.o gccspec.o version.o intl.o prefix.o \
    version.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
- -	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o intl.o prefix.o version.o \
- -	  $(EXTRA_GCC_OBJS) $(LIBS)
+	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o gccspec.o intl.o \
+	  prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS)
 
 # Dump a specs file to make -B./ read these specs over installed ones.
 specs: xgcc$(exeext)
@@ -1397,6 +1397,8 @@
 	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
   $(DRIVER_DEFINES) \
   -c `echo $(srcdir)/gcc.c | sed 's,^\./,,'`
+
+gccspec.o: gccspec.c $(CONFIG_H) system.h
 
 tree-check.h: s-check ; @true
 s-check : gencheck $(srcdir)/move-if-change
===================================================================
Index: cp/Make-lang.in
- --- cp/Make-lang.in	1999/03/18 22:00:18	1.32
+++ cp/Make-lang.in	1999/03/24 16:12:48
@@ -75,10 +75,6 @@
 # Tell GNU make to ignore these if they exist.
 .PHONY: C++ c++
 
- -g++.c: $(srcdir)/gcc.c
- -	-rm -f $@
- -	$(LN_S) $(srcdir)/gcc.c $@
- -
 g++spec.o: $(srcdir)/cp/g++spec.c
 	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/cp/g++spec
.c
 
@@ -90,19 +86,8 @@
 	  $(MAKE) $(SUBDIR_FLAGS_TO_PASS) $(CXX_FLAGS_TO_PASS) \
 	    $$cp_srcdir/parse.c
 
- -# N.B.: This is a copy of the gcc.o rule, with -DLANG_SPECIFIC_DRIVER added.
- -# It'd be nice if we could find an easier way to do this---rather than have
- -# to track changes to the toplevel gcc Makefile as well.
- -# We depend on g++.c last, to make it obvious where it came from.
- -g++.o: $(CONFIG_H) intl.h multilib.h config.status system.h \
- -    Makefile $(lang_specs_files) g++.c prefix.h
- -	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
- -	$(DRIVER_DEFINES) \
- -	-DLANG_SPECIFIC_DRIVER \
- -  -c g++.c
- -
 # Create the compiler driver for g++.
- -GXX_OBJS = g++.o g++spec.o intl.o prefix.o version.o 
+GXX_OBJS = gcc.o g++spec.o intl.o prefix.o version.o 
 g++$(exeext): $(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBDEPS)
 	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
 	  $(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBS)
@@ -290,7 +275,6 @@
 c++.distclean:
 	-rm -f cp/config.status cp/Makefile
 	-rm -f cp/parse.output
- -	-rm -f g++.c
 c++.extraclean:
 c++.maintainer-clean:
 	-rm -f cp/parse.c cp/parse.h
===================================================================
Index: f/Make-lang.in
- --- f/Make-lang.in	1999/03/21 07:52:55	1.52
+++ f/Make-lang.in	1999/03/24 16:12:48
@@ -59,16 +59,6 @@
   f77.extraclean f77.maintainer-clean f77.distdir f77.rebuilt \
   f77.stage1 f77.stage2 f77.stage3 f77.stage4
 
- -g77.c: $(srcdir)/gcc.c
- -	case "$(LANGUAGES)" in \
- -	  *[fF]77*) touch lang-f77;; \
- -	  *) rm -f lang-f77;; \
- -	esac
- -	if [ -f lang-f77 ]; then \
- -	  rm -f g77.c; \
- -	  $(LN_S) $(srcdir)/gcc.c g77.c; \
- -	else true; fi
- -
 g77spec.o: $(srcdir)/f/g77spec.c $(srcdir)/f/version.h
 	case "$(LANGUAGES)" in \
 	  *[fF]77*) touch lang-f77;; \
@@ -88,25 +78,11 @@
 	    $(srcdir)/f/version.c; \
 	else true; fi
 
- -# N.B.: This is a copy of the gcc.o rule, with -DLANG_SPECIFIC_DRIVER added.
- -# It'd be nice if we could find an easier way to do this---rather than have
- -# to track changes to the toplevel gcc Makefile as well.
- -# We depend on g77.c last, to make it obvious where it came from.
- -g77.o: $(CONFIG_H) multilib.h config.status $(lang_specs_files) g77.c prefix.h
- -	case "$(LANGUAGES)" in \
- -	  *[fF]77*) touch lang-f77;; \
- -	  *) rm -f lang-f77;; \
- -	esac
- -	if [ -f lang-f77 ]; then \
- -	  $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(DRIVER_DEFINES) \
- -	   -DLANG_SPECIFIC_DRIVER -c g77.c; \
- -	else true; fi
- -
 # Create the compiler driver for g77.
- -g77$(exeext): g77.o g77spec.o g77version.o version.o prefix.o intl.o \
+g77$(exeext): gcc.o g77spec.o g77version.o version.o prefix.o intl.o \
   $(LIBDEPS) $(EXTRA_GCC_OBJS)
 	if [ -f lang-f77 ]; then \
- -	  $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ g77.o g77spec.o g77version.o \
+	  $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o g77spec.o g77version.o \
 	   version.o prefix.o intl.o $(EXTRA_GCC_OBJS) $(LIBS); \
 	else true; fi
 
@@ -428,7 +404,7 @@
 	-rm -f g77.aux g77.cps g77.ky g77.toc g77.vr g77.fn g77.kys \
 	       g77.pg g77.tp g77.vrs g77.cp g77.fns g77.log g77.pgs g77.tps 
 f77.clean:
- -	-rm -f g77.c g77.o g77spec.o g77version.o
+	-rm -f g77spec.o g77version.o
 f77.distclean:
 	-rm -f lang-f77 f/Makefile
 f77.extraclean:
@@ -439,7 +415,7 @@
 # The main makefile has already created stage?/f.
 
 G77STAGESTUFF = f/*$(objext) f/fini f/stamp-str f/str-*.h f/str-*.j \
- -  lang-f77 g77.c g77.o g77spec.o g77version.o
+  lang-f77 g77spec.o g77version.o
 
 f77.stage1: stage1-start
 	-if [ -f lang-f77 ]; then \
===================================================================
Index: java/Make-lang.in
- --- java/Make-lang.in	1999/03/21 07:52:57	1.18
+++ java/Make-lang.in	1999/03/24 16:12:49
@@ -79,30 +79,15 @@
 jc1$(exeext): $(P) $(JAVA_SRCS) $(LIBDEPS) stamp-objlist
 	cd java; $(MAKE) $(FLAGS_TO_PASS) $(JAVA_FLAGS_TO_PASS) ../jc1$(exeext)
 
- -$(GCJ).c: $(srcdir)/gcc.c
- -	-rm -f $@
- -	$(LN_S) $(srcdir)/gcc.c $@
- -
 jvspec.o: $(srcdir)/java/jvspec.c
 	$(CC) -c -DWITH_THREAD_$(GCC_THREAD_FILE) -DWITH_GC_$(JAVAGC) \
 		$(ALL_CFLAGS) $(ALL_CPPFLAGS) \
 		$(INCLUDES) $(srcdir)/java/jvspec.c
 
- -# N.B.: This is a copy of the gcc.o rule, with -DLANG_SPECIFIC_DRIVER added.
- -# It'd be nice if we could find an easier way to do this---rather than have
- -# to track changes to the toplevel gcc Makefile as well.
- -# We depend on $(GCJ).c last, to make it obvious where it came from.
- -$(GCJ).o: $(CONFIG_H) multilib.h config.status $(lang_specs_files) $(GCJ).c \
- -       system.h prefix.h
- -	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
- -	$(DRIVER_DEFINES) \
- -	-DLANG_SPECIFIC_DRIVER \
- -  -c $(GCJ).c
- -
 # Create the compiler driver for $(GCJ).
- -$(GCJ)$(exeext): $(GCJ).o jvspec.o version.o \
+$(GCJ)$(exeext): gcc.o jvspec.o version.o \
 	   prefix.o intl.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
- -	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GCJ).o jvspec.o prefix.o intl.o 
\
+	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o jvspec.o prefix.o intl.o \
 	  version.o $(EXTRA_GCC_OBJS) $(LIBS)
 
 # Create a version of the $(GCJ) driver which calls the cross-compiler.
===================================================================
Index: gccspec.c
- --- /dev/null	Wed Mar 24 11:05:38 1999
+++ gccspec.c	Tue Mar 23 17:48:19 1999
@@ -0,0 +1,43 @@
+/* Specific flags and argument handling of the C front-end.
+   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.  */
+
+#include "config.h"
+#include "system.h"
+
+/* Filter argc and argv before processing by the gcc driver proper. */
+void
+lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)
+     void (*fn)() ATTRIBUTE_UNUSED;
+     int *in_argc ATTRIBUTE_UNUSED;
+     char ***in_argv ATTRIBUTE_UNUSED;
+     int *in_added_libraries ATTRIBUTE_UNUSED;
+{
+  return;  /* Not used for C. */
+}
+
+/* Called before linking.  Returns 0 on success and -1 on failure. */
+int
+lang_specific_pre_link ()
+{
+  return 0;  /* Not used for C. */
+}
+
+/* Number of extra output files that lang_specific_pre_link may generate. */
+int lang_specific_extra_outfiles = 0;  /* Not used for C. */

------- End of Forwarded Message



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