summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-10-10 07:32:33 +0000
committerMike Frysinger <vapier@gentoo.org>2010-10-10 07:32:33 +0000
commit9f6eeb60cfe27e1f685403ea51df360f026dac4d (patch)
tree0269c19d0ffd2ca4457b1e8e46bda0b66e7dd0a2 /eclass/toolchain.eclass
parentx86 stable wrt bug #339726 (diff)
downloadhistorical-9f6eeb60cfe27e1f685403ea51df360f026dac4d.tar.gz
historical-9f6eeb60cfe27e1f685403ea51df360f026dac4d.tar.bz2
historical-9f6eeb60cfe27e1f685403ea51df360f026dac4d.zip
make sure toolchain supports pthreads before enabling openmp #326757 #335883
Diffstat (limited to 'eclass/toolchain.eclass')
-rw-r--r--eclass/toolchain.eclass12
1 files changed, 10 insertions, 2 deletions
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 0a96362d82c3..5cf42ca7e979 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.439 2010/09/05 05:52:46 dirtyepic Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.440 2010/10/10 07:32:33 vapier Exp $
#
# Maintainer: Toolchain Ninjas <toolchain@gentoo.org>
@@ -1150,7 +1150,15 @@ gcc-compiler-configure() {
fi
if tc_version_is_at_least "4.2" ; then
- confgcc="${confgcc} $(use_enable openmp libgomp)"
+ # Make sure target has pthreads support. #326757 #335883
+ # There shouldn't be a chicken&egg problem here as openmp won't
+ # build without a C library, and you can't build that w/out
+ # already having a compiler ...
+ if ! is_crosscompile || \
+ $(tc-getCPP ${CTARGET}) -E - <<<"#include <pthread.h>" >& /dev/null
+ then
+ confgcc="${confgcc} $(use_enable openmp libgomp)"
+ fi
fi
# enable the cld workaround until we move things to stable.