Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/glibc/
Date: Sun, 31 Dec 2017 21:26:45
Message-Id: 1514755589.0e95698ff9584aa8045275705c0247a77264d044.slyfox@gentoo
1 commit: 0e95698ff9584aa8045275705c0247a77264d044
2 Author: Matija Skala <mskala <AT> gmx <DOT> com>
3 AuthorDate: Thu Nov 9 16:49:37 2017 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Sun Dec 31 21:26:29 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0e95698f
7
8 sys-libs/glibc: avoid libm-2.26.so symlink clash on merged /usr, bug #627378
9
10 The problem in bug #627378 manifests as libm-2.26.so file corruption:
11
12 Before the change glibc package contained a 'libm-2.26.so'
13 symlink from '/usr/lib64' to '/lib64':
14
15 $ equery f sys-libs/glibc | sed 's@usr/lib@lib@g' | sort | uniq -d
16 /lib64/libm-2.26.so
17
18 When both are the same directory all depends on the merge order:
19 - symlink first, then real file. real file overwrites symlink, all is good
20 - real file first, then symlink. symlink overwrites the file and points to
21 itself. Binaries linked against libm fail to start.
22
23 The change is to get rid of symlink (symlink was a workaround to portage's
24 QA check) and move 'libm-2.26.a' from '/usr/lib64' to '/usr/lib64/glibc-<pv>'.
25
26 Reported-by: Duncan
27 Fixed-by: Matija Skala
28 Closes: https://bugs.gentoo.org/627378
29 Closes: https://github.com/gentoo/gentoo/pull/4268
30
31 sys-libs/glibc/{glibc-2.26-r4.ebuild => glibc-2.26-r5.ebuild} | 11 +++++++----
32 sys-libs/glibc/glibc-9999.ebuild | 11 +++++++----
33 2 files changed, 14 insertions(+), 8 deletions(-)
34
35 diff --git a/sys-libs/glibc/glibc-2.26-r4.ebuild b/sys-libs/glibc/glibc-2.26-r5.ebuild
36 similarity index 97%
37 rename from sys-libs/glibc/glibc-2.26-r4.ebuild
38 rename to sys-libs/glibc/glibc-2.26-r5.ebuild
39 index 97cf7ef1cbc..abde9e62f95 100644
40 --- a/sys-libs/glibc/glibc-2.26-r4.ebuild
41 +++ b/sys-libs/glibc/glibc-2.26-r5.ebuild
42 @@ -607,15 +607,18 @@ glibc_do_src_install() {
43 find "${D}" -name "libnsl.a" -delete
44 find "${D}" -name "libnsl.so" -delete
45
46 - # Normally real_pv is ${PV}. Live ebuilds are exception, there we need
47 + # Normally upstream_pv is ${PV}. Live ebuilds are exception, there we need
48 # to infer upstream version:
49 # '#define VERSION "2.26.90"' -> '2.26.90'
50 local upstream_pv=$(sed -n -r 's/#define VERSION "(.*)"/\1/p' "${S}"/version.h)
51
52 - # Newer versions get fancy with libm linkage to include vectorized support.
53 - # While we don't really need a ldscript here, portage QA checks get upset.
54 if [[ -e ${ED}$(alt_usrlibdir)/libm-${upstream_pv}.a ]] ; then
55 - dosym ../../$(get_libdir)/libm-${upstream_pv}.so $(alt_usrlibdir)/libm-${upstream_pv}.so
56 + # Move versioned .a file out of libdir to evade portage QA checks
57 + # instead of using gen_usr_ldscript(). We fix ldscript as:
58 + # "GROUP ( /usr/lib64/libm-<pv>.a ..." -> "GROUP ( /usr/lib64/glibc-<pv>/libm-<pv>.a ..."
59 + sed -i "s@\(libm-${upstream_pv}.a\)@${P}/\1@" "${ED}"$(alt_usrlibdir)/libm.a || die
60 + dodir $(alt_usrlibdir)/${P}
61 + mv "${ED}"$(alt_usrlibdir)/libm-${upstream_pv}.a "${ED}"$(alt_usrlibdir)/${P}/libm-${upstream_pv}.a || die
62 fi
63
64 # We'll take care of the cache ourselves
65
66 diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild
67 index a5bf3b51ebc..2aed938db02 100644
68 --- a/sys-libs/glibc/glibc-9999.ebuild
69 +++ b/sys-libs/glibc/glibc-9999.ebuild
70 @@ -614,15 +614,18 @@ glibc_do_src_install() {
71 find "${D}" -name "libnsl.a" -delete
72 find "${D}" -name "libnsl.so" -delete
73
74 - # Normally real_pv is ${PV}. Live ebuilds are exception, there we need
75 + # Normally upstream_pv is ${PV}. Live ebuilds are exception, there we need
76 # to infer upstream version:
77 # '#define VERSION "2.26.90"' -> '2.26.90'
78 local upstream_pv=$(sed -n -r 's/#define VERSION "(.*)"/\1/p' "${S}"/version.h)
79
80 - # Newer versions get fancy with libm linkage to include vectorized support.
81 - # While we don't really need a ldscript here, portage QA checks get upset.
82 if [[ -e ${ED}$(alt_usrlibdir)/libm-${upstream_pv}.a ]] ; then
83 - dosym ../../$(get_libdir)/libm-${upstream_pv}.so $(alt_usrlibdir)/libm-${upstream_pv}.so
84 + # Move versioned .a file out of libdir to evade portage QA checks
85 + # instead of using gen_usr_ldscript(). We fix ldscript as:
86 + # "GROUP ( /usr/lib64/libm-<pv>.a ..." -> "GROUP ( /usr/lib64/glibc-<pv>/libm-<pv>.a ..."
87 + sed -i "s@\(libm-${upstream_pv}.a\)@${P}/\1@" "${ED}"$(alt_usrlibdir)/libm.a || die
88 + dodir $(alt_usrlibdir)/${P}
89 + mv "${ED}"$(alt_usrlibdir)/libm-${upstream_pv}.a "${ED}"$(alt_usrlibdir)/${P}/libm-${upstream_pv}.a || die
90 fi
91
92 # We'll take care of the cache ourselves