summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2016-02-21 17:58:51 +0100
committerFabian Groffen <grobian@gentoo.org>2016-02-21 17:59:27 +0100
commit022e9119a570763a27a3a9a5b1563a90e115220b (patch)
tree86aee7cb473009dd72323a2c7038812edc741b27 /profiles
parentprofiles/package.mask: Mask dev-java/concurrent-util for removal. See bug 544... (diff)
downloadgentoo-022e9119a570763a27a3a9a5b1563a90e115220b.tar.gz
gentoo-022e9119a570763a27a3a9a5b1563a90e115220b.tar.bz2
gentoo-022e9119a570763a27a3a9a5b1563a90e115220b.zip
profiles/prefix/linux/profile.bashrc: do not require ldd, bug #572902
Diffstat (limited to 'profiles')
-rw-r--r--profiles/prefix/linux/profile.bashrc23
1 files changed, 20 insertions, 3 deletions
diff --git a/profiles/prefix/linux/profile.bashrc b/profiles/prefix/linux/profile.bashrc
index 4e9218257749..693dd8e407ad 100644
--- a/profiles/prefix/linux/profile.bashrc
+++ b/profiles/prefix/linux/profile.bashrc
@@ -3,10 +3,27 @@
#
# # Remember, bash treats floats like strings..
+get_libc_vers_min() {
+ if [[ -x /usr/bin/ldd ]] ; then
+ /usr/bin/ldd --version \
+ | head -n1 \
+ | grep -o ") 2\.[0-9]\+" \
+ | cut -d. -f2
+ return
+ elif [[ -x /lib/libc.so.6 || -x /lib64/libc.so.6 ]] ; then
+ /lib/libc.so.6 || lib64/libc.so.6 \
+ | head -n1 \
+ | grep -o 'version 2\.[0-9]\+' \
+ | cut -d. -f2
+ return
+ fi
+ echo "0"
+}
+
if [[ ${CATEGORY}/${PN} == sys-devel/gcc && ${EBUILD_PHASE} == unpack ]]; then
# Since 2.3 > 2.12 in numerical terms, just compare 2.X to 2.Y, will break
# if >=3.0 is ever released
- VERS=$(/usr/bin/ldd --version | head -n1 | grep -o ") [0-9]\.[0-9]\+" | cut -d. -f2 )
+ VERS=$(get_libc_vers_min)
if [[ $VERS -lt 12 ]]; then # compare host glibc 2.x to 2.12
ewarn "Your host glibc is too old; disabling automatic fortify. bug 289757"
EPATCH_EXCLUDE+=" 10_all_gcc-default-fortify-source.patch" # <=gcc-4.5*
@@ -15,11 +32,11 @@ if [[ ${CATEGORY}/${PN} == sys-devel/gcc && ${EBUILD_PHASE} == unpack ]]; then
fi
if [[ ${EBUILD_PHASE} == setup ]]; then
- VERS=$(/usr/bin/ldd --version | head -n1 | grep -o ") [0-9]\.[0-9]\+" | cut -d. -f2 )
+ VERS=$(get_libc_vers_min)
if [[ $VERS -lt 6 && "${CFLAGS} " != *'gnu89-inline '* ]]; then # compare host glibc 2.x to 2.6
einfo "Your host glibc is too old; enabling -fgnu89-inline compiler flag. bug 473524"
CFLAGS="${CFLAGS} -fgnu89-inline" # for C only
fi
fi
-# vim: set syn=sh expandtab ts=4:
+# vim: set syn=sh: