Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: profiles/prefix/linux/
Date: Sun, 21 Feb 2016 16:59:58
Message-Id: 1456073967.022e9119a570763a27a3a9a5b1563a90e115220b.grobian@gentoo
1 commit: 022e9119a570763a27a3a9a5b1563a90e115220b
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 21 16:58:51 2016 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 21 16:59:27 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=022e9119
7
8 profiles/prefix/linux/profile.bashrc: do not require ldd, bug #572902
9
10 profiles/prefix/linux/profile.bashrc | 23 ++++++++++++++++++++---
11 1 file changed, 20 insertions(+), 3 deletions(-)
12
13 diff --git a/profiles/prefix/linux/profile.bashrc b/profiles/prefix/linux/profile.bashrc
14 index 4e92182..693dd8e 100644
15 --- a/profiles/prefix/linux/profile.bashrc
16 +++ b/profiles/prefix/linux/profile.bashrc
17 @@ -3,10 +3,27 @@
18 #
19 # # Remember, bash treats floats like strings..
20
21 +get_libc_vers_min() {
22 + if [[ -x /usr/bin/ldd ]] ; then
23 + /usr/bin/ldd --version \
24 + | head -n1 \
25 + | grep -o ") 2\.[0-9]\+" \
26 + | cut -d. -f2
27 + return
28 + elif [[ -x /lib/libc.so.6 || -x /lib64/libc.so.6 ]] ; then
29 + /lib/libc.so.6 || lib64/libc.so.6 \
30 + | head -n1 \
31 + | grep -o 'version 2\.[0-9]\+' \
32 + | cut -d. -f2
33 + return
34 + fi
35 + echo "0"
36 +}
37 +
38 if [[ ${CATEGORY}/${PN} == sys-devel/gcc && ${EBUILD_PHASE} == unpack ]]; then
39 # Since 2.3 > 2.12 in numerical terms, just compare 2.X to 2.Y, will break
40 # if >=3.0 is ever released
41 - VERS=$(/usr/bin/ldd --version | head -n1 | grep -o ") [0-9]\.[0-9]\+" | cut -d. -f2 )
42 + VERS=$(get_libc_vers_min)
43 if [[ $VERS -lt 12 ]]; then # compare host glibc 2.x to 2.12
44 ewarn "Your host glibc is too old; disabling automatic fortify. bug 289757"
45 EPATCH_EXCLUDE+=" 10_all_gcc-default-fortify-source.patch" # <=gcc-4.5*
46 @@ -15,11 +32,11 @@ if [[ ${CATEGORY}/${PN} == sys-devel/gcc && ${EBUILD_PHASE} == unpack ]]; then
47 fi
48
49 if [[ ${EBUILD_PHASE} == setup ]]; then
50 - VERS=$(/usr/bin/ldd --version | head -n1 | grep -o ") [0-9]\.[0-9]\+" | cut -d. -f2 )
51 + VERS=$(get_libc_vers_min)
52 if [[ $VERS -lt 6 && "${CFLAGS} " != *'gnu89-inline '* ]]; then # compare host glibc 2.x to 2.6
53 einfo "Your host glibc is too old; enabling -fgnu89-inline compiler flag. bug 473524"
54 CFLAGS="${CFLAGS} -fgnu89-inline" # for C only
55 fi
56 fi
57
58 -# vim: set syn=sh expandtab ts=4:
59 +# vim: set syn=sh: