All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-yocto][PATCH] poky-tiny: Use musl for default system C library
@ 2015-12-20  0:05 Khem Raj
  2016-01-08  9:09 ` Burton, Ross
  0 siblings, 1 reply; 5+ messages in thread
From: Khem Raj @ 2015-12-20  0:05 UTC (permalink / raw)
  To: yocto

poky-tiny is reference for smallest footprint distro that can be
generated using yocto project infrastructure. Therefore switch to using
musl which gives the smallest footprint with a lot of extra stretching
for adding new package if needed, core-image-minimal for qemux86 comes
out to be 716K ( rootfs only ), boot tested on qemux86/poky-tiny

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta-yocto/conf/distro/poky-tiny.conf | 25 +++++--------------------
 1 file changed, 5 insertions(+), 20 deletions(-)

diff --git a/meta-yocto/conf/distro/poky-tiny.conf b/meta-yocto/conf/distro/poky-tiny.conf
index b0227de..de3a441 100644
--- a/meta-yocto/conf/distro/poky-tiny.conf
+++ b/meta-yocto/conf/distro/poky-tiny.conf
@@ -25,12 +25,12 @@
 # [ ] Define linux-yocto-tiny configs for all supported BSPs
 # [ ] Drop ldconfig from the installation
 # [ ] Modify the runqemu scripts to work with ext2 parameter:
-#     runqemu qemux86 qemuparams="-nographic" bootparams="console=ttyS0,115200 root=0800" 
+#     runqemu qemux86 qemuparams="-nographic" bootparams="console=ttyS0,115200 root=0800"
 # [ ] Modify busybox to allow for DISTRO_FEATURES-like confiruration
 
 require conf/distro/poky.conf
 DISTRO = "poky-tiny"
-
+TCLIBC = "musl"
 # FIXME: consider adding a new "tiny" feature
 #DISTRO_FEATURES_append = " tiny"
 
@@ -57,27 +57,11 @@ ENABLE_WIDEC_class-native = "true"
 # eglibc->bash->gettext->libc-posix-clang-wchar dependency.
 USE_NLS="no"
 
-# Reconfigure eglibc for a smaller installation
-# Comment out any of the lines below to disable them in the build
-DISTRO_FEATURES_LIBC_TINY = "libc-libm libc-crypt"
-DISTRO_FEATURES_LIBC_TINY_append_x86-64 = " libc-libm-big"
-
-# Required for "who"
-DISTRO_FEATURES_LIBC_MINIMAL = "libc-utmp libc-utmpx libc-getlogin"
-DISTRO_FEATURES_LIBC_REGEX = "libc-posix-regexp"
-DISTRO_FEATURES_LIBC_NET = "libc-inet libc-nis"
-
-DISTRO_FEATURES_LIBC = "${DISTRO_FEATURES_LIBC_TINY} \
-                        ${DISTRO_FEATURES_LIBC_MINIMAL} \
-                        ${DISTRO_FEATURES_LIBC_REGEX} \
-                        ${DISTRO_FEATURES_LIBC_NET} \
-                       "
-
 # Comment out any of the lines below to disable them in the build
 # DISTRO_FEATURES options:
 # alsa bluetooth ext2 irda pcmcia usbgadget usbhost wifi nfs zeroconf pci
 DISTRO_FEATURES_TINY = "pci"
-DISTRO_FEATURES_NET = "ipv4"
+DISTRO_FEATURES_NET = "ipv4 ipv6"
 DISTRO_FEATURES_USB = "usbhost"
 #DISTRO_FEATURES_USBGADGET = "usbgadget"
 #DISTRO_FEATURES_WIFI = "wifi"
@@ -87,13 +71,14 @@ DISTRO_FEATURES = "${DISTRO_FEATURES_TINY} \
                    ${DISTRO_FEATURES_USB} \
                    ${DISTRO_FEATURES_USBGADGET} \
                    ${DISTRO_FEATURES_WIFI} \
-                   ${DISTRO_FEATURES_LIBC} \
                   "
 
 # Enable LFS - see bug YOCTO #5865
 DISTRO_FEATURES_append_libc-uclibc = " largefile"
+DISTRO_FEATURES_append_libc-musl = " largefile"
 
 DISTRO_FEATURES_class-native = "${DISTRO_FEATURES_DEFAULT} ${DISTRO_FEATURES_LIBC} ${POKY_DEFAULT_DISTRO_FEATURES}"
+DISTRO_FEATURES_class-nativesdk = "${DISTRO_FEATURES_DEFAULT} ${DISTRO_FEATURES_LIBC} ${POKY_DEFAULT_DISTRO_FEATURES}"
 
 # Use tmpdevfs and the busybox runtime services
 VIRTUAL-RUNTIME_dev_manager = ""
-- 
2.6.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [meta-yocto][PATCH] poky-tiny: Use musl for default system C library
  2015-12-20  0:05 [meta-yocto][PATCH] poky-tiny: Use musl for default system C library Khem Raj
@ 2016-01-08  9:09 ` Burton, Ross
  2016-01-08  9:21   ` Burton, Ross
  0 siblings, 1 reply; 5+ messages in thread
From: Burton, Ross @ 2016-01-08  9:09 UTC (permalink / raw)
  To: Khem Raj; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 598 bytes --]

On 20 December 2015 at 00:05, Khem Raj <raj.khem@gmail.com> wrote:

> poky-tiny is reference for smallest footprint distro that can be
> generated using yocto project infrastructure. Therefore switch to using
> musl which gives the smallest footprint with a lot of extra stretching
> for adding new package if needed, core-image-minimal for qemux86 comes
> out to be 716K ( rootfs only ), boot tested on qemux86/poky-tiny
>

For anyone else reading, I just gave this a test locally, and for context
the previous poky-tiny was using a tuned glibc and the rootfs came in at
1.5M.

Ross

[-- Attachment #2: Type: text/html, Size: 1029 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [meta-yocto][PATCH] poky-tiny: Use musl for default system C library
  2016-01-08  9:09 ` Burton, Ross
@ 2016-01-08  9:21   ` Burton, Ross
  2016-01-18  7:04     ` Khem Raj
  0 siblings, 1 reply; 5+ messages in thread
From: Burton, Ross @ 2016-01-08  9:21 UTC (permalink / raw)
  To: Khem Raj; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 817 bytes --]

On 8 January 2016 at 09:09, Burton, Ross <ross.burton@intel.com> wrote:

> For anyone else reading, I just gave this a test locally, and for context
> the previous poky-tiny was using a tuned glibc and the rootfs came in at
> 1.5M.
>

Finished my comparison builds:

musl:
-rw-r--r-- 1 ross ross  731681 Jan  7 23:46
core-image-minimal-qemux86-20160107234351.rootfs.cpio.gz
glibc:
-rw-r--r-- 1 ross ross 1569610 Jan  8 00:01
core-image-minimal-qemux86-20160107235147.rootfs.cpio.gz
uclibc:
-rw-r--r-- 1 ross ross  669759 Jan  8 09:14
core-image-minimal-qemux86-20160108090512.rootfs.cpio.gz

So it's a slightly increase over uclibc, but by default poky-tiny uses
glibc so this is a massive win.  In the greater scheme of things musl is
trending to be worth the increase over uclibc too.

Ross

[-- Attachment #2: Type: text/html, Size: 1328 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [meta-yocto][PATCH] poky-tiny: Use musl for default system C library
  2016-01-08  9:21   ` Burton, Ross
@ 2016-01-18  7:04     ` Khem Raj
  2016-01-22 21:45       ` Khem Raj
  0 siblings, 1 reply; 5+ messages in thread
From: Khem Raj @ 2016-01-18  7:04 UTC (permalink / raw)
  To: Burton, Ross; +Cc: yocto


[-- Attachment #1.1: Type: text/plain, Size: 1282 bytes --]


> On Jan 8, 2016, at 1:21 AM, Burton, Ross <ross.burton@intel.com> wrote:
> 
> 
> On 8 January 2016 at 09:09, Burton, Ross <ross.burton@intel.com <mailto:ross.burton@intel.com>> wrote:
> For anyone else reading, I just gave this a test locally, and for context the previous poky-tiny was using a tuned glibc and the rootfs came in at 1.5M.
> 
> Finished my comparison builds:
> 
> musl:
> -rw-r--r-- 1 ross ross  731681 Jan  7 23:46 core-image-minimal-qemux86-20160107234351.rootfs.cpio.gz
> glibc:
> -rw-r--r-- 1 ross ross 1569610 Jan  8 00:01 core-image-minimal-qemux86-20160107235147.rootfs.cpio.gz
> uclibc:
> -rw-r--r-- 1 ross ross  669759 Jan  8 09:14 core-image-minimal-qemux86-20160108090512.rootfs.cpio.gz
> 
> So it's a slightly increase over uclibc, but by default poky-tiny uses glibc so this is a massive win.  In the greater scheme of things musl is trending to be worth the increase over uclibc too.
> 

Thanks Ross for this info. I think it will be interesting to know the sizes of packages contributing to image from buildhistory if you have it lying around.
musl has libpthread/libm etc. all bundled into single .so for simplicity reasons. I would like to get to bottom of the slight increase of musl over uclibc based system



> Ross


[-- Attachment #1.2: Type: text/html, Size: 2641 bytes --]

[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 211 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [meta-yocto][PATCH] poky-tiny: Use musl for default system C library
  2016-01-18  7:04     ` Khem Raj
@ 2016-01-22 21:45       ` Khem Raj
  0 siblings, 0 replies; 5+ messages in thread
From: Khem Raj @ 2016-01-22 21:45 UTC (permalink / raw)
  To: Burton, Ross; +Cc: yocto


[-- Attachment #1.1: Type: text/plain, Size: 2127 bytes --]


> On Jan 17, 2016, at 11:04 PM, Khem Raj <raj.khem@gmail.com> wrote:
> 
>> 
>> On Jan 8, 2016, at 1:21 AM, Burton, Ross <ross.burton@intel.com <mailto:ross.burton@intel.com>> wrote:
>> 
>> 
>> On 8 January 2016 at 09:09, Burton, Ross <ross.burton@intel.com <mailto:ross.burton@intel.com>> wrote:
>> For anyone else reading, I just gave this a test locally, and for context the previous poky-tiny was using a tuned glibc and the rootfs came in at 1.5M.
>> 
>> Finished my comparison builds:
>> 
>> musl:
>> -rw-r--r-- 1 ross ross  731681 Jan  7 23:46 core-image-minimal-qemux86-20160107234351.rootfs.cpio.gz
>> glibc:
>> -rw-r--r-- 1 ross ross 1569610 Jan  8 00:01 core-image-minimal-qemux86-20160107235147.rootfs.cpio.gz
>> uclibc:
>> -rw-r--r-- 1 ross ross  669759 Jan  8 09:14 core-image-minimal-qemux86-20160108090512.rootfs.cpio.gz
>> 
>> So it's a slightly increase over uclibc, but by default poky-tiny uses glibc so this is a massive win.  In the greater scheme of things musl is trending to be worth the increase over uclibc too.
>> 
> 
> Thanks Ross for this info. I think it will be interesting to know the sizes of packages contributing to image from buildhistory if you have it lying around.
> musl has libpthread/libm etc. all bundled into single .so for simplicity reasons. I would like to get to bottom of the slight increase of musl over uclibc based system
> 

musl/core-image-minimal ( 690K )

601 KiB busybox
598 KiB musl
23 KiB netbase
5 KiB update-rc.d
4 KiB update-alternatives-opkg
3 KiB busybox-udhcpc
3 KiB busybox-mdev
3 KiB base-files
2 KiB run-postinsts
2 KiB busybox-syslog

uclibc/core-image-minimal ( 614K)

603     KiB busybox
515     KiB uclibc
73      KiB libm1
23      KiB netbase
5       KiB update-rc.d
4       KiB update-alternatives-opkg
3       KiB busybox-udhcpc
3       KiB busybox-mdev
3       KiB base-files
2       KiB run-postinsts
2       KiB busybox-syslog


I don’t know why musl one is 690K where as the factored  sizes are quite same for both images . May be because it is on different machine.


> 
> 
>> Ross


[-- Attachment #1.2: Type: text/html, Size: 8565 bytes --]

[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 211 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-01-22 21:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-20  0:05 [meta-yocto][PATCH] poky-tiny: Use musl for default system C library Khem Raj
2016-01-08  9:09 ` Burton, Ross
2016-01-08  9:21   ` Burton, Ross
2016-01-18  7:04     ` Khem Raj
2016-01-22 21:45       ` 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.