summaryrefslogtreecommitdiffstats
path: root/meta-poky
diff options
context:
space:
mode:
authorSinan Kaya <okaya@kernel.org>2020-11-16 00:40:33 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-12-03 22:53:55 +0000
commitc39dfcbabc0e7f913a0ccdf458af46e47cf8d1a2 (patch)
tree12c8a99ca92bccc32d6a86c71c27937a1e284e8c /meta-poky
parentf107844a62c9304646aa68ddf707ce7305553f18 (diff)
downloadpoky-c39dfcbabc0e7f913a0ccdf458af46e47cf8d1a2.tar.gz
poky-c39dfcbabc0e7f913a0ccdf458af46e47cf8d1a2.tar.bz2
poky-c39dfcbabc0e7f913a0ccdf458af46e47cf8d1a2.zip
poky-tiny: enable section removal
Use GCC sections flags so that unused sections can be garbage collected at link time. (From meta-yocto rev: 70176ee6235c2545e18df855cac2c3524b7e50e4) Signed-off-by: Sinan Kaya <okaya@kernel.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta-poky')
-rw-r--r--meta-poky/conf/distro/include/gcsections.inc22
-rw-r--r--meta-poky/conf/distro/poky-tiny.conf2
2 files changed, 24 insertions, 0 deletions
diff --git a/meta-poky/conf/distro/include/gcsections.inc b/meta-poky/conf/distro/include/gcsections.inc
new file mode 100644
index 0000000000..dd98943acb
--- /dev/null
+++ b/meta-poky/conf/distro/include/gcsections.inc
@@ -0,0 +1,22 @@
+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 = ""
+CFLAGS_SECTION_REMOVAL_pn-perl = ""
+LDFLAGS_SECTION_REMOVAL_pn-perl = ""
+CFLAGS_SECTION_REMOVAL_pn-grub-efi = ""
+LDFLAGS_SECTION_REMOVAL_pn-grub-efi = ""
+CFLAGS_SECTION_REMOVAL_pn-grub = ""
+LDFLAGS_SECTION_REMOVAL_pn-grub = ""
+
+# set default for target
+CFLAGS_append_class-target = " ${CFLAGS_SECTION_REMOVAL}"
+LDFLAGS_append_class-target = " ${LDFLAGS_SECTION_REMOVAL}"
+
+# set default for nativesdk
+CFLAGS_append_class-nativesdk = " ${CFLAGS_SECTION_REMOVAL}"
+LDFLAGS_append_class-nativesdk = " ${LDFLAGS_SECTION_REMOVAL}"
diff --git a/meta-poky/conf/distro/poky-tiny.conf b/meta-poky/conf/distro/poky-tiny.conf
index 9a043b1ef5..e125b23d46 100644
--- a/meta-poky/conf/distro/poky-tiny.conf
+++ b/meta-poky/conf/distro/poky-tiny.conf
@@ -29,6 +29,8 @@
# [ ] Modify busybox to allow for DISTRO_FEATURES-like confiruration
require conf/distro/poky.conf
+require conf/distro/include/gcsections.inc
+
DISTRO = "poky-tiny"
DISTROOVERRIDES = "poky:poky-tiny"
TCLIBC = "musl"