Patchwork uclibc: improve packaging granularity

login
register
mail settings
Submitter Phil Blundell
Date July 19, 2011, 4:01 p.m.
Message ID <1311091299.30326.38.camel@phil-desktop>
Download mbox | patch
Permalink /patch/7903/
State New, archived
Headers show

Comments

Phil Blundell - July 19, 2011, 4:01 p.m.
Put each of the libraries into its own package rather than dumping them
all into libc0.  This saves ~300kB on the installed size of an i586 micro-base-image
and avoids the need to set the hated LEAD_SONAME.

Signed-off-by: Phil Blundell <philb@gnu.org>
---
 meta/recipes-core/uclibc/uclibc.inc |   31 ++++++++++++++++---------------
 1 files changed, 16 insertions(+), 15 deletions(-)
Khem Raj - July 19, 2011, 5:09 p.m.
On Tue, Jul 19, 2011 at 9:01 AM, Phil Blundell <philb@gnu.org> wrote:
> Put each of the libraries into its own package rather than dumping them
> all into libc0.  This saves ~300kB on the installed size of an i586 micro-base-image
> and avoids the need to set the hated LEAD_SONAME.
>
> Signed-off-by: Phil Blundell <philb@gnu.org>
> ---
>  meta/recipes-core/uclibc/uclibc.inc |   31 ++++++++++++++++---------------
>  1 files changed, 16 insertions(+), 15 deletions(-)
>
> diff --git a/meta/recipes-core/uclibc/uclibc.inc b/meta/recipes-core/uclibc/uclibc.inc
> index 23a8ecb..222c34f 100644
> --- a/meta/recipes-core/uclibc/uclibc.inc
> +++ b/meta/recipes-core/uclibc/uclibc.inc
> @@ -13,7 +13,7 @@ SECTION = "libs"
>  LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=a6f89e2100d9b6cdffcea4f398e37343 \
>                    file://COPYING.LIB.boilerplate;md5=aaddeadcddeb918297e0e4afc52ce46f \
>  file://${S}/test/regex/testregex.c;startline=1;endline=31;md5=234efb227d0a40677f895e4a1e26e960"
> -INC_PR = "r2"
> +INC_PR = "r4"
>
>  require uclibc-config.inc
>  STAGINGCC = "gcc-cross-intermediate"
> @@ -49,27 +49,28 @@ RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
>  INHIBIT_DEFAULT_DEPS = "1"
>
>  PACKAGES =+ "ldd uclibc-utils-dbg uclibc-utils uclibc-gconv uclibc-thread-db uclibc-argp uclibc-backtrace"
> -
> -LEAD_SONAME = "libc.so"
> +PACKAGES =+ "uclibc-libcrypt uclibc-libintl uclibc-libnsl uclibc-libresolv uclibc-libm"
> +PACKAGES =+ "uclibc-libdl uclibc-libutil uclibc-libpthread uclibc-librt"
> +
> +FILES_uclibc-libcrypt = "${base_libdir}/libcrypt*.so.* ${base_libdir}/libcrypt-*.so"
> +FILES_uclibc-libintl = "${base_libdir}/libintl*.so.* ${base_libdir}/libintl-*.so"
> +FILES_uclibc-libnsl = "${base_libdir}/libnsl*.so.* ${base_libdir}/libnsl-*.so"
> +FILES_uclibc-libresolv = "${base_libdir}/libresolv*.so.* ${base_libdir}/libresolv-*.so"
> +FILES_uclibc-libm = "${base_libdir}/libm*.so.* ${base_libdir}/libm-*.so"
> +FILES_uclibc-libdl = "${base_libdir}/libdl*.so.* ${base_libdir}/libdl-*.so"
> +FILES_uclibc-libutil = "${base_libdir}/libutil*.so.* ${base_libdir}/libutil-*.so"
> +FILES_uclibc-libpthread = "${base_libdir}/libpthread*.so.* ${base_libdir}/libpthread-*.so"
> +FILES_uclibc-librt = "${base_libdir}/librt*.so.* ${base_libdir}/librt-*.so"
>
>  # The last line (gdb and lib1) is for uclinux-uclibc builds
> -uclibc_baselibs = "${base_libdir}/libcrypt*.so.* ${base_libdir}/libcrypt-*.so \
> -                   ${base_libdir}/libintl*.so.* ${base_libdir}/libintl-*.so \
> -                   ${base_libdir}/libnsl*.so.* ${base_libdir}/libnsl-*.so \
> -                   ${base_libdir}/libresolv*.so.* ${base_libdir}/libresolv-*.so \
> -                   ${base_libdir}/ld*.so.* ${base_libdir}/ld*.so \
> +uclibc_baselibs = "${base_libdir}/ld*.so.* ${base_libdir}/ld*.so \
>                    ${base_libdir}/libc*.so.* ${base_libdir}/libuClibc-*.so \
> -                   ${base_libdir}/libdl*.so.* ${base_libdir}/libdl-*.so \
> -                   ${base_libdir}/libm*.so.* ${base_libdir}/libm-*.so \
> -                   ${base_libdir}/libutil*.so.* ${base_libdir}/libutil-*.so \
> -                   ${base_libdir}/libpthread*.so.* ${base_libdir}/libpthread-*.so \
> -                   ${base_libdir}/librt*.so.* ${base_libdir}/librt-*.so \
>                    ${libdir}/libc.gdb ${libdir}/libc ${base_libdir}/lib1.so \
>                   "
>  FILES_${PN} = "${sysconfdir} ${uclibc_baselibs} /sbin/ldconfig \
>                ${libexecdir} ${datadir}/zoneinfo ${libdir}/locale"
>  FILES_ldd = "${bindir}/ldd"
> -FILES_uclibc-dev_append = "\
> +FILES_${PN}-dev_append = "\

