Hello Richard,
Thanks for your answer, I didn't think about poking parent directory issue
but you're right. What about setting B to ${EXTERNALSRC}/${PN}-build
instead ?
The important thing here (from what I understood) is to avoid having too
much relative path (that is to say a number of '../' greater than the
number of directory required to reach BDIR starting from EXTERNALSRC.
On Mon, 28 Jun 2021 at 00:04, Richard Purdie <
[email protected]> wrote:
> On Wed, 2021-06-23 at 15:06 +0200, Frederic Martinsons wrote:
> > When using external source manager (devtool), the debug symbol generated
> > by the compilation doesn't point to the right directory.
> > This is normally handled by gcc options that are defined
> > in DEBUG_PREFIX_MAP in conf/bitbake.conf.
> >
> > But the path in it are hardcoded and point to WORKDIR which is
> > not overloaded by devtool.
> >
> > This patch takes the parent directory of external source directory
> > and prepend correct path to DEBUG_PREFIX_MAP.
> >
> > Moreover, to avoid wrong path resolution during dwarfsrcfiles step
> > in splitdebuginfo, it make B variable point to the same
> > structure as EXTERNALSRC (if EXTERNALSRC_BUILD is not defined).
> >
> > Signed-off-by: Frederic Martinsons <[email protected]>
> > ---
> > meta/classes/externalsrc.bbclass | 14 +++++++++++++-
> > 1 file changed, 13 insertions(+), 1 deletion(-)
> >
> > diff --git a/meta/classes/externalsrc.bbclass
> b/meta/classes/externalsrc.bbclass
> > index 3d6b80bee2..de5ef714b4 100644
> > --- a/meta/classes/externalsrc.bbclass
> > +++ b/meta/classes/externalsrc.bbclass
> > @@ -53,14 +53,26 @@ python () {
> > d.setVar('BB_DONT_CACHE', '1')
> >
> >
> > if externalsrc:
> > + import os
> > import oe.recipeutils
> > import oe.path
> >
> >
> > + pn = d.getVar('PN')
> > + # taken from bitbake.conf
> > + debugsrcdir = "/usr/src/debug/%s/%s%s-%s" % (pn,
> d.getVar('EXTENDPE'), d.getVar('PV'), d.getVar('PR'))
> > + externalsrc_parentdir = os.path.dirname(externalsrc)
> > +
> > + debug_prefix_map_ext = "-fmacro-prefix-map=%s=%s " %
> (externalsrc_parentdir, debugsrcdir)
> > + macro_prefix_map_ext = "-fdebug-prefix-map=%s=%s " %
> (externalsrc_parentdir, debugsrcdir)
> > + d.prependVar('DEBUG_PREFIX_MAP', debug_prefix_map_ext)
> > + d.prependVar('DEBUG_PREFIX_MAP', macro_prefix_map_ext)
> > +
> > d.setVar('S', externalsrc)
> > if externalsrcbuild:
> > d.setVar('B', externalsrcbuild)
> > else:
> > - d.setVar('B', '${WORKDIR}/${BPN}-${PV}/')
> > + builddir = os.path.join(externalsrc_parentdir, "%s-build" %
> pn)
> > + d.setVar('B', builddir)
> >
>
> I'm ok with adding some prefix mappings however the commit message doesn't
> really
> make it clear that you're actually inventing a new build directory here
> too. We
> can't just poke around the parent directory of the externalsrc like this
> since we
> have no idea what that directory is and we've not been asked to "touch" it.
>
> Cheers,
>
> Richard
>
>
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#153336):
https://lists.openembedded.org/g/openembedded-core/message/153336
Mute This Topic: https://lists.openembedded.org/mt/83737158/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-