public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Link more common objects consistently into host programs
@ 2011-05-20 13:51 Joseph S. Myers
  2011-05-20 14:12 ` Paolo Bonzini
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Joseph S. Myers @ 2011-05-20 13:51 UTC (permalink / raw)
  To: gcc-patches; +Cc: gdr, bonzini, dj, neroden, aoliva, Ralf.Wildenhues, ro

There are an increasing number of common object files that get linked
into a range of programs GCC builds and installs for the host,
including but not limited to the core compilers and the drivers.

These have various ad hoc code listing them explicitly for each
program using some of them, with the objects split in non-obvious ways
between $(GCC_OBJS) and the Makefile.in rules linking xgcc (for
example).  As the set of common objects increases, it seems better to
put them in a .a file and just link that in everywhere, rather than
explicitly listing the exact set used by each program; the static
linker will then take care of using just the set required by a given
program.

This patch does so, for five common objects.  Linking in the common
diagnostics code means that programs may get the version of
fancy_abort from that code (where previously they got either the
version from errors.o, which is no longer built for the host after
this patch, or no version of that function at all); so that it is
obviously safe to call that version, the various programs (gcov,
gcov-dump, lto-wrapper, jcf-dump, jvgenmain) are made to initialize
the diagnostics code.  This patch does *not* convert those programs to
using the common diagnostics functions in place of their own
diagnostics functions (or raw fprintf), except where the functions had
the same names as the common ones and so were removed.

(It would make sense to convert those programs to the common code,
although gcov-dump is only an uninstalled debugging program so maybe
should be added to po/EXCLUDES so the messages don't need to be
translated.  Indeed, I think it would make sense for the generator
programs to use the common code instead of errors.c, although the copy
built for the build system should have all i18n support disabled in
that case.)

I haven't tested building mips-tdump or mips-tfile with this patch,
but don't think it should cause any problems as the static linker
should just ignore the diagnostics objects for those programs.  In
principle mips-tfile should use the common code instead of its own
implementations of error and fancy_abort, but I doubt it's worth
converting it (the line-number handling makes it a nontrivial
conversion as that would need to move to the line-map infrastructure
as well).

Bootstrapped with no regressions on x86_64-unknown-linux-gnu.  OK to
commit?  (I think this needs build system review for the build system
changes, and diagnostics review for the changes to make various
programs initialize diagnostics.)

(I expect to create a second layer of common code in a separate
archive, used by a smaller subset of programs, with eventually
versions of prefix.o opts.o opts-common.o options.o and the new common
target hooks used by those files.)

(Apart from the arbitrary division between GCC_OBJS and the xgcc link
rule, mentioned above, there are other arbitrary divisions that don't
make sense to me.  In particular, the separation between OBJS-common,
OBJS-md and OBJS-archive, all used only in the definition of OBJS and
all ending up in libbackend.a.  The "not used by all languages"
description seems doubtful for most of the files, and while there may
be a logical separation of a few objects as only used by cpplib-using
languages, right now we just link cpplib into everything because
that's where the line-maps code is.)

2011-05-20  Joseph Myers  <joseph@codesourcery.com>

	* Makefile.in (LIBDEPS): Add libcommon.a.
	(LIBS): Likewise.
	(GCC_OBJS): Remove diagnostic.o, pretty-print.o and input.o.
	(OBJS-common): Remove diagnostic.o, input.o, intl.o,
	pretty-print.o and version.o.
	(OBJS-libcommon): New.
	(ALL_HOST_BACKEND_OBJS): Add $(OBJS-libcommon).
	(BACKEND): Add libcommon.a.
	(MOSTLYCLEANFILES): Likewise.
	(libcommon.a): New.
	(xgcc$(exeext)): Don't explicitly use version.o and intl.o.
	(cpp$(exeext)): Likewise.
	(COLLECT2_OBJS): Remove intl.o, version.o, diagnostic.o,
	pretty-print.o and input.o.
	(lto-wrapper$(exeext)): Don't explicitly use intl.o.
	(lto-wrapper.o): Depend on $(DIAGNOSTIC_H).
	(errors.o): Remove.
	(mips-tfile): Don't explicitly use version.o.
	(mips-tdump): Likewise.
	(gcov.o): Depend on $(DIAGNOSTIC_H).
	(gcov-dump.o): Depend on intl.h and $(DIAGNOSTIC_H).
	(GCOV_OBJS): Remove intl.o, version.o and errors.o.
	(GCOV_DUMP_OBJS): Remove version.o and errors.o.
	* gcov-dump.c: Include intl.h and diagnostic.h.
	(main): Initialize diagnostics.
	* gcov.c: Include diagnostic.h.
	(fnotice): Remove.
	(main): Initialize diagnostics.
	* lto-wrapper.c: Include diagnostic.h.
	(main): Initialize diagnostics.

ada:
2011-05-20  Joseph Myers  <joseph@codesourcery.com>

	* gcc-interface/Make-lang.in (EXTRA_GNATBIND_OBJS): Remove
	version.o.
	* gcc-interface/Makefile.in (EXTRA_GNATTOOLS_OBJS): Use
	libcommon.a instead of version.o.

cp:
2011-05-20  Joseph Myers  <joseph@codesourcery.com>

	* Make-lang.in (GXX_OBJS): Remove intl.o and version.o.

fortran:
2011-05-20  Joseph Myers  <joseph@codesourcery.com>

	* Make-lang.in (GFORTRAN_D_OBJS): Remove version.o and intl.o.

go:
2011-05-20  Joseph Myers  <joseph@codesourcery.com>

	* Make-lang.in (GCCGO_OBJS): Remove intl.o and version.o.

java:
2011-05-20  Joseph Myers  <joseph@codesourcery.com>

	* Make-lang.in ($(XGCJ)$(exeext)): Don't explicitly use intl.o and
	version.o.
	(JCFDUMP_OBJS): Remove errors.o, version.o and intl.o.
	(JVGENMAIN_OBJS): Remove errors.o and intl.o.
	(java/jcf-dump.o, java/jvgenmain.o): Depend in $(DIAGNOSTIC_H).
	* jcf-dump.c: Include diagnostic.h.
	(main): Initialize diagnostics.
	* jvgenmain.c: Include diagnostic.h.
	(main): Initialize diagnostics.

Index: gcc/java/jcf-dump.c
===================================================================
--- gcc/java/jcf-dump.c	(revision 173917)
+++ gcc/java/jcf-dump.c	(working copy)
@@ -52,6 +52,7 @@ The Free Software Foundation is independ
 #include "system.h"
 #include "coretypes.h"
 #include "intl.h"
+#include "diagnostic.h"
 
 #include "jcf.h"
 #include "tree.h"
@@ -1172,12 +1173,22 @@ main (int argc, char** argv)
 {
   JCF jcf[1];
   int argi, opt;
+  const char *p;
+
+  p = argv[0] + strlen (argv[0]);
+  while (p != argv[0] && !IS_DIR_SEPARATOR (p[-1]))
+    --p;
+  progname = p;
+
+  xmalloc_set_program_name (progname);
 
   /* Unlock the stdio streams.  */
   unlock_std_streams ();
 
   gcc_init_libintl ();
 
+  diagnostic_initialize (global_dc, 0);
+
   if (argc <= 1)
     {
       fprintf (stderr, _("jcf-dump: no classes specified\n"));
Index: gcc/java/Make-lang.in
===================================================================
--- gcc/java/Make-lang.in	(revision 173917)
+++ gcc/java/Make-lang.in	(working copy)
@@ -1,7 +1,7 @@
 # Top level -*- makefile -*- fragment for the GNU compiler for the Java(TM)
 # language.
 #   Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-#   2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+#   2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 
 #This file is part of GCC.
 
@@ -63,11 +63,10 @@ jvspec.o: $(srcdir)/java/jvspec.c $(SYST
 		$(INCLUDES) $(srcdir)/java/jvspec.c $(OUTPUT_OPTION))
 
 # Create the compiler driver for $(XGCJ).
-$(XGCJ)$(exeext): $(GCC_OBJS) jvspec.o java/jcf-path.o version.o \
-	   prefix.o intl.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
+$(XGCJ)$(exeext): $(GCC_OBJS) jvspec.o java/jcf-path.o \
+	   prefix.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
 	+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) \
-	  jvspec.o java/jcf-path.o prefix.o intl.o \
-	  version.o $(EXTRA_GCC_OBJS) $(LIBS)
+	  jvspec.o java/jcf-path.o prefix.o $(EXTRA_GCC_OBJS) $(LIBS)
 
 # Create a version of the $(XGCJ) driver which calls the cross-compiler.
 $(XGCJ)-cross$(exeext): $(XGCJ)$(exeext)
@@ -86,9 +85,9 @@ JAVA_OBJS = java/class.o java/decl.o jav
   java/jcf-path.o java/boehm.o java/java-gimplify.o
 
 JCFDUMP_OBJS = java/jcf-dump.o java/jcf-io.o java/jcf-depend.o java/jcf-path.o \
-		java/win32-host.o java/zextract.o errors.o version.o ggc-none.o intl.o
+		java/win32-host.o java/zextract.o ggc-none.o
 
-JVGENMAIN_OBJS = java/jvgenmain.o java/mangle_name.o errors.o intl.o
+JVGENMAIN_OBJS = java/jvgenmain.o java/mangle_name.o
 
 java_OBJS = $(sort $(JAVA_OBJS) $(JCFDUMP_OBJS) $(JVGENMAIN_OBJS)) jvspec.o
 
@@ -269,7 +268,7 @@ JAVA_TREE_H = $(TREE_H) $(HASHTAB_H) jav
 
 java/jcf-dump.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(JAVA_TREE_H) \
   java/jcf-dump.c java/jcf-reader.c java/jcf.h java/javaop.h java/javaop.def \
-  version.h $(GGC_H) intl.h java/zipfile.h
+  version.h $(GGC_H) intl.h java/zipfile.h $(DIAGNOSTIC_H)
 java/boehm.o: java/boehm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
   $(TREE_H) $(JAVA_TREE_H) java/parse.h
 java/builtins.o: java/builtins.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
@@ -299,7 +298,7 @@ java/jcf-parse.o: java/jcf-parse.c $(CON
   java/parse.h $(GGC_H) debug.h $(REAL_H) gt-java-jcf-parse.h \
   java/jcf-reader.c java/zipfile.h java/jcf.h $(BITMAP_H)
 java/jvgenmain.o: java/jvgenmain.c $(CONFIG_H) $(JAVA_TREE_H) $(SYSTEM_H) \
-  coretypes.h $(TM_H) intl.h
+  coretypes.h $(TM_H) intl.h $(DIAGNOSTIC_H)
 java/lang.o: java/lang.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h input.h \
   $(SYSTEM_H) coretypes.h $(TM_H) $(DIAGNOSTIC_H) \
   langhooks.h $(LANGHOOKS_DEF_H) gt-java-lang.h $(OPTS_H) $(OPTIONS_H) \
Index: gcc/java/jvgenmain.c
===================================================================
--- gcc/java/jvgenmain.c	(revision 173917)
+++ gcc/java/jvgenmain.c	(working copy)
@@ -1,6 +1,6 @@
 /* Program to generate "main" a Java(TM) class containing a main method.
    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-   2007, 2008, 2010 Free Software Foundation, Inc.
+   2007, 2008, 2010, 2011 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -32,6 +32,7 @@ The Free Software Foundation is independ
 #include "tree.h"
 #include "java-tree.h"
 #include "intl.h"
+#include "diagnostic.h"
 #include "tm.h"         /* FIXME: For gcc_obstack_init from defaults.h.  */
 
 static char * do_mangle_classname (const char *string);
@@ -59,11 +60,20 @@ main (int argc, char **argv)
   int indirect = 0;
   char *prog_name = argv[0];
 
+  p = argv[0] + strlen (argv[0]);
+  while (p != argv[0] && !IS_DIR_SEPARATOR (p[-1]))
+    --p;
+  progname = p;
+
+  xmalloc_set_program_name (progname);
+
   /* Unlock the stdio streams.  */
   unlock_std_streams ();
 
   gcc_init_libintl ();
 
+  diagnostic_initialize (global_dc, 0);
+
   if (argc > 1 && ! strcmp (argv[1], "-findirect-dispatch"))
     {
       indirect = 1;
Index: gcc/gcov.c
===================================================================
--- gcc/gcov.c	(revision 173917)
+++ gcc/gcov.c	(working copy)
@@ -37,6 +37,7 @@ along with Gcov; see the file COPYING3. 
 #include "coretypes.h"
 #include "tm.h"
 #include "intl.h"
+#include "diagnostic.h"
 #include "version.h"
 
 #include <getopt.h>
@@ -342,7 +343,6 @@ static int flag_preserve_paths = 0;
 static int flag_counts = 0;
 
 /* Forward declarations.  */
-static void fnotice (FILE *, const char *, ...) ATTRIBUTE_PRINTF_2;
 static int process_args (int, char **);
 static void print_usage (int) ATTRIBUTE_NORETURN;
 static void print_version (void) ATTRIBUTE_NORETURN;
@@ -369,12 +369,22 @@ main (int argc, char **argv)
 {
   int argno;
   int first_arg;
+  const char *p;
+
+  p = argv[0] + strlen (argv[0]);
+  while (p != argv[0] && !IS_DIR_SEPARATOR (p[-1]))
+    --p;
+  progname = p;
+
+  xmalloc_set_program_name (progname);
 
   /* Unlock the stdio streams.  */
   unlock_std_streams ();
 
   gcc_init_libintl ();
 
+  diagnostic_initialize (global_dc, 0);
+
   /* Handle response files.  */
   expandargv (&argc, &argv);
 
@@ -401,16 +411,6 @@ main (int argc, char **argv)
 
   return 0;
 }
-
-static void
-fnotice (FILE *file, const char *cmsgid, ...)
-{
-  va_list ap;
-
-  va_start (ap, cmsgid);
-  vfprintf (file, _(cmsgid), ap);
-  va_end (ap);
-}
 \f
 /* Print a usage message and exit.  If ERROR_P is nonzero, this is an error,
    otherwise the output of --help.  */
Index: gcc/cp/Make-lang.in
===================================================================
--- gcc/cp/Make-lang.in	(revision 173917)
+++ gcc/cp/Make-lang.in	(working copy)
@@ -60,7 +60,7 @@ g++spec.o: $(srcdir)/cp/g++spec.c $(SYST
 		$(INCLUDES) $(srcdir)/cp/g++spec.c)
 
 # Create the compiler driver for g++.
-GXX_OBJS = $(GCC_OBJS) g++spec.o intl.o prefix.o version.o
+GXX_OBJS = $(GCC_OBJS) g++spec.o prefix.o
 g++$(exeext): $(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBDEPS)
 	+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
 	  $(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBS)
Index: gcc/lto-wrapper.c
===================================================================
--- gcc/lto-wrapper.c	(revision 173917)
+++ gcc/lto-wrapper.c	(working copy)
@@ -41,6 +41,7 @@ along with GCC; see the file COPYING3.  
 #include "system.h"
 #include "coretypes.h"
 #include "intl.h"
+#include "diagnostic.h"
 #include "obstack.h"
 
 int debug;				/* true if -save-temps.  */
@@ -627,8 +628,19 @@ cont:
 int
 main (int argc, char *argv[])
 {
+  const char *p;
+
+  p = argv[0] + strlen (argv[0]);
+  while (p != argv[0] && !IS_DIR_SEPARATOR (p[-1]))
+    --p;
+  progname = p;
+
+  xmalloc_set_program_name (progname);
+
   gcc_init_libintl ();
 
+  diagnostic_initialize (global_dc, 0);
+
   if (signal (SIGINT, SIG_IGN) != SIG_IGN)
     signal (SIGINT, fatal_signal);
 #ifdef SIGHUP
Index: gcc/go/Make-lang.in
===================================================================
--- gcc/go/Make-lang.in	(revision 173917)
+++ gcc/go/Make-lang.in	(working copy)
@@ -36,7 +36,7 @@ gospec.o: $(srcdir)/go/gospec.c $(SYSTEM
 	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(DRIVER_DEFINES) \
 		$(INCLUDES) $(srcdir)/go/gospec.c)
 
-GCCGO_OBJS = $(GCC_OBJS) gospec.o intl.o prefix.o version.o
+GCCGO_OBJS = $(GCC_OBJS) gospec.o prefix.o
 gccgo$(exeext): $(GCCGO_OBJS) $(EXTRA_GCC_OBJS) $(LIBDEPS)
 	$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
 	  $(GCCGO_OBJS) $(EXTRA_GCC_OBJS) $(LIBS)
Index: gcc/ada/gcc-interface/Makefile.in
===================================================================
--- gcc/ada/gcc-interface/Makefile.in	(revision 173917)
+++ gcc/ada/gcc-interface/Makefile.in	(working copy)
@@ -180,7 +180,7 @@ LIBINTL_DEP = @LIBINTL_DEP@
 SYSLIBS = @GNAT_LIBEXC@
 
 # List of extra object files linked in with various programs.
-EXTRA_GNATTOOLS_OBJS = ../../prefix.o ../../version.o
+EXTRA_GNATTOOLS_OBJS = ../../prefix.o ../../libcommon.a
 
 # List extra gnattools
 EXTRA_GNATTOOLS =
Index: gcc/ada/gcc-interface/Make-lang.in
===================================================================
--- gcc/ada/gcc-interface/Make-lang.in	(revision 173917)
+++ gcc/ada/gcc-interface/Make-lang.in	(working copy)
@@ -469,7 +469,7 @@ GNATBIND_OBJS = \
 
 # List of extra object files linked in with various programs.
 EXTRA_GNAT1_OBJS = prefix.o
-EXTRA_GNATBIND_OBJS = prefix.o version.o
+EXTRA_GNATBIND_OBJS = prefix.o
 
 # Language-independent object files.
 ADA_BACKEND = $(BACKEND) attribs.o
Index: gcc/fortran/Make-lang.in
===================================================================
--- gcc/fortran/Make-lang.in	(revision 173917)
+++ gcc/fortran/Make-lang.in	(working copy)
@@ -1,6 +1,6 @@
 # -*- makefile -*-
 # Top level makefile fragment for GNU gfortran, the GNU Fortran 95 compiler.
-# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
 # Free Software Foundation, Inc.
 # Contributed by Paul Brook <paul@nowt.org
 # and Steven Bosscher <s.bosscher@student.tudelft.nl>
@@ -84,7 +84,7 @@ gfortranspec.o: $(srcdir)/fortran/gfortr
 		$(INCLUDES) $(srcdir)/fortran/gfortranspec.c)
 
 # Create the compiler driver gfortran.
-GFORTRAN_D_OBJS = $(GCC_OBJS) gfortranspec.o version.o prefix.o intl.o
+GFORTRAN_D_OBJS = $(GCC_OBJS) gfortranspec.o prefix.o
 gfortran$(exeext): $(GFORTRAN_D_OBJS) $(EXTRA_GCC_OBJS) $(LIBDEPS)
 	+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
 	  $(GFORTRAN_D_OBJS) $(EXTRA_GCC_OBJS) $(LIBS)
Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in	(revision 173917)
+++ gcc/Makefile.in	(working copy)
@@ -1047,7 +1047,8 @@ LIBIBERTY = ../libiberty/libiberty.a
 BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/libiberty.a
 
 # Dependencies on the intl and portability libraries.
-LIBDEPS= $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP) $(LIBDECNUMBER)
+LIBDEPS= libcommon.a $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP) \
+	$(LIBDECNUMBER)
 
 # Likewise, for use in the tools that must run on this machine
 # even if we are cross-building GCC.
@@ -1055,8 +1056,8 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY)
 
 # How to link with both our special library facilities
 # and the system's installed libraries.
-LIBS = @LIBS@ $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) $(LIBDECNUMBER) \
-	$(HOST_LIBS)
+LIBS = @LIBS@ libcommon.a $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) \
+	$(LIBDECNUMBER) $(HOST_LIBS)
 BACKENDLIBS = $(CLOOGLIBS) $(PPLLIBS) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \
 	$(ZLIB)
 # Any system libraries needed just for GNAT.
@@ -1167,8 +1168,7 @@ CXX_TARGET_OBJS=@cxx_target_objs@
 FORTRAN_TARGET_OBJS=@fortran_target_objs@
 
 # Object files for gcc driver.
-GCC_OBJS = gcc.o opts-common.o gcc-options.o diagnostic.o pretty-print.o \
-  input.o vec.o ggc-none.o
+GCC_OBJS = gcc.o opts-common.o gcc-options.o vec.o ggc-none.o
 
 # Language-specific object files shared by all C-family front ends.
 C_COMMON_OBJS = c-family/c-common.o c-family/c-cppbuiltin.o c-family/c-dump.o \
@@ -1239,7 +1239,6 @@ OBJS-common = \
 	df-problems.o \
 	df-scan.o \
 	dfp.o \
-	diagnostic.o \
 	dojump.o \
 	dominance.o \
 	domwalk.o \
@@ -1288,10 +1287,8 @@ OBJS-common = \
 	ifcvt.o \
 	implicit-zee.o \
 	init-regs.o \
-	input.o \
 	integrate.o \
 	internal-fn.o \
-	intl.o \
 	ira.o \
 	ira-build.o \
 	ira-costs.o \
@@ -1336,7 +1333,6 @@ OBJS-common = \
 	postreload-gcse.o \
 	postreload.o \
 	predict.o \
-	pretty-print.o \
 	print-rtl.o \
 	print-tree.o \
 	profile.o \
@@ -1464,7 +1460,6 @@ OBJS-common = \
 	var-tracking.o \
 	varasm.o \
 	vec.o \
-	version.o \
 	vmsdbgout.o \
 	web.o \
 	xcoffout.o
@@ -1501,12 +1496,16 @@ OBJS-archive = \
 
 OBJS = $(OBJS-common) $(OBJS-md) $(OBJS-archive)
 
+# Objects in libcommon.a, potentially used by all host binaries and with
+# no target dependencies.
+OBJS-libcommon = diagnostic.o pretty-print.o intl.o input.o version.o
+
 # This lists all host objects for the front ends.
 ALL_HOST_FRONTEND_OBJS = $(C_OBJS) \
   $(foreach v,$(CONFIG_LANGUAGES),$($(v)_OBJS))
 
-ALL_HOST_BACKEND_OBJS = $(GCC_OBJS) $(OBJS) \
-  @TREEBROWSER@ main.o gccspec.o version.o intl.o prefix.o cppspec.o \
+ALL_HOST_BACKEND_OBJS = $(GCC_OBJS) $(OBJS) $(OBJS-libcommon) \
+  @TREEBROWSER@ main.o gccspec.o prefix.o cppspec.o \
   $(COLLECT2_OBJS) $(EXTRA_GCC_OBJS) mips-tfile.o mips-tdump.o \
   $(GCOV_OBJS) $(GCOV_DUMP_OBJS)
 
@@ -1514,7 +1513,8 @@ ALL_HOST_BACKEND_OBJS = $(GCC_OBJS) $(OB
 # compilation or not.
 ALL_HOST_OBJS = $(ALL_HOST_FRONTEND_OBJS) $(ALL_HOST_BACKEND_OBJS)
 
-BACKEND = main.o @TREEBROWSER@ libbackend.a $(CPPLIB) $(LIBDECNUMBER)
+BACKEND = main.o @TREEBROWSER@ libbackend.a libcommon.a $(CPPLIB) \
+	$(LIBDECNUMBER)
 
 MOSTLYCLEANFILES = insn-flags.h insn-config.h insn-codes.h \
  insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \
@@ -1526,7 +1526,7 @@ MOSTLYCLEANFILES = insn-flags.h insn-con
  $(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross$(exeext) \
  $(SPECS) collect2$(exeext) lto-wrapper$(exeext) \
  gcov-iov$(build_exeext) gcov$(exeext) gcov-dump$(exeext) \
- *.[0-9][0-9].* *.[si] *-checksum.c libbackend.a libgcc.mk
+ *.[0-9][0-9].* *.[si] *-checksum.c libbackend.a libcommon.a libgcc.mk
 
 # Defined in libgcc2.c, included only in the static library.
 LIB2FUNCS_ST = _eprintf __gcc_bcmp
@@ -1838,21 +1838,24 @@ libbackend.a: $(OBJS)
 	$(AR) $(AR_FLAGS) libbackend.a $(OBJS)
 	-$(RANLIB) $(RANLIB_FLAGS) libbackend.a
 
+libcommon.a: $(OBJS-libcommon)
+	-rm -rf libcommon.a
+	$(AR) $(AR_FLAGS) libcommon.a $(OBJS-libcommon)
+	-$(RANLIB) $(RANLIB_FLAGS) libcommon.a
+
 # 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_OBJS) gccspec.o version.o intl.o prefix.o \
-   version.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
+xgcc$(exeext): $(GCC_OBJS) gccspec.o prefix.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
 	+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) \
-	  gccspec.o intl.o prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS)
+	  gccspec.o prefix.o $(EXTRA_GCC_OBJS) $(LIBS)
 
 # cpp is to cpp0 as gcc is to cc1.
 # The only difference from xgcc is that it's linked with cppspec.o
 # instead of gccspec.o.
-cpp$(exeext): $(GCC_OBJS) cppspec.o version.o intl.o prefix.o \
-   version.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
+cpp$(exeext): $(GCC_OBJS) cppspec.o prefix.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
 	+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) \
-	  cppspec.o intl.o prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS)
+	  cppspec.o prefix.o $(EXTRA_GCC_OBJS) $(LIBS)
 
 # Dump a specs file to make -B./ read these specs over installed ones.
 $(SPECS): xgcc$(exeext)
@@ -2089,8 +2092,7 @@ sbitmap.o: sbitmap.c sbitmap.h $(CONFIG_
 ebitmap.o: ebitmap.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(EBITMAP_H)
 sparseset.o: sparseset.c $(SYSTEM_H) sparseset.h $(CONFIG_H)
 
-COLLECT2_OBJS = collect2.o collect2-aix.o tlink.o intl.o version.o \
-  diagnostic.o pretty-print.o input.o
+COLLECT2_OBJS = collect2.o collect2-aix.o tlink.o
 COLLECT2_LIBS = @COLLECT2_LIBS@
 collect2$(exeext): $(COLLECT2_OBJS) $(LIBDEPS)
 # Don't try modifying collect2 (aka ld) in place--it might be linking this.
@@ -2111,12 +2113,12 @@ collect2-aix.o : collect2-aix.c $(CONFIG
 tlink.o: tlink.c $(DEMANGLE_H) $(HASHTAB_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
     $(OBSTACK_H) collect2.h intl.h $(DIAGNOSTIC_CORE_H)
 
-lto-wrapper$(exeext): lto-wrapper.o intl.o $(LIBDEPS)
-	+$(COMPILER) $(ALL_COMPILERFLAGS) $(LDFLAGS) -o T$@ lto-wrapper.o intl.o $(LIBS)
+lto-wrapper$(exeext): lto-wrapper.o $(LIBDEPS)
+	+$(COMPILER) $(ALL_COMPILERFLAGS) $(LDFLAGS) -o T$@ lto-wrapper.o $(LIBS)
 	mv -f T$@ $@
 
 lto-wrapper.o: lto-wrapper.c $(CONFIG_H) $(SYSTEM_H) coretypes.h intl.h \
-	$(OBSTACK_H)
+	$(OBSTACK_H) $(DIAGNOSTIC_H)
 
 # Files used by all variants of C.
 c-family/c-common.o : c-family/c-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
@@ -3505,7 +3507,6 @@ params.o : params.c $(CONFIG_H) $(SYSTEM
 pointer-set.o: pointer-set.c pointer-set.h $(CONFIG_H) $(SYSTEM_H)
 hooks.o: hooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(HOOKS_H)
 pretty-print.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h intl.h $(PRETTY_PRINT_H)
-errors.o : errors.c $(CONFIG_H) $(SYSTEM_H) errors.h $(BCONFIG_H)
 dbgcnt.o: dbgcnt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(DIAGNOSTIC_CORE_H) $(DBGCNT_H) \
    $(TM_H) $(RTL_H) output.h
 lower-subreg.o : lower-subreg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
@@ -3527,16 +3528,16 @@ $(out_object_file): $(out_file) $(CONFIG
 		$(out_file) $(OUTPUT_OPTION)
 
 # Build auxiliary files that support ecoff format.
-mips-tfile: mips-tfile.o version.o $(LIBDEPS)
+mips-tfile: mips-tfile.o $(LIBDEPS)
 	$(LINKER) $(LINKERFLAGS) $(LDFLAGS) -o $@ \
-		mips-tfile.o version.o $(LIBS)
+		mips-tfile.o $(LIBS)
 
 mips-tfile.o : mips-tfile.c $(CONFIG_H) $(SYSTEM_H) \
    version.h $(srcdir)/../include/getopt.h $(GSTAB_H) intl.h
 
-mips-tdump: mips-tdump.o version.o $(LIBDEPS)
+mips-tdump: mips-tdump.o $(LIBDEPS)
 	$(LINKER) $(LINKERFLAGS) $(LDFLAGS) -o $@ \
-		mips-tdump.o version.o $(LIBS)
+		mips-tdump.o $(LIBS)
 
 mips-tdump.o : mips-tdump.c $(CONFIG_H) $(SYSTEM_H) \
    version.h $(srcdir)/../include/getopt.h stab.def
@@ -4060,14 +4061,14 @@ s-iov: build/gcov-iov$(build_exeext) $(B
 	$(STAMP) s-iov
 
 gcov.o: gcov.c gcov-io.c $(GCOV_IO_H) intl.h $(SYSTEM_H) coretypes.h $(TM_H) \
-   $(CONFIG_H) version.h
+   $(CONFIG_H) version.h $(DIAGNOSTIC_H)
 gcov-dump.o: gcov-dump.c gcov-io.c $(GCOV_IO_H) $(SYSTEM_H) coretypes.h \
-   $(TM_H) $(CONFIG_H) version.h
+   $(TM_H) $(CONFIG_H) version.h intl.h $(DIAGNOSTIC_H)
 
-GCOV_OBJS = gcov.o intl.o version.o errors.o
+GCOV_OBJS = gcov.o
 gcov$(exeext): $(GCOV_OBJS) $(LIBDEPS)
 	+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_OBJS) $(LIBS) -o $@
-GCOV_DUMP_OBJS = gcov-dump.o version.o errors.o
+GCOV_DUMP_OBJS = gcov-dump.o
 gcov-dump$(exeext): $(GCOV_DUMP_OBJS) $(LIBDEPS)
 	+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GCOV_DUMP_OBJS) \
 		$(LIBS) -o $@
Index: gcc/gcov-dump.c
===================================================================
--- gcc/gcov-dump.c	(revision 173917)
+++ gcc/gcov-dump.c	(working copy)
@@ -22,6 +22,8 @@ along with Gcov; see the file COPYING3. 
 #include "coretypes.h"
 #include "tm.h"
 #include "version.h"
+#include "intl.h"
+#include "diagnostic.h"
 #include <getopt.h>
 #define IN_GCOV (-1)
 #include "gcov-io.h"
@@ -76,10 +78,22 @@ int
 main (int argc ATTRIBUTE_UNUSED, char **argv)
 {
   int opt;
+  const char *p;
+
+  p = argv[0] + strlen (argv[0]);
+  while (p != argv[0] && !IS_DIR_SEPARATOR (p[-1]))
+    --p;
+  progname = p;
+
+  xmalloc_set_program_name (progname);
 
   /* Unlock the stdio streams.  */
   unlock_std_streams ();
 
+  gcc_init_libintl ();
+
+  diagnostic_initialize (global_dc, 0);
+
   while ((opt = getopt_long (argc, argv, "hlpv", options, NULL)) != -1)
     {
       switch (opt)

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Link more common objects consistently into host programs
  2011-05-20 13:51 Link more common objects consistently into host programs Joseph S. Myers
@ 2011-05-20 14:12 ` Paolo Bonzini
  2011-05-20 14:35 ` Merge OBJS-common,-md,-archive Michael Matz
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2011-05-20 14:12 UTC (permalink / raw)
  To: Joseph S. Myers
  Cc: gcc-patches, gdr, dj, neroden, aoliva, Ralf.Wildenhues, ro

On 05/20/2011 02:21 PM, Joseph S. Myers wrote:
> 2011-05-20  Joseph Myers<joseph@codesourcery.com>
>
> 	* Makefile.in (LIBDEPS): Add libcommon.a.
> 	(LIBS): Likewise.
> 	(GCC_OBJS): Remove diagnostic.o, pretty-print.o and input.o.
> 	(OBJS-common): Remove diagnostic.o, input.o, intl.o,
> 	pretty-print.o and version.o.
> 	(OBJS-libcommon): New.
> 	(ALL_HOST_BACKEND_OBJS): Add $(OBJS-libcommon).
> 	(BACKEND): Add libcommon.a.
> 	(MOSTLYCLEANFILES): Likewise.
> 	(libcommon.a): New.
> 	(xgcc$(exeext)): Don't explicitly use version.o and intl.o.
> 	(cpp$(exeext)): Likewise.
> 	(COLLECT2_OBJS): Remove intl.o, version.o, diagnostic.o,
> 	pretty-print.o and input.o.
> 	(lto-wrapper$(exeext)): Don't explicitly use intl.o.
> 	(lto-wrapper.o): Depend on $(DIAGNOSTIC_H).
> 	(errors.o): Remove.
> 	(mips-tfile): Don't explicitly use version.o.
> 	(mips-tdump): Likewise.
> 	(gcov.o): Depend on $(DIAGNOSTIC_H).
> 	(gcov-dump.o): Depend on intl.h and $(DIAGNOSTIC_H).
> 	(GCOV_OBJS): Remove intl.o, version.o and errors.o.
> 	(GCOV_DUMP_OBJS): Remove version.o and errors.o.
> 	* gcov-dump.c: Include intl.h and diagnostic.h.
> 	(main): Initialize diagnostics.
> 	* gcov.c: Include diagnostic.h.
> 	(fnotice): Remove.
> 	(main): Initialize diagnostics.
> 	* lto-wrapper.c: Include diagnostic.h.
> 	(main): Initialize diagnostics.
>
> ada:
> 2011-05-20  Joseph Myers<joseph@codesourcery.com>
>
> 	* gcc-interface/Make-lang.in (EXTRA_GNATBIND_OBJS): Remove
> 	version.o.
> 	* gcc-interface/Makefile.in (EXTRA_GNATTOOLS_OBJS): Use
> 	libcommon.a instead of version.o.
>
> cp:
> 2011-05-20  Joseph Myers<joseph@codesourcery.com>
>
> 	* Make-lang.in (GXX_OBJS): Remove intl.o and version.o.
>
> fortran:
> 2011-05-20  Joseph Myers<joseph@codesourcery.com>
>
> 	* Make-lang.in (GFORTRAN_D_OBJS): Remove version.o and intl.o.
>
> go:
> 2011-05-20  Joseph Myers<joseph@codesourcery.com>
>
> 	* Make-lang.in (GCCGO_OBJS): Remove intl.o and version.o.
>
> java:
> 2011-05-20  Joseph Myers<joseph@codesourcery.com>
>
> 	* Make-lang.in ($(XGCJ)$(exeext)): Don't explicitly use intl.o and
> 	version.o.
> 	(JCFDUMP_OBJS): Remove errors.o, version.o and intl.o.
> 	(JVGENMAIN_OBJS): Remove errors.o and intl.o.
> 	(java/jcf-dump.o, java/jvgenmain.o): Depend in $(DIAGNOSTIC_H).
> 	* jcf-dump.c: Include diagnostic.h.
> 	(main): Initialize diagnostics.
> 	* jvgenmain.c: Include diagnostic.h.
> 	(main): Initialize diagnostics.
>

Build parts are okay, so language maintainers can just approve their own 
bits.

Paolo

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Merge OBJS-common,-md,-archive
  2011-05-20 13:51 Link more common objects consistently into host programs Joseph S. Myers
  2011-05-20 14:12 ` Paolo Bonzini
