lto.inc: Add global LTO distro policy file

Submitted by Khem Raj on March 23, 2020, 11:25 p.m. | Patch ID: 171243

Details

Message ID 20200323232529.3658577-1-raj.khem@gmail.com
State New
Headers show

Commit Message

Khem Raj March 23, 2020, 11:25 p.m.
Distros which want to enable LTO can utilize this file, it only covers
packages from OE-Core, other layers should include there own exclusion
list for recipe which dont work with LTO

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/conf/distro/include/lto.inc | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 meta/conf/distro/include/lto.inc

Patch hide | download patch | download mbox

diff --git a/meta/conf/distro/include/lto.inc b/meta/conf/distro/include/lto.inc
new file mode 100644
index 0000000000..0cedc8deca
--- /dev/null
+++ b/meta/conf/distro/include/lto.inc
@@ -0,0 +1,23 @@ 
+LTO_pn-glibc = ""
+LTO_pn-gcc-runtime = ""
+LTO_pn-libgcc-initial = ""
+LTO_pn-libgcc = ""
+LTO_pn-libpam = ""
+LTO_pn-elfutils = ""
+LTO_pn-perl = ""
+LTO_pn-busybox = ""
+LTO_pn-libxcrypt = ""
+LTO_pn-curl = ""
+LTO_pn-libcap = ""
+LTO_pn-python3 = ""
+LTO_pn-libproxy = ""
+LTO_pn-libbsd = ""
+
+LTO ?= "-flto"
+
+SELECTED_OPTIMIZATION_append_class-target = " ${LTO}"
+TARGET_LDFLAGS_append_class-target = " ${LTO}"
+
+SELECTED_OPTIMIZATION[vardeps] += "LTO"
+
+PACKAGE_DEBUG_SPLIT_STYLE = "debug-without-src"

Comments

Richard Purdie March 24, 2020, 8:37 a.m.
On Mon, 2020-03-23 at 16:25 -0700, Khem Raj wrote:
> Distros which want to enable LTO can utilize this file, it only
> covers
> packages from OE-Core, other layers should include there own
> exclusion
> list for recipe which dont work with LTO
> 
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/conf/distro/include/lto.inc | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
>  create mode 100644 meta/conf/distro/include/lto.inc
> 
> diff --git a/meta/conf/distro/include/lto.inc
> b/meta/conf/distro/include/lto.inc
> new file mode 100644
> index 0000000000..0cedc8deca
> --- /dev/null
> +++ b/meta/conf/distro/include/lto.inc
> @@ -0,0 +1,23 @@
> +LTO_pn-glibc = ""
> +LTO_pn-gcc-runtime = ""
> +LTO_pn-libgcc-initial = ""
> +LTO_pn-libgcc = ""
> +LTO_pn-libpam = ""
> +LTO_pn-elfutils = ""
> +LTO_pn-perl = ""
> +LTO_pn-busybox = ""
> +LTO_pn-libxcrypt = ""
> +LTO_pn-curl = ""
> +LTO_pn-libcap = ""
> +LTO_pn-python3 = ""
> +LTO_pn-libproxy = ""
> +LTO_pn-libbsd = ""
> +
> +LTO ?= "-flto"
> +
> +SELECTED_OPTIMIZATION_append_class-target = " ${LTO}"
> +TARGET_LDFLAGS_append_class-target = " ${LTO}"
> +
> +SELECTED_OPTIMIZATION[vardeps] += "LTO"
> +
> +PACKAGE_DEBUG_SPLIT_STYLE = "debug-without-src"

Why do we need to specify the debug split style here?

Cheers,

Richard
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#136628): https://lists.openembedded.org/g/openembedded-core/message/136628
Mute This Topic: https://lists.openembedded.org/mt/72506212/3617530
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-
Adrian Bunk March 24, 2020, 11:27 a.m.
On Mon, Mar 23, 2020 at 04:25:29PM -0700, Khem Raj wrote:
> Distros which want to enable LTO can utilize this file, it only covers
> packages from OE-Core, other layers should include there own exclusion
> list for recipe which dont work with LTO
>...
> +++ b/meta/conf/distro/include/lto.inc
> @@ -0,0 +1,23 @@
> +LTO_pn-glibc = ""
> +LTO_pn-gcc-runtime = ""
> +LTO_pn-libgcc-initial = ""
> +LTO_pn-libgcc = ""
> +LTO_pn-libpam = ""
> +LTO_pn-elfutils = ""
> +LTO_pn-perl = ""
> +LTO_pn-busybox = ""
> +LTO_pn-libxcrypt = ""
> +LTO_pn-curl = ""
> +LTO_pn-libcap = ""
> +LTO_pn-python3 = ""
> +LTO_pn-libproxy = ""
> +LTO_pn-libbsd = ""
>...

It would be better to have these in the individual recipes,
it is much easier to understand what is going on when all
recipe-specific information is in the recipe.

Otherwise this will end as an implementation of workarounds that
might not even be needed anymore, for a previous example with
several workarounds that were no longer needed see
https://git.openembedded.org/openembedded-core/commit/?id=8bbb17d2dcafa9b4e26941a55932f4be2782e1d1

cu
Adrian
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#136630): https://lists.openembedded.org/g/openembedded-core/message/136630
Mute This Topic: https://lists.openembedded.org/mt/72506212/3617530
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-
Adrian Bunk March 24, 2020, 11:37 a.m.
On Mon, Mar 23, 2020 at 04:25:29PM -0700, Khem Raj wrote:
>...
> +LTO_pn-python3 = ""
>...

Building Python with LTO works by passing --with-lto to configure.

cu
Adrian
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#136637): https://lists.openembedded.org/g/openembedded-core/message/136637
Mute This Topic: https://lists.openembedded.org/mt/72506212/3617530
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-
Richard Purdie March 24, 2020, 11:50 a.m.
On Tue, 2020-03-24 at 13:27 +0200, Adrian Bunk wrote:
> On Mon, Mar 23, 2020 at 04:25:29PM -0700, Khem Raj wrote:
> > Distros which want to enable LTO can utilize this file, it only
> > covers
> > packages from OE-Core, other layers should include there own
> > exclusion
> > list for recipe which dont work with LTO
> > ...
> > +++ b/meta/conf/distro/include/lto.inc
> > @@ -0,0 +1,23 @@
> > +LTO_pn-glibc = ""
> > +LTO_pn-gcc-runtime = ""
> > +LTO_pn-libgcc-initial = ""
> > +LTO_pn-libgcc = ""
> > +LTO_pn-libpam = ""
> > +LTO_pn-elfutils = ""
> > +LTO_pn-perl = ""
> > +LTO_pn-busybox = ""
> > +LTO_pn-libxcrypt = ""
> > +LTO_pn-curl = ""
> > +LTO_pn-libcap = ""
> > +LTO_pn-python3 = ""
> > +LTO_pn-libproxy = ""
> > +LTO_pn-libbsd = ""
> > ...
> 
> It would be better to have these in the individual recipes,
> it is much easier to understand what is going on when all
> recipe-specific information is in the recipe.

I disagree. These files do let someone working on specific enablement
see the status collectively and allow people to opt in/out of a given
development feature.

At some point in the future that can tip into making more sense in a
recipe but its a staged process and things often make sense to start
like this.

Cheers,

Richard
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#136638): https://lists.openembedded.org/g/openembedded-core/message/136638
Mute This Topic: https://lists.openembedded.org/mt/72506212/3617530
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-
Adrian Bunk March 24, 2020, 12:02 p.m.
On Mon, Mar 23, 2020 at 04:25:29PM -0700, Khem Raj wrote:
> Distros which want to enable LTO can utilize this file, it only covers
> packages from OE-Core, other layers should include there own exclusion
> list for recipe which dont work with LTO
>...

More and more upstreams already default to LTO in their build system.

What is the recommended way to get the correct configure options to 
disable LTO in all such recipes?

The option is obviously recipe-specific, but there has to be some
global define the recipe can check for disable/default/enable.

