On Wed, Nov 19, 2025 at 9:20 AM Gyorgy Sarvari <[email protected]>
wrote:
> Hmm, I just noticed that this flag wasn't omitted accidentally at all,
> but because clang doesn't support it.
>
> Please ignore this patch, will try to come up with some conditional
> patch or something like that.
>
Right, the intention was to keep the DEBUG_PREFIX_MAP to be generic
and I was hoping that packages won't need -fcanon-prefix-map but that's
not the case. In any case I think we now have toolchain classes and these
options are compiler specific so we could either move the whole
assignment out of bitbake.conf and into toolchain classes
or define addon variable in gcc.bbclass
DEBUG_PREFIX_MAP_EXTRA = "-fcanon-prefix-map"
and prepend it to DEBUG_PREFIX_MAP in bitbake.conf
That will allow it to be overridden cleanly in recipes if needed.
Third option is to keep it as such and add
DEBUG_PREFIX_MAP =+ "-fcanon-prefix-map" meta/classes/toolchain/gcc.bbclass
also keep in mind that this option is only available in gcc-13+
so DEBUG_PREFIX_MAP if used on native recipes might fail for hosts with
gcc < 13
>
> On 11/19/25 11:19, Gyorgy Sarvari wrote:
> > When the debug-prefix-map and macro-prefix-map compiler flags
> > were change to file-prefix-map[1] the -fcanon-prefix-map
> > flag was removed, most likely accidentally.
> >
> > Due to this the file paths were not canonicalized before
> > substituting them, so they did not always match the corresponding keys.
> >
> > E.g. relative pathes were not converted to absolute ones:
> > ../../sources/foo.cpp doesn't match ${S}/foo.cpp, and due to
> > this some debug sources were missed.
> >
> > This patch adds back the -fcanon-prefix-map flag.
> >
> > [1]:
> https://git.openembedded.org/openembedded-core/commit/?id=ff73fa7ef7666a6dbe34f15515bc3ab6e574c5b0
> >
> > Cc: Khem Raj <[email protected]>
> > Signed-off-by: Gyorgy Sarvari <[email protected]>
> > ---
> > meta/conf/bitbake.conf | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> > index 52ceb76bbb..f789b8e326 100644
> > --- a/meta/conf/bitbake.conf
> > +++ b/meta/conf/bitbake.conf
> > @@ -650,7 +650,7 @@ EXTRA_OEMAKE:prepend:task-install =
> "${PARALLEL_MAKEINST} "
> > ##################################################################
> > TARGET_DBGSRC_DIR ?= "/usr/src/debug/${PN}/${PV}"
> > # Beware: applied last to first
> > -DEBUG_PREFIX_MAP ?= "\
> > +DEBUG_PREFIX_MAP ?= "-fcanon-prefix-map \
> > -ffile-prefix-map=${S}=${TARGET_DBGSRC_DIR} \
> > -ffile-prefix-map=${B}=${TARGET_DBGSRC_DIR} \
> > -ffile-prefix-map=${STAGING_DIR_HOST}= \
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#226574):
https://lists.openembedded.org/g/openembedded-core/message/226574
Mute This Topic: https://lists.openembedded.org/mt/116371356/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-