This is the mail archive of the 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]

[PATCH V3] [gcc-4.10] gcc/ fix parallel building failure

Changed in V3:
- For gcc-ar.o, gcc-nm.o and gcc-ranlib.o, we make use
  of '$(ALL_HOST_OBJS) : | $(generated_files)' rule,
  for errors.o, we refered what gengtype-parse.o did.

Changed in V2:
- Make use of '$(ALL_HOST_OBJS) : | $(generated_files)'
  rule to check the dependency.

The gcc-ar.o, gcc-nm.o, gcc-ranlib.o and errors.o included
config.h which was a generated file. But no explicity rule
to clarify the dependency. There was potential building
failure while parallel make.

For gcc-ar.o, gcc-nm.o and gcc-ranlib.o, they were compiled from one C
source file gcc-ar.c, we add them to ALL_HOST_BACKEND_OBJS, so the
'$(ALL_HOST_OBJS) : | $(generated_files)' rule could work for these

For errors.o, it is part of gengtype, and the gengtype generator program
is special: Two versions are built. One is for the build machine, and one
is for the host. We refered what gengtype-parse.o did (which also is part
of gengtype).

[GCC #61899]

Signed-off-by: Hongxu Jia <>
 gcc/ | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gcc/ b/gcc/
index a726109..cdaa406 100644
--- a/gcc/
+++ b/gcc/
@@ -1491,13 +1491,16 @@ OBJS-libcommon-target = $(common_out_object_file) prefix.o params.o \
 	opts.o opts-common.o options.o vec.o hooks.o common/common-targhooks.o \
 	hash-table.o file-find.o
+# Objects compiled from one C source file gcc-ar.c
+OBJS-gcc-ar = gcc-ar.o gcc-nm.o gcc-ranlib.o
 # This lists all host objects for the front ends.
   $(OBJS-libcommon-target) @TREEBROWSER@ main.o c-family/cppspec.o \
-  $(GCOV_TOOL_OBJS) lto-wrapper.o collect-utils.o
+  $(GCOV_TOOL_OBJS) lto-wrapper.o collect-utils.o $(OBJS-gcc-ar)
 # This lists all host object files, whether they are included in this
 # compilation or not.
@@ -2447,6 +2450,8 @@ gengtype-lex.o: $(CONFIG_H) $(BCONFIG_H)
 CFLAGS-gengtype-lex.o += -DGENERATOR_FILE
 build/gengtype-lex.o: $(BCONFIG_H)
+errors.o : $(CONFIG_H)
 gengtype-parse.o build/gengtype-parse.o : gengtype-parse.c gengtype.h \
 gengtype-parse.o: $(CONFIG_H)

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