diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-03-20 22:23:47 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-03-20 22:23:47 +0000 |
commit | 27be4f5e30955beca5a9fc19f8dd823176731c6a (patch) | |
tree | f0e624a43e58080f579727656e6c3425c97a5c85 /sys-libs/glibc | |
parent | old (diff) | |
download | gentoo-2-27be4f5e30955beca5a9fc19f8dd823176731c6a.tar.gz gentoo-2-27be4f5e30955beca5a9fc19f8dd823176731c6a.tar.bz2 gentoo-2-27be4f5e30955beca5a9fc19f8dd823176731c6a.zip |
Check for the __sync_fetch_and_add symbol directly rather than trying to mess with the defines in the CPP output #199334 by Xavier Neys.
(Portage version: 2.2.0_alpha26/cvs/Linux x86_64)
Diffstat (limited to 'sys-libs/glibc')
-rw-r--r-- | sys-libs/glibc/ChangeLog | 7 | ||||
-rw-r--r-- | sys-libs/glibc/files/eblits/common.eblit | 18 | ||||
-rw-r--r-- | sys-libs/glibc/files/eblits/pkg_setup.eblit | 31 |
3 files changed, 39 insertions, 17 deletions
diff --git a/sys-libs/glibc/ChangeLog b/sys-libs/glibc/ChangeLog index d6470939160c..d2a187bc015d 100644 --- a/sys-libs/glibc/ChangeLog +++ b/sys-libs/glibc/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for sys-libs/glibc # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/ChangeLog,v 1.761 2011/03/18 20:25:03 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/ChangeLog,v 1.762 2011/03/20 22:23:47 vapier Exp $ + + 20 Mar 2011; Mike Frysinger <vapier@gentoo.org> files/eblits/common.eblit, + files/eblits/pkg_setup.eblit: + Check for the __sync_fetch_and_add symbol directly rather than trying to mess + with the defines in the CPP output #199334 by Xavier Neys. 18 Mar 2011; Mike Frysinger <vapier@gentoo.org> files/eblits/src_install.eblit: diff --git a/sys-libs/glibc/files/eblits/common.eblit b/sys-libs/glibc/files/eblits/common.eblit index a42108f1f514..6049c483e962 100644 --- a/sys-libs/glibc/files/eblits/common.eblit +++ b/sys-libs/glibc/files/eblits/common.eblit @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/common.eblit,v 1.19 2011/03/20 21:28:51 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/common.eblit,v 1.20 2011/03/20 22:23:47 vapier Exp $ # We need to be able to set alternative headers for # compiling for non-native platform @@ -46,19 +46,19 @@ setup_target_flags() { case $(tc-arch) in x86) - # -march needed for #185404 - local t=${CTARGET_OPT:-${CTARGET}} - t=${t%%-*} - if ! echo "" | $(tc-getCC) ${CFLAGS} -E -dD - | grep -qs __${t}__ ; then + # -march needed for #185404 #199334 + if ! glibc_compile_test "" 'void f(int i, void *p) {if (__sync_fetch_and_add(&i, 1)) f(i, p);}\nint main(){return 0;}\n' ; then + local t=${CTARGET_OPT:-${CTARGET}} + t=${t%%-*} filter-flags '-march=*' export CFLAGS="-march=${t} ${CFLAGS}" fi ;; amd64) - # -march needed for #185404 - local t=${CTARGET_OPT:-${CTARGET}} - t=${t%%-*} - if ! echo "" | $(tc-getCC) ${CFLAGS} ${CFLAGS_x86} -m32 -E -dD - | grep -qs __${t}__ ; then + # -march needed for #185404 #199334 + if ! glibc_compile_test "${CFLAGS_x86}" 'void f(int i, void *p) {if (__sync_fetch_and_add(&i, 1)) f(i, p);}\nint main(){return 0;}\n' ; then + local t=${CTARGET_OPT:-${CTARGET}} + t=${t%%-*} filter-flags '-march=*' export CFLAGS_x86="${CFLAGS_x86} -march=${t}" fi diff --git a/sys-libs/glibc/files/eblits/pkg_setup.eblit b/sys-libs/glibc/files/eblits/pkg_setup.eblit index 6f5ae2743ea1..a0143c76ba27 100644 --- a/sys-libs/glibc/files/eblits/pkg_setup.eblit +++ b/sys-libs/glibc/files/eblits/pkg_setup.eblit @@ -1,31 +1,48 @@ -# Copyright 1999-2009 Gentoo Foundation +# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/pkg_setup.eblit,v 1.5 2011/03/09 08:02:57 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/files/eblits/pkg_setup.eblit,v 1.6 2011/03/20 22:23:47 vapier Exp $ -glibc_run_test() { - local ret +glibc_compile_test() { + local ret save_cflags=${CFLAGS} + CFLAGS+=" $1" + shift pushd "${T}" >/dev/null + rm -f glibc-test* printf '%b' "$*" > glibc-test.c + emake -s glibc-test + ret=$? + + popd >/dev/null + + CFLAGS=${save_cflags} + return ${ret} +} + +glibc_run_test() { + local ret + if [[ ${EMERGE_FROM} == "binary" ]] ; then # ignore build failures when installing a binary package #324685 - emake -s glibc-test 2>/dev/null || return 0 + glibc_compile_test "" "$@" 2>/dev/null || return 0 else - if ! emake glibc-test ; then + if ! glibc_compile_test "" "$@" ; then ewarn "Simple build failed ... assuming this is desired #324685" return 0 fi fi + pushd "${T}" >/dev/null + ./glibc-test ret=$? rm -f glibc-test* popd >/dev/null - return $ret + return ${ret} } eblit-glibc-pkg_setup() { |