poky-tiny: enable section removal
PATCH v5 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 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
meta-poky/conf/distro/poky-tiny.conf +18 -0
@@ -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}" +
Signature · 1 line
2.17.1
Quoted 25 lines · Sinan Kaya
Use GCC sections flags so that unused sections can be garbage collected at link time.
Signed-off-by Sinan Kaya <[email protected]>--- meta-poky/conf/distro/poky-tiny.conf | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)meta-poky/conf/distro/poky-tiny.conf +8
-0@@ -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 = ""
meta-poky/conf/distro/poky-tiny.conf PNBLACKLIST[core-image-weston] = "not buildable with poky-tiny" · line 142
Quoted 10 lines
meta-poky/conf/distro/poky-tiny.conf +10
-0+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.
Quoted 4 lines
Quoted 13 lines · Khem Raj
meta-poky/conf/distro/poky-tiny.conf PNBLACKLIST[core-image-weston] = "not buildable with poky-tiny" · line 142
Quoted 9 lines
meta-poky/conf/distro/poky-tiny.conf +8
-0+# 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/requiredirective
Quoted 2 lines
Could be useful for non-poky distros as well.
Sure, I can move there once I get a successful build hint from Richard.
Quoted 14 lines · Sinan Kaya
Quoted 13 lines · Khem Raj
meta-poky/conf/distro/poky-tiny.conf PNBLACKLIST[core-image-weston] = "not buildable with poky-tiny" · line 142
Quoted 9 lines
meta-poky/conf/distro/poky-tiny.conf +8
-0+# 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/requiredirective
Quoted 5 lines
Quoted 2 lines
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
Quoted 5 lines · Richard Purdie
Quoted 2 lines
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.