gcc-4.9.inc: fix parallel building failure
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 objects. 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). [YOCTO #6568] (From OE-Core rev: aea4b2d58856226c471922dfa40650cba2f5a36a) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
2d1660112e
commit
2ca9406701
|
@ -1,56 +1,61 @@
|
||||||
gcc/Makefile.in: fix parallel building failure
|
gcc/Makefile.in: fix parallel building failure
|
||||||
|
|
||||||
Most C source files included config.h which was generated by a rule.
|
The gcc-ar.o, gcc-nm.o, gcc-ranlib.o and errors.o included
|
||||||
But no related prerequisites was added to the C source compiling rule.
|
config.h which was a generated file. But no explicity rule
|
||||||
There was potential building failure while makefile enabled parallel.
|
to clarify the dependency. There was potential building
|
||||||
|
failure while parallel make.
|
||||||
|
|
||||||
The C source compiling rule used suffix rule '.c.o', but the suffix
|
For gcc-ar.o, gcc-nm.o and gcc-ranlib.o, they were compiled from one C
|
||||||
rule doesn't support prerequisites.
|
source file gcc-ar.c, we add them to ALL_HOST_BACKEND_OBJS, so the
|
||||||
https://www.gnu.org/software/make/manual/html_node/Suffix-Rules.html
|
'$(ALL_HOST_OBJS) : | $(generated_files)' rule could work for these
|
||||||
|
objects.
|
||||||
|
|
||||||
We used the pattern rule '%.o : %.c' to instead, and add the config.h
|
For errors.o, it is part of gengtype, and the gengtype generator program
|
||||||
as its prerequisite
|
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).
|
||||||
|
|
||||||
We also moved the '%.o : %.c' rule down to the 'build/%.o :' rule, which
|
[GCC #61899]
|
||||||
makes '%.o : %.c' rule doesn't override 'build/%.o :'.
|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61899
|
||||||
|
|
||||||
Upstream-Status: Pending
|
Upstream-Status: Send to gcc-patches@gcc.gnu.org mailing list
|
||||||
|
|
||||||
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||||
---
|
---
|
||||||
gcc/Makefile.in | 12 ++++++++----
|
gcc/Makefile.in | 7 ++++++-
|
||||||
1 file changed, 8 insertions(+), 4 deletions(-)
|
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
|
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
|
||||||
index 6475cba..04889fe 100644
|
index 6475cba..56e50bb 100644
|
||||||
--- a/gcc/Makefile.in
|
--- a/gcc/Makefile.in
|
||||||
+++ b/gcc/Makefile.in
|
+++ b/gcc/Makefile.in
|
||||||
@@ -1054,10 +1054,6 @@ COMPILE = source='$<' object='$@' libtool=no \
|
@@ -1481,13 +1481,16 @@ OBJS-libcommon-target = $(common_out_object_file) prefix.o params.o \
|
||||||
POSTCOMPILE =
|
opts.o opts-common.o options.o vec.o hooks.o common/common-targhooks.o \
|
||||||
endif
|
hash-table.o file-find.o
|
||||||
|
|
||||||
-.cc.o .c.o:
|
+# Objects compiled from one C source file gcc-ar.c
|
||||||
- $(COMPILE) $<
|
+OBJS-gcc-ar = gcc-ar.o gcc-nm.o gcc-ranlib.o
|
||||||
- $(POSTCOMPILE)
|
+
|
||||||
-
|
# This lists all host objects for the front ends.
|
||||||
#
|
ALL_HOST_FRONTEND_OBJS = $(foreach v,$(CONFIG_LANGUAGES),$($(v)_OBJS))
|
||||||
# Support for additional languages (other than C).
|
|
||||||
# C can be supported this way too (leave for later).
|
|
||||||
@@ -2342,6 +2338,14 @@ build/%.o : # dependencies provided by explicit rule later
|
|
||||||
$(COMPILER_FOR_BUILD) -c $(BUILD_COMPILERFLAGS) $(BUILD_CPPFLAGS) \
|
|
||||||
-o $@ $<
|
|
||||||
|
|
||||||
+%.o: %.c $(CONFIG_H)
|
ALL_HOST_BACKEND_OBJS = $(GCC_OBJS) $(OBJS) $(OBJS-libcommon) \
|
||||||
+ $(COMPILE) $<
|
$(OBJS-libcommon-target) @TREEBROWSER@ main.o c-family/cppspec.o \
|
||||||
+ $(POSTCOMPILE)
|
$(COLLECT2_OBJS) $(EXTRA_GCC_OBJS) $(GCOV_OBJS) $(GCOV_DUMP_OBJS) \
|
||||||
|
- lto-wrapper.o
|
||||||
|
+ lto-wrapper.o $(OBJS-gcc-ar)
|
||||||
|
|
||||||
|
# This lists all host object files, whether they are included in this
|
||||||
|
# compilation or not.
|
||||||
|
@@ -2437,6 +2440,8 @@ gengtype-parse.o: $(CONFIG_H)
|
||||||
|
CFLAGS-build/gengtype-parse.o += -DGENERATOR_FILE
|
||||||
|
build/gengtype-parse.o: $(BCONFIG_H)
|
||||||
|
|
||||||
|
+errors.o : $(CONFIG_H)
|
||||||
+
|
+
|
||||||
+%.o: %.cc $(CONFIG_H)
|
gengtype-state.o build/gengtype-state.o: gengtype-state.c $(SYSTEM_H) \
|
||||||
+ $(COMPILE) $<
|
gengtype.h errors.h double-int.h version.h $(HASHTAB_H) $(OBSTACK_H) \
|
||||||
+ $(POSTCOMPILE)
|
$(XREGEX_H)
|
||||||
+
|
|
||||||
## build/version.o is compiled by the $(COMPILER_FOR_BUILD) but needs
|
|
||||||
## several C macro definitions, just like version.o
|
|
||||||
build/version.o: version.c version.h \
|
|
||||||
--
|
--
|
||||||
1.8.1.2
|
1.8.1.2
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue