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]
Other format: [Raw text]

Re: Put more common objects in libcommon-target.a


On 05/24/2011 01:42 PM, Joseph S. Myers wrote:
This patch continues preparing for a target structure shared by the
driver (including for this purpose collect2 and gnatbind) and the core
compilers by creating a library libcommon-target.a to contain the
shared code that may have such target dependencies.  Right now it
contains opts-common.o (which doesn't have target dependencies itself
except indirectly through options.o), options.o and prefix.o; it's
intended to include the shared target structure and associated
functions, and opts.o once all the hooks used there
(targetm.handle_option targetm.default_target_flags
targetm.unwind_tables_default targetm.target_option.init_struct
targetm.target_option.optimization_table targetm.except_unwind_info
targetm.have_named_sections targetm.supports_split_stack targetm.help)
have moved to the common structure.

Bootstrapped with no regressions on x86_64-unknown-linux-gnu.  OK to
commit?

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

	* Makefile.in (GCC_OBJS): Remove opts-common.o and options.o.
	(OBJS): Remove options.o, opts-common.o and prefix.o.
	(OBJS-libcommon-target): New.
	(ALL_HOST_BACKEND_OBJS): Include $(OBJS-libcommon-target).
	(BACKEND): Include libcommon-target.a.
	(MOSTLYCLEANFILES): Include libcommon-target.a.
	(libcommon-target.a): New.
	(xgcc$(exeext), cpp$(exeext)): Use libcommon-target.a instead of
	prefix.o.

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

	* gcc-interface/Make-lang.in (GNAT1_OBJS): Don't include
	$(EXTRA_GNAT1_OBJS).
	(GNATBIND_OBJS): Don't include $(EXTRA_GNATBIND_OBJS).
	(EXTRA_GNAT1_OBJS, EXTRA_GNATBIND_OBJS): Remove.
	(gnat1$(exeext), gnatbind$(exeext)): Use libcommon-target.a.
	* gcc-interface/Makefile.in (EXTRA_GNATTOOLS_OBJS): Use
	libcommon-target.a instead of prefix.o.

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

	* Make-lang.in (GXX_OBJS): Remove prefix.o.
	(g++$(exeext)): Use libcommon-target.a.
	(CXX_C_OBJS): Remove prefix.o.

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

	* Make-lang.in (GFORTRAN_D_OBJS): Remove prefix.o.
	(gfortran$(exeext)): Use libcommon-target.a.

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

	* Make-lang.in (GCCGO_OBJS): Remove prefix.o.
	(gccgo$(exeext)): Use libcommon-target.a.

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

	* Make-lang.in ($(XGCJ)$(exeext)): Use libcommon-target.a instead
	of prefix.o.

Index: gcc/java/Make-lang.in
===================================================================
--- gcc/java/Make-lang.in	(revision 174085)
+++ gcc/java/Make-lang.in	(working copy)
@@ -64,9 +64,9 @@ jvspec.o: $(srcdir)/java/jvspec.c $(SYST

  # Create the compiler driver for $(XGCJ).
  $(XGCJ)$(exeext): $(GCC_OBJS) jvspec.o java/jcf-path.o \
-	   prefix.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
+	   libcommon-target.a $(LIBDEPS) $(EXTRA_GCC_OBJS)
  	+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) \
-	  jvspec.o java/jcf-path.o prefix.o $(EXTRA_GCC_OBJS) $(LIBS)
+	  jvspec.o java/jcf-path.o $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBS)

  # Create a version of the $(XGCJ) driver which calls the cross-compiler.
  $(XGCJ)-cross$(exeext): $(XGCJ)$(exeext)
Index: gcc/cp/Make-lang.in
===================================================================
--- gcc/cp/Make-lang.in	(revision 174085)
+++ gcc/cp/Make-lang.in	(working copy)
@@ -60,10 +60,10 @@ 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 prefix.o
-g++$(exeext): $(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBDEPS)
+GXX_OBJS = $(GCC_OBJS) g++spec.o
+g++$(exeext): $(GXX_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBDEPS)
  	+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
-	  $(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBS)
+	  $(GXX_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBS)

  # Create a version of the g++ driver which calls the cross-compiler.
  g++-cross$(exeext): g++$(exeext)
@@ -72,7 +72,7 @@ g++-cross$(exeext): g++$(exeext)

  # The compiler itself.
  # Shared with C front end:
-CXX_C_OBJS = attribs.o incpath.o prefix.o \
+CXX_C_OBJS = attribs.o incpath.o \
  	$(C_COMMON_OBJS) $(CXX_TARGET_OBJS)

  # Language-specific object files for C++ and Objective C++.
Index: gcc/go/Make-lang.in
===================================================================
--- gcc/go/Make-lang.in	(revision 174085)
+++ gcc/go/Make-lang.in	(working copy)
@@ -36,10 +36,10 @@ 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 prefix.o
-gccgo$(exeext): $(GCCGO_OBJS) $(EXTRA_GCC_OBJS) $(LIBDEPS)
+GCCGO_OBJS = $(GCC_OBJS) gospec.o
+gccgo$(exeext): $(GCCGO_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBDEPS)
  	$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
-	  $(GCCGO_OBJS) $(EXTRA_GCC_OBJS) $(LIBS)
+	  $(GCCGO_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBS)

  # Use strict warnings.
  go-warn = $(STRICT_WARN)
Index: gcc/ada/gcc-interface/Makefile.in
===================================================================
--- gcc/ada/gcc-interface/Makefile.in	(revision 174085)
+++ 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 ../../libcommon.a
+EXTRA_GNATTOOLS_OBJS = ../../libcommon-target.a ../../libcommon.a

  # List extra gnattools
  EXTRA_GNATTOOLS =
Index: gcc/ada/gcc-interface/Make-lang.in
===================================================================
--- gcc/ada/gcc-interface/Make-lang.in	(revision 174085)
+++ gcc/ada/gcc-interface/Make-lang.in	(working copy)
@@ -340,7 +340,7 @@ GNAT_ADA_OBJS =	\
  # Object files for gnat executables
  GNAT1_ADA_OBJS = $(GNAT_ADA_OBJS) ada/back_end.o ada/gnat1drv.o

-GNAT1_OBJS = $(GNAT1_C_OBJS) $(GNAT1_ADA_OBJS) $(EXTRA_GNAT1_OBJS)
+GNAT1_OBJS = $(GNAT1_C_OBJS) $(GNAT1_ADA_OBJS)

  GNATBIND_OBJS = \
   ada/adaint.o     \
@@ -464,12 +464,7 @@ GNATBIND_OBJS = \
   ada/uintp.o      \
   ada/uname.o      \
   ada/urealp.o     \
- ada/widechar.o   \
- $(EXTRA_GNATBIND_OBJS)
-
-# List of extra object files linked in with various programs.
-EXTRA_GNAT1_OBJS = prefix.o
-EXTRA_GNATBIND_OBJS = prefix.o
+ ada/widechar.o

  # Language-independent object files.
  ADA_BACKEND = $(BACKEND) attribs.o
@@ -480,12 +475,12 @@ TARGET_ADA_SRCS =
  # Needs to be built with CC=gcc
  # Since the RTL should be built with the latest compiler, remove the
  #  stamp target in the parent directory whenever gnat1 is rebuilt
-gnat1$(exeext): $(TARGET_ADA_SRCS) $(GNAT1_OBJS) $(ADA_BACKEND) $(LIBDEPS)
-	$(GCC_LINK) -o $@ $(GNAT1_OBJS) $(ADA_BACKEND) $(LIBS) $(SYSLIBS) $(BACKENDLIBS) $(CFLAGS)
+gnat1$(exeext): $(TARGET_ADA_SRCS) $(GNAT1_OBJS) $(ADA_BACKEND) libcommon-target.a $(LIBDEPS)
+	$(GCC_LINK) -o $@ $(GNAT1_OBJS) $(ADA_BACKEND) libcommon-target.a $(LIBS) $(SYSLIBS) $(BACKENDLIBS) $(CFLAGS)
  	$(RM) stamp-gnatlib2-rts stamp-tools

-gnatbind$(exeext): ada/b_gnatb.o $(CONFIG_H) $(GNATBIND_OBJS) $(LIBDEPS)
-	$(GCC_LINK) -o $@ ada/b_gnatb.o $(GNATBIND_OBJS) $(LIBS) $(SYSLIBS) $(CFLAGS)
+gnatbind$(exeext): ada/b_gnatb.o $(CONFIG_H) $(GNATBIND_OBJS) libcommon-target.a $(LIBDEPS)
+	$(GCC_LINK) -o $@ ada/b_gnatb.o $(GNATBIND_OBJS) libcommon-target.a $(LIBS) $(SYSLIBS) $(CFLAGS)

  # use cross-gcc
  gnat-cross: force
Index: gcc/fortran/Make-lang.in
===================================================================
--- gcc/fortran/Make-lang.in	(revision 174085)
+++ gcc/fortran/Make-lang.in	(working copy)
@@ -84,10 +84,11 @@ gfortranspec.o: $(srcdir)/fortran/gfortr
  		$(INCLUDES) $(srcdir)/fortran/gfortranspec.c)

  # Create the compiler driver gfortran.
-GFORTRAN_D_OBJS = $(GCC_OBJS) gfortranspec.o prefix.o
-gfortran$(exeext): $(GFORTRAN_D_OBJS) $(EXTRA_GCC_OBJS) $(LIBDEPS)
+GFORTRAN_D_OBJS = $(GCC_OBJS) gfortranspec.o
+gfortran$(exeext): $(GFORTRAN_D_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a \
+	$(LIBDEPS)
  	+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
-	  $(GFORTRAN_D_OBJS) $(EXTRA_GCC_OBJS) $(LIBS)
+	  $(GFORTRAN_D_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBS)

  # Create a version of the gfortran driver which calls the cross-compiler.
  gfortran-cross$(exeext): gfortran$(exeext)
Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in	(revision 174085)
+++ gcc/Makefile.in	(working copy)
@@ -1168,7 +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 options.o vec.o ggc-none.o
+GCC_OBJS = gcc.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 \
@@ -1340,9 +1340,7 @@ OBJS = \
  	omega.o \
  	omp-low.o \
  	optabs.o \
-	options.o \
  	options-save.o \
-	opts-common.o \
  	opts-global.o \
  	opts.o \
  	params.o \
@@ -1352,7 +1350,6 @@ OBJS = \
  	postreload-gcse.o \
  	postreload.o \
  	predict.o \
-	prefix.o \
  	print-rtl.o \
  	print-tree.o \
  	profile.o \
@@ -1494,12 +1491,16 @@ OBJS = \
  # no target dependencies.
  OBJS-libcommon = diagnostic.o pretty-print.o intl.o input.o version.o

+# Objects in libcommon-target.a, used by drivers and by the core
+# compiler and containing target-dependent code.
+OBJS-libcommon-target = prefix.o opts-common.o options.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) $(OBJS-libcommon) \
-  @TREEBROWSER@ main.o gccspec.o prefix.o cppspec.o \
+  $(OBJS-libcommon-target) @TREEBROWSER@ main.o gccspec.o cppspec.o \
    $(COLLECT2_OBJS) $(EXTRA_GCC_OBJS) mips-tfile.o mips-tdump.o \
    $(GCOV_OBJS) $(GCOV_DUMP_OBJS)

@@ -1507,8 +1508,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 libcommon.a $(CPPLIB) \
-	$(LIBDECNUMBER)
+BACKEND = main.o @TREEBROWSER@ libbackend.a libcommon-target.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 \
@@ -1520,7 +1521,8 @@ 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 libcommon.a libgcc.mk
+ *.[0-9][0-9].* *.[si] *-checksum.c libbackend.a libcommon-target.a \
+ libcommon.a libgcc.mk

  # Defined in libgcc2.c, included only in the static library.
  LIB2FUNCS_ST = _eprintf __gcc_bcmp
@@ -1832,6 +1834,11 @@ libbackend.a: $(OBJS)
  	$(AR) $(AR_FLAGS) libbackend.a $(OBJS)
  	-$(RANLIB) $(RANLIB_FLAGS) libbackend.a

+libcommon-target.a: $(OBJS-libcommon-target)
+	-rm -rf libcommon-target.a
+	$(AR) $(AR_FLAGS) libcommon-target.a $(OBJS-libcommon-target)
+	-$(RANLIB) $(RANLIB_FLAGS) libcommon-target.a
+
  libcommon.a: $(OBJS-libcommon)
  	-rm -rf libcommon.a
  	$(AR) $(AR_FLAGS) libcommon.a $(OBJS-libcommon)
@@ -1840,16 +1847,18 @@ libcommon.a: $(OBJS-libcommon)
  # 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 prefix.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
+xgcc$(exeext): $(GCC_OBJS) gccspec.o libcommon-target.a $(LIBDEPS) \
+	$(EXTRA_GCC_OBJS)
  	+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) \
-	  gccspec.o prefix.o $(EXTRA_GCC_OBJS) $(LIBS)
+	  gccspec.o $(EXTRA_GCC_OBJS) libcommon-target.a $(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 prefix.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
+cpp$(exeext): $(GCC_OBJS) cppspec.o libcommon-target.a $(LIBDEPS) \
+	$(EXTRA_GCC_OBJS)
  	+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) \
-	  cppspec.o prefix.o $(EXTRA_GCC_OBJS) $(LIBS)
+	  cppspec.o $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBS)

  # Dump a specs file to make -B./ read these specs over installed ones.
  $(SPECS): xgcc$(exeext)


Ok.


Paolo


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