From patchwork Thu Feb 23 16:16:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 6906 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 6EECF23EAE for ; Thu, 23 Feb 2012 16:16:05 +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 374E4A1892B for ; Thu, 23 Feb 2012 16:16:05 +0000 (UTC) Received: by yhgm50 with SMTP id m50so790563yhg.11 for ; Thu, 23 Feb 2012 08:16:04 -0800 (PST) Received: from mr.google.com ([10.50.89.232]) by 10.50.89.232 with SMTP id br8mr2834650igb.30.1330013764785 (num_hops = 1); Thu, 23 Feb 2012 08:16:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.50.89.232 with SMTP id br8mr2382568igb.30.1330013764569; Thu, 23 Feb 2012 08:16:04 -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 r10csp14812ibr; Thu, 23 Feb 2012 08:16:03 -0800 (PST) Received: by 10.180.83.97 with SMTP id p1mr3475028wiy.19.1330013762690; Thu, 23 Feb 2012 08:16:02 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id v23si1490631weq.145.2012.02.23.08.16.01 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 23 Feb 2012 08:16:02 -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 1S0bKq-0006iS-1E; Thu, 23 Feb 2012 16:16:00 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org Subject: [PATCH] configure: Detect when glibc implements makecontext() to always fail Date: Thu, 23 Feb 2012 16:16:00 +0000 Message-Id: <1330013760-25793-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 X-Gm-Message-State: ALoCoQlyfpvHCwfmsWTAbqrsfpkp6JdFSzH63p7rzHyCFWKajTLSRaGMKInYv1XX6xXbRw/MzvtP Improve the configure test for presence of ucontext functions by making linker warnings fatal; this allows us to detect when we are linked with a glibc which implements makecontext() to always return ENOSYS. Signed-off-by: Peter Maydell --- Compiling on an Ubuntu Natty ARM host will hit this. (Anybody think we should clean up our configure tests so we can enable -Werror and -Wl,--fatal-warnings on all of them?) configure | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 9b4fe34..4d9d9e0 100755 --- a/configure +++ b/configure @@ -2549,9 +2549,12 @@ ucontext_coroutine=no if test "$darwin" != "yes"; then cat > $TMPC << EOF #include -int main(void) { makecontext(0, 0, 0); } +int main(void) { makecontext(0, 0, 0); return 0; } EOF - if compile_prog "" "" ; then + # Note that we enable fatal linker warnings to catch the + # glibc "makecontext is not implemented and will always fail" + # linker warning. + if compile_prog "-Wl,--fatal-warnings" "" ; then ucontext_coroutine=yes fi fi