sys-libs/glibc: Work around usrmerge problems

Portage will blindly clobber like-named files when extracting /lib
and /usr/lib if they are symlinked together on the host.  In this
case, it extracts a symlink that points to itself, so this changes
it to move the library into /usr for the boards.  Checks in portage
and the ChromeOS scripts prevent any straightforward copying or
linking.
This commit is contained in:
David Michael 2018-04-04 14:45:55 -04:00
parent 31718996a0
commit f1286ee37b

View File

@ -166,6 +166,16 @@ src_prepare() {
src_install() {
toolchain-glibc_src_install "$@"
# Work around #627378 on the boards.
if [[ ${ROOT:-/} =~ ^/build/ ]] ; then
local libm=("${ED}"/usr/lib*/libm-${PV}.so)
libm="${libm[0]:${#ED}}"
if [ -h "${ED}$libm" ] ; then
rm -f "${ED}$libm"
mv "${ED}${libm#/usr}" "${ED}$libm"
fi
fi
# Use tmpfiles to put nscd.conf in /etc and create directories.
insinto /usr/share/baselayout
if ! in_iuse nscd || use nscd ; then