All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Sinan Kaya" <okaya@kernel.org>
To: poky@lists.yoctoproject.org
Cc: Sinan Kaya <okaya@kernel.org>
Subject: [PATCH v3] poky-tiny: enable section removal
Date: Mon,  9 Nov 2020 22:38:24 +0000	[thread overview]
Message-ID: <20201109223824.12351-1-okaya@kernel.org> (raw)

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..1e37394875d 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"
+
+# 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"
+
+# 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


             reply	other threads:[~2020-11-09 22:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-09 22:38 Sinan Kaya [this message]
2020-11-10 10:11 ` [poky] [PATCH v3] poky-tiny: enable section removal Paul Barker
2020-11-10 17:55   ` Sinan Kaya
2020-11-10 21:35 ` Richard Purdie
2020-11-10 22:51   ` Sinan Kaya

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201109223824.12351-1-okaya@kernel.org \
    --to=okaya@kernel.org \
    --cc=poky@lists.yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.