From f1286ee37bc2e4e9b90d354f881e9722b73c96f5 Mon Sep 17 00:00:00 2001 From: David Michael Date: Wed, 4 Apr 2018 14:45:55 -0400 Subject: [PATCH] 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. --- .../sys-libs/glibc/glibc-2.25-r11.ebuild | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/glibc-2.25-r11.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/glibc-2.25-r11.ebuild index 2bbe170673..1c80ea228f 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/glibc-2.25-r11.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/sys-libs/glibc/glibc-2.25-r11.ebuild @@ -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