From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:47761) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0bOw-0007CU-Bs for qemu-devel@nongnu.org; Thu, 23 Feb 2012 11:20:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S0bOq-0000uO-FH for qemu-devel@nongnu.org; Thu, 23 Feb 2012 11:20:14 -0500 Received: from mnementh.archaic.org.uk ([81.2.115.146]:35639) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S0bOq-0000tL-2g for qemu-devel@nongnu.org; Thu, 23 Feb 2012 11:20:08 -0500 From: Peter Maydell Date: Thu, 23 Feb 2012 16:20:05 +0000 Message-Id: <1330014005-25831-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH] configure: Check whether makecontext() is a glibc stub function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: patches@linaro.org On some systems (notably ARM Linux) glibc provides implementations of makecontext(), getcontext() and friends which are stubs which always return failure. Make the configure test for makecontext() also check for the presence of the __stub_makecontext macro which indicates the presence of these stubs, so we can avoid trying to use them and fall back to a different coroutine implementation instead. Signed-off-by: Peter Maydell --- I think this fixes the last of the bugs which meant we had to declare ARM hosts as officially unsupported in QEMU 1.0... configure | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/configure b/configure index 037f7f7..9fbf88a 100755 --- a/configure +++ b/configure @@ -2712,11 +2712,15 @@ fi ########################################## # check if we have makecontext +# (and that it's not a glibc stub which always returns -1) ucontext_coroutine=no if test "$darwin" != "yes"; then cat > $TMPC << EOF #include +#ifdef __stub_makecontext +#error Ignoring glibc stub makecontext which will always fail +#endif int main(void) { makecontext(0, 0, 0); return 0; } EOF if compile_prog "" "" ; then -- 1.7.1