Re: [OE-core] [PATCH 1/1] eglibc: migrate configurability from oe
On Fri, 2011-06-03 at 14:47 +0800, Kang Kai wrote: From: Kang Kai kai.k...@windriver.com Migrate configurability from oe, try to shrink minimal image size The switch is in local.conf.sample, uncomment the line DISTRO_FEATURES_EGLIBC = and write what options you want to enable. If want to disable locale-code charsets or locales, you have to uncomment PACKAGE_NO_GCONV = 1 Because without this, it fails on package_do_split_gconvs in libc-package.bbclass I have some comments: a) I think these should become flags in DISTRO_FEATURES with an eglibc- prefix so something like spawn would become eglibc-spawn b) I think we need to create a local.conf.sample.extended which has information about more advanced settings a user can configure. I don't want every setting in local.conf as standard as it gives the user the impression they have to change them which they don't. Some existing data in local.conf.sample can be moved over. c) The code triggered by PACKAGE_NO_GCONV should also trigger if you set the appropriate eglibc- feature flags automatically. Having two variables you have to keep track of the combinations of is just plain wrong. They should be controlled by one flag only. If there is generic packaging code that handles these we might not need the eglibc- prefix for those options. Cheers, Richard Signed-off-by: Kang Kai kai.k...@windriver.com --- meta-yocto/conf/local.conf.sample |9 +++ .../eglibc-2.13-fix-macro-RTLD_DEBUG.patch | 20 +++ meta/recipes-core/eglibc/eglibc-options.inc| 55 meta/recipes-core/eglibc/eglibc.inc| 13 + meta/recipes-core/eglibc/eglibc_2.13.bb|4 +- 5 files changed, 100 insertions(+), 1 deletions(-) create mode 100644 meta/recipes-core/eglibc/eglibc-2.13/eglibc-2.13-fix-macro-RTLD_DEBUG.patch create mode 100644 meta/recipes-core/eglibc/eglibc-options.inc diff --git a/meta-yocto/conf/local.conf.sample b/meta-yocto/conf/local.conf.sample index 359e510..f68e80a 100644 --- a/meta-yocto/conf/local.conf.sample +++ b/meta-yocto/conf/local.conf.sample @@ -87,6 +87,15 @@ PACKAGE_CLASSES ?= package_rpm package_ipk # NOTE: if listing mklibs prelink both, then make sure mklibs is before prelink USER_CLASSES ?= image-mklibs image-prelink +# eglibc configurability is used to reduce minimal images's size. +# PACKAGE_NO_GCONV should be set to 1, or locale-code posix-clang-wchar +# charsets locales need to be include in DISTRO_FEATURES_EGLIBC, please check +# package_do_split_gconvs in libc-package.bbclass for detail +#PACKAGE_NO_GCONV = 1 + +# if you want to enable any option listed below, please uncomment next line and copy it here +#DISTRO_FEATURES_EGLIBC = + # POKYMODE controls the characteristics of the generated packages/images by # telling poky which type of toolchain to use. # diff --git a/meta/recipes-core/eglibc/eglibc-2.13/eglibc-2.13-fix-macro-RTLD_DEBUG.patch b/meta/recipes-core/eglibc/eglibc-2.13/eglibc-2.13-fix-macro-RTLD_DEBUG.patch new file mode 100644 index 000..dffc648 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.13/eglibc-2.13-fix-macro-RTLD_DEBUG.patch @@ -0,0 +1,20 @@ +When disable OPTION_EGLIBC_RTLD_DEBUG, compilation fails. +Created on Jun 1, 2011 by Kang Kai kai.k...@windriver.com + +Upstream-Status: Submitted + +Signed-off-by: Kang Kai kai.k...@windriver.com +Index: libc/elf/dl-lookup.c +=== +--- libc/elf/dl-lookup.c (revision 13356) libc/elf/dl-lookup.c (working copy) +@@ -423,7 +423,9 @@ + hash table. */ + if (__builtin_expect (tab-size, 0)) + { ++ #if __OPTION_EGLIBC_RTLD_DEBUG + assert (GLRO(dl_debug_mask) DL_DEBUG_PRELINK); ++ #endif + __rtld_lock_unlock_recursive (tab-lock); + goto success; + } diff --git a/meta/recipes-core/eglibc/eglibc-options.inc b/meta/recipes-core/eglibc/eglibc-options.inc new file mode 100644 index 000..7cd0287 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-options.inc @@ -0,0 +1,55 @@ +def eglibc_cfg(feature, features, tokens, cnf): + if type(tokens) == type(): + tokens = [tokens] + if type(features) == type([]) and feature in features: + cnf.extend([token + ' = y' for token in tokens]) + else: + for token in tokens: + cnf.extend([token + ' = n']) + if token == 'OPTION_EGLIBC_NSSWITCH': + cnf.extend([OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG = ${S}/nss/nsswitch.conf]) + cnf.extend([OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS = ${S}/nss/fixed-nsswitch.functions]) + +# Map distro features to eglibc options settings +def
Re: [OE-core] [PATCH 1/1] eglibc: migrate configurability from oe
Hi Richard, Thanks for your comments. And I have one question: On Fri, 2011-06-03 at 14:47 +0800, Kang Kai wrote: From: Kang Kaikai.k...@windriver.com Migrate configurability from oe, try to shrink minimal image size The switch is in local.conf.sample, uncomment the line DISTRO_FEATURES_EGLIBC = and write what options you want to enable. If want to disable locale-code charsets or locales, you have to uncomment PACKAGE_NO_GCONV = 1 Because without this, it fails on package_do_split_gconvs in libc-package.bbclass I have some comments: a) I think these should become flags in DISTRO_FEATURES with an eglibc- prefix so something like spawn would become eglibc-spawn Do you mean every option in DISTRO_FEATURES_EGLIBC should be a single flag in DISTRO_FEATURES? In that case, DISTRO_FEATURES_EGLIBC is not needed, right? b) I think we need to create a local.conf.sample.extended which has information about more advanced settings a user can configure. I don't want every setting in local.conf as standard as it gives the user the impression they have to change them which they don't. Some existing data in local.conf.sample can be moved over. c) The code triggered by PACKAGE_NO_GCONV should also trigger if you set the appropriate eglibc- feature flags automatically. Having two variables you have to keep track of the combinations of is just plain wrong. They should be controlled by one flag only. If there is generic packaging code that handles these we might not need the eglibc- prefix for those options. Ok, I will use one flag only. Cheers, Richard Thanks Regards, Kai Signed-off-by: Kang Kaikai.k...@windriver.com --- meta-yocto/conf/local.conf.sample |9 +++ .../eglibc-2.13-fix-macro-RTLD_DEBUG.patch | 20 +++ meta/recipes-core/eglibc/eglibc-options.inc| 55 meta/recipes-core/eglibc/eglibc.inc| 13 + meta/recipes-core/eglibc/eglibc_2.13.bb|4 +- 5 files changed, 100 insertions(+), 1 deletions(-) create mode 100644 meta/recipes-core/eglibc/eglibc-2.13/eglibc-2.13-fix-macro-RTLD_DEBUG.patch create mode 100644 meta/recipes-core/eglibc/eglibc-options.inc diff --git a/meta-yocto/conf/local.conf.sample b/meta-yocto/conf/local.conf.sample index 359e510..f68e80a 100644 --- a/meta-yocto/conf/local.conf.sample +++ b/meta-yocto/conf/local.conf.sample @@ -87,6 +87,15 @@ PACKAGE_CLASSES ?= package_rpm package_ipk # NOTE: if listing mklibs prelink both, then make sure mklibs is before prelink USER_CLASSES ?= image-mklibs image-prelink +# eglibc configurability is used to reduce minimal images's size. +# PACKAGE_NO_GCONV should be set to 1, or locale-code posix-clang-wchar +# charsets locales need to be include in DISTRO_FEATURES_EGLIBC, please check +# package_do_split_gconvs in libc-package.bbclass for detail +#PACKAGE_NO_GCONV = 1 + +# if you want to enable any option listed below, please uncomment next line and copy it here +#DISTRO_FEATURES_EGLIBC = + # POKYMODE controls the characteristics of the generated packages/images by # telling poky which type of toolchain to use. # diff --git a/meta/recipes-core/eglibc/eglibc-2.13/eglibc-2.13-fix-macro-RTLD_DEBUG.patch b/meta/recipes-core/eglibc/eglibc-2.13/eglibc-2.13-fix-macro-RTLD_DEBUG.patch new file mode 100644 index 000..dffc648 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.13/eglibc-2.13-fix-macro-RTLD_DEBUG.patch @@ -0,0 +1,20 @@ +When disable OPTION_EGLIBC_RTLD_DEBUG, compilation fails. +Created on Jun 1, 2011 by Kang Kaikai.k...@windriver.com + +Upstream-Status: Submitted + +Signed-off-by: Kang Kaikai.k...@windriver.com +Index: libc/elf/dl-lookup.c +=== +--- libc/elf/dl-lookup.c (revision 13356) libc/elf/dl-lookup.c (working copy) +@@ -423,7 +423,9 @@ +hash table. */ + if (__builtin_expect (tab-size, 0)) + { ++ #if __OPTION_EGLIBC_RTLD_DEBUG + assert (GLRO(dl_debug_mask) DL_DEBUG_PRELINK); ++ #endif + __rtld_lock_unlock_recursive (tab-lock); + goto success; + } diff --git a/meta/recipes-core/eglibc/eglibc-options.inc b/meta/recipes-core/eglibc/eglibc-options.inc new file mode 100644 index 000..7cd0287 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-options.inc @@ -0,0 +1,55 @@ +def eglibc_cfg(feature, features, tokens, cnf): + if type(tokens) == type(): + tokens = [tokens] + if type(features) == type([]) and feature in features: + cnf.extend([token + ' = y' for token in tokens]) + else: + for token in tokens: + cnf.extend([token + ' = n']) + if token == 'OPTION_EGLIBC_NSSWITCH': + cnf.extend([OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG =
Re: [OE-core] [PATCH 1/1] eglibc: migrate configurability from oe
On Fri, 2011-06-03 at 09:22 +0100, Richard Purdie wrote: On Fri, 2011-06-03 at 14:47 +0800, Kang Kai wrote: From: Kang Kai kai.k...@windriver.com Migrate configurability from oe, try to shrink minimal image size The switch is in local.conf.sample, uncomment the line DISTRO_FEATURES_EGLIBC = and write what options you want to enable. If want to disable locale-code charsets or locales, you have to uncomment PACKAGE_NO_GCONV = 1 Because without this, it fails on package_do_split_gconvs in libc-package.bbclass I have some comments: a) I think these should become flags in DISTRO_FEATURES with an eglibc- prefix so something like spawn would become eglibc-spawn I'm not sure I agree with that. Some, maybe most, of these flags are not really specific to eglibc (in concept, even if eglibc is the only package which respects them at the moment). Some of them (eg ipv6) are already established DISTRO_FEATURES which are used in various other places; others, including perhaps your spawn example, are specifically bound to the contents of the C library but could equally well be respected by uclibc. So, for the latter group, I think just libc-spawn would be better than eglibc-spawn. Maybe libc-has-spawn would be even better, to make it clear that we're talking about a feature within libc and not a specific variant of libc. In an ideal world there would also be a mechanism for packages to declare that they require a particular feature from libc, i.e. a recipe could say DISTRO_REQUIRED_FEATURES = libc-spawn and it would then be a configuration error to try to build that recipe for a distro that doesn't admit the necessary things. b) I think we need to create a local.conf.sample.extended which has information about more advanced settings a user can configure. I don't want every setting in local.conf as standard as it gives the user the impression they have to change them which they don't. Some existing data in local.conf.sample can be moved over. Agreed. c) The code triggered by PACKAGE_NO_GCONV should also trigger if you set the appropriate eglibc- feature flags automatically. Having two variables you have to keep track of the combinations of is just plain wrong. They should be controlled by one flag only. If there is generic packaging code that handles these we might not need the eglibc- prefix for those options. I didn't fully understand the commentary around PACKAGE_NO_GCONV so I'm not sure that I have a meaningful opinion on that one yet. As far as I know, though, there is no generic packaging code for gconvs (unlike locales, which are handled generically in package.bbclass) but, again, the concept of gconvs is not eglibc specific and there are other libs which might provide them. p. ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH 1/1] eglibc: migrate configurability from oe
On Fri, 2011-06-03 at 16:54 +0800, Kang Kai wrote: Hi Richard, Thanks for your comments. And I have one question: On Fri, 2011-06-03 at 14:47 +0800, Kang Kai wrote: From: Kang Kaikai.k...@windriver.com Migrate configurability from oe, try to shrink minimal image size The switch is in local.conf.sample, uncomment the line DISTRO_FEATURES_EGLIBC = and write what options you want to enable. If want to disable locale-code charsets or locales, you have to uncomment PACKAGE_NO_GCONV = 1 Because without this, it fails on package_do_split_gconvs in libc-package.bbclass I have some comments: a) I think these should become flags in DISTRO_FEATURES with an eglibc- prefix so something like spawn would become eglibc-spawn Do you mean every option in DISTRO_FEATURES_EGLIBC should be a single flag in DISTRO_FEATURES? No, you'd still have all the options you currently have but instead of being called X they would be eglibc-X. Cheers, Richard ___ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Re: [OE-core] [PATCH 1/1] eglibc: migrate configurability from oe
On 06/02/2011 02:41 AM, Kang Kai wrote: From: Kang Kaikai.k...@windriver.com Migrate configurability from oe, try to shrink minimal image size The switch is in local.conf.sample, uncomment the line DISTRO_FEATURES_EGLIBC = and write what options you want to enable. If want to disable locale-code charsets or locales, you have to uncomment PACKAGE_NO_GCONV = 1 Because without this, it fails on package_do_split_gconvs in libc-package.bbclass This should really be posted on the openembedded-core@lists.openembedded.org alias so that all can see it. Signed-off-by: Kang Kaikai.k...@windriver.com --- meta-yocto/conf/local.conf.sample | 17 ++ .../eglibc-2.13-fix-macro-RTLD_DEBUG.patch | 20 +++ meta/recipes-core/eglibc/eglibc-options.inc| 55 meta/recipes-core/eglibc/eglibc.inc|6 ++ meta/recipes-core/eglibc/eglibc_2.13.bb|4 +- 5 files changed, 101 insertions(+), 1 deletions(-) create mode 100644 meta/recipes-core/eglibc/eglibc-2.13/eglibc-2.13-fix-macro-RTLD_DEBUG.patch create mode 100644 meta/recipes-core/eglibc/eglibc-options.inc diff --git a/meta-yocto/conf/local.conf.sample b/meta-yocto/conf/local.conf.sample index 359e510..310e51e 100644 --- a/meta-yocto/conf/local.conf.sample +++ b/meta-yocto/conf/local.conf.sample @@ -87,6 +87,23 @@ PACKAGE_CLASSES ?= package_rpm package_ipk # NOTE: if listing mklibs prelink both, then make sure mklibs is before prelink USER_CLASSES ?= image-mklibs image-prelink +# eglibc configurability is used to reduce minimal images's size. +# PACKAGE_NO_GCONV should be set to 1, or locale-code posix-clang-wchar +# charsets locales need to be include in DISTRO_FEATURES_EGLIBC, please check +# package_do_split_gconvs in libc-package.bbclass for detail +#PACKAGE_NO_GCONV = 1 + +# if you want to enable any option listed below, please uncomment next line and copy it here +#DISTRO_FEATURES_EGLIBC = + +DISTRO_FEATURES_EGLIBC ??= ipv6 backtrace big-macros bsd cxx-tests catgets charsets \ + crypt crypt-ufc db-aliases envz fcvt fmtmsg fstab ftraverse \ + getlogin idn inet inet-anl libm libm-big locales locale-code \ + memusage nis nsswitch rcmd rtld-debug spawn streams sunrpc utmp \ + utmpx wordexp posix-clang-wchar posix-regexp posix-regexp-glibc \ + posix-wchar-io + + I have some concern with this change being in sample, are these features enabled by default, is that the intention? If someone already has a local.conf then this will not be used, I think that the initial soft assignment (??=) needs to be someplace else, like in eglibc.inc maybe Sau! # POKYMODE controls the characteristics of the generated packages/images by # telling poky which type of toolchain to use. # diff --git a/meta/recipes-core/eglibc/eglibc-2.13/eglibc-2.13-fix-macro-RTLD_DEBUG.patch b/meta/recipes-core/eglibc/eglibc-2.13/eglibc-2.13-fix-macro-RTLD_DEBUG.patch new file mode 100644 index 000..dffc648 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.13/eglibc-2.13-fix-macro-RTLD_DEBUG.patch @@ -0,0 +1,20 @@ +When disable OPTION_EGLIBC_RTLD_DEBUG, compilation fails. +Created on Jun 1, 2011 by Kang Kaikai.k...@windriver.com + +Upstream-Status: Submitted + +Signed-off-by: Kang Kaikai.k...@windriver.com +Index: libc/elf/dl-lookup.c +=== +--- libc/elf/dl-lookup.c (revision 13356) libc/elf/dl-lookup.c (working copy) +@@ -423,7 +423,9 @@ +hash table. */ + if (__builtin_expect (tab-size, 0)) + { ++ #if __OPTION_EGLIBC_RTLD_DEBUG + assert (GLRO(dl_debug_mask) DL_DEBUG_PRELINK); ++ #endif + __rtld_lock_unlock_recursive (tab-lock); + goto success; + } diff --git a/meta/recipes-core/eglibc/eglibc-options.inc b/meta/recipes-core/eglibc/eglibc-options.inc new file mode 100644 index 000..7cd0287 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-options.inc @@ -0,0 +1,55 @@ +def eglibc_cfg(feature, features, tokens, cnf): + if type(tokens) == type(): + tokens = [tokens] + if type(features) == type([]) and feature in features: + cnf.extend([token + ' = y' for token in tokens]) + else: + for token in tokens: + cnf.extend([token + ' = n']) + if token == 'OPTION_EGLIBC_NSSWITCH': + cnf.extend([OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG = ${S}/nss/nsswitch.conf]) + cnf.extend([OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS = ${S}/nss/fixed-nsswitch.functions]) + +# Map distro features to eglibc options settings +def
Re: [OE-core] [PATCH 1/1] eglibc: migrate configurability from oe
Hi Saul Koen, On 06/02/2011 02:41 AM, Kang Kai wrote: From: Kang Kaikai.k...@windriver.com Migrate configurability from oe, try to shrink minimal image size The switch is in local.conf.sample, uncomment the line DISTRO_FEATURES_EGLIBC = and write what options you want to enable. If want to disable locale-code charsets or locales, you have to uncomment PACKAGE_NO_GCONV = 1 Because without this, it fails on package_do_split_gconvs in libc-package.bbclass This should really be posted on the openembedded-core@lists.openembedded.org alias so that all can see it. I'll send it to oe-core right now. Thanks. Regards, Kai Signed-off-by: Kang Kaikai.k...@windriver.com --- meta-yocto/conf/local.conf.sample | 17 ++ .../eglibc-2.13-fix-macro-RTLD_DEBUG.patch | 20 +++ meta/recipes-core/eglibc/eglibc-options.inc| 55 meta/recipes-core/eglibc/eglibc.inc|6 ++ meta/recipes-core/eglibc/eglibc_2.13.bb|4 +- 5 files changed, 101 insertions(+), 1 deletions(-) create mode 100644 meta/recipes-core/eglibc/eglibc-2.13/eglibc-2.13-fix-macro-RTLD_DEBUG.patch create mode 100644 meta/recipes-core/eglibc/eglibc-options.inc diff --git a/meta-yocto/conf/local.conf.sample b/meta-yocto/conf/local.conf.sample index 359e510..310e51e 100644 --- a/meta-yocto/conf/local.conf.sample +++ b/meta-yocto/conf/local.conf.sample @@ -87,6 +87,23 @@ PACKAGE_CLASSES ?= package_rpm package_ipk # NOTE: if listing mklibs prelink both, then make sure mklibs is before prelink USER_CLASSES ?= image-mklibs image-prelink +# eglibc configurability is used to reduce minimal images's size. +# PACKAGE_NO_GCONV should be set to 1, or locale-code posix-clang-wchar +# charsets locales need to be include in DISTRO_FEATURES_EGLIBC, please check +# package_do_split_gconvs in libc-package.bbclass for detail +#PACKAGE_NO_GCONV = 1 + +# if you want to enable any option listed below, please uncomment next line and copy it here +#DISTRO_FEATURES_EGLIBC = + +DISTRO_FEATURES_EGLIBC ??= ipv6 backtrace big-macros bsd cxx-tests catgets charsets \ + crypt crypt-ufc db-aliases envz fcvt fmtmsg fstab ftraverse \ + getlogin idn inet inet-anl libm libm-big locales locale-code \ + memusage nis nsswitch rcmd rtld-debug spawn streams sunrpc utmp \ + utmpx wordexp posix-clang-wchar posix-regexp posix-regexp-glibc \ + posix-wchar-io + + I have some concern with this change being in sample, are these features enabled by default, is that the intention? If someone already has a local.conf then this will not be used, I think that the initial soft assignment (??=) needs to be someplace else, like in eglibc.inc maybe Sau! # POKYMODE controls the characteristics of the generated packages/images by # telling poky which type of toolchain to use. # diff --git a/meta/recipes-core/eglibc/eglibc-2.13/eglibc-2.13-fix-macro-RTLD_DEBUG.patch b/meta/recipes-core/eglibc/eglibc-2.13/eglibc-2.13-fix-macro-RTLD_DEBUG.patch new file mode 100644 index 000..dffc648 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-2.13/eglibc-2.13-fix-macro-RTLD_DEBUG.patch @@ -0,0 +1,20 @@ +When disable OPTION_EGLIBC_RTLD_DEBUG, compilation fails. +Created on Jun 1, 2011 by Kang Kaikai.k...@windriver.com + +Upstream-Status: Submitted + +Signed-off-by: Kang Kaikai.k...@windriver.com +Index: libc/elf/dl-lookup.c +=== +--- libc/elf/dl-lookup.c(revision 13356) libc/elf/dl-lookup.c(working copy) +@@ -423,7 +423,9 @@ + hash table. */ + if (__builtin_expect (tab-size, 0)) + { ++ #if __OPTION_EGLIBC_RTLD_DEBUG + assert (GLRO(dl_debug_mask) DL_DEBUG_PRELINK); ++ #endif + __rtld_lock_unlock_recursive (tab-lock); + goto success; + } diff --git a/meta/recipes-core/eglibc/eglibc-options.inc b/meta/recipes-core/eglibc/eglibc-options.inc new file mode 100644 index 000..7cd0287 --- /dev/null +++ b/meta/recipes-core/eglibc/eglibc-options.inc @@ -0,0 +1,55 @@ +def eglibc_cfg(feature, features, tokens, cnf): +if type(tokens) == type(): +tokens = [tokens] +if type(features) == type([]) and feature in features: +cnf.extend([token + ' = y' for token in tokens]) +else: +for token in tokens: +cnf.extend([token + ' = n']) +if token == 'OPTION_EGLIBC_NSSWITCH': +cnf.extend([OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG = ${S}/nss/nsswitch.conf]) +cnf.extend([OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS = ${S}/nss/fixed-nsswitch.functions]) + +# Map distro features to eglibc options settings +def features_to_eglibc_settings(d): +cnf = ([]) +distro_features