diff options
author | Hongxu Jia <hongxu.jia@windriver.com> | 2014-07-29 10:02:02 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-08-02 09:26:13 +0100 |
commit | 2ca9406701e4b957c115eba37e77832252351e81 (patch) | |
tree | 23b63b09ec42967763bc237958b2d20d51dcc1d7 /meta/recipes-devtools | |
parent | 2d1660112e54653f7bb763939d0416472c49fe01 (diff) | |
download | poky-2ca9406701e4b957c115eba37e77832252351e81.tar.gz |
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>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch | 79 |
1 files changed, 42 insertions, 37 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch b/meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch index 213820a104..4c98ca273a 100644 --- a/meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch +++ b/meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch | |||
@@ -1,56 +1,61 @@ | |||
1 | gcc/Makefile.in: fix parallel building failure | 1 | gcc/Makefile.in: fix parallel building failure |
2 | 2 | ||
3 | Most C source files included config.h which was generated by a rule. | 3 | The gcc-ar.o, gcc-nm.o, gcc-ranlib.o and errors.o included |
4 | But no related prerequisites was added to the C source compiling rule. | 4 | config.h which was a generated file. But no explicity rule |
5 | There was potential building failure while makefile enabled parallel. | 5 | to clarify the dependency. There was potential building |
6 | failure while parallel make. | ||
6 | 7 | ||
7 | The C source compiling rule used suffix rule '.c.o', but the suffix | 8 | For gcc-ar.o, gcc-nm.o and gcc-ranlib.o, they were compiled from one C |
8 | rule doesn't support prerequisites. | 9 | source file gcc-ar.c, we add them to ALL_HOST_BACKEND_OBJS, so the |
9 | https://www.gnu.org/software/make/manual/html_node/Suffix-Rules.html | 10 | '$(ALL_HOST_OBJS) : | $(generated_files)' rule could work for these |
11 | objects. | ||
10 | 12 | ||
11 | We used the pattern rule '%.o : %.c' to instead, and add the config.h | 13 | For errors.o, it is part of gengtype, and the gengtype generator program |
12 | as its prerequisite | 14 | is special: Two versions are built. One is for the build machine, and one |
15 | is for the host. We refered what gengtype-parse.o did (which also is part | ||
16 | of gengtype). | ||
13 | 17 | ||
14 | We also moved the '%.o : %.c' rule down to the 'build/%.o :' rule, which | 18 | [GCC #61899] |
15 | makes '%.o : %.c' rule doesn't override 'build/%.o :'. | 19 | https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61899 |
16 | 20 | ||
17 | Upstream-Status: Pending | 21 | Upstream-Status: Send to gcc-patches@gcc.gnu.org mailing list |
18 | 22 | ||
19 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | 23 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
20 | --- | 24 | --- |
21 | gcc/Makefile.in | 12 ++++++++---- | 25 | gcc/Makefile.in | 7 ++++++- |
22 | 1 file changed, 8 insertions(+), 4 deletions(-) | 26 | 1 file changed, 6 insertions(+), 1 deletion(-) |
23 | 27 | ||
24 | diff --git a/gcc/Makefile.in b/gcc/Makefile.in | 28 | diff --git a/gcc/Makefile.in b/gcc/Makefile.in |
25 | index 6475cba..04889fe 100644 | 29 | index 6475cba..56e50bb 100644 |
26 | --- a/gcc/Makefile.in | 30 | --- a/gcc/Makefile.in |
27 | +++ b/gcc/Makefile.in | 31 | +++ b/gcc/Makefile.in |
28 | @@ -1054,10 +1054,6 @@ COMPILE = source='$<' object='$@' libtool=no \ | 32 | @@ -1481,13 +1481,16 @@ OBJS-libcommon-target = $(common_out_object_file) prefix.o params.o \ |
29 | POSTCOMPILE = | 33 | opts.o opts-common.o options.o vec.o hooks.o common/common-targhooks.o \ |
30 | endif | 34 | hash-table.o file-find.o |
31 | 35 | ||
32 | -.cc.o .c.o: | 36 | +# Objects compiled from one C source file gcc-ar.c |
33 | - $(COMPILE) $< | 37 | +OBJS-gcc-ar = gcc-ar.o gcc-nm.o gcc-ranlib.o |
34 | - $(POSTCOMPILE) | ||
35 | - | ||
36 | # | ||
37 | # Support for additional languages (other than C). | ||
38 | # C can be supported this way too (leave for later). | ||
39 | @@ -2342,6 +2338,14 @@ build/%.o : # dependencies provided by explicit rule later | ||
40 | $(COMPILER_FOR_BUILD) -c $(BUILD_COMPILERFLAGS) $(BUILD_CPPFLAGS) \ | ||
41 | -o $@ $< | ||
42 | |||
43 | +%.o: %.c $(CONFIG_H) | ||
44 | + $(COMPILE) $< | ||
45 | + $(POSTCOMPILE) | ||
46 | + | 38 | + |
47 | +%.o: %.cc $(CONFIG_H) | 39 | # This lists all host objects for the front ends. |
48 | + $(COMPILE) $< | 40 | ALL_HOST_FRONTEND_OBJS = $(foreach v,$(CONFIG_LANGUAGES),$($(v)_OBJS)) |
49 | + $(POSTCOMPILE) | 41 | |
42 | ALL_HOST_BACKEND_OBJS = $(GCC_OBJS) $(OBJS) $(OBJS-libcommon) \ | ||
43 | $(OBJS-libcommon-target) @TREEBROWSER@ main.o c-family/cppspec.o \ | ||
44 | $(COLLECT2_OBJS) $(EXTRA_GCC_OBJS) $(GCOV_OBJS) $(GCOV_DUMP_OBJS) \ | ||
45 | - lto-wrapper.o | ||
46 | + lto-wrapper.o $(OBJS-gcc-ar) | ||
47 | |||
48 | # This lists all host object files, whether they are included in this | ||
49 | # compilation or not. | ||
50 | @@ -2437,6 +2440,8 @@ gengtype-parse.o: $(CONFIG_H) | ||
51 | CFLAGS-build/gengtype-parse.o += -DGENERATOR_FILE | ||
52 | build/gengtype-parse.o: $(BCONFIG_H) | ||
53 | |||
54 | +errors.o : $(CONFIG_H) | ||
50 | + | 55 | + |
51 | ## build/version.o is compiled by the $(COMPILER_FOR_BUILD) but needs | 56 | gengtype-state.o build/gengtype-state.o: gengtype-state.c $(SYSTEM_H) \ |
52 | ## several C macro definitions, just like version.o | 57 | gengtype.h errors.h double-int.h version.h $(HASHTAB_H) $(OBSTACK_H) \ |
53 | build/version.o: version.c version.h \ | 58 | $(XREGEX_H) |
54 | -- | 59 | -- |
55 | 1.8.1.2 | 60 | 1.8.1.2 |
56 | 61 | ||