Skip to contentSkip to conversation

poky-tiny: enable section removal

PATCH Superseded Sinan Kaya 2 participants 3 messages Nov 10, 2020 – Nov 13, 2020

v4 of 7 Superseded Latest is v7 →

lore
Share & tools
lore

Sinan Kaya

author
#0 lore raw

PATCH v4 1/1 poky-tiny: enable section removal

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

---
 meta-poky/conf/distro/poky-tiny.conf | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
meta-poky/conf/distro/poky-tiny.conf +14 -0
index c6d4b88f83d..eead97a404e 100644
@@ -122,3 +122,17 @@ 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 = ""
+
+# set default for all targets
+CFLAGS_append = " ${CFLAGS_SECTION_REMOVAL}"
+LDFLAGS_append = " ${LDFLAGS_SECTION_REMOVAL}"
+
Signature · 1 line
2.17.1
#1 lore raw
Quoted 7 lines · Sinan Kaya

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

---
 meta-poky/conf/distro/poky-tiny.conf | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

I did try this again but still has perl-native issues:

https://autobuilder.yoctoproject.org/typhoon/#/builders/15/builds/2977
https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/1566
(and other selftest failures too)

Cheers,

Richard

author
#2 lore raw
Quoted 9 lines · Richard Purdie
Quoted 7 lines · Sinan Kaya

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

---
 meta-poky/conf/distro/poky-tiny.conf | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
Quoted 6 lines

I did try this again but still has perl-native issues:

https://autobuilder.yoctoproject.org/typhoon/#/builders/15/builds/2977
https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/1566
(and other selftest failures too)

I omitted the feature from native builds and posted v5.

Quoted 4 lines

Cheers,

Richard