All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5] poky-tiny: enable section removal
@ 2020-11-13  0:27 Sinan Kaya
  2020-11-13  4:59 ` [poky] " Khem Raj
  0 siblings, 1 reply; 5+ messages in thread
From: Sinan Kaya @ 2020-11-13  0:27 UTC (permalink / raw)
  To: poky; +Cc: Sinan Kaya

Use GCC sections flags so that unused sections can be garbage
collected at link time.

Signed-off-by: Sinan Kaya <okaya@kernel.org>
---
 meta-poky/conf/distro/poky-tiny.conf | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/meta-poky/conf/distro/poky-tiny.conf b/meta-poky/conf/distro/poky-tiny.conf
index c6d4b88f83d..583088185c6 100644
--- a/meta-poky/conf/distro/poky-tiny.conf
+++ b/meta-poky/conf/distro/poky-tiny.conf
@@ -122,3 +122,21 @@ PNBLACKLIST[core-image-weston] = "not buildable with poky-tiny"
 
 # Disable python usage in opkg-utils since it won't build with tiny config
 PACKAGECONFIG_remove_pn-opkg-utils = "python"
+
+CFLAGS_SECTION_REMOVAL = "-ffunction-sections -fdata-sections"
+LDFLAGS_SECTION_REMOVAL = "-Wl,--gc-sections"
+
+# packages with build problems using sections
+CFLAGS_SECTION_REMOVAL_pn-glibc = ""
+LDFLAGS_SECTION_REMOVAL_pn-glibc = ""
+CFLAGS_SECTION_REMOVAL_pn-cairo = ""
+LDFLAGS_SECTION_REMOVAL_pn-cairo = ""
+
+# omit section removal on native builds
+CFLAGS_SECTION_REMOVAL_class-native = ""
+LDFLAGS_SECTION_REMOVAL_class-native = ""
+
+# set default for all targets
+CFLAGS_append = " ${CFLAGS_SECTION_REMOVAL}"
+LDFLAGS_append = " ${LDFLAGS_SECTION_REMOVAL}"
+
-- 
2.17.1


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

* Re: [poky] [PATCH v5] poky-tiny: enable section removal
  2020-11-13  0:27 [PATCH v5] poky-tiny: enable section removal Sinan Kaya
@ 2020-11-13  4:59 ` Khem Raj
  2020-11-13  5:13   ` Sinan Kaya
  0 siblings, 1 reply; 5+ messages in thread
From: Khem Raj @ 2020-11-13  4:59 UTC (permalink / raw)
  To: Sinan Kaya, poky

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



On 11/12/20 4:27 PM, Sinan Kaya wrote:
> Use GCC sections flags so that unused sections can be garbage
> collected at link time.
> 
> Signed-off-by: Sinan Kaya <okaya@kernel.org>
> ---
>  meta-poky/conf/distro/poky-tiny.conf | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/meta-poky/conf/distro/poky-tiny.conf b/meta-poky/conf/distro/poky-tiny.conf
> index c6d4b88f83d..583088185c6 100644
> --- a/meta-poky/conf/distro/poky-tiny.conf
> +++ b/meta-poky/conf/distro/poky-tiny.conf
> @@ -122,3 +122,21 @@ PNBLACKLIST[core-image-weston] = "not buildable with poky-tiny"
>
>  # Disable python usage in opkg-utils since it won't build with tiny config
>  PACKAGECONFIG_remove_pn-opkg-utils = "python"
> +
> +CFLAGS_SECTION_REMOVAL = "-ffunction-sections -fdata-sections"
> +LDFLAGS_SECTION_REMOVAL = "-Wl,--gc-sections"
> +
> +# packages with build problems using sections
> +CFLAGS_SECTION_REMOVAL_pn-glibc = ""
> +LDFLAGS_SECTION_REMOVAL_pn-glibc = ""
> +CFLAGS_SECTION_REMOVAL_pn-cairo = ""
> +LDFLAGS_SECTION_REMOVAL_pn-cairo = ""
> +
> +# omit section removal on native builds
> +CFLAGS_SECTION_REMOVAL_class-native = ""
> +LDFLAGS_SECTION_REMOVAL_class-native = ""
> +
> +# set default for all targets
> +CFLAGS_append = " ${CFLAGS_SECTION_REMOVAL}"
> +LDFLAGS_append = " ${LDFLAGS_SECTION_REMOVAL}"
> +
> 

I think this should be an independent .inc file in oe-core
much like lto.inc, perhaps something like size_opts.inc
and here it could just in added via a include/require directive

Could be useful for non-poky distros as well.

> 
> 
> 
> 

[-- Attachment #2: pEpkey.asc --]
[-- Type: application/pgp-keys, Size: 2373 bytes --]

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

* Re: [poky] [PATCH v5] poky-tiny: enable section removal
  2020-11-13  4:59 ` [poky] " Khem Raj
