All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bitbake.conf: Add -fcanon-prefix-map to DEBUG_PREFIX_MAP
@ 2023-04-28  3:20 Khem Raj
  2023-04-28 11:17 ` [OE-core] " Martin Jansa
  2023-05-27  5:27 ` Jacob Kroon
  0 siblings, 2 replies; 6+ messages in thread
From: Khem Raj @ 2023-04-28  3:20 UTC (permalink / raw)
  To: openembedded-core; +Cc: Khem Raj

This should help canonicalize the relative paths and symlinks
during cross compile, -fcanon-prefix-map is newly added in gcc-13+ [1]

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108464#c8
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/conf/bitbake.conf | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index d94ffe1df9..453bef37a9 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -644,7 +644,8 @@ EXTRA_OEMAKE:prepend:task-install = "${PARALLEL_MAKEINST} "
 # Optimization flags.
 ##################################################################
 # Beware: applied last to first
-DEBUG_PREFIX_MAP ?= "-fmacro-prefix-map=${S}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
+DEBUG_PREFIX_MAP ?= "-fcanon-prefix-map \
+ -fmacro-prefix-map=${S}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
  -fdebug-prefix-map=${S}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
  -fmacro-prefix-map=${B}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
  -fdebug-prefix-map=${B}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
-- 
2.40.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [OE-core] [PATCH] bitbake.conf: Add -fcanon-prefix-map to DEBUG_PREFIX_MAP
  2023-04-28  3:20 [PATCH] bitbake.conf: Add -fcanon-prefix-map to DEBUG_PREFIX_MAP Khem Raj
@ 2023-04-28 11:17 ` Martin Jansa
  2023-04-28 13:44   ` Khem Raj
  2023-05-27  5:27 ` Jacob Kroon
  1 sibling, 1 reply; 6+ messages in thread
From: Martin Jansa @ 2023-04-28 11:17 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 1884 bytes --]

Do you already have a follow-up change for meta-clang which seems to be
broken by this change?

clang-16: error: unknown argument: '-fcanon-prefix-map'

On Fri, Apr 28, 2023 at 5:20 AM Khem Raj <raj.khem@gmail.com> wrote:

> This should help canonicalize the relative paths and symlinks
> during cross compile, -fcanon-prefix-map is newly added in gcc-13+ [1]
>
> [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108464#c8
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/conf/bitbake.conf | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index d94ffe1df9..453bef37a9 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -644,7 +644,8 @@ EXTRA_OEMAKE:prepend:task-install =
> "${PARALLEL_MAKEINST} "
>  # Optimization flags.
>  ##################################################################
>  # Beware: applied last to first
> -DEBUG_PREFIX_MAP ?=
> "-fmacro-prefix-map=${S}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
> +DEBUG_PREFIX_MAP ?= "-fcanon-prefix-map \
> + -fmacro-prefix-map=${S}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
>   -fdebug-prefix-map=${S}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
>   -fmacro-prefix-map=${B}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
>   -fdebug-prefix-map=${B}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
> --
> 2.40.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#180504):
> https://lists.openembedded.org/g/openembedded-core/message/180504
> Mute This Topic: https://lists.openembedded.org/mt/98551742/3617156
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> Martin.Jansa@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

[-- Attachment #2: Type: text/html, Size: 2915 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OE-core] [PATCH] bitbake.conf: Add -fcanon-prefix-map to DEBUG_PREFIX_MAP
  2023-04-28 11:17 ` [OE-core] " Martin Jansa
@ 2023-04-28 13:44   ` Khem Raj
  0 siblings, 0 replies; 6+ messages in thread
From: Khem Raj @ 2023-04-28 13:44 UTC (permalink / raw)
  To: Martin Jansa; +Cc: openembedded-core

On Fri, Apr 28, 2023 at 4:18 AM Martin Jansa <Martin.Jansa@gmail.com> wrote:
>
> Do you already have a follow-up change for meta-clang which seems to be broken by this change?
>
> clang-16: error: unknown argument: '-fcanon-prefix-map'
>
yes
https://github.com/kraj/meta-clang/pull/782

> On Fri, Apr 28, 2023 at 5:20 AM Khem Raj <raj.khem@gmail.com> wrote:
>>
>> This should help canonicalize the relative paths and symlinks
>> during cross compile, -fcanon-prefix-map is newly added in gcc-13+ [1]
>>
>> [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108464#c8
>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> ---
>>  meta/conf/bitbake.conf | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
>> index d94ffe1df9..453bef37a9 100644
>> --- a/meta/conf/bitbake.conf
>> +++ b/meta/conf/bitbake.conf
>> @@ -644,7 +644,8 @@ EXTRA_OEMAKE:prepend:task-install = "${PARALLEL_MAKEINST} "
>>  # Optimization flags.
>>  ##################################################################
>>  # Beware: applied last to first
>> -DEBUG_PREFIX_MAP ?= "-fmacro-prefix-map=${S}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
>> +DEBUG_PREFIX_MAP ?= "-fcanon-prefix-map \
>> + -fmacro-prefix-map=${S}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
>>   -fdebug-prefix-map=${S}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
>>   -fmacro-prefix-map=${B}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
>>   -fdebug-prefix-map=${B}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
>> --
>> 2.40.1
>>
>>
>>
>>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#180526): https://lists.openembedded.org/g/openembedded-core/message/180526
> Mute This Topic: https://lists.openembedded.org/mt/98551742/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OE-core] [PATCH] bitbake.conf: Add -fcanon-prefix-map to DEBUG_PREFIX_MAP
  2023-04-28  3:20 [PATCH] bitbake.conf: Add -fcanon-prefix-map to DEBUG_PREFIX_MAP Khem Raj
  2023-04-28 11:17 ` [OE-core] " Martin Jansa
@ 2023-05-27  5:27 ` Jacob Kroon
  2023-05-27  7:50   ` Khem Raj
  2023-05-27  8:16   ` Richard Purdie
  1 sibling, 2 replies; 6+ messages in thread
From: Jacob Kroon @ 2023-05-27  5:27 UTC (permalink / raw)
  To: Khem Raj, openembedded-core

On 4/28/23 05:20, Khem Raj wrote:
> This should help canonicalize the relative paths and symlinks
> during cross compile, -fcanon-prefix-map is newly added in gcc-13+ [1]
> 
> [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108464#c8
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>   meta/conf/bitbake.conf | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index d94ffe1df9..453bef37a9 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -644,7 +644,8 @@ EXTRA_OEMAKE:prepend:task-install = "${PARALLEL_MAKEINST} "
>   # Optimization flags.
>   ##################################################################
>   # Beware: applied last to first
> -DEBUG_PREFIX_MAP ?= "-fmacro-prefix-map=${S}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
> +DEBUG_PREFIX_MAP ?= "-fcanon-prefix-map \
> + -fmacro-prefix-map=${S}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
>    -fdebug-prefix-map=${S}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
>    -fmacro-prefix-map=${B}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
>    -fdebug-prefix-map=${B}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
> 

Maybe we can take the opportunity to also cleanup DEBUG_PREFIX_MAP by 
replacing debug/macro/canon with a single -ffile-prefix-map ?

 From the gcc 13.1.1 manpage:

> -ffile-prefix-map=old=new
>            When compiling files residing in directory old, record any references to them in the result of the
>            compilation as if the files resided in directory new instead.  Specifying this option is equivalent to
>            specifying all the individual -f*-prefix-map options.  This can be used to make reproducible builds
>            that are location independent.  Directories referenced by directives are not affected by these options.
>            See also -fmacro-prefix-map, -fdebug-prefix-map, -fprofile-prefix-map and -fcanon-prefix-map.

Jacob


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OE-core] [PATCH] bitbake.conf: Add -fcanon-prefix-map to DEBUG_PREFIX_MAP
  2023-05-27  5:27 ` Jacob Kroon
@ 2023-05-27  7:50   ` Khem Raj
  2023-05-27  8:16   ` Richard Purdie
  1 sibling, 0 replies; 6+ messages in thread
From: Khem Raj @ 2023-05-27  7:50 UTC (permalink / raw)
  To: Jacob Kroon; +Cc: openembedded-core

On Fri, May 26, 2023 at 10:27 PM Jacob Kroon <jacob.kroon@gmail.com> wrote:
>
> On 4/28/23 05:20, Khem Raj wrote:
> > This should help canonicalize the relative paths and symlinks
> > during cross compile, -fcanon-prefix-map is newly added in gcc-13+ [1]
> >
> > [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108464#c8
> > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > ---
> >   meta/conf/bitbake.conf | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> > index d94ffe1df9..453bef37a9 100644
> > --- a/meta/conf/bitbake.conf
> > +++ b/meta/conf/bitbake.conf
> > @@ -644,7 +644,8 @@ EXTRA_OEMAKE:prepend:task-install = "${PARALLEL_MAKEINST} "
> >   # Optimization flags.
> >   ##################################################################
> >   # Beware: applied last to first
> > -DEBUG_PREFIX_MAP ?= "-fmacro-prefix-map=${S}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
> > +DEBUG_PREFIX_MAP ?= "-fcanon-prefix-map \
> > + -fmacro-prefix-map=${S}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
> >    -fdebug-prefix-map=${S}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
> >    -fmacro-prefix-map=${B}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
> >    -fdebug-prefix-map=${B}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
> >
>
> Maybe we can take the opportunity to also cleanup DEBUG_PREFIX_MAP by
> replacing debug/macro/canon with a single -ffile-prefix-map ?

Yes, somewhere I had such a patch and I dropped it from my queue IIRC
it was for clang alone maybe
but it is not a simple replacement, we have to adjust
some recipes to this option,

>
>  From the gcc 13.1.1 manpage:
>
> > -ffile-prefix-map=old=new
> >            When compiling files residing in directory old, record any references to them in the result of the
> >            compilation as if the files resided in directory new instead.  Specifying this option is equivalent to
> >            specifying all the individual -f*-prefix-map options.  This can be used to make reproducible builds
> >            that are location independent.  Directories referenced by directives are not affected by these options.
> >            See also -fmacro-prefix-map, -fdebug-prefix-map, -fprofile-prefix-map and -fcanon-prefix-map.
>
> Jacob


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OE-core] [PATCH] bitbake.conf: Add -fcanon-prefix-map to DEBUG_PREFIX_MAP
  2023-05-27  5:27 ` Jacob Kroon
  2023-05-27  7:50   ` Khem Raj
@ 2023-05-27  8:16   ` Richard Purdie
  1 sibling, 0 replies; 6+ messages in thread
From: Richard Purdie @ 2023-05-27  8:16 UTC (permalink / raw)
  To: Jacob Kroon, Khem Raj, openembedded-core

On Sat, 2023-05-27 at 07:27 +0200, Jacob Kroon wrote:
> On 4/28/23 05:20, Khem Raj wrote:
> > This should help canonicalize the relative paths and symlinks
> > during cross compile, -fcanon-prefix-map is newly added in gcc-13+ [1]
> > 
> > [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108464#c8
> > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > ---
> >   meta/conf/bitbake.conf | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> > index d94ffe1df9..453bef37a9 100644
> > --- a/meta/conf/bitbake.conf
> > +++ b/meta/conf/bitbake.conf
> > @@ -644,7 +644,8 @@ EXTRA_OEMAKE:prepend:task-install = "${PARALLEL_MAKEINST} "
> >   # Optimization flags.
> >   ##################################################################
> >   # Beware: applied last to first
> > -DEBUG_PREFIX_MAP ?= "-fmacro-prefix-map=${S}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
> > +DEBUG_PREFIX_MAP ?= "-fcanon-prefix-map \
> > + -fmacro-prefix-map=${S}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
> >    -fdebug-prefix-map=${S}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
> >    -fmacro-prefix-map=${B}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
> >    -fdebug-prefix-map=${B}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \
> > 
> 
> Maybe we can take the opportunity to also cleanup DEBUG_PREFIX_MAP by 
> replacing debug/macro/canon with a single -ffile-prefix-map ?
> 
>  From the gcc 13.1.1 manpage:
> 
> > -ffile-prefix-map=old=new
> >            When compiling files residing in directory old, record any references to them in the result of the
> >            compilation as if the files resided in directory new instead.  Specifying this option is equivalent to
> >            specifying all the individual -f*-prefix-map options.  This can be used to make reproducible builds
> >            that are location independent.  Directories referenced by directives are not affected by these options.
> >            See also -fmacro-prefix-map, -fdebug-prefix-map, -fprofile-prefix-map and -fcanon-prefix-map.
> 

Sadly not, I'd wondered about this too and tried it fairly recently.

From memory, the issue is that there are tools which only accept one of
these (binutils as maybe?) and if we switch, we lose some set of the
prefix mapping which causes build reproducible issues.

I'd love to do it but only once it doesn't break things. It may be
possible to pass in different options to the different tools but at
that point it started looking too complex for the time I had available
to test.

Cheers,

Richard





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-05-27  8:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-28  3:20 [PATCH] bitbake.conf: Add -fcanon-prefix-map to DEBUG_PREFIX_MAP Khem Raj
2023-04-28 11:17 ` [OE-core] " Martin Jansa
2023-04-28 13:44   ` Khem Raj
2023-05-27  5:27 ` Jacob Kroon
2023-05-27  7:50   ` Khem Raj
2023-05-27  8:16   ` Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.