* [PATCH v2] poky-tiny: enable section removal
@ 2020-11-09 22:25 Sinan Kaya
2020-11-09 22:34 ` [poky] " Khem Raj
0 siblings, 1 reply; 2+ messages in thread
From: Sinan Kaya @ 2020-11-09 22:25 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 | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/meta-poky/conf/distro/poky-tiny.conf b/meta-poky/conf/distro/poky-tiny.conf
index c6d4b88f83d..19e48851519 100644
--- a/meta-poky/conf/distro/poky-tiny.conf
+++ b/meta-poky/conf/distro/poky-tiny.conf
@@ -122,3 +122,25 @@ 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"
+
+# set default for all targets
+CFLAGS_append += "-ffunction-sections -fdata-sections"
+LDFLAGS_append += "-Wl,--gc-sections"
+
+# gc-sections requires either an entry or an undefined symbol
+CFLAGS_remove_pn-glibc += "-ffunction-sections -fdata-sections"
+LDFLAGS_remove_pn-glibc += "-Wl,--gc-sections"
+
+# perl won't cross compile with sections
+CFLAGS_remove_pn-perl += "-ffunction-sections -fdata-sections"
+LDFLAGS_remove_pn-perl += "-Wl,--gc-sections"
+
+# libdevmapper won't compile with sections
+# CFLAGS_remove_pn-libdevmapper += "-ffunction-sections -fdata-sections"
+# LDFLAGS_remove_pn-libdevmapper += "-Wl,--gc-sections"
+
+# Unknown float word ordering. You need to manually preset
+CFLAGS_remove_pn-cairo += "-ffunction-sections -fdata-sections"
+LDFLAGS_remove_pn-cairo += "-Wl,--gc-sections"
+
+
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [poky] [PATCH v2] poky-tiny: enable section removal
2020-11-09 22:25 [PATCH v2] poky-tiny: enable section removal Sinan Kaya
@ 2020-11-09 22:34 ` Khem Raj
0 siblings, 0 replies; 2+ messages in thread
From: Khem Raj @ 2020-11-09 22:34 UTC (permalink / raw)
To: Sinan Kaya, poky
On 11/9/20 2:25 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 | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/meta-poky/conf/distro/poky-tiny.conf b/meta-poky/conf/distro/poky-tiny.conf
> index c6d4b88f83d..19e48851519 100644
> --- a/meta-poky/conf/distro/poky-tiny.conf
> +++ b/meta-poky/conf/distro/poky-tiny.conf
> @@ -122,3 +122,25 @@ 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"
> +
> +# set default for all targets
> +CFLAGS_append += "-ffunction-sections -fdata-sections"
> +LDFLAGS_append += "-Wl,--gc-sections"
lets not use += here with _append, and add a leading whitespace after
first quote
> +
> +# gc-sections requires either an entry or an undefined symbol
> +CFLAGS_remove_pn-glibc += "-ffunction-sections -fdata-sections"
> +LDFLAGS_remove_pn-glibc += "-Wl,--gc-sections"
remove += here just = is enough with _remove
> +
> +# perl won't cross compile with sections
> +CFLAGS_remove_pn-perl += "-ffunction-sections -fdata-sections"
> +LDFLAGS_remove_pn-perl += "-Wl,--gc-sections"
> +
same above
> +# libdevmapper won't compile with sections
> +# CFLAGS_remove_pn-libdevmapper += "-ffunction-sections -fdata-sections"
> +# LDFLAGS_remove_pn-libdevmapper += "-Wl,--gc-sections"
same here
> +
> +# Unknown float word ordering. You need to manually preset
> +CFLAGS_remove_pn-cairo += "-ffunction-sections -fdata-sections"
> +LDFLAGS_remove_pn-cairo += "-Wl,--gc-sections"
same here
> +
> +
>
>
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-09 22:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-09 22:25 [PATCH v2] poky-tiny: enable section removal Sinan Kaya
2020-11-09 22:34 ` [poky] " Khem Raj
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.