cu
Adrian
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#136639): https://lists.openembedded.org/g/openembedded-core/message/136639
Mute This Topic: https://lists.openembedded.org/mt/72506212/3617530
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-
Khem Raj March 24, 2020, 1:46 p.m.
On Tue, Mar 24, 2020 at 1:37 AM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> On Mon, 2020-03-23 at 16:25 -0700, Khem Raj wrote:
> > Distros which want to enable LTO can utilize this file, it only
> > covers
> > packages from OE-Core, other layers should include there own
> > exclusion
> > list for recipe which dont work with LTO
> >
> > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > ---
> >  meta/conf/distro/include/lto.inc | 23 +++++++++++++++++++++++
> >  1 file changed, 23 insertions(+)
> >  create mode 100644 meta/conf/distro/include/lto.inc
> >
> > diff --git a/meta/conf/distro/include/lto.inc
> > b/meta/conf/distro/include/lto.inc
> > new file mode 100644
> > index 0000000000..0cedc8deca
> > --- /dev/null
> > +++ b/meta/conf/distro/include/lto.inc
> > @@ -0,0 +1,23 @@
> > +LTO_pn-glibc = ""
> > +LTO_pn-gcc-runtime = ""
> > +LTO_pn-libgcc-initial = ""
> > +LTO_pn-libgcc = ""
> > +LTO_pn-libpam = ""
> > +LTO_pn-elfutils = ""
> > +LTO_pn-perl = ""
> > +LTO_pn-busybox = ""
> > +LTO_pn-libxcrypt = ""
> > +LTO_pn-curl = ""
> > +LTO_pn-libcap = ""
> > +LTO_pn-python3 = ""
> > +LTO_pn-libproxy = ""
> > +LTO_pn-libbsd = ""
> > +
> > +LTO ?= "-flto"
> > +
> > +SELECTED_OPTIMIZATION_append_class-target = " ${LTO}"
> > +TARGET_LDFLAGS_append_class-target = " ${LTO}"
> > +
> > +SELECTED_OPTIMIZATION[vardeps] += "LTO"
> > +
> > +PACKAGE_DEBUG_SPLIT_STYLE = "debug-without-src"
>
> Why do we need to specify the debug split style here?
>

debug file generator does  not generate debugsrc packages with lto i
have not investigates in
detail but its due to the fact that .o files are not normal elf objs

> Cheers,
>
> Richard
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#136642): https://lists.openembedded.org/g/openembedded-core/message/136642
Mute This Topic: https://lists.openembedded.org/mt/72506212/3617530
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-
Khem Raj March 24, 2020, 1:47 p.m.
On Tue, Mar 24, 2020 at 4:37 AM Adrian Bunk <bunk@stusta.de> wrote:
>
> On Mon, Mar 23, 2020 at 04:25:29PM -0700, Khem Raj wrote:
> >...
> > +LTO_pn-python3 = ""
> >...
>
> Building Python with LTO works by passing --with-lto to configure.

I think per recipe knobs I did not work on yet but perhaps worth
adding them in next release
or may be as packageconfig dependent on lto distro feature
>
> cu
> Adrian
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#136643): https://lists.openembedded.org/g/openembedded-core/message/136643
Mute This Topic: https://lists.openembedded.org/mt/72506212/3617530
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-
Khem Raj March 24, 2020, 1:50 p.m.
On Tue, Mar 24, 2020 at 4:50 AM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> On Tue, 2020-03-24 at 13:27 +0200, Adrian Bunk wrote:
> > On Mon, Mar 23, 2020 at 04:25:29PM -0700, Khem Raj wrote:
> > > Distros which want to enable LTO can utilize this file, it only
> > > covers
> > > packages from OE-Core, other layers should include there own
> > > exclusion
> > > list for recipe which dont work with LTO
> > > ...
> > > +++ b/meta/conf/distro/include/lto.inc
> > > @@ -0,0 +1,23 @@
> > > +LTO_pn-glibc = ""
> > > +LTO_pn-gcc-runtime = ""
> > > +LTO_pn-libgcc-initial = ""
> > > +LTO_pn-libgcc = ""
> > > +LTO_pn-libpam = ""
> > > +LTO_pn-elfutils = ""
> > > +LTO_pn-perl = ""
> > > +LTO_pn-busybox = ""
> > > +LTO_pn-libxcrypt = ""
> > > +LTO_pn-curl = ""
> > > +LTO_pn-libcap = ""
> > > +LTO_pn-python3 = ""
> > > +LTO_pn-libproxy = ""
> > > +LTO_pn-libbsd = ""
> > > ...
> >
> > It would be better to have these in the individual recipes,
> > it is much easier to understand what is going on when all
> > recipe-specific information is in the recipe.
>
> I disagree. These files do let someone working on specific enablement
> see the status collectively and allow people to opt in/out of a given
> development feature.
>
> At some point in the future that can tip into making more sense in a
> recipe but its a staged process and things often make sense to start
> like this.

yeah. Maybe there should be a distro feature knob this inc file should
add which can be used by recipes
for an exception like adding configure options
>
> Cheers,
>
> Richard
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#136644): https://lists.openembedded.org/g/openembedded-core/message/136644
Mute This Topic: https://lists.openembedded.org/mt/72506212/3617530
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-