From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Phil Blundell <pb@pbcl.net>
Cc: openembedded-core <openembedded-core@lists.openembedded.org>
Subject: Re: gcc: Fix strange C++ repo issues
Date: Thu, 10 Oct 2013 12:12:49 +0100 [thread overview]
Message-ID: <1381403569.29912.83.camel@ted> (raw)
In-Reply-To: <1381402804.11000.61.camel@phil-desktop.brightsign>
On Thu, 2013-10-10 at 12:00 +0100, Phil Blundell wrote:
> On Wed, 2013-10-09 at 23:11 +0100, Richard Purdie wrote:
> > +++ b/meta/recipes-devtools/gcc/gcc-4.8/0047-repomembug.patch
> > @@ -0,0 +1,46 @@
> > +When compiling a project using -frepo, .rpo files are written alongside
> > +the .o file, the symbols either have O or C against them. During final linking,
> > +the objects can be recompiled with some of the entries tweaked/chosen by the
> > +tlink.c code (visible with TLINK_VERBOSE=3).
> > +
> > +My tests showed that init_repo (cp/repo.c) was correcting calling
> > +IDENTIFIER_REPO_CHOSEN against the right identifers.
> > +
> > +By the time finish_repo() or emit_repo_p() were called, the pointer returned
> > +by get_identifier() for the symbol marked during init_repo had changed and
> > +the chosen bit was no longer set. This lead to linking bugs like:
> > +
> > +collect: relinking
> > +collect2: error: '_ZNK6sudoku5ClearINS_8SequenceEEclERS1_' was assigned to 'board.rpo', but was not defined during recompilation, or vice versa
> > +
> > +The problem is that the garbage collection is getting called before
> > +finish_repo() is called and ggc_protect_identifiers is set to false
> > +so the identifiers are not preserved. They are recreated but the
> > +chosen bits get wiped out.
> > +
> > +The fix is to change ggc_protect_identifiers *after* the finish_repo
> > +calls are made.
> > +
> > +Reproduction is tricky since you need to trigger the garbage collector at
> > +just the right moment.
> > +
> > +RP 2013/10/9
> > +
> > +Index: gcc-4.8.1/gcc/toplev.c
>
> This patch header seems to lack an Upstream-Status.
Thanks, I've already fixed that in the version in the master-next
branch, along with tweaking the explanation a little more.
Cheers,
Richard
prev parent reply other threads:[~2013-10-10 11:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-09 22:11 gcc: Fix strange C++ repo issues Richard Purdie
2013-10-10 6:21 ` Khem Raj
2013-10-10 11:00 ` Phil Blundell
2013-10-10 11:12 ` Richard Purdie [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1381403569.29912.83.camel@ted \
--to=richard.purdie@linuxfoundation.org \
--cc=openembedded-core@lists.openembedded.org \
--cc=pb@pbcl.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox