* [PATCH 1/1] gcc-4.9.inc: fix parallel building failure
2014-07-24 1:48 [PATCH 0/1] " Hongxu Jia
@ 2014-07-24 1:48 ` Hongxu Jia
2014-07-24 2:19 ` Khem Raj
0 siblings, 1 reply; 7+ messages in thread
From: Hongxu Jia @ 2014-07-24 1:48 UTC (permalink / raw)
To: openembedded-core; +Cc: saul.wold
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@windriver.com>
---
meta/recipes-devtools/gcc/gcc-4.9.inc | 1 +
...Makefile.in-fix-parallel-building-failure.patch | 56 ++++++++++++++++++++++
2 files changed, 57 insertions(+)
create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch
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@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)
+-
+ #\f
+ # 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
+
--
1.8.1.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] gcc-4.9.inc: fix parallel building failure
2014-07-24 1:48 ` [PATCH 1/1] " Hongxu Jia
@ 2014-07-24 2:19 ` Khem Raj
0 siblings, 0 replies; 7+ messages in thread
From: Khem Raj @ 2014-07-24 2:19 UTC (permalink / raw)
To: Hongxu Jia; +Cc: Saul Wold, Patches and discussions about the oe-core layer
On Wed, Jul 23, 2014 at 6:48 PM, Hongxu Jia <hongxu.jia@windriver.com> wrote:
> 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]
Please post this patch to gcc mailing list as well for feedback.
>
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
> meta/recipes-devtools/gcc/gcc-4.9.inc | 1 +
> ...Makefile.in-fix-parallel-building-failure.patch | 56 ++++++++++++++++++++++
> 2 files changed, 57 insertions(+)
> create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch
>
> 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@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
> +
> --
> 1.8.1.2
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH V2 0/1] gcc-4.9.inc: fix parallel building failure
@ 2014-07-25 10:13 Hongxu Jia
2014-07-25 10:13 ` [PATCH 1/1] " Hongxu Jia
0 siblings, 1 reply; 7+ messages in thread
From: Hongxu Jia @ 2014-07-25 10:13 UTC (permalink / raw)
To: openembedded-core; +Cc: saul.wold
Change in V2:
As the upstream of gcc suggested:
- The previous fix is too hack;
- Use '$(ALL_HOST_OBJS) : | $(generated_files)' rule to
handle the dependency.
Test Steps:
1. For reproducing the issue every time, manually modify
gcc/Makefile.in to delay the generation of config.h:
...
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index c4daf69..c502898 100644
--- gcc-4.9.0/gcc/Makefile.in
+++ gcc-4.9.0/gcc/Makefile.in
@@ -1622,9 +1622,12 @@ tm.h: cs-tm.h ; @true
tm_p.h: cs-tm_p.h ; @true
cs-config.h: Makefile
+ @echo "start to generate config.h `date`"
+ sleep 10
TARGET_CPU_DEFAULT="" \
HEADERS="$(host_xm_include_list)" DEFINES="$(host_xm_defines)" \
$(SHELL) $(srcdir)/mkconfig.sh config.h
+ @echo "config.h generated `date`"
cs-bconfig.h: Makefile
TARGET_CPU_DEFAULT="" \
...
2. bitbake gcc-cross-arm
//Hongxu
The following changes since commit 1306f263ed7b3de4e85c6dc8b377e5c05afd6bf0:
package_ipk.bbclass: Support hierarchical feed (2014-07-23 22:06:10 +0100)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib hongxu/fix-gcc
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/fix-gcc
Hongxu Jia (1):
gcc-4.9.inc: fix parallel building failure
meta/recipes-devtools/gcc/gcc-4.9.inc | 1 +
...Makefile.in-fix-parallel-building-failure.patch | 64 ++++++++++++++++++++++
2 files changed, 65 insertions(+)
create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch
--
1.8.1.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 1/1] gcc-4.9.inc: fix parallel building failure
2014-07-25 10:13 [PATCH V2 0/1] gcc-4.9.inc: fix parallel building failure Hongxu Jia
@ 2014-07-25 10:13 ` Hongxu Jia
2014-07-25 15:48 ` Saul Wold
0 siblings, 1 reply; 7+ messages in thread
From: Hongxu Jia @ 2014-07-25 10:13 UTC (permalink / raw)
To: openembedded-core; +Cc: saul.wold
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]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
meta/recipes-devtools/gcc/gcc-4.9.inc | 1 +
...Makefile.in-fix-parallel-building-failure.patch | 64 ++++++++++++++++++++++
2 files changed, 65 insertions(+)
create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch
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..6277bec
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch
@@ -0,0 +1,64 @@
+From 5a50cebd00930930e609e978331ede690f34512b Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Fri, 25 Jul 2014 14:35:17 +0800
+Subject: [PATCH] gcc/Makefile.in: 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).
+
+[GCC #61899]
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61899
+
+Upstream-Status: Send to gcc-patches@gcc.gnu.org mailing list
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gcc/Makefile.in | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index 6475cba..56e50bb 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -1481,13 +1481,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.
+ ALL_HOST_FRONTEND_OBJS = $(foreach v,$(CONFIG_LANGUAGES),$($(v)_OBJS))
+
+ ALL_HOST_BACKEND_OBJS = $(GCC_OBJS) $(OBJS) $(OBJS-libcommon) \
+ $(OBJS-libcommon-target) @TREEBROWSER@ main.o c-family/cppspec.o \
+ $(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)
++
+ gengtype-state.o build/gengtype-state.o: gengtype-state.c $(SYSTEM_H) \
+ gengtype.h errors.h double-int.h version.h $(HASHTAB_H) $(OBSTACK_H) \
+ $(XREGEX_H)
+--
+1.8.1.2
+
--
1.8.1.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] gcc-4.9.inc: fix parallel building failure
2014-07-25 10:13 ` [PATCH 1/1] " Hongxu Jia
@ 2014-07-25 15:48 ` Saul Wold
2014-07-29 1:14 ` Hongxu Jia
0 siblings, 1 reply; 7+ messages in thread
From: Saul Wold @ 2014-07-25 15:48 UTC (permalink / raw)
To: Hongxu Jia, openembedded-core
Can you please rebase this against master as we have already merged the
first version.
Thanks
Sau!
On 07/25/2014 03:13 AM, Hongxu Jia wrote:
> 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]
>
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
> meta/recipes-devtools/gcc/gcc-4.9.inc | 1 +
> ...Makefile.in-fix-parallel-building-failure.patch | 64 ++++++++++++++++++++++
> 2 files changed, 65 insertions(+)
> create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch
>
> 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..6277bec
> --- /dev/null
> +++ b/meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch
> @@ -0,0 +1,64 @@
> +From 5a50cebd00930930e609e978331ede690f34512b Mon Sep 17 00:00:00 2001
> +From: Hongxu Jia <hongxu.jia@windriver.com>
> +Date: Fri, 25 Jul 2014 14:35:17 +0800
> +Subject: [PATCH] gcc/Makefile.in: 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).
> +
> +[GCC #61899]
> +https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61899
> +
> +Upstream-Status: Send to gcc-patches@gcc.gnu.org mailing list
> +
> +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> +---
> + gcc/Makefile.in | 7 ++++++-
> + 1 file changed, 6 insertions(+), 1 deletion(-)
> +
> +diff --git a/gcc/Makefile.in b/gcc/Makefile.in
> +index 6475cba..56e50bb 100644
> +--- a/gcc/Makefile.in
> ++++ b/gcc/Makefile.in
> +@@ -1481,13 +1481,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.
> + ALL_HOST_FRONTEND_OBJS = $(foreach v,$(CONFIG_LANGUAGES),$($(v)_OBJS))
> +
> + ALL_HOST_BACKEND_OBJS = $(GCC_OBJS) $(OBJS) $(OBJS-libcommon) \
> + $(OBJS-libcommon-target) @TREEBROWSER@ main.o c-family/cppspec.o \
> + $(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)
> ++
> + gengtype-state.o build/gengtype-state.o: gengtype-state.c $(SYSTEM_H) \
> + gengtype.h errors.h double-int.h version.h $(HASHTAB_H) $(OBSTACK_H) \
> + $(XREGEX_H)
> +--
> +1.8.1.2
> +
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/1] gcc-4.9.inc: fix parallel building failure
2014-07-25 15:48 ` Saul Wold
@ 2014-07-29 1:14 ` Hongxu Jia
0 siblings, 0 replies; 7+ messages in thread
From: Hongxu Jia @ 2014-07-29 1:14 UTC (permalink / raw)
To: Saul Wold, openembedded-core
On 07/25/2014 11:48 PM, Saul Wold wrote:
>
>
> Can you please rebase this against master as we have already merged
> the first version.
>
No problem, I am working on it
//Hongxu
> Thanks
> Sau!
>
>
> On 07/25/2014 03:13 AM, Hongxu Jia wrote:
>> 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]
>>
>> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
>> ---
>> meta/recipes-devtools/gcc/gcc-4.9.inc | 1 +
>> ...Makefile.in-fix-parallel-building-failure.patch | 64
>> ++++++++++++++++++++++
>> 2 files changed, 65 insertions(+)
>> create mode 100644
>> meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch
>>
>> 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..6277bec
>> --- /dev/null
>> +++
>> b/meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch
>> @@ -0,0 +1,64 @@
>> +From 5a50cebd00930930e609e978331ede690f34512b Mon Sep 17 00:00:00 2001
>> +From: Hongxu Jia <hongxu.jia@windriver.com>
>> +Date: Fri, 25 Jul 2014 14:35:17 +0800
>> +Subject: [PATCH] gcc/Makefile.in: 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).
>> +
>> +[GCC #61899]
>> +https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61899
>> +
>> +Upstream-Status: Send to gcc-patches@gcc.gnu.org mailing list
>> +
>> +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
>> +---
>> + gcc/Makefile.in | 7 ++++++-
>> + 1 file changed, 6 insertions(+), 1 deletion(-)
>> +
>> +diff --git a/gcc/Makefile.in b/gcc/Makefile.in
>> +index 6475cba..56e50bb 100644
>> +--- a/gcc/Makefile.in
>> ++++ b/gcc/Makefile.in
>> +@@ -1481,13 +1481,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.
>> + ALL_HOST_FRONTEND_OBJS = $(foreach v,$(CONFIG_LANGUAGES),$($(v)_OBJS))
>> +
>> + ALL_HOST_BACKEND_OBJS = $(GCC_OBJS) $(OBJS) $(OBJS-libcommon) \
>> + $(OBJS-libcommon-target) @TREEBROWSER@ main.o c-family/cppspec.o \
>> + $(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)
>> ++
>> + gengtype-state.o build/gengtype-state.o: gengtype-state.c
>> $(SYSTEM_H) \
>> + gengtype.h errors.h double-int.h version.h $(HASHTAB_H)
>> $(OBSTACK_H) \
>> + $(XREGEX_H)
>> +--
>> +1.8.1.2
>> +
>>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/1] gcc-4.9.inc: fix parallel building failure
2014-07-29 2:02 [PATCH V3 0/1] " Hongxu Jia
@ 2014-07-29 2:02 ` Hongxu Jia
0 siblings, 0 replies; 7+ messages in thread
From: Hongxu Jia @ 2014-07-29 2:02 UTC (permalink / raw)
To: openembedded-core; +Cc: saul.wold
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]
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
...Makefile.in-fix-parallel-building-failure.patch | 79 ++++++++++++----------
1 file 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 213820a..4c98ca2 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 @@
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 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.
-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
+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.
-We used the pattern rule '%.o : %.c' to instead, and add the config.h
-as its prerequisite
+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).
-We also moved the '%.o : %.c' rule down to the 'build/%.o :' rule, which
-makes '%.o : %.c' rule doesn't override 'build/%.o :'.
+[GCC #61899]
+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>
---
- gcc/Makefile.in | 12 ++++++++----
- 1 file changed, 8 insertions(+), 4 deletions(-)
+ gcc/Makefile.in | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
-index 6475cba..04889fe 100644
+index 6475cba..56e50bb 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
-@@ -1054,10 +1054,6 @@ COMPILE = source='$<' object='$@' libtool=no \
- POSTCOMPILE =
- endif
+@@ -1481,13 +1481,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
--.cc.o .c.o:
-- $(COMPILE) $<
-- $(POSTCOMPILE)
--
- #\f
- # 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)
++# Objects compiled from one C source file gcc-ar.c
++OBJS-gcc-ar = gcc-ar.o gcc-nm.o gcc-ranlib.o
+
-+%.o: %.cc $(CONFIG_H)
-+ $(COMPILE) $<
-+ $(POSTCOMPILE)
+ # This lists all host objects for the front ends.
+ ALL_HOST_FRONTEND_OBJS = $(foreach v,$(CONFIG_LANGUAGES),$($(v)_OBJS))
+
+ ALL_HOST_BACKEND_OBJS = $(GCC_OBJS) $(OBJS) $(OBJS-libcommon) \
+ $(OBJS-libcommon-target) @TREEBROWSER@ main.o c-family/cppspec.o \
+ $(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)
+
- ## 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 \
+ gengtype-state.o build/gengtype-state.o: gengtype-state.c $(SYSTEM_H) \
+ gengtype.h errors.h double-int.h version.h $(HASHTAB_H) $(OBSTACK_H) \
+ $(XREGEX_H)
--
1.8.1.2
--
1.8.1.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-07-29 2:02 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-25 10:13 [PATCH V2 0/1] gcc-4.9.inc: fix parallel building failure Hongxu Jia
2014-07-25 10:13 ` [PATCH 1/1] " Hongxu Jia
2014-07-25 15:48 ` Saul Wold
2014-07-29 1:14 ` Hongxu Jia
-- strict thread matches above, loose matches on Subject: below --
2014-07-29 2:02 [PATCH V3 0/1] " Hongxu Jia
2014-07-29 2:02 ` [PATCH 1/1] " Hongxu Jia
2014-07-24 1:48 [PATCH 0/1] " Hongxu Jia
2014-07-24 1:48 ` [PATCH 1/1] " Hongxu Jia
2014-07-24 2:19 ` Khem Raj
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox