diff mbox series

[yocto-patches,meta-selinux] ] libsepol: disable LTO to fix buildpaths QA failure

Message ID 20260328155821.407004-1-thomas.perrot@bootlin.com
State New
Headers show
Series [yocto-patches,meta-selinux] ] libsepol: disable LTO to fix buildpaths QA failure | expand

Commit Message

Thomas Perrot March 28, 2026, 3:58 p.m. UTC
From: Thomas Perrot <thomas.perrot@bootlin.com>

Fat LTO objects in the static library embed original source paths in
.gnu.lto_* IR sections. Unlike DWARF output, these sections are not
affected by -ffile-prefix-map, causing TMPDIR references to survive
into the installed libsepol-staticdev package.

Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
---
 recipes-security/selinux/libsepol_3.10.bb | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Yi Zhao April 2, 2026, 8:31 a.m. UTC | #1
Hi Thomas,


Could you please provide the build steps to reproduce this QA failure? I 
can not reproduce the issue, even without applying this patch.


Thanks,

Yi

On 3/28/26 23:58, Thomas Perrot via lists.yoctoproject.org wrote:
> From: Thomas Perrot <thomas.perrot@bootlin.com>
>
> Fat LTO objects in the static library embed original source paths in
> .gnu.lto_* IR sections. Unlike DWARF output, these sections are not
> affected by -ffile-prefix-map, causing TMPDIR references to survive
> into the installed libsepol-staticdev package.
>
> Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
> ---
>   recipes-security/selinux/libsepol_3.10.bb | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/recipes-security/selinux/libsepol_3.10.bb b/recipes-security/selinux/libsepol_3.10.bb
> index 0423a2a6ea31..0a51aba28ee8 100644
> --- a/recipes-security/selinux/libsepol_3.10.bb
> +++ b/recipes-security/selinux/libsepol_3.10.bb
> @@ -13,4 +13,8 @@ inherit lib_package
>   
>   DEPENDS = "flex-native"
>   
> +# LTO fat objects in static library embed original source paths in .gnu.lto_* IR
> +# sections which are not affected by -ffile-prefix-map, causing buildpaths QA failure
> +LTO = ""
> +
>   BBCLASSEXTEND = "native"
Thomas Perrot April 20, 2026, 9:30 a.m. UTC | #2
Hello Yi,

On Thu, 2026-04-02 at 16:31 +0800, Yi Zhao wrote:
> Hi Thomas,
> 
> 
> Could you please provide the build steps to reproduce this QA
> failure? 

To reproduce it, LTO is required to be enabled. For example:

DISTRO_FEATURES:append = " lto"
require conf/distro/include/lto.inc

Kind regards,
Thomas

> I 
> can not reproduce the issue, even without applying this patch.
> 
> 
> Thanks,
> 
> Yi
> 
> On 3/28/26 23:58, Thomas Perrot via lists.yoctoproject.org wrote:
> > From: Thomas Perrot <thomas.perrot@bootlin.com>
> > 
> > Fat LTO objects in the static library embed original source paths
> > in
> > .gnu.lto_* IR sections. Unlike DWARF output, these sections are not
> > affected by -ffile-prefix-map, causing TMPDIR references to survive
> > into the installed libsepol-staticdev package.
> > 
> > Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
> > ---
> >   recipes-security/selinux/libsepol_3.10.bb | 4 ++++
> >   1 file changed, 4 insertions(+)
> > 
> > diff --git a/recipes-security/selinux/libsepol_3.10.bb b/recipes-
> > security/selinux/libsepol_3.10.bb
> > index 0423a2a6ea31..0a51aba28ee8 100644
> > --- a/recipes-security/selinux/libsepol_3.10.bb
> > +++ b/recipes-security/selinux/libsepol_3.10.bb
> > @@ -13,4 +13,8 @@ inherit lib_package
> >   
> >   DEPENDS = "flex-native"
> >   
> > +# LTO fat objects in static library embed original source paths in
> > .gnu.lto_* IR
> > +# sections which are not affected by -ffile-prefix-map, causing
> > buildpaths QA failure
> > +LTO = ""
> > +
> >   BBCLASSEXTEND = "native"
Yi Zhao April 20, 2026, 1:44 p.m. UTC | #3
On 4/20/26 17:30, Thomas Perrot wrote:
> Hello Yi,
>
> On Thu, 2026-04-02 at 16:31 +0800, Yi Zhao wrote:
>> Hi Thomas,
>>
>>
>> Could you please provide the build steps to reproduce this QA
>> failure?
> To reproduce it, LTO is required to be enabled. For example:
>
> DISTRO_FEATURES:append = " lto"
> require conf/distro/include/lto.inc

Thanks.  I have merged these patches.


//Yi

>
> Kind regards,
> Thomas
>
>> I
>> can not reproduce the issue, even without applying this patch.
>>
>>
>> Thanks,
>>
>> Yi
>>
>> On 3/28/26 23:58, Thomas Perrot via lists.yoctoproject.org wrote:
>>> From: Thomas Perrot <thomas.perrot@bootlin.com>
>>>
>>> Fat LTO objects in the static library embed original source paths
>>> in
>>> .gnu.lto_* IR sections. Unlike DWARF output, these sections are not
>>> affected by -ffile-prefix-map, causing TMPDIR references to survive
>>> into the installed libsepol-staticdev package.
>>>
>>> Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
>>> ---
>>>    recipes-security/selinux/libsepol_3.10.bb | 4 ++++
>>>    1 file changed, 4 insertions(+)
>>>
>>> diff --git a/recipes-security/selinux/libsepol_3.10.bb b/recipes-
>>> security/selinux/libsepol_3.10.bb
>>> index 0423a2a6ea31..0a51aba28ee8 100644
>>> --- a/recipes-security/selinux/libsepol_3.10.bb
>>> +++ b/recipes-security/selinux/libsepol_3.10.bb
>>> @@ -13,4 +13,8 @@ inherit lib_package
>>>    
>>>    DEPENDS = "flex-native"
>>>    
>>> +# LTO fat objects in static library embed original source paths in
>>> .gnu.lto_* IR
>>> +# sections which are not affected by -ffile-prefix-map, causing
>>> buildpaths QA failure
>>> +LTO = ""
>>> +
>>>    BBCLASSEXTEND = "native"
diff mbox series

Patch

diff --git a/recipes-security/selinux/libsepol_3.10.bb b/recipes-security/selinux/libsepol_3.10.bb
index 0423a2a6ea31..0a51aba28ee8 100644
--- a/recipes-security/selinux/libsepol_3.10.bb
+++ b/recipes-security/selinux/libsepol_3.10.bb
@@ -13,4 +13,8 @@  inherit lib_package
 
 DEPENDS = "flex-native"
 
+# LTO fat objects in static library embed original source paths in .gnu.lto_* IR
+# sections which are not affected by -ffile-prefix-map, causing buildpaths QA failure
+LTO = ""
+
 BBCLASSEXTEND = "native"