same uclibc.inc is also used by uclibc-initial recipe so using ${PN}
may not be ok here

>         ${libdir}/lib*.so \
>         ${libdir}/*_nonshared.a \
>         ${libdir}/[S]*crt[1in].o \
> @@ -84,7 +85,7 @@ FILES_uclibc-thread-db = "${base_libdir}/libthread_db*"
>  FILES_uclibc-argp = "${base_libdir}/libuargp-*.so ${base_libdir}/libuargp*.so.*"
>  FILES_uclibc-backtrace = "${base_libdir}/libubacktrace-*.so ${base_libdir}/libubacktrace*.so.*"
>
> -RPROVIDES_uclibc-dev += "libc-dev virtual-libc-dev"
> +RPROVIDES_${PN}-dev += "libc-dev virtual-libc-dev"

same as above

>  # uclibc does not really have libsegfault but then using the one from glibc is also not
>  # going to work. So we pretend that we have it to make bitbake not pull other recipes
>  # to satisfy this dependency for the images/tasks
> --
> 1.7.4.1
>
>
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
Phil Blundell - July 19, 2011, 5:13 p.m.
On Tue, 2011-07-19 at 10:09 -0700, Khem Raj wrote:
> On Tue, Jul 19, 2011 at 9:01 AM, Phil Blundell <philb@gnu.org> wrote:
> > -FILES_uclibc-dev_append = "\
> > +FILES_${PN}-dev_append = "\
> 
> same uclibc.inc is also used by uclibc-initial recipe so using ${PN}
> may not be ok here

Does uclibc-initial generate any PACKAGES?  I rather assumed it was
sysroot only, in which case the FILES are irrelevant.

In any case, the name of the FILES variable needs to match the value in
PACKAGES.  Having "FILES_uclibc-dev" is no good if PACKAGES talks about
"${PN}-dev", which appears to be the case here.

p.
Phil Blundell - July 19, 2011, 5:16 p.m.
On Tue, 2011-07-19 at 18:13 +0100, Phil Blundell wrote:
> On Tue, 2011-07-19 at 10:09 -0700, Khem Raj wrote:
> > On Tue, Jul 19, 2011 at 9:01 AM, Phil Blundell <philb@gnu.org> wrote:
> > > -FILES_uclibc-dev_append = "\
> > > +FILES_${PN}-dev_append = "\
> > 
> > same uclibc.inc is also used by uclibc-initial recipe so using ${PN}
> > may not be ok here
> 
> Does uclibc-initial generate any PACKAGES?  I rather assumed it was
> sysroot only, in which case the FILES are irrelevant.
> 
> In any case, the name of the FILES variable needs to match the value in
> PACKAGES.  Having "FILES_uclibc-dev" is no good if PACKAGES talks about
> "${PN}-dev", which appears to be the case here.

... and, maybe more to the point, it's also no good to be doing
"FILES_uclibc-dev_append" when there is a ${PN}-dev definition in
bitbake.conf.  They need to be consistent.

p.
Saul Wold - July 20, 2011, 5:24 p.m.
On 07/19/2011 09:01 AM, Phil Blundell wrote:
> Put each of the libraries into its own package rather than dumping them
> all into libc0.  This saves ~300kB on the installed size of an i586 micro-base-image
> and avoids the need to set the hated LEAD_SONAME.
>
> Signed-off-by: Phil Blundell<philb@gnu.org>
> ---
>   meta/recipes-core/uclibc/uclibc.inc |   31 ++++++++++++++++---------------
>   1 files changed, 16 insertions(+), 15 deletions(-)
>
> diff --git a/meta/recipes-core/uclibc/uclibc.inc b/meta/recipes-core/uclibc/uclibc.inc
> index 23a8ecb..222c34f 100644
> --- a/meta/recipes-core/uclibc/uclibc.inc
> +++ b/meta/recipes-core/uclibc/uclibc.inc
> @@ -13,7 +13,7 @@ SECTION = "libs"
>   LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=a6f89e2100d9b6cdffcea4f398e37343 \
>   		    file://COPYING.LIB.boilerplate;md5=aaddeadcddeb918297e0e4afc52ce46f \
>   file://${S}/test/regex/testregex.c;startline=1;endline=31;md5=234efb227d0a40677f895e4a1e26e960"
> -INC_PR = "r2"
> +INC_PR = "r4"
>
>   require uclibc-config.inc
>   STAGINGCC = "gcc-cross-intermediate"
> @@ -49,27 +49,28 @@ RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
>   INHIBIT_DEFAULT_DEPS = "1"
>
>   PACKAGES =+ "ldd uclibc-utils-dbg uclibc-utils uclibc-gconv uclibc-thread-db uclibc-argp uclibc-backtrace"
> -
> -LEAD_SONAME = "libc.so"
> +PACKAGES =+ "uclibc-libcrypt uclibc-libintl uclibc-libnsl uclibc-libresolv uclibc-libm"
> +PACKAGES =+ "uclibc-libdl uclibc-libutil uclibc-libpthread uclibc-librt"
> +
> +FILES_uclibc-libcrypt = "${base_libdir}/libcrypt*.so.* ${base_libdir}/libcrypt-*.so"
> +FILES_uclibc-libintl = "${base_libdir}/libintl*.so.* ${base_libdir}/libintl-*.so"
> +FILES_uclibc-libnsl = "${base_libdir}/libnsl*.so.* ${base_libdir}/libnsl-*.so"
> +FILES_uclibc-libresolv = "${base_libdir}/libresolv*.so.* ${base_libdir}/libresolv-*.so"
> +FILES_uclibc-libm = "${base_libdir}/libm*.so.* ${base_libdir}/libm-*.so"
> +FILES_uclibc-libdl = "${base_libdir}/libdl*.so.* ${base_libdir}/libdl-*.so"
> +FILES_uclibc-libutil = "${base_libdir}/libutil*.so.* ${base_libdir}/libutil-*.so"
> +FILES_uclibc-libpthread = "${base_libdir}/libpthread*.so.* ${base_libdir}/libpthread-*.so"
> +FILES_uclibc-librt = "${base_libdir}/librt*.so.* ${base_libdir}/librt-*.so"
>
>   # The last line (gdb and lib1) is for uclinux-uclibc builds
> -uclibc_baselibs = "${base_libdir}/libcrypt*.so.* ${base_libdir}/libcrypt-*.so \
> -                   ${base_libdir}/libintl*.so.* ${base_libdir}/libintl-*.so \
> -                   ${base_libdir}/libnsl*.so.* ${base_libdir}/libnsl-*.so \
> -                   ${base_libdir}/libresolv*.so.* ${base_libdir}/libresolv-*.so \
> -                   ${base_libdir}/ld*.so.* ${base_libdir}/ld*.so \
> +uclibc_baselibs = "${base_libdir}/ld*.so.* ${base_libdir}/ld*.so \
>                      ${base_libdir}/libc*.so.* ${base_libdir}/libuClibc-*.so \
> -                   ${base_libdir}/libdl*.so.* ${base_libdir}/libdl-*.so \
> -                   ${base_libdir}/libm*.so.* ${base_libdir}/libm-*.so \
> -                   ${base_libdir}/libutil*.so.* ${base_libdir}/libutil-*.so \
> -                   ${base_libdir}/libpthread*.so.* ${base_libdir}/libpthread-*.so \
> -                   ${base_libdir}/librt*.so.* ${base_libdir}/librt-*.so \
>                      ${libdir}/libc.gdb ${libdir}/libc ${base_libdir}/lib1.so \
>                     "
>   FILES_${PN} = "${sysconfdir} ${uclibc_baselibs} /sbin/ldconfig \
>                  ${libexecdir} ${datadir}/zoneinfo ${libdir}/locale"
>   FILES_ldd = "${bindir}/ldd"
> -FILES_uclibc-dev_append = "\
> +FILES_${PN}-dev_append = "\
>           ${libdir}/lib*.so \
>           ${libdir}/*_nonshared.a \
>           ${libdir}/[S]*crt[1in].o \
> @@ -84,7 +85,7 @@ FILES_uclibc-thread-db = "${base_libdir}/libthread_db*"
>   FILES_uclibc-argp = "${base_libdir}/libuargp-*.so ${base_libdir}/libuargp*.so.*"
>   FILES_uclibc-backtrace = "${base_libdir}/libubacktrace-*.so ${base_libdir}/libubacktrace*.so.*"
>
> -RPROVIDES_uclibc-dev += "libc-dev virtual-libc-dev"
> +RPROVIDES_${PN}-dev += "libc-dev virtual-libc-dev"
>   # uclibc does not really have libsegfault but then using the one from glibc is also not
>   # going to work. So we pretend that we have it to make bitbake not pull other recipes
>   # to satisfy this dependency for the images/tasks

Merged into OE-Core

Thanks
	Sau!

Patch

diff --git a/meta/recipes-core/uclibc/uclibc.inc b/meta/recipes-core/uclibc/uclibc.inc
index 23a8ecb..222c34f 100644
--- a/meta/recipes-core/uclibc/uclibc.inc
+++ b/meta/recipes-core/uclibc/uclibc.inc
@@ -13,7 +13,7 @@  SECTION = "libs"
 LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=a6f89e2100d9b6cdffcea4f398e37343 \
 		    file://COPYING.LIB.boilerplate;md5=aaddeadcddeb918297e0e4afc52ce46f \
 file://${S}/test/regex/testregex.c;startline=1;endline=31;md5=234efb227d0a40677f895e4a1e26e960"
-INC_PR = "r2"
+INC_PR = "r4"
 
 require uclibc-config.inc
 STAGINGCC = "gcc-cross-intermediate"
@@ -49,27 +49,28 @@  RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
 INHIBIT_DEFAULT_DEPS = "1"
 
 PACKAGES =+ "ldd uclibc-utils-dbg uclibc-utils uclibc-gconv uclibc-thread-db uclibc-argp uclibc-backtrace"
-
-LEAD_SONAME = "libc.so"
+PACKAGES =+ "uclibc-libcrypt uclibc-libintl uclibc-libnsl uclibc-libresolv uclibc-libm"
+PACKAGES =+ "uclibc-libdl uclibc-libutil uclibc-libpthread uclibc-librt"
+
+FILES_uclibc-libcrypt = "${base_libdir}/libcrypt*.so.* ${base_libdir}/libcrypt-*.so"
+FILES_uclibc-libintl = "${base_libdir}/libintl*.so.* ${base_libdir}/libintl-*.so"
+FILES_uclibc-libnsl = "${base_libdir}/libnsl*.so.* ${base_libdir}/libnsl-*.so"
+FILES_uclibc-libresolv = "${base_libdir}/libresolv*.so.* ${base_libdir}/libresolv-*.so"
+FILES_uclibc-libm = "${base_libdir}/libm*.so.* ${base_libdir}/libm-*.so"
+FILES_uclibc-libdl = "${base_libdir}/libdl*.so.* ${base_libdir}/libdl-*.so"
+FILES_uclibc-libutil = "${base_libdir}/libutil*.so.* ${base_libdir}/libutil-*.so"
+FILES_uclibc-libpthread = "${base_libdir}/libpthread*.so.* ${base_libdir}/libpthread-*.so"
+FILES_uclibc-librt = "${base_libdir}/librt*.so.* ${base_libdir}/librt-*.so"
 
 # The last line (gdb and lib1) is for uclinux-uclibc builds
-uclibc_baselibs = "${base_libdir}/libcrypt*.so.* ${base_libdir}/libcrypt-*.so \
-                   ${base_libdir}/libintl*.so.* ${base_libdir}/libintl-*.so \
-                   ${base_libdir}/libnsl*.so.* ${base_libdir}/libnsl-*.so \
-                   ${base_libdir}/libresolv*.so.* ${base_libdir}/libresolv-*.so \
-                   ${base_libdir}/ld*.so.* ${base_libdir}/ld*.so \
+uclibc_baselibs = "${base_libdir}/ld*.so.* ${base_libdir}/ld*.so \
                    ${base_libdir}/libc*.so.* ${base_libdir}/libuClibc-*.so \
-                   ${base_libdir}/libdl*.so.* ${base_libdir}/libdl-*.so \
-                   ${base_libdir}/libm*.so.* ${base_libdir}/libm-*.so \
-                   ${base_libdir}/libutil*.so.* ${base_libdir}/libutil-*.so \
-                   ${base_libdir}/libpthread*.so.* ${base_libdir}/libpthread-*.so \
-                   ${base_libdir}/librt*.so.* ${base_libdir}/librt-*.so \
                    ${libdir}/libc.gdb ${libdir}/libc ${base_libdir}/lib1.so \
                   "
 FILES_${PN} = "${sysconfdir} ${uclibc_baselibs} /sbin/ldconfig \
                ${libexecdir} ${datadir}/zoneinfo ${libdir}/locale"
 FILES_ldd = "${bindir}/ldd"
-FILES_uclibc-dev_append = "\
+FILES_${PN}-dev_append = "\
         ${libdir}/lib*.so \
         ${libdir}/*_nonshared.a \
         ${libdir}/[S]*crt[1in].o \
@@ -84,7 +85,7 @@  FILES_uclibc-thread-db = "${base_libdir}/libthread_db*"
 FILES_uclibc-argp = "${base_libdir}/libuargp-*.so ${base_libdir}/libuargp*.so.*"
 FILES_uclibc-backtrace = "${base_libdir}/libubacktrace-*.so ${base_libdir}/libubacktrace*.so.*"
 
-RPROVIDES_uclibc-dev += "libc-dev virtual-libc-dev"
+RPROVIDES_${PN}-dev += "libc-dev virtual-libc-dev"
 # uclibc does not really have libsegfault but then using the one from glibc is also not
 # going to work. So we pretend that we have it to make bitbake not pull other recipes
 # to satisfy this dependency for the images/tasks