diff options
Diffstat (limited to 'meta/recipes-core/glibc')
-rw-r--r-- | meta/recipes-core/glibc/cross-localedef-native_2.24.bb | 1 | ||||
-rw-r--r-- | meta/recipes-core/glibc/glibc-collateral.inc | 2 | ||||
-rw-r--r-- | meta/recipes-core/glibc/glibc-initial.inc | 2 | ||||
-rw-r--r-- | meta/recipes-core/glibc/glibc-locale.inc | 5 | ||||
-rw-r--r-- | meta/recipes-core/glibc/glibc-mtrace.inc | 2 | ||||
-rw-r--r-- | meta/recipes-core/glibc/glibc-package.inc | 45 | ||||
-rw-r--r-- | meta/recipes-core/glibc/glibc-scripts.inc | 2 | ||||
-rw-r--r-- | meta/recipes-core/glibc/glibc/archive-path.patch | 39 | ||||
-rw-r--r-- | meta/recipes-core/glibc/glibc/relocate-locales.patch | 33 | ||||
-rw-r--r-- | meta/recipes-core/glibc/glibc_2.24.bb | 7 |
10 files changed, 108 insertions, 30 deletions
diff --git a/meta/recipes-core/glibc/cross-localedef-native_2.24.bb b/meta/recipes-core/glibc/cross-localedef-native_2.24.bb index 4a77eee2c9..ceaaf97308 100644 --- a/meta/recipes-core/glibc/cross-localedef-native_2.24.bb +++ b/meta/recipes-core/glibc/cross-localedef-native_2.24.bb @@ -37,6 +37,7 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ file://0024-eglibc-Forward-port-cross-locale-generation-support.patch \ file://0025-Define-DUMMY_LOCALE_T-if-not-defined.patch \ file://0001-Include-locale_t.h-compatibility-header.patch \ + file://archive-path.patch \ " # Makes for a rather long rev (22 characters), but... # diff --git a/meta/recipes-core/glibc/glibc-collateral.inc b/meta/recipes-core/glibc/glibc-collateral.inc index 60655eba3c..5159a6d453 100644 --- a/meta/recipes-core/glibc/glibc-collateral.inc +++ b/meta/recipes-core/glibc/glibc-collateral.inc @@ -15,7 +15,7 @@ do_patch[noexec] = "1" do_configure[noexec] = "1" do_compile[noexec] = "1" -do_install[depends] += "virtual/${MLPREFIX}libc:do_populate_sysroot" +do_install[depends] += "virtual/${MLPREFIX}libc:do_stash_locale" COMPATIBLE_HOST_libc-musl_class-target = "null" COMPATIBLE_HOST_libc-uclibc_class-target = "null" diff --git a/meta/recipes-core/glibc/glibc-initial.inc b/meta/recipes-core/glibc/glibc-initial.inc index 2e3bc8104a..8058b68d62 100644 --- a/meta/recipes-core/glibc/glibc-initial.inc +++ b/meta/recipes-core/glibc/glibc-initial.inc @@ -48,7 +48,7 @@ do_install () { done } -do_install_locale() { +do_stash_locale() { : } diff --git a/meta/recipes-core/glibc/glibc-locale.inc b/meta/recipes-core/glibc/glibc-locale.inc index 3fecdf996c..d09e6e355c 100644 --- a/meta/recipes-core/glibc/glibc-locale.inc +++ b/meta/recipes-core/glibc/glibc-locale.inc @@ -12,7 +12,7 @@ BINUTILSDEP = "virtual/${MLPREFIX}${TARGET_PREFIX}binutils:do_populate_sysroot" BINUTILSDEP_class-nativesdk = "virtual/${TARGET_PREFIX}binutils-crosssdk:do_populate_sysroot" do_package[depends] += "${BINUTILSDEP}" -# localedef links with libc.so and glibc-collateral.incinhibits all default deps +# localedef links with libc.so and glibc-collateral.inc inhibits all default deps # cannot add virtual/libc to DEPENDS, because it would conflict with libc-initial in RSS RDEPENDS_localedef += "glibc" @@ -39,7 +39,6 @@ PACKAGES = "localedef ${PN}-dbg" PACKAGES_DYNAMIC = "^locale-base-.* \ ^glibc-gconv-.* ^glibc-charmap-.* ^glibc-localedata-.* ^glibc-binary-localedata-.* \ - ^glibc-gconv-.* ^glibc-charmap-.* ^glibc-localedata-.* ^glibc-binary-localedata-.* \ ^${MLPREFIX}glibc-gconv$" # Create a glibc-binaries package @@ -70,7 +69,7 @@ DESCRIPTION_localedef = "glibc: compile locale definition files" FILES_${MLPREFIX}glibc-gconv = "${libdir}/gconv/*" FILES_localedef = "${bindir}/localedef" -LOCALETREESRC = "${STAGING_INCDIR}/glibc-locale-internal-${MULTIMACH_TARGET_SYS}" +LOCALETREESRC = "${STAGING_DIR}-components/${PACKAGE_ARCH}/glibc-stash-locale" do_install () { mkdir -p ${D}${bindir} ${D}${datadir} ${D}${libdir} diff --git a/meta/recipes-core/glibc/glibc-mtrace.inc b/meta/recipes-core/glibc/glibc-mtrace.inc index e12b079e06..a7f9f7872f 100644 --- a/meta/recipes-core/glibc/glibc-mtrace.inc +++ b/meta/recipes-core/glibc/glibc-mtrace.inc @@ -5,7 +5,7 @@ DESCRIPTION = "mtrace utility provided by glibc" RDEPENDS_${PN} = "perl" RPROVIDES_${PN} = "libc-mtrace" -SRC = "${STAGING_INCDIR}/glibc-scripts-internal-${MULTIMACH_TARGET_SYS}" +SRC = "${STAGING_DIR}-components/${PACKAGE_ARCH}/glibc-stash-locale/scripts" do_install() { install -d -m 0755 ${D}${bindir} diff --git a/meta/recipes-core/glibc/glibc-package.inc b/meta/recipes-core/glibc/glibc-package.inc index bad642449a..6f4e71d1de 100644 --- a/meta/recipes-core/glibc/glibc-package.inc +++ b/meta/recipes-core/glibc/glibc-package.inc @@ -145,8 +145,11 @@ do_install_append_aarch64 () { fi } -do_install_locale () { - dest=${D}/${includedir}/glibc-locale-internal-${MULTIMACH_TARGET_SYS} +LOCALESTASH = "${WORKDIR}/stashed-locale" +bashscripts = "mtrace sotruss xtrace" + +do_stash_locale () { + dest=${LOCALESTASH} install -d ${dest}${base_libdir} ${dest}${bindir} ${dest}${libdir} ${dest}${datadir} if [ "${base_libdir}" != "${libdir}" ]; then cp -fpPR ${D}${base_libdir}/* ${dest}${base_libdir} @@ -166,14 +169,8 @@ do_install_locale () { cp -fpPR ${D}${datadir}/* ${dest}${datadir} rm -rf ${D}${datadir}/locale/ cp -fpPR ${WORKDIR}/SUPPORTED ${dest} -} - -addtask do_install_locale after do_install before do_populate_sysroot do_package -bashscripts = "mtrace sotruss xtrace" - -do_evacuate_scripts () { - target=${D}${includedir}/glibc-scripts-internal-${MULTIMACH_TARGET_SYS} + target=${dest}/scripts mkdir -p $target for i in ${bashscripts}; do if [ -f ${D}${bindir}/$i ]; then @@ -182,22 +179,36 @@ do_evacuate_scripts () { done } -addtask evacuate_scripts after do_install before do_populate_sysroot do_package +addtask do_stash_locale after do_install before do_populate_sysroot do_package +do_stash_locale[dirs] = "${B}" +do_stash_locale[cleandirs] = "${LOCALESTASH}" +SSTATETASKS += "do_stash_locale" +do_stash_locale[sstate-inputdirs] = "${LOCALESTASH}" +do_stash_locale[sstate-outputdirs] = "${STAGING_DIR}-components/${PACKAGE_ARCH}/glibc-stash-locale" +do_stash_locale[sstate-fixmedir] = "${STAGING_DIR}-components/${PACKAGE_ARCH}/glibc-stash-locale" -PACKAGE_PREPROCESS_FUNCS += "glibc_package_preprocess" +python do_stash_locale_setscene () { + sstate_setscene(d) +} +addtask do_stash_locale_setscene -glibc_package_preprocess () { - rm -rf ${PKGD}/${includedir}/glibc-locale-internal-${MULTIMACH_TARGET_SYS} - rm -rf ${PKGD}/${includedir}/glibc-scripts-internal-${MULTIMACH_TARGET_SYS} +do_poststash_install_cleanup () { + # Remove all files which do_stash_locale would remove (mv) + # since that task could have come from sstate and not get run. for i in ${bashscripts}; do - rm -f ${PKGD}${bindir}/$i + rm -f ${D}${bindir}/$i done - rm -rf ${PKGD}/${localedir} + rm -f ${D}${bindir}/localedef + rm -rf ${D}${datadir}/i18n + rm -rf ${D}${libdir}/gconv + rm -rf ${D}/${localedir} + rm -rf ${D}${datadir}/locale if [ "${libdir}" != "${exec_prefix}/lib" ]; then # This dir only exists to hold locales - rm -rf ${PKGD}${exec_prefix}/lib + rm -rf ${D}${exec_prefix}/lib fi } +addtask do_poststash_install_cleanup after do_stash_locale do_install before do_populate_sysroot do_package pkg_postinst_nscd () { if [ -z "$D" ]; then diff --git a/meta/recipes-core/glibc/glibc-scripts.inc b/meta/recipes-core/glibc/glibc-scripts.inc index bce0a42106..c661f2b636 100644 --- a/meta/recipes-core/glibc/glibc-scripts.inc +++ b/meta/recipes-core/glibc/glibc-scripts.inc @@ -4,7 +4,7 @@ SUMMARY = "utility scripts provided by glibc" DESCRIPTION = "utility scripts provided by glibc" RDEPENDS_${PN} = "bash glibc-mtrace" -SRC = "${STAGING_INCDIR}/glibc-scripts-internal-${MULTIMACH_TARGET_SYS}" +SRC = "${STAGING_DIR}-components/${PACKAGE_ARCH}/glibc-stash-locale/scripts" bashscripts = "sotruss xtrace" diff --git a/meta/recipes-core/glibc/glibc/archive-path.patch b/meta/recipes-core/glibc/glibc/archive-path.patch new file mode 100644 index 0000000000..b0d3158cfe --- /dev/null +++ b/meta/recipes-core/glibc/glibc/archive-path.patch @@ -0,0 +1,39 @@ +localedef --add-to-archive uses a hard-coded locale path which doesn't exist in +normal use, and there's no way to pass an alternative filename. + +Add a fallback of $LOCALEARCHIVE from the environment, and allow creation of new locale archives that are not the system archive. + +Upstream-Status: Inappropriate (OE-specific) +Signed-off-by: Ross Burton <ross.burton@intel.com> + +diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c +index ca332a34..6b7ba9b2 100644 +--- a/locale/programs/locarchive.c ++++ b/locale/programs/locarchive.c +@@ -569,10 +569,13 @@ open_archive (struct locarhandle *ah, bool readonly) + /* If ah has a non-NULL fname open that otherwise open the default. */ + if (archivefname == NULL) + { +- archivefname = default_fname; +- if (output_prefix) +- memcpy (default_fname, output_prefix, prefix_len); +- strcpy (default_fname + prefix_len, ARCHIVE_NAME); ++ archivefname = getenv("LOCALEARCHIVE"); ++ if (archivefname == NULL) { ++ archivefname = default_fname; ++ if (output_prefix) ++ memcpy (default_fname, output_prefix, prefix_len); ++ strcpy (default_fname + prefix_len, ARCHIVE_NAME); ++ } + } + + while (1) +@@ -585,7 +588,7 @@ open_archive (struct locarhandle *ah, bool readonly) + the default locale archive we ignore the failure and + list an empty archive, otherwise we print an error + and exit. */ +- if (errno == ENOENT && archivefname == default_fname) ++ if (errno == ENOENT) + { + if (readonly) + { diff --git a/meta/recipes-core/glibc/glibc/relocate-locales.patch b/meta/recipes-core/glibc/glibc/relocate-locales.patch new file mode 100644 index 0000000000..11f7df4aca --- /dev/null +++ b/meta/recipes-core/glibc/glibc/relocate-locales.patch @@ -0,0 +1,33 @@ +The glibc locale path is hard-coded to the install prefix, but in SDKs we need +to be able to relocate the binaries. Expand the strings to 4K and put them in a +magic segment that we can relocate at install time. + +Upstream-Status: Inappropriate (OE-specific) +Signed-off-by: Ross Burton <ross.burton@intel.com> + +Index: git/locale/localeinfo.h +=================================================================== +--- git.orig/locale/localeinfo.h ++++ git/locale/localeinfo.h +@@ -325,7 +325,7 @@ _nl_lookup_word (locale_t l, int categor + } + + /* Default search path if no LOCPATH environment variable. */ +-extern char _nl_default_locale_path[] attribute_hidden; ++extern char _nl_default_locale_path[4096] attribute_hidden; + + /* Load the locale data for CATEGORY from the file specified by *NAME. + If *NAME is "", use environment variables as specified by POSIX, and +Index: git/locale/loadarchive.c +=================================================================== +--- git.orig/locale/loadarchive.c ++++ git/locale/loadarchive.c +@@ -42,7 +42,7 @@ + + + /* Name of the locale archive file. */ +-static const char archfname[] = COMPLOCALEDIR "/locale-archive"; ++static const char archfname[4096] __attribute__ ((section (".gccrelocprefix"))) = COMPLOCALEDIR "/locale-archive"; + + /* Size of initial mapping window, optimal if large enough to + cover the header plus the initial locale. */ diff --git a/meta/recipes-core/glibc/glibc_2.24.bb b/meta/recipes-core/glibc/glibc_2.24.bb index 6ea45857d2..94df4fc948 100644 --- a/meta/recipes-core/glibc/glibc_2.24.bb +++ b/meta/recipes-core/glibc/glibc_2.24.bb @@ -65,6 +65,7 @@ SRC_URI_append_class-nativesdk = "\ file://0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch \ file://0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch \ file://0004-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch \ + file://relocate-locales.patch \ " S = "${WORKDIR}/git" @@ -144,12 +145,6 @@ do_compile () { } -# Use the host locale archive when built for nativesdk so that we don't need to -# ship a complete (100MB) locale set. -do_compile_prepend_class-nativesdk() { - echo "complocaledir=/usr/lib/locale" >> ${S}/configparms -} - require glibc-package.inc BBCLASSEXTEND = "nativesdk" |