commit:     f0d5c947f4d53e8e2ec1762ff20c23328362a943
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Mon Nov  9 20:13:29 2020 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Tue Nov 10 19:15:45 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f0d5c947

sys-libs/glibc: move local-archive to /usr/lib/locale

Closes: https://bugs.gentoo.org/753740
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 .../{glibc-9999.ebuild => glibc-2.32-r3.ebuild}    | 59 ++++++++++++----------
 sys-libs/glibc/glibc-9999.ebuild                   | 32 +++++-------
 2 files changed, 45 insertions(+), 46 deletions(-)

diff --git a/sys-libs/glibc/glibc-9999.ebuild 
b/sys-libs/glibc/glibc-2.32-r3.ebuild
similarity index 97%
copy from sys-libs/glibc/glibc-9999.ebuild
copy to sys-libs/glibc/glibc-2.32-r3.ebuild
index ade64de2bd4..bbb7b0dfa30 100644
--- a/sys-libs/glibc/glibc-9999.ebuild
+++ b/sys-libs/glibc/glibc-2.32-r3.ebuild
@@ -16,16 +16,16 @@ SLOT="2.2"
 EMULTILIB_PKG="true"
 
 # Gentoo patchset (ignored for live ebuilds)
-PATCH_VER=16
-PATCH_DEV=slyfox
+PATCH_VER=2
+PATCH_DEV=dilfridge
 
 if [[ ${PV} == 9999* ]]; then
        inherit git-r3
 else
-       #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc 
~ppc64 ~riscv ~s390 ~sparc ~x86"
-       KEYWORDS=""
+       KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 
~riscv ~s390 ~sparc ~x86"
        SRC_URI="mirror://gnu/glibc/${P}.tar.xz"
        SRC_URI+=" 
https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${P}-patches-${PATCH_VER}.tar.xz";
+       SRC_URI+=" riscv? ( 
https://dev.gentoo.org/~dilfridge/distfiles/backport-rv32.txz )"
 fi
 
 RELEASE_VER=${PV}
@@ -133,13 +133,13 @@ RESTRICT="!test? ( test )"
 
 if [[ ${CATEGORY} == cross-* ]] ; then
        BDEPEND+=" !headers-only? (
-               >=${CATEGORY}/binutils-2.27
+               >=${CATEGORY}/binutils-2.24
                >=${CATEGORY}/gcc-6
        )"
        [[ ${CATEGORY} == *-linux* ]] && DEPEND+=" ${CATEGORY}/linux-headers"
 else
        BDEPEND+="
-               >=sys-devel/binutils-2.27
+               >=sys-devel/binutils-2.24
                >=sys-devel/gcc-6
        "
        DEPEND+=" virtual/os-headers "
@@ -765,6 +765,7 @@ src_unpack() {
 
        cd "${WORKDIR}" || die
        unpack locale-gen-${LOCALE_GEN_VER}.tar.gz
+       use riscv && unpack backport-rv32.txz
 }
 
 src_prepare() {
@@ -778,6 +779,12 @@ src_prepare() {
                elog "Applying Gentoo Glibc Patchset ${patchsetname}"
                eapply "${WORKDIR}"/patches
                einfo "Done."
+
+               if use riscv ; then
+                       elog "Adding rv32 backport patchset for glibc-2.32 
(experimental)"
+                       eapply "${WORKDIR}"/backport-rv32
+                       einfo "Done."
+               fi
        fi
 
        default
@@ -863,6 +870,14 @@ glibc_do_configure() {
                        # https://sourceware.org/PR24202
                        myconf+=( --enable-stack-protector=no )
                        ;;
+               powerpc-*)
+                       # Currently gcc on powerpc32 generates invalid code for
+                       # __builtin_return_address(0) calls. Normally programs
+                       # don't do that but malloc hooks in glibc do:
+                       # https://gcc.gnu.org/PR81996
+                       # https://bugs.gentoo.org/629054
+                       myconf+=( --enable-stack-protector=no )
+                       ;;
                *)
                        # Use '=strong' instead of '=all' to protect only 
functions
                        # worth protecting from stack smashes.
@@ -943,6 +958,11 @@ glibc_do_configure() {
                $(use_enable static-pie)
                $(use_enable systemtap)
                $(use_enable nscd)
+
+               # locale data is arch-independent
+               # https://bugs.gentoo.org/753740
+               libc_cv_complocaledir='${exec_prefix}/lib/locale'
+
                ${EXTRA_ECONF}
        )
 
@@ -1328,26 +1348,7 @@ glibc_do_src_install() {
        insinto /etc
        doins locale.gen
 
-       # Make sure all the ABI's can find the locales and so we only
-       # have to generate one set
-       local a
-       keepdir /usr/$(get_libdir)/locale
-       for a in $(get_install_abis) ; do
-               if [[ ! -e ${ED}/usr/$(get_abi_LIBDIR ${a})/locale ]] ; then
-                       dosym ../$(get_libdir)/locale /usr/$(get_abi_LIBDIR 
${a})/locale
-               fi
-       done
-
-       # HACK: If we're building for riscv, we need to additionally make sure 
that
-       # we can find the locale archive afterwards
-       case ${CTARGET} in
-               riscv*)
-                       if [[ ! -e ${ED}/usr/lib/locale ]] ; then
-                               dosym ../$(get_libdir)/locale /usr/lib/locale
-                       fi
-                       ;;
-               *) ;;
-       esac
+       keepdir /usr/lib/locale
 
        cd "${S}"
 
@@ -1474,6 +1475,12 @@ pkg_preinst() {
        [[ -n ${ROOT} ]] && return 0
        [[ -d ${ED}/$(get_libdir) ]] || return 0
        [[ -z ${BOOTSTRAP_RAP} ]] && glibc_sanity_check
+
+       if [[ -L ${EROOT}/usr/lib/locale ]]; then
+               # Help portage migrate this to a directory
+               # https://bugs.gentoo.org/753740
+               rm "${EROOT}"/usr/lib/locale || die
+       fi
 }
 
 pkg_postinst() {

diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild
index ade64de2bd4..c424c7a6b9b 100644
--- a/sys-libs/glibc/glibc-9999.ebuild
+++ b/sys-libs/glibc/glibc-9999.ebuild
@@ -943,6 +943,11 @@ glibc_do_configure() {
                $(use_enable static-pie)
                $(use_enable systemtap)
                $(use_enable nscd)
+
+               # locale data is arch-independent
+               # https://bugs.gentoo.org/753740
+               libc_cv_complocaledir='${exec_prefix}/lib/locale'
+
                ${EXTRA_ECONF}
        )
 
@@ -1328,26 +1333,7 @@ glibc_do_src_install() {
        insinto /etc
        doins locale.gen
 
-       # Make sure all the ABI's can find the locales and so we only
-       # have to generate one set
-       local a
-       keepdir /usr/$(get_libdir)/locale
-       for a in $(get_install_abis) ; do
-               if [[ ! -e ${ED}/usr/$(get_abi_LIBDIR ${a})/locale ]] ; then
-                       dosym ../$(get_libdir)/locale /usr/$(get_abi_LIBDIR 
${a})/locale
-               fi
-       done
-
-       # HACK: If we're building for riscv, we need to additionally make sure 
that
-       # we can find the locale archive afterwards
-       case ${CTARGET} in
-               riscv*)
-                       if [[ ! -e ${ED}/usr/lib/locale ]] ; then
-                               dosym ../$(get_libdir)/locale /usr/lib/locale
-                       fi
-                       ;;
-               *) ;;
-       esac
+       keepdir /usr/lib/locale
 
        cd "${S}"
 
@@ -1474,6 +1460,12 @@ pkg_preinst() {
        [[ -n ${ROOT} ]] && return 0
        [[ -d ${ED}/$(get_libdir) ]] || return 0
        [[ -z ${BOOTSTRAP_RAP} ]] && glibc_sanity_check
+
+       if [[ -L ${EROOT}/usr/lib/locale ]]; then
+               # Help portage migrate this to a directory
+               # https://bugs.gentoo.org/753740
+               rm "${EROOT}"/usr/lib/locale || die
+       fi
 }
 
 pkg_postinst() {

Reply via email to