public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Sergei Trofimovich <slyfox@gentoo.org>
To: gentoo-dev@lists.gentoo.org, toolchain@gentoo.org
Cc: Sergei Trofimovich <slyfox@gentoo.org>
Subject: [gentoo-dev] [PATCH] toolchain-glibc.eclass: fix libm.so symlinking for live glibc
Date: Tue,  8 Aug 2017 16:53:22 +0100	[thread overview]
Message-ID: <20170808155322.16552-1-slyfox@gentoo.org> (raw)

The failure happens when live glibc-9999 ebuild is installed:
 * QA Notice: Missing gen_usr_ldscript for libm-2.26.90.so
 * ERROR: sys-libs/glibc-9999::gentoo failed:
 *   add those ldscripts

The problem here is how upstream glibc version is detected:
    dosym ../../$(get_libdir)/libm-${PV}.so $(alt_usrlibdir)/libm-${PV}.so

Change to use 'version.h' to pick upstream version.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
---
 eclass/toolchain-glibc.eclass | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/eclass/toolchain-glibc.eclass b/eclass/toolchain-glibc.eclass
index 1d6a54a37f1..83d6293c6cb 100644
--- a/eclass/toolchain-glibc.eclass
+++ b/eclass/toolchain-glibc.eclass
@@ -1138,10 +1138,14 @@ toolchain-glibc_do_src_install() {
 		cp -a elf/ld.so "${ED}"$(alt_libdir)/$(scanelf -qSF'%S#F' elf/ld.so) || die "copying nptl interp"
 	fi
 
+	# Normally real_pv is ${PV}. Live ebuilds are exception, there we need
+	# to infer upstream version:
+	# '#define VERSION "2.26.90"' -> '2.26.90'
+	local upstream_pv=$(sed -n -r 's/#define VERSION "(.*)"/\1/p' "${S}"/version.h)
 	# Newer versions get fancy with libm linkage to include vectorized support.
 	# While we don't really need a ldscript here, portage QA checks get upset.
-	if [[ -e ${ED}$(alt_usrlibdir)/libm-${PV}.a ]] ; then
-		dosym ../../$(get_libdir)/libm-${PV}.so $(alt_usrlibdir)/libm-${PV}.so
+	if [[ -e ${ED}$(alt_usrlibdir)/libm-${upstream_pv}.a ]] ; then
+		dosym ../../$(get_libdir)/libm-${upstream_pv}.so $(alt_usrlibdir)/libm-${upstream_pv}.so
 	fi
 
 	# We'll take care of the cache ourselves
-- 
2.14.0



             reply	other threads:[~2017-08-08 15:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-08 15:53 Sergei Trofimovich [this message]
2017-08-10 21:41 ` [gentoo-dev] Re: [PATCH] toolchain-glibc.eclass: fix libm.so symlinking for live glibc Duncan
2017-08-11  8:14   ` Sergei Trofimovich
2017-08-11  9:29     ` Duncan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170808155322.16552-1-slyfox@gentoo.org \
    --to=slyfox@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=toolchain@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox