Skip to contentSkip to conversation

site/common-glibc: Set gnulib locale variables

PATCH New Richard Purdie 1 participant 4 messages Sep 18

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 site/common-glibc: Set gnulib locale variables

These locale variables are determined by running test binaries. Our sysroots don't really set up locales properly and the results vary depending on the host architecture and the locales installed.

Fix the values to a known set of locales that could be installed if the user does so which is at least determinsitic. These are selected so the m4 recipe ptests run successfully.

An extra mbrtoc32 macro needs to also be set to have zh_CN work correctly on target.

We still need the musl equivalent to this.

---
 meta/site/common-glibc | 10 ++++++++++
 1 file changed, 10 insertions(+)
meta/site/common-glibc +10 -0
index 29f96da48d6..4dbfb4cb57f 100644
@@ -67,9 +67,19 @@ gl_cv_func_mbrtowc_sanitycheck=${gl_cv_func_mbrtowc_sanitycheck=yes}
 gl_cv_func_mbrtowc_null_arg=${gl_cv_func_mbrtowc_null_arg=yes}
 gl_cv_func_mbrtowc_retval=${gl_cv_func_mbrtowc_retval=yes}
 gl_cv_func_mbrtowc_nul_retval=${gl_cv_func_mbrtowc_nul_retval=yes}
+gl_cv_func_mbrtoc32_utf8_locale_works=yes
 
 # va_copy and _va_copy
 ac_cv_va_copy=${ac_cv_va_copy=yes}
 ac_cv___va_copy=${ac_cv___va_copy=yes}
 ac_cv_func_va_copy=${ac_cv_func_va_copy=yes}
 ac_cv_func___va_copy=${ac_cv_func___va_copy=yes}
+
+# gnulib locale-en.m4 and friends look at the sysroot or host locales
+# we need something deterministic
+gt_cv_locale_en_utf8=en_US.UTF-8
+gt_cv_locale_fr=fr_FR.iso88591
+gt_cv_locale_fr_utf8=fr_FR.UTF-8
+gt_cv_locale_zh_CN=zh_CN.GB18030
+gt_cv_locale_ja=ja_JP.euc_jp
+gt_cv_locale_tr_utf8=tr_TR.UTF-8
#1 lore raw

PATCH 2/4 m4: Add missing ptest locale dependencies

With the locale configure values set correctly in the site files, it highlights missing test dependencies. Add those and also remove the previous configure workarounds for locales which are now not needed.

---
 meta/recipes-devtools/m4/m4-1.4.21.inc | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
meta/recipes-devtools/m4/m4-1.4.21.inc +6 -5
index 3be6a521a86..41f8021d025 100644
@@ -47,14 +47,15 @@ do_install_ptest() {
                      ${D}${PTEST_PATH}/tests/test-xalloc-die
 }
 
-do_install_ptest:append:libc-glibc() {
-                sed -i -e  "s;LOCALE_FR='fr_FR';LOCALE_FR='fr_FR.iso88591';g" \
-                       -e  "s;LOCALE_FR_UTF8='none';LOCALE_FR_UTF8='fr_FR.utf8';g" ${D}${PTEST_PATH}/tests/Makefile
-}
-
 RDEPENDS:${PN}-ptest += "make coreutils diffutils bash locale-base-fr-fr"
 
 RDEPENDS:${PN}-ptest:append:libc-glibc = "\
+     locale-base-ja-jp.euc-jp \
      locale-base-fr-fr.iso-8859-1 \
+     locale-base-tr-tr \
+     locale-base-en-us \
+     locale-base-zh-cn.gb18030 \
      glibc-gconv-iso8859-1 \
+     glibc-gconv-euc-jp \
+     glibc-gconv-gb18030 \
 "
#2 lore raw

PATCH 3/4 coreutils: Add missing locale ptest dependencies

In reply to Richard Purdie

With the site file locale entries fixed, we need these dependencies to avoid test failures.

---
 meta/recipes-core/coreutils/coreutils_9.11.bb | 11 +++++++++++
 1 file changed, 11 insertions(+)
meta/recipes-core/coreutils/coreutils_9.11.bb +11 -0
index bbef3263994..b24a9ac9962 100644
@@ -230,3 +230,14 @@ RDEPENDS:${PN}-ptest += "xz  \
                          ${@bb.utils.filter('PACKAGECONFIG', 'acl', d)} \
                          ${@bb.utils.contains('PACKAGECONFIG', 'xattr', 'attr', '', d)}"
 FILES:${PN}-ptest += "${bindir}/getlimits"
+
+RDEPENDS:${PN}-ptest:append:libc-glibc = "\
+     locale-base-ja-jp.euc-jp \
+     locale-base-fr-fr \
+     locale-base-fr-fr.iso-8859-1 \
+     locale-base-zh-cn.gb18030 \
+     glibc-gconv-iso8859-1 \
+     glibc-gconv-euc-jp \
+     glibc-gconv-gb18030 \
+"
+
#3 lore raw

PATCH 4/4 gettext: Add missing locale ptest dependency

In reply to Richard Purdie

The site files handle the fr locale now.

Add a missing locale dependency so tests work with the new site file entries.

---
 meta/recipes-core/gettext/gettext_1.0.bb | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
meta/recipes-core/gettext/gettext_1.0.bb +1 -2
index ce1d698260d..8a93ce1b49d 100644
@@ -50,8 +50,6 @@ EXTRA_OECONF += "--without-lispdir \
                 "
 EXTRA_OECONF:append:class-target = " \
                  --with-bisonlocaledir=${datadir}/locale \
-                 gt_cv_locale_fr_utf8=fr_FR \
-                 gt_cv_locale_fr=fr_FR.ISO-8859-1 \
                  gt_cv_locale_de_utf8=de_DE \
                  gt_cv_locale_de=de_DE.ISO-8859-1 \
 "
@@ -224,6 +222,7 @@ RDEPENDS:${PN}-ptest:append:libc-glibc = "\
 RRECOMMENDS:${PN}-ptest:append:libc-glibc = "\
     locale-base-de-de.iso-8859-1 \
     locale-base-fr-fr.iso-8859-1 \
+    locale-base-ja-jp.euc-jp \
 "
 
 BBCLASSEXTEND = "native nativesdk"