@ 2020-11-13  5:13   ` Sinan Kaya
  2020-11-13 15:18     ` Richard Purdie
  0 siblings, 1 reply; 5+ messages in thread
From: Sinan Kaya @ 2020-11-13  5:13 UTC (permalink / raw)
  To: Khem Raj, poky

On 11/12/2020 11:59 PM, Khem Raj wrote:
>> +# omit section removal on native builds
>> +CFLAGS_SECTION_REMOVAL_class-native = ""
>> +LDFLAGS_SECTION_REMOVAL_class-native = ""
>> +
>> +# set default for all targets
>> +CFLAGS_append = " ${CFLAGS_SECTION_REMOVAL}"
>> +LDFLAGS_append = " ${LDFLAGS_SECTION_REMOVAL}"
>> +
>>
> I think this should be an independent .inc file in oe-core
> much like lto.inc, perhaps something like size_opts.inc
> and here it could just in added via a include/require directive
> 
> Could be useful for non-poky distros as well.
> 

Sure, I can move there once I get a successful build hint from Richard.

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

* Re: [poky] [PATCH v5] poky-tiny: enable section removal
  2020-11-13  5:13   ` Sinan Kaya
@ 2020-11-13 15:18     ` Richard Purdie
  2020-11-13 22:15       ` Sinan Kaya
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Purdie @ 2020-11-13 15:18 UTC (permalink / raw)
  To: Sinan Kaya, Khem Raj, poky; +Cc: Ross Burton

On Fri, 2020-11-13 at 00:13 -0500, Sinan Kaya wrote:
> On 11/12/2020 11:59 PM, Khem Raj wrote:
> > > +# omit section removal on native builds
> > > +CFLAGS_SECTION_REMOVAL_class-native = ""
> > > +LDFLAGS_SECTION_REMOVAL_class-native = ""
> > > +
> > > +# set default for all targets
> > > +CFLAGS_append = " ${CFLAGS_SECTION_REMOVAL}"
> > > +LDFLAGS_append = " ${LDFLAGS_SECTION_REMOVAL}"
> > > +
> > > 
> > I think this should be an independent .inc file in oe-core
> > much like lto.inc, perhaps something like size_opts.inc
> > and here it could just in added via a include/require directive
> > 
> > Could be useful for non-poky distros as well.
> > 
> 
> Sure, I can move there once I get a successful build hint from
> Richard.

Fails in perl this time:

https://autobuilder.yoctoproject.org/typhoon/#/builders/15/builds/2981

Cheers,

Richard


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

* Re: [poky] [PATCH v5] poky-tiny: enable section removal
  2020-11-13 15:18     ` Richard Purdie
@ 2020-11-13 22:15       ` Sinan Kaya
  0 siblings, 0 replies; 5+ messages in thread
From: Sinan Kaya @ 2020-11-13 22:15 UTC (permalink / raw)
  To: Richard Purdie, Khem Raj, poky; +Cc: Ross Burton

On 11/13/2020 10:18 AM, Richard Purdie wrote:
>> Sure, I can move there once I get a successful build hint from
>> Richard.
> Fails in perl this time:
> 
> https://autobuilder.yoctoproject.org/typhoon/#/builders/15/builds/2981

v6 posted.

Fingers crossed.

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

end of thread, other threads:[~2020-11-13 22:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-13  0:27 [PATCH v5] poky-tiny: enable section removal Sinan Kaya
2020-11-13  4:59 ` [poky] " Khem Raj
2020-11-13  5:13   ` Sinan Kaya
2020-11-13 15:18     ` Richard Purdie
2020-11-13 22:15       ` Sinan Kaya

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.