diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 5291cde8dc6a7557ead6288c7e382d7bc52aa214..d921d7074185fb8d49fb3c5a0666c5e01c352317 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -265,6 +265,10 @@ EXTRA_PARTS =
 # compiler proper (cc1, cc1obj, cc1plus).
 EXTRA_OBJS =
 
+# List of extra object files that should be compiled and linked with
+# the gcc driver.
+EXTRA_GCC_OBJS =
+
 # List of additional header files to install.
 # Often this is edited directly by `configure'.
 EXTRA_HEADERS =
@@ -670,11 +674,11 @@ stamp-objlist: Makefile $(OBJS) $(BC_OBJS)
 # 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: gcc.o version.o $(LIBDEPS)
-	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o version.o $(LIBS)
+xgcc: gcc.o version.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
+	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o version.o $(EXTRA_GCC_OBJS) $(LIBS)
 
 # Dump a specs file to make -B./ read these specs over installed ones.
-specs: xgcc$(exeext)
+specs: xgcc
 	$(GCC_FOR_TARGET) -dumpspecs > tmp-specs
 	mv tmp-specs specs
 
@@ -970,7 +974,7 @@ stmp-multilib-sub:
 	else true; \
 	fi
 	(cd tmpcopy; $(AR) x ../$(LIBGCC2))
-	(cd tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc.a *.o)
+	(cd tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc.a *.$(objext))
 	rm -rf libgcc2.a tmpcopy
 	if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc.a; else true; fi
 	if [ -d $(dir) ]; then true; else mkdir $(dir); fi
@@ -1941,7 +1945,7 @@ clean: mostlyclean bytecode.clean lang.clean
 # Using unprotoize.c is not quite right in the first place, 
 # but what better way is there?
 	-rm -f libgcc.a libgcc1.a libgcc1-asm.a libgcc2.a libgcc2.ready
-	-rm -f libgcc1.null $(LIB2FUNCS_EXTRA)
+	-rm -f libgcc1.null
 	-rm -f *.dvi
 	-rm -f */*.dvi
 	-if [ -f md.pre-cpp ]; then \
@@ -2415,7 +2419,7 @@ gnucompare: force
 	done
 	for dir in tmp-foo $(SUBDIRS); do \
 	  if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \
-	    for file in $$dir/*.o; do \
+	    for file in $$dir/*.$(objext); do \
 	      cmp --ignore-initial=16 $$file stage2/$$file || true ; \
 	    done; \
 	  fi; \