summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-10-09 20:37:49 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-10-14 16:55:22 +0100
commit1960f0068410ca62b27887f5f2607a80dba596b9 (patch)
tree144009b8ed1e6216e3ba38cd256fae8426da5b54 /meta/recipes-devtools
parent0314b910e9c60f50acb62974a8b13c174fc9877b (diff)
downloadpoky-1960f0068410ca62b27887f5f2607a80dba596b9.tar.gz
gcc: Fix strange C++ repo issues
(From OE-Core rev: 9f6c4edf40963d1f3fb9f7e2d2b7a866aa1afe57) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.8.inc1
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.8/0047-repomembug.patch53
2 files changed, 54 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.8.inc b/meta/recipes-devtools/gcc/gcc-4.8.inc
index 4af98f8fee..8d50bf79d0 100644
--- a/meta/recipes-devtools/gcc/gcc-4.8.inc
+++ b/meta/recipes-devtools/gcc/gcc-4.8.inc
@@ -76,6 +76,7 @@ SRC_URI = "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \
76 file://0044-gengtypes.patch \ 76 file://0044-gengtypes.patch \
77 file://0045-gcc-4.8-PR57717-PowerPC-E500v2.patch \ 77 file://0045-gcc-4.8-PR57717-PowerPC-E500v2.patch \
78 file://0046-libatomic-deptracking.patch \ 78 file://0046-libatomic-deptracking.patch \
79 file://0047-repomembug.patch \
79 " 80 "
80SRC_URI[md5sum] = "3b2386c114cd74185aa3754b58a79304" 81SRC_URI[md5sum] = "3b2386c114cd74185aa3754b58a79304"
81SRC_URI[sha256sum] = "545b44be3ad9f2c4e90e6880f5c9d4f0a8f0e5f67e1ffb0d45da9fa01bb05813" 82SRC_URI[sha256sum] = "545b44be3ad9f2c4e90e6880f5c9d4f0a8f0e5f67e1ffb0d45da9fa01bb05813"
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0047-repomembug.patch b/meta/recipes-devtools/gcc/gcc-4.8/0047-repomembug.patch
new file mode 100644
index 0000000000..868a4f3a51
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0047-repomembug.patch
@@ -0,0 +1,53 @@
1When compiling a project using -frepo, .rpo files are written alongside
2the .o file, the symbols either have O or C against them. During final linking,
3the objects can be recompiled with some of the entries tweaked/chosen by the
4tlink.c code (visible with TLINK_VERBOSE=3), it does this by changing O -> C
5in the .rpo files.
6
7My tests showed that init_repo (cp/repo.c) was correctly calling
8IDENTIFIER_REPO_CHOSEN against the right identifers and setting the
9chosen bit.
10
11By the time finish_repo() or emit_repo_p() were called, the pointer returned
12by get_identifier() for the symbol marked during init_repo had changed and
13the chosen bit was no longer set. This lead to linking bugs like:
14
15collect: relinking
16collect2: error: '_ZNK6sudoku5ClearINS_8SequenceEEclERS1_' was assigned to 'board.rpo', but was not defined during recompilation, or vice versa
17
18The problem is that the garbage collection is getting called before
19finish_repo() is called and ggc_protect_identifiers is set to false
20so the identifiers are not preserved. They are recreated but the
21chosen bits get wiped out which is why the pointer changes and the
22chosen bit is not set.
23
24The fix is to change ggc_protect_identifiers *after* the finish_repo
25calls are made.
26
27Reproduction is tricky since you need to trigger the garbage collector at
28just the right moment.
29
30RP 2013/10/9
31
32[YOCTO #5133]
33
34Upstream-State: Pending
35
36Index: gcc-4.8.1/gcc/toplev.c
37===================================================================
38--- gcc-4.8.1.orig/gcc/toplev.c 2013-03-28 08:29:51.000000000 +0000
39+++ gcc-4.8.1/gcc/toplev.c 2013-10-09 20:27:17.089228023 +0000
40@@ -551,11 +551,11 @@
41 if (flag_syntax_only || flag_wpa)
42 return;
43
44- ggc_protect_identifiers = false;
45-
46 /* This must also call finalize_compilation_unit. */
47 lang_hooks.decls.final_write_globals ();
48
49+ ggc_protect_identifiers = false;
50+
51 if (seen_error ())
52 return;
53