From patchwork Thu Feb 23 16:20:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 6907 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 69EE223EAE for ; Thu, 23 Feb 2012 16:20:09 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id 3337AA1892B for ; Thu, 23 Feb 2012 16:20:09 +0000 (UTC) Received: by yhgm50 with SMTP id m50so794851yhg.11 for ; Thu, 23 Feb 2012 08:20:08 -0800 (PST) Received: from mr.google.com ([10.50.155.231]) by 10.50.155.231 with SMTP id vz7mr2889792igb.26.1330014008759 (num_hops = 1); Thu, 23 Feb 2012 08:20:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.50.155.231 with SMTP id vz7mr2434350igb.26.1330014008555; Thu, 23 Feb 2012 08:20:08 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.11.10 with SMTP id r10cs14896ibr; Thu, 23 Feb 2012 08:20:08 -0800 (PST) Received: by 10.180.7.231 with SMTP id m7mr4670049wia.3.1330014007411; Thu, 23 Feb 2012 08:20:07 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id ha6si2450789wib.9.2012.02.23.08.20.06 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 23 Feb 2012 08:20:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1S0bOn-0006j4-V3; Thu, 23 Feb 2012 16:20:05 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org Subject: [PATCH] configure: Check whether makecontext() is a glibc stub function Date: Thu, 23 Feb 2012 16:20:05 +0000 Message-Id: <1330014005-25831-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 X-Gm-Message-State: ALoCoQlaoe5T1zvmrDDwrs0gbCJ16gmum2nW1LsCT4YAn0KupZx4InNMA2vsgozCaOZ7fPPj8+wc 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