@ 2011-05-20 14:35 ` Michael Matz
  2011-05-20 14:41   ` Paolo Bonzini
  2011-05-20 18:20   ` Joseph S. Myers
  2011-05-20 15:57 ` Link more common objects consistently into host programs Gabriel Dos Reis
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 8+ messages in thread
From: Michael Matz @ 2011-05-20 14:35 UTC (permalink / raw)
  To: Joseph S. Myers, bonzini; +Cc: gcc-patches

Hi,

On Fri, 20 May 2011, Joseph S. Myers wrote:

> (Apart from the arbitrary division between GCC_OBJS and the xgcc link 
> rule, mentioned above, there are other arbitrary divisions that don't 
> make sense to me.  In particular, the separation between OBJS-common, 
> OBJS-md and OBJS-archive, all used only in the definition of OBJS and 
> all ending up in libbackend.a.

Indeed, this split doesn't make sense since some years.  I have this local 
patch since I don't know when.

Okay for trunk?  (regstrapped multiple times on x86_64-linux, with all 
languages)


Ciao,
Michael.

	* Makefile.in (OBJS-common, OBJS-md, OBJS-archive): Merge into OBJS.

Index: Makefile.in
===================================================================
--- Makefile.in	(revision 173940)
+++ Makefile.in	(working copy)
@@ -1189,7 +1189,7 @@ C_OBJS = c-lang.o c-family/stub-objc.o $
 # We put the insn-*.o files first so that a parallel make will build
 # them sooner, because they are large and otherwise tend to be the
 # last objects to finish building.
-OBJS-common = \
+OBJS = \
 	insn-attrtab.o \
 	insn-automata.o \
 	insn-emit.o \
@@ -1222,11 +1222,16 @@ OBJS-common = \
 	cfgloopanal.o \
 	cfgloopmanip.o \
 	cfgrtl.o \
+	cgraph.o \
+	cgraphbuild.o \
+	cgraphunit.o \
 	combine.o \
 	combine-stack-adj.o \
 	compare-elim.o \
 	convert.o \
 	coverage.o \
+	cppbuiltin.o \
+	cppdefault.o \
 	cprop.o \
 	cse.o \
 	cselib.o \
@@ -1287,11 +1292,23 @@ OBJS-common = \
 	hwint.o \
 	ifcvt.o \
 	implicit-zee.o \
+	incpath.o \
 	init-regs.o \
 	input.o \
 	integrate.o \
 	internal-fn.o \
 	intl.o \
+	ipa-cp.o \
+	ipa-split.o \
+	ipa-inline.o \
+	ipa-inline-analysis.o \
+	ipa-inline-transform.o \
+	ipa-prop.o \
+	ipa-pure-const.o \
+	ipa-reference.o \
+	ipa-ref.o \
+	ipa-utils.o \
+	ipa.o \
 	ira.o \
 	ira-build.o \
 	ira-costs.o \
@@ -1319,6 +1336,7 @@ OBJS-common = \
 	lto-opts.o \
 	lto-streamer.o \
 	lto-compress.o \
+	matrix-reorg.o \
 	mcf.o \
 	mode-switching.o \
 	modulo-sched.o \
@@ -1336,6 +1354,7 @@ OBJS-common = \
 	postreload-gcse.o \
 	postreload.o \
 	predict.o \
+	prefix.o \
 	pretty-print.o \
 	print-rtl.o \
 	print-tree.o \
@@ -1394,10 +1413,12 @@ OBJS-common = \
 	tree-eh.o \
 	tree-emutls.o \
 	tree-if-conv.o \
+	tree-inline.o \
 	tree-into-ssa.o \
 	tree-iterator.o \
 	tree-loop-distribution.o \
 	tree-nested.o \
+	tree-nomudflap.o \
 	tree-nrv.o \
 	tree-object-size.o \
 	tree-optimize.o \
@@ -1452,54 +1473,26 @@ OBJS-common = \
 	tree-tailcall.o \
 	tree-vect-generic.o \
 	tree-vect-patterns.o \
-        tree-vect-data-refs.o \
-        tree-vect-stmts.o \
-        tree-vect-loop.o \
-        tree-vect-loop-manip.o \
-        tree-vect-slp.o \
+	tree-vect-data-refs.o \
+	tree-vect-stmts.o \
+	tree-vect-loop.o \
+	tree-vect-loop-manip.o \
+	tree-vect-slp.o \
 	tree-vectorizer.o \
 	tree-vrp.o \
 	tree.o \
 	value-prof.o \
 	var-tracking.o \
 	varasm.o \
+	varpool.o \
 	vec.o \
 	version.o \
 	vmsdbgout.o \
 	web.o \
-	xcoffout.o
-
-# Target object files.
-OBJS-md = $(out_object_file)
-
-# Language independent object files which are not used by all languages.
-OBJS-archive = \
+	xcoffout.o \
+	$(out_object_file) \
 	$(EXTRA_OBJS) \
-	$(host_hook_obj) \
-	cgraph.o \
-	cgraphbuild.o \
-	cgraphunit.o \
-	cppbuiltin.o \
-	cppdefault.o \
-	incpath.o \
-	ipa-cp.o \
-        ipa-split.o \
-	ipa-inline.o \
-	ipa-inline-analysis.o \
-	ipa-inline-transform.o \
-	ipa-prop.o \
-	ipa-pure-const.o \
-	ipa-reference.o \
-	ipa-ref.o \
-	ipa-utils.o \
-	ipa.o \
-	matrix-reorg.o \
-	prefix.o \
-	tree-inline.o \
-	tree-nomudflap.o \
-	varpool.o
-
-OBJS = $(OBJS-common) $(OBJS-md) $(OBJS-archive)
+	$(host_hook_obj)
 
 # This lists all host objects for the front ends.
 ALL_HOST_FRONTEND_OBJS = $(C_OBJS) \

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Merge OBJS-common,-md,-archive
  2011-05-20 14:35 ` Merge OBJS-common,-md,-archive Michael Matz
@ 2011-05-20 14:41   ` Paolo Bonzini
  2011-05-20 18:20   ` Joseph S. Myers
  1 sibling, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2011-05-20 14:41 UTC (permalink / raw)
  To: Michael Matz; +Cc: Joseph S. Myers, gcc-patches

On 05/20/2011 03:49 PM, Michael Matz wrote:
> Hi,
>
> On Fri, 20 May 2011, Joseph S. Myers wrote:
>
>> (Apart from the arbitrary division between GCC_OBJS and the xgcc link
>> rule, mentioned above, there are other arbitrary divisions that don't
>> make sense to me.  In particular, the separation between OBJS-common,
>> OBJS-md and OBJS-archive, all used only in the definition of OBJS and
>> all ending up in libbackend.a.
>
> Indeed, this split doesn't make sense since some years.  I have this local
> patch since I don't know when.
>
> Okay for trunk?  (regstrapped multiple times on x86_64-linux, with all
> languages)
>
>
> Ciao,
> Michael.
>
> 	* Makefile.in (OBJS-common, OBJS-md, OBJS-archive): Merge into OBJS.
>
> Index: Makefile.in
> ===================================================================
> --- Makefile.in	(revision 173940)
> +++ Makefile.in	(working copy)
> @@ -1189,7 +1189,7 @@ C_OBJS = c-lang.o c-family/stub-objc.o $
>   # We put the insn-*.o files first so that a parallel make will build
>   # them sooner, because they are large and otherwise tend to be the
>   # last objects to finish building.
> -OBJS-common = \
> +OBJS = \
>   	insn-attrtab.o \
>   	insn-automata.o \
>   	insn-emit.o \
> @@ -1222,11 +1222,16 @@ OBJS-common = \
>   	cfgloopanal.o \
>   	cfgloopmanip.o \
>   	cfgrtl.o \
> +	cgraph.o \
> +	cgraphbuild.o \
> +	cgraphunit.o \
>   	combine.o \
>   	combine-stack-adj.o \
>   	compare-elim.o \
>   	convert.o \
>   	coverage.o \
> +	cppbuiltin.o \
> +	cppdefault.o \
>   	cprop.o \
>   	cse.o \
>   	cselib.o \
> @@ -1287,11 +1292,23 @@ OBJS-common = \
>   	hwint.o \
>   	ifcvt.o \
>   	implicit-zee.o \
> +	incpath.o \
>   	init-regs.o \
>   	input.o \
>   	integrate.o \
>   	internal-fn.o \
>   	intl.o \
> +	ipa-cp.o \
> +	ipa-split.o \
> +	ipa-inline.o \
> +	ipa-inline-analysis.o \
> +	ipa-inline-transform.o \
> +	ipa-prop.o \
> +	ipa-pure-const.o \
> +	ipa-reference.o \
> +	ipa-ref.o \
> +	ipa-utils.o \
> +	ipa.o \
>   	ira.o \
>   	ira-build.o \
>   	ira-costs.o \
> @@ -1319,6 +1336,7 @@ OBJS-common = \
>   	lto-opts.o \
>   	lto-streamer.o \
>   	lto-compress.o \
> +	matrix-reorg.o \
>   	mcf.o \
>   	mode-switching.o \
>   	modulo-sched.o \
> @@ -1336,6 +1354,7 @@ OBJS-common = \
>   	postreload-gcse.o \
>   	postreload.o \
>   	predict.o \
> +	prefix.o \
>   	pretty-print.o \
>   	print-rtl.o \
>   	print-tree.o \
> @@ -1394,10 +1413,12 @@ OBJS-common = \
>   	tree-eh.o \
>   	tree-emutls.o \
>   	tree-if-conv.o \
> +	tree-inline.o \
>   	tree-into-ssa.o \
>   	tree-iterator.o \
>   	tree-loop-distribution.o \
>   	tree-nested.o \
> +	tree-nomudflap.o \
>   	tree-nrv.o \
>   	tree-object-size.o \
>   	tree-optimize.o \
> @@ -1452,54 +1473,26 @@ OBJS-common = \
>   	tree-tailcall.o \
>   	tree-vect-generic.o \
>   	tree-vect-patterns.o \
> -        tree-vect-data-refs.o \
> -        tree-vect-stmts.o \
> -        tree-vect-loop.o \
> -        tree-vect-loop-manip.o \
> -        tree-vect-slp.o \
> +	tree-vect-data-refs.o \
> +	tree-vect-stmts.o \
> +	tree-vect-loop.o \
> +	tree-vect-loop-manip.o \
> +	tree-vect-slp.o \
>   	tree-vectorizer.o \
>   	tree-vrp.o \
>   	tree.o \
>   	value-prof.o \
>   	var-tracking.o \
>   	varasm.o \
> +	varpool.o \
>   	vec.o \
>   	version.o \
>   	vmsdbgout.o \
>   	web.o \
> -	xcoffout.o
> -
> -# Target object files.
> -OBJS-md = $(out_object_file)
> -
> -# Language independent object files which are not used by all languages.
> -OBJS-archive = \
> +	xcoffout.o \
> +	$(out_object_file) \
>   	$(EXTRA_OBJS) \
> -	$(host_hook_obj) \
> -	cgraph.o \
> -	cgraphbuild.o \
> -	cgraphunit.o \
> -	cppbuiltin.o \
> -	cppdefault.o \
> -	incpath.o \
> -	ipa-cp.o \
> -        ipa-split.o \
> -	ipa-inline.o \
> -	ipa-inline-analysis.o \
> -	ipa-inline-transform.o \
> -	ipa-prop.o \
> -	ipa-pure-const.o \
> -	ipa-reference.o \
> -	ipa-ref.o \
> -	ipa-utils.o \
> -	ipa.o \
> -	matrix-reorg.o \
> -	prefix.o \
> -	tree-inline.o \
> -	tree-nomudflap.o \
> -	varpool.o
> -
> -OBJS = $(OBJS-common) $(OBJS-md) $(OBJS-archive)
> +	$(host_hook_obj)
>
>   # This lists all host objects for the front ends.
>   ALL_HOST_FRONTEND_OBJS = $(C_OBJS) \
>

Looks good, thanks.

Paolo

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Link more common objects consistently into host programs
  2011-05-20 13:51 Link more common objects consistently into host programs Joseph S. Myers
  2011-05-20 14:12 ` Paolo Bonzini
  2011-05-20 14:35 ` Merge OBJS-common,-md,-archive Michael Matz
@ 2011-05-20 15:57 ` Gabriel Dos Reis
  2011-05-20 16:39 ` Rainer Orth
  2011-05-20 18:01 ` Tom Tromey
  4 siblings, 0 replies; 8+ messages in thread
From: Gabriel Dos Reis @ 2011-05-20 15:57 UTC (permalink / raw)
  To: Joseph S. Myers
  Cc: gcc-patches, bonzini, dj, neroden, aoliva, Ralf.Wildenhues, ro

On Fri, May 20, 2011 at 7:21 AM, Joseph S. Myers
<joseph@codesourcery.com> wrote:
> There are an increasing number of common object files that get linked
> into a range of programs GCC builds and installs for the host,
> including but not limited to the core compilers and the drivers.

the diagnostic part is OK.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Link more common objects consistently into host programs
  2011-05-20 13:51 Link more common objects consistently into host programs Joseph S. Myers
                   ` (2 preceding siblings ...)
  2011-05-20 15:57 ` Link more common objects consistently into host programs Gabriel Dos Reis
@ 2011-05-20 16:39 ` Rainer Orth
  2011-05-20 18:01 ` Tom Tromey
  4 siblings, 0 replies; 8+ messages in thread
From: Rainer Orth @ 2011-05-20 16:39 UTC (permalink / raw)
  To: Joseph S. Myers
  Cc: gcc-patches, gdr, bonzini, dj, neroden, aoliva, Ralf.Wildenhues

"Joseph S. Myers" <joseph@codesourcery.com> writes:

> I haven't tested building mips-tdump or mips-tfile with this patch,
> but don't think it should cause any problems as the static linker
> should just ignore the diagnostics objects for those programs.  In
> principle mips-tfile should use the common code instead of its own
> implementations of error and fancy_abort, but I doubt it's worth
> converting it (the line-number handling makes it a nontrivial
> conversion as that would need to move to the line-map infrastructure
> as well).

Indeed: if any more work is spent in this area, it should be to get gas
working again on Tru64 UNIX and get rid of mips-t* completely.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Link more common objects consistently into host programs
  2011-05-20 13:51 Link more common objects consistently into host programs Joseph S. Myers
                   ` (3 preceding siblings ...)
  2011-05-20 16:39 ` Rainer Orth
@ 2011-05-20 18:01 ` Tom Tromey
  4 siblings, 0 replies; 8+ messages in thread
From: Tom Tromey @ 2011-05-20 18:01 UTC (permalink / raw)
  To: Joseph S. Myers
  Cc: gcc-patches, gdr, bonzini, dj, neroden, aoliva, Ralf.Wildenhues, ro

>>>>> "Joseph" == Joseph S Myers <joseph@codesourcery.com> writes:

Joseph> 2011-05-20  Joseph Myers  <joseph@codesourcery.com>
Joseph> 	* Make-lang.in ($(XGCJ)$(exeext)): Don't explicitly use intl.o and
Joseph> 	version.o.
Joseph> 	(JCFDUMP_OBJS): Remove errors.o, version.o and intl.o.
Joseph> 	(JVGENMAIN_OBJS): Remove errors.o and intl.o.
Joseph> 	(java/jcf-dump.o, java/jvgenmain.o): Depend in $(DIAGNOSTIC_H).
Joseph> 	* jcf-dump.c: Include diagnostic.h.
Joseph> 	(main): Initialize diagnostics.
Joseph> 	* jvgenmain.c: Include diagnostic.h.
Joseph> 	(main): Initialize diagnostics.

This is ok.  Thanks.

Tom

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Merge OBJS-common,-md,-archive
  2011-05-20 14:35 ` Merge OBJS-common,-md,-archive Michael Matz
  2011-05-20 14:41   ` Paolo Bonzini
@ 2011-05-20 18:20   ` Joseph S. Myers
  1 sibling, 0 replies; 8+ messages in thread
From: Joseph S. Myers @ 2011-05-20 18:20 UTC (permalink / raw)
  To: Michael Matz; +Cc: bonzini, gcc-patches

That patch left a stray reference to $(OBJS-common) in a comment.  I've 
applied this patch as obvious to fix this.

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 173962)
+++ ChangeLog	(working copy)
@@ -1,3 +1,7 @@
+2011-05-20  Joseph Myers  <joseph@codesourcery.com>
+
+	* Makefile.in: Update comment referring to $(OBJS-common).
+
 2011-05-20  Ian Lance Taylor  <iant@google.com>
 
 	* godump.c (go_output_typedef): Put enum constants in the macro
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 173962)
+++ Makefile.in	(working copy)
@@ -3848,7 +3848,7 @@
        $(ALL_GTFILES_H) gtype-desc.c gtype-desc.h gcov-iov.h
 
 # In order for parallel make to really start compiling the expensive
-# objects from $(OBJS-common) as early as possible, build all their
+# objects from $(OBJS) as early as possible, build all their
 # prerequisites strictly before all objects.
 $(ALL_HOST_OBJS) : | $(generated_files)
 

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-05-20 16:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-20 13:51 Link more common objects consistently into host programs Joseph S. Myers
2011-05-20 14:12 ` Paolo Bonzini
2011-05-20 14:35 ` Merge OBJS-common,-md,-archive Michael Matz
2011-05-20 14:41   ` Paolo Bonzini
2011-05-20 18:20   ` Joseph S. Myers
2011-05-20 15:57 ` Link more common objects consistently into host programs Gabriel Dos Reis
2011-05-20 16:39 ` Rainer Orth
2011-05-20 18:01 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).