[oe-commits] Hongxu Jia : gcc-4.9.inc: fix parallel building failure

git at git.openembedded.org git at git.openembedded.org
Fri Jul 25 14:34:32 UTC 2014


Module: openembedded-core.git
Branch: master
Commit: 86c2483f0fe05fb763d280ae22d70e54cb4bb0bc
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=86c2483f0fe05fb763d280ae22d70e54cb4bb0bc

Author: Hongxu Jia <hongxu.jia at windriver.com>
Date:   Thu Jul 24 09:48:59 2014 +0800

gcc-4.9.inc: fix parallel building failure

In subdir 'gcc', Most C source files included config.h which was
generated by a rule. But no related prerequisites was added to
the C source compiling rule. There was potential building failure
while makefile enabled parallel.

The C source compiling rule used suffix rule '.c.o', but the suffix
rule doesn't support prerequisites.
https://www.gnu.org/software/make/manual/html_node/Suffix-Rules.html

We used the pattern rule '%.o : %.c' to instead, and add the config.h
as its prerequisite

We also moved the '%.o : %.c' rule down to the 'build/%.o :' rule, which
makes '%.o : %.c' rule doesn't override 'build/%.o :'.

[YOCTO #6568]

Signed-off-by: Hongxu Jia <hongxu.jia at windriver.com>
Signed-off-by: Saul Wold <sgw at linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/recipes-devtools/gcc/gcc-4.9.inc              |  1 +
 ...Makefile.in-fix-parallel-building-failure.patch | 56 ++++++++++++++++++++++
 2 files changed, 57 insertions(+)

diff --git a/meta/recipes-devtools/gcc/gcc-4.9.inc b/meta/recipes-devtools/gcc/gcc-4.9.inc
index cbf1355..10bd5d5 100644
--- a/meta/recipes-devtools/gcc/gcc-4.9.inc
+++ b/meta/recipes-devtools/gcc/gcc-4.9.inc
@@ -67,6 +67,7 @@ SRC_URI = "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \
            file://0051-eabispe.patch \
            file://0052-Fix-GCC-targeting-E500-SPE-errors-with-the-_Decimal64-type.patch \
            file://0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch \
+           file://0054-gcc-Makefile.in-fix-parallel-building-failure.patch \
 	  "
 SRC_URI[md5sum] = "9709b49ae0e904cbb0a6a1b62853b556"
 SRC_URI[sha256sum] = "b9b047a97bade9c1c89970bc8e211ff57b7b8998a1730a80a653d329f8ed1257"
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
new file mode 100644
index 0000000..213820a
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch
@@ -0,0 +1,56 @@
+gcc/Makefile.in: fix parallel building failure
+
+Most C source files included config.h which was generated by a rule.
+But no related prerequisites was added to the C source compiling rule.
+There was potential building failure while makefile enabled parallel.
+
+The C source compiling rule used suffix rule '.c.o', but the suffix
+rule doesn't support prerequisites.
+https://www.gnu.org/software/make/manual/html_node/Suffix-Rules.html
+
+We used the pattern rule '%.o : %.c' to instead, and add the config.h
+as its prerequisite
+
+We also moved the '%.o : %.c' rule down to the 'build/%.o :' rule, which
+makes '%.o : %.c' rule doesn't override 'build/%.o :'.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia at windriver.com>
+---
+ gcc/Makefile.in | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index 6475cba..04889fe 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -1054,10 +1054,6 @@ COMPILE = source='$<' object='$@' libtool=no \
+ POSTCOMPILE =
+ endif
+ 
+-.cc.o .c.o:
+-	$(COMPILE) $<
+-	$(POSTCOMPILE)
+-
+ #
+ # 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)
++	$(COMPILE) $<
++	$(POSTCOMPILE)
++
++%.o: %.cc $(CONFIG_H)
++	$(COMPILE) $<
++	$(POSTCOMPILE)
++
+ ## 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
+



More information about the Openembedded-commits